/* The trip header on the website, wide windows (owner 2026-11-04 mock; the app's is mobile/www/css/trip-header.css):
   the cover behind 40% of the window, the label, the gold line, the big title, one plain route line, the tabs on the
   photo. Scrolled: a slim bar on the photo, the same tools, the tabs on the page. */
.mast-when[hidden] { display: none; }

@media (max-width: 47.99rem) {
  .mast-when { display: none; }
}

@media (min-width: 48rem) {
  /* ——— the photo ——— */
  html.wb-new .workbook::before {
    height: calc(var(--nu-head-h, 0px) + 1.25rem);
    background:
      /* the photo stays the star (owner 2026-11-04: "the shadow is destroying the cover photo"): shade behind the words on the left, a light edge top and bottom */
      linear-gradient(90deg, rgba(10, 20, 16, 0.68) 0, rgba(10, 20, 16, 0.52) 34%, rgba(10, 20, 16, 0) 68%),
      linear-gradient(180deg, rgba(10, 20, 16, 0.3) 0, rgba(10, 20, 16, 0) 24%, rgba(10, 20, 16, 0) 62%, rgba(10, 20, 16, 0.36) 100%),
      var(--nu-cover, none) var(--nu-cover-pos, center 40%) / cover no-repeat,
      /* a pale trip colour gets the Expenses card's dark veil (--forest-shade, shared/trip-core.js themeReadable; 0 on
         dark colours) under the cover, so the tabs on its light right side still read (app: trip-header.css) */
      linear-gradient(rgba(0, 0, 0, var(--forest-shade, 0)), rgba(0, 0, 0, var(--forest-shade, 0))),
      var(--forest);
  }
  /* The rounded top runs the whole window, however wide: the page itself stops at its reading width. */
  html.wb-new .sheet { position: relative; }
  html.wb-new .sheet::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    z-index: -1;
    width: 100vw;
    height: 2rem; /* past the photo’s end, which falls on a fraction of a pixel */
    border-radius: 20px 20px 0 0;
    background: var(--body-bg, var(--paper, #f3efe4));
    transform: translateX(-50%);
    pointer-events: none;
  }

  /* The header lines up with the page under it, however wide the window. */
  html.wb-new {
    --head-pad: calc(max(0px, (100vw - 1920px) / 2) + max(1rem, 3vw));
  }
  html.wb-new .mast,
  html.wb-new .sheet-nav,
  html.wb-new .nu-mini {
    padding-right: var(--head-pad) !important;
    padding-left: var(--head-pad) !important;
  }
  html.wb-new .mast-full,
  html.wb-new .sheet-nav-row { max-width: none !important; width: auto !important; margin-right: 0 !important; margin-left: 0 !important; }
  html.wb-new .mast-top { left: var(--head-pad) !important; }
  html.wb-new .sheet-nav-tray { right: var(--head-pad) !important; }

  /* ——— the words ——— */
  html.wb-new .mast {
    /* 40% of the window, at most 320px: the details stay on the first screen of a big desktop (owner 2026-11-04) */
    min-height: calc(min(40vh, 20rem) - 3.25rem);
    min-height: calc(min(40svh, 20rem) - 3.25rem);
    padding-bottom: 0.9rem;
  }
  html.wb-new .mast-full {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    padding-top: 4.5rem;
  }
  html.wb-new .mast-kicker {
    display: block;
    min-height: 0;
    margin: 0 0 0.45rem;
    padding: 0 !important;
    color: #e6d7ae;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  }
  html.wb-new .mast-when {
    margin: 0 0 0.5rem;
    color: #f0d898;
    font-size: 0.95rem;
    font-weight: 700;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  }
  html.wb-new .mast-when .mast-countdown-chip {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
  }
  html.wb-new .mast-when .mast-countdown-chip::before,
  html.wb-new .mast-when .mast-countdown-ico { display: none; }
  html.wb-new .mast-when .mast-countdown-chip strong { color: inherit; font: inherit; }
  html.wb-new .mast h1 {
    margin-top: 0;
    color: #fff;
    font-family: "Playfair Display", var(--serif);
    font-size: clamp(2.5rem, 4.2vw, 3.4rem);
    font-weight: 500;
    /* room for g, p, y: the title clips what overflows, and Playfair hangs low */
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
    line-height: 1.22;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
  }
  html.wb-new .mast-meta { gap: 0.6rem; margin-top: 0.6rem; }
  html.wb-new .mast-meta .mast-route {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    font-weight: 400;
  }

  /* ——— the buttons: round and easy to see on any photo ——— */
  html.wb-new .mast-back,
  html.wb-new .nu-mini-back,
  html.wb-new .sheet-nav-tray .public-nav-ico:not(.public-nav-share):not(.public-nav-copy):not(.public-nav-upvote) {
    box-sizing: border-box;
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(10, 20, 16, 0.62);
    color: #fff;
  }
  html.wb-new .sheet-nav-tray .public-nav-label,
  html.wb-new .sheet-nav-tray #mast-publish.public-nav-label,
  html.wb-new .sheet-nav-tray #mast-publish.is-published,
  html.wb-new .sheet-nav-tray .public-nav-share,
  html.wb-new .sheet-nav-tray .public-nav-upvote,
  html.wb-new .sheet-nav-tray .account-slot > * {
    min-height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: rgba(10, 20, 16, 0.62);
    color: #fff;
  }
  html.wb-new .sheet-nav-tray .public-nav-copy {
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border: 1px solid #f0d898;
    border-radius: 999px;
    background: #f0d898;
    color: #1f2a24;
    font-weight: 700;
  }

  /* ——— public itinerary: Copy is the gold button, the creator has their own line ——— */
  html.wb-new .mast #nav-edit,
  html.wb-new #nav-edit.public-nav-copy {
    border-color: #f0d898 !important;
    background: #f0d898 !important;
    color: #1f2a24 !important;
    opacity: 1 !important;
  }
  html.wb-new.pub-mast .sheet-nav-tray:has(#public-nav:not([hidden])) #public-nav > #nav-edit:not([hidden]) {
    border-color: #f0d898 !important;
    background: #f0d898 !important;
    color: #1f2a24 !important;
  }
  html.wb-new.pub-mast .sheet-nav-tray:has(#public-nav:not([hidden])) #public-nav > #nav-edit:not([hidden]) :is(.public-nav-text, .public-nav-svg) { color: #1f2a24 !important; }
  html.wb-new #nav-edit .public-nav-text { color: #1f2a24 !important; }
  /* the owner: their picture and name, as on the app */
  html.wb-new.pub-head #mast .pub-mast-creator { padding: 0; border: 0; background: none; color: #fff; }
  html.wb-new.pub-head #mast .pub-mast-creator::before { content: none; display: none; }
  html.wb-new.pub-head #mast .pub-creator::before { content: none; display: none; }
  html.wb-new.pub-head #mast .pub-mast-avatar {
    display: inline-grid !important;
    place-items: center;
    overflow: hidden;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: #c9b98f;
    color: #1f2a24;
    font: 700 0.72rem/1 var(--sans);
  }
  html.wb-new.pub-head #mast .pub-mast-creator { display: inline-flex; align-items: center; gap: 0.55rem; }
  html.wb-new.pub-head #mast .pub-mast-creator-text::before { content: none; }
  html.wb-new.pub-head #mast .pub-mast-creator-text b { color: #fff; font-size: 0.9rem; }
  html.wb-new #nav-share,
  html.wb-new #nav-more {
    opacity: 1 !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(10, 20, 16, 0.62) !important;
    color: #fff !important;
    backdrop-filter: none;
  }
  html.wb-new.pub-head .mast { min-height: calc(min(40vh, 20rem) - 3.25rem) !important; min-height: calc(min(40svh, 20rem) - 3.25rem) !important; }
  html.wb-new.pub-mast .mast #mast-title { max-width: none; }
  html.wb-new.pub-mast .mast h1 em { display: inline; }
  html.wb-new.pub-head #mast-meta { display: grid !important; gap: 0.6rem; }
  html.wb-new.pub-head #mast-meta .nu-people { display: flex; align-items: center; gap: 0.6rem; }
  html.wb-new.pub-head #mast-meta .nu-hl-dot { display: none; }

  /* ——— the tabs: on the photo, a gold line under the open one ——— */
  html.wb-new .sheet-nav { background: transparent; }
  html.wb-new .sheet-tabs { gap: 2rem; }
  html.wb-new .sheet-tabs [role="tab"] {
    min-height: 3.25rem;
    padding: 0;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.94rem;
    font-weight: 700;
  }
  html.wb-new .sheet-tabs [role="tab"]:hover { background: none; color: #fff; }
  html.wb-new .sheet-tabs [role="tab"][aria-selected="true"] {
    border: 0;
    border-bottom: 2px solid #f0d898;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #fff;
  }
  html.wb-new .sheet-tabs [role="tab"]#tab-recap {
    align-self: center;
    min-height: 2.1rem;
    padding: 0 1rem;
    border: 0;
    border-image: none;
    border-radius: 999px;
    background: #f0d898 !important; /* over recap.css’s shimmer */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    color: #1f2a24;
    -webkit-text-fill-color: #1f2a24;
    animation: none;
  }
  html.wb-new .sheet-tabs [role="tab"]#tab-recap::after { display: none; }
  html.wb-new .sheet-tabs [role="tab"]#tab-recap > * { color: #1f2a24; -webkit-text-fill-color: #1f2a24; }
  html.wb-new .sheet-tabs-fade { display: none; }

  /* ——— scrolled: the slim bar ——— */
  html.wb-new .nu-mini {
    z-index: 49; /* under the tab row, whose tools sit on the bar */
    box-sizing: border-box;
    height: 4.5rem;
    padding: 0 max(1rem, 3%);
    background:
      linear-gradient(rgba(10, 20, 16, 0.72), rgba(10, 20, 16, 0.72)),
      var(--nu-cover, none) var(--nu-cover-pos, center 40%) / cover no-repeat,
      var(--forest);
  }
  html.wb-new .nu-mini strong {
    flex: 0 1 auto;
    color: #fff;
    font: 500 1.5rem/1.35 "Playfair Display", var(--serif);
  }
  html.wb-new .nu-mini strong em { color: #e6c98e; }
  html.wb-new .nu-mini-badge {
    padding: 0;
    border-radius: 0;
    background: none;
    color: #f0d898;
    font-size: 0.82rem;
  }
  html.nu-slim:not(.wbp-open).wb-new .sheet-nav-tray {
    position: fixed;
    top: 0.875rem;
    z-index: 61;
  }
  html.nu-slim:not(.wbp-open).wb-new .sheet-nav-tray .account-slot { display: none; }
  html.nu-slim:not(.wbp-open).wb-new .sheet-nav {
    position: sticky;
    top: 4.5rem;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: var(--cream);
  }
  html.nu-slim:not(.wbp-open).wb-new .sheet-tabs [role="tab"] { color: #6a766e; }
  html.nu-slim:not(.wbp-open).wb-new .sheet-tabs [role="tab"][aria-selected="true"] {
    border-bottom-color: #c9a85c;
    color: var(--ink);
  }
  html.nu-slim:not(.wbp-open).wb-new .sheet-tabs [role="tab"]#tab-recap { color: #1f2a24; }

  /* Scroll stops clear the bar and the tabs. */
  html.wb-new { scroll-padding-top: 8.5rem; }
}

/* A short window: still 40%, every trip the same (owner 2026-11-04), with smaller words so they fit. */
@media (min-width: 48rem) and (max-height: 700px) {
  html.wb-new .mast { min-height: calc(40vh - 2.75rem); min-height: calc(40svh - 2.75rem); padding-top: 0; padding-bottom: 0.2rem; }
  html.wb-new.pub-head .mast { min-height: calc(40vh - 2.75rem) !important; min-height: calc(40svh - 2.75rem) !important; }
  html.wb-new .mast-full { padding-top: 0; }
  html.wb-new .mast-kicker { margin-bottom: 0.15rem; }
  html.wb-new .mast-when { margin-bottom: 0.15rem; font-size: 0.82rem; }
  html.wb-new .mast h1 { font-size: 1.9rem; }
  html.wb-new .mast-meta { margin-top: 0.2rem; }
  html.wb-new .mast-meta .mast-route { font-size: 0.88rem; }
  html.wb-new .mast-top { top: 0.7rem; }
  html.wb-new .sheet-nav-tray { top: 0.7rem; }
  html.wb-new .sheet-tabs [role="tab"] { min-height: 2.75rem; }
}
