/* The v3 header, desktop and mid widths (owner, 14 Nov 2026). Spec: docs-wip/reference/design/header-v3/header-final.html,
   Implementation guide sections 4 to 7 (prototype: header-lab.css, variant "ult"). Markup: scripts/nav_sync.py (the
   .tb-nav header block); behaviour: assets/tb-nav.js. Plain CSS, no build step.

   Two states on .tb-nav[data-state]: "glass" (floating pill over a photo band, .fb-hero) and "solid" (flat banner, past
   the hero or on a page with no hero). Every change uses real CSS transitions on one curve, 0.46s cubic-bezier(.22,1,.36,1).
   From 901px wide. Under 900px (phones, run C) the old header and hamburger still run, and the new bar is hidden. The
   header element is the old .tb-header as well, so the phone header keeps its old rules until run C removes them. */

:root { --tbn-ease: cubic-bezier(.22, 1, .36, 1); }

/* the section kanji chips: Seasonal and Trips (colours approved in the spec) */
.tb-nav__s .g { font-style: normal; font-family: var(--jp, serif); font-size: 11.5px; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; background: #2E6CA8; color: #fff; flex: none; }
.tb-nav__s .g.t { background: #9A7426; }

/* phones: the old header is the header, the new bar parts stay out of the way */
@media (max-width: 900px) {
  .tb-nav__bg, .tb-nav__isl { display: none !important; }
}

@media (min-width: 901px) {
  body.has-tb-nav { --hd: 60px; padding-top: 60px; }
  body.has-tb-nav:is([data-hero="dark"], [data-hero="light"]) { padding-top: 0; }
  /* the old header is not shown here */
  header.tb-header.tb-nav .tb-header__nav, header.tb-header.tb-nav .tb-menu-btn { display: none; }
  header.tb-header.tb-nav .tb-logo__mark { display: none; }

  header.tb-header.tb-nav {
    --h: 60px; --row-top: 0px;
    --fg: var(--ink); --fg2: var(--ink-2); --fg3: var(--ink-3); --hl: rgba(17, 19, 18, .07); --line: var(--rule);
    --ibg: rgba(251, 251, 248, 0); --ibg-open: rgba(251, 251, 248, .99); --ir: 0px; --ir-open: 0 0 14px 14px;
    --blur: 10px; --sh: none; --sh-open: 0 34px 60px -30px rgba(0, 0, 0, .6);
    position: fixed; top: 0; left: 0; right: 0; z-index: 60;
    background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
    font-size: 14px; pointer-events: none;
  }
  header.tb-header.tb-nav > * { pointer-events: auto; }
  header.tb-header.tb-nav[data-state="glass"] {
    --h: 52px; --row-top: 14px;
    --fg: #fff; --fg2: rgba(255, 255, 255, .72); --fg3: rgba(255, 255, 255, .5); --hl: rgba(255, 255, 255, .15); --line: rgba(255, 255, 255, .14);
    --ibg: rgba(17, 19, 18, .64); --ibg-open: rgba(17, 19, 18, .94); --ir: 26px; --ir-open: 26px;
    --blur: 19px;
    --sh: 0 12px 30px -14px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .14); --sh-open: 0 34px 60px -30px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .14);
  }

  /* the banner behind everything in the solid state */
  .tb-nav__bg { position: absolute; left: 0; right: 0; top: 0; height: 60px; background: rgba(251, 251, 248, .97);
    -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); box-shadow: 0 1px 0 var(--rule);
    transition: opacity .46s var(--tbn-ease); }
  .tb-nav[data-state="glass"] .tb-nav__bg { opacity: 0; }

  header.tb-header.tb-nav .tb-nav__row { position: relative; display: flex; align-items: flex-start; gap: 14px; max-width: none;
    margin: 0; padding: 0 24px; height: auto; margin-top: var(--row-top); transition: margin-top .46s var(--tbn-ease); }

  /* logo: text only, white over a photo, with a dark backing when the photo is light */
  .tb-nav__logo { flex: 1; height: var(--h); display: flex; align-items: center; transition: height .46s var(--tbn-ease); }
  header.tb-header.tb-nav .tb-header__inner > .tb-logo.tb-nav__logo .tb-logo__name { display: inline-flex; }   /* beats redesign.css, which hides the name at mid widths */
  .tb-nav__logo .tb-logo__name { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; margin-left: -14px; border-radius: 19px;
    font-family: inherit; font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); white-space: nowrap;
    transition: color .3s ease, background-color .3s ease, text-shadow .3s ease; }
  .tb-nav[data-state="glass"] .tb-nav__logo .tb-logo__name { color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }
  body[data-hero="light"] .tb-nav[data-state="glass"] .tb-nav__logo .tb-logo__name { background: rgba(17, 19, 18, .62); text-shadow: none;
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }

  /* the island: the sections, and the panel that grows out of them */
  .tb-nav__isl { position: relative; flex: none; height: var(--h); transition: height .46s var(--tbn-ease); }
  .tb-nav__ibg { position: absolute; left: 50%; top: 0; width: 100%; height: var(--h); transform: translateX(calc(-50% + var(--bx, 0px)));
    background-color: var(--ibg); border-radius: var(--ir);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(1.2); backdrop-filter: blur(var(--blur)) saturate(1.2); box-shadow: var(--sh);
    transition: transform .46s var(--tbn-ease), width .46s var(--tbn-ease), height .46s var(--tbn-ease), border-radius .46s var(--tbn-ease), background-color .46s var(--tbn-ease), box-shadow .46s var(--tbn-ease); }
  .tb-nav__isl.is-open .tb-nav__ibg { width: var(--bw, 100%); height: var(--bh, var(--h)); background-color: var(--ibg-open); border-radius: var(--ir-open); box-shadow: var(--sh-open); }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    header.tb-header.tb-nav[data-state="glass"] { --ibg: rgba(17, 19, 18, .86); --ibg-open: rgba(17, 19, 18, .97); }
  }

  .tb-nav__secs { position: relative; z-index: 1; display: flex; align-items: center; gap: 2px; height: var(--h); padding: 0 8px;
    transition: height .46s var(--tbn-ease); }
  .tb-nav__hl { position: absolute; left: 0; top: 50%; height: 36px; margin-top: -18px; width: 0; border-radius: 18px; background: var(--hl); opacity: 0;
    pointer-events: none; transition: transform .38s var(--tbn-ease), width .38s var(--tbn-ease), opacity .2s ease, background-color .46s var(--tbn-ease); }
  .tb-nav[data-state="solid"] .tb-nav__hl { border-radius: 8px; }
  .tb-nav__s { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 18px;
    font: inherit; font-size: 14px; line-height: 1; white-space: nowrap; text-decoration: none; color: var(--fg2); background: none; border: 0; cursor: pointer;
    transition: color .3s ease, border-radius .46s var(--tbn-ease); }
  .tb-nav[data-state="solid"] .tb-nav__s { border-radius: 8px; }
  .tb-nav__s:hover, .tb-nav__s.is-act { color: var(--fg); }
  .tb-nav__s.is-cur { color: var(--fg); font-weight: 600; }
  .tb-nav__s.is-cur::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
  .tb-nav__s:focus-visible, .tb-card a:focus-visible { outline: 2px solid var(--accent, #0B4A7F); outline-offset: 1px; }
  .tb-nav[data-state="glass"] .tb-nav__s:focus-visible, .tb-nav[data-state="glass"] .tb-card a:focus-visible { outline-color: #fff; }

  /* the panel */
  .tb-nav__panel { position: absolute; z-index: 1; left: 50%; top: var(--h); width: var(--bw, 100%); transform: translateX(calc(-50% + var(--bx, 0px))); padding: 4px 14px 14px;
    color: var(--fg); opacity: 0; transition: opacity .18s ease; }
  .tb-nav__panel[hidden] { display: none; }
  .tb-nav__isl.is-open .tb-nav__panel { opacity: 1; transition: opacity .28s ease .08s; }
  .tb-nav__ph { display: flex; align-items: baseline; gap: 8px; padding: 8px 4px 10px; border-top: 1px solid var(--line); }
  .tb-nav__ph b { font-size: 15px; font-weight: 600; }
  .tb-nav__ph .jp { font-size: 12px; color: var(--fg3); }
  .tb-nav__ph .k { margin-left: auto; font-family: var(--mono, monospace); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg3); }
  .tb-nav__cards { display: grid; grid-template-columns: repeat(var(--c, 4), minmax(0, 1fr)); gap: 10px; }

  .tb-nav .tb-card { background: transparent; border: 1px solid var(--line); }   /* redesign.css's generic .tb-card is a white surface */
  .tb-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; animation: tbn-rise .4s var(--tbn-ease) backwards; animation-delay: calc(var(--n, 0) * 30ms); }
  @keyframes tbn-rise { from { opacity: 0; transform: translateY(8px); } }
  .tb-card--spot { grid-column: span 2; }
  .tb-card__ph { position: relative; display: block; height: 150px; border-radius: 14px; overflow: hidden; color: #fff; text-decoration: none; background: #3a403d; }
  .tb-nav__cards.many .tb-card__ph { height: 104px; }
  .tb-card__ph .ph { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
  .tb-card__ph:hover .ph { transform: scale(1.06); }
  .tb-card__ph::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .66)); transition: box-shadow .15s; }
  .tb-card__ph:hover::after { box-shadow: inset 0 0 0 2px var(--fg); }
  .tb-card.is-cur .tb-card__ph::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--fg) 60%, transparent); }
  .tb-card--feat .tb-card__ph::after { box-shadow: inset 0 0 0 2px #E2C27A; }
  .tb-card__ph .n { position: absolute; z-index: 1; left: 11px; right: 8px; bottom: 9px; font-size: 15px; font-weight: 500; line-height: 1.15; text-wrap: balance; overflow-wrap: break-word; }
  @media (max-width: 1180px) { .tb-card__ph .n { left: 9px; right: 6px; font-size: 13.5px; } }
  .tb-card__ph .n .jp { font-size: 11px; margin-left: 6px; opacity: .8; font-weight: 400; }
  .tb-nav__cards.many .tb-card__ph .n .jp { display: none; }
  .tb-card__g { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .tb-card__g a { font-size: 13px; color: var(--fg2); padding: 0 8px; border: solid transparent; border-width: 5px 0; background-clip: padding-box; border-radius: 7px; line-height: 1.25; overflow: hidden; text-decoration: none;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .tb-card__g a:hover { background: var(--hl); color: var(--fg); }
  .tb-card__g .all a { color: var(--fg); font-weight: 600; }
  .tb-card__tag { margin: 0; font-size: 13px; color: var(--fg2); padding: 2px 4px 0; }
  .tb-card__picks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tb-card__pick { position: relative; display: block; height: 62px; border-radius: 10px; overflow: hidden; background: #3a403d; color: #fff; text-decoration: none; }
  .tb-card__pick .ph { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
  .tb-card__pick:hover .ph { transform: scale(1.06); }
  .tb-card__pick::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(transparent 30%, rgba(0, 0, 0, .7)); }
  .tb-card__pick span.n { position: absolute; z-index: 1; left: 8px; right: 6px; bottom: 5px; font-size: 12px; font-weight: 500; line-height: 1.15; }
  .tb-card--spot .tb-card__ph { height: 104px; box-shadow: 0 0 0 2px #E2C27A; }
  .tb-card--spot .tb-card__ph::after { box-shadow: none; }

  /* the actions on the bar: glass chips over a photo, today's buttons otherwise */
  header.tb-header.tb-nav .tb-nav__act { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 8px; height: var(--h); transition: height .46s var(--tbn-ease); }
  .tb-nav__act :is(.tb-btn, .tb-ssn, .tb-share-btn, .tb-lang) { height: 38px; box-sizing: border-box; white-space: nowrap;
    transition: background-color .46s var(--tbn-ease), color .3s ease, box-shadow .46s var(--tbn-ease), border-color .3s ease; }
  .tb-nav__act .tb-btn--ghost { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; }
  .tb-nav__act .tb-btn--primary { gap: 0; }
  .tb-nav__act .tb-btn--primary .tb-nav__lbl { margin-left: .3em; }
  .tb-nav__act .tb-pref { display: inline-flex; align-items: center; gap: 4px; }
  .tb-nav__act .tb-pref { transition: background-color .46s var(--tbn-ease), border-color .3s ease, box-shadow .46s var(--tbn-ease); }
  .tb-nav[data-state="glass"] .tb-nav__act :is(.tb-btn--ghost, .tb-share-btn, .tb-pref) {
    background: rgba(17, 19, 18, .64); color: #fff; border-color: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(19px) saturate(1.2); backdrop-filter: blur(19px) saturate(1.2); }
  /* the season pill and language links sit inside one glass chip (.tb-pref): they are bare in it, white text */
  .tb-nav[data-state="glass"] .tb-nav__act .tb-pref :is(.tb-ssn, .tb-lang) { background: transparent; color: #fff; border-color: transparent; box-shadow: none; }
  .tb-nav[data-state="glass"] .tb-nav__act .tb-pref .tb-lang + .tb-lang,
  .tb-nav[data-state="glass"] .tb-nav__act .tb-pref .tb-ssn + .tb-lang { border-left: 1px solid rgba(255, 255, 255, .2); }
  .tb-nav[data-state="glass"] .tb-nav__act .tb-pref :is(.tb-ssn, .tb-lang):hover { background: rgba(255, 255, 255, .15); }
  .tb-nav[data-state="glass"] .tb-nav__act .tb-ssn em { color: rgba(255, 255, 255, .6); }
  .tb-nav[data-state="glass"] .tb-nav__act .tb-ssn__jp { color: #fff; }
  .tb-nav[data-state="glass"] .tb-nav__act .tb-btn--primary { background: #fff; color: var(--ink); border-color: #fff; }
}

/* 901 to 1180: still one bar, 60px; icon buttons for Search and the season picker, "Plan", no kanji chips */
@media (min-width: 901px) and (max-width: 1180px) {
  .tb-nav__lbl { display: none; }
  .tb-nav__act .tb-btn--ghost[data-open-search] { width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
  .tb-nav__act .tb-ssn { width: 38px; padding: 0; justify-content: center; gap: 0; }
  .tb-nav__act .tb-ssn .tb-ssn__name, .tb-nav__act .tb-ssn em { display: none; }
  .tb-nav__s .g { display: none; }
  .tb-nav__s { padding: 0 9px; }
  header.tb-header.tb-nav .tb-nav__row { padding: 0 16px; gap: 10px; }
  .tb-nav__secs { padding: 0 4px; }
}
@media (min-width: 901px) and (max-width: 960px) { .tb-nav__s { padding: 0 7px; } }

@media (prefers-reduced-motion: reduce) {
  header.tb-header.tb-nav, header.tb-header.tb-nav * { transition-duration: .15s !important; animation: none !important; }
}
