/* The v3 header on phones (under 901px): the hero top row and the Island. Owner, 14 Nov 2026. Spec: docs-wip/reference/design/header-v3/
   header-final.html, Implementation guide section 8 (prototype: mobile-lab.css/js, mode "e"). Markup: scripts/nav_sync.py
   (island_block, between the nav:header markers); behaviour: assets/tb-island.js. Plain CSS, no build step.

   - Top of the page: no bar. The wordmark (top left) and a 40px glass search button (top right) are part of the page, so they
     scroll away with the hero. A light hero gives the wordmark a dark backing. data-hero="none": a 56px solid row, not sticky.
   - The Island: a fixed pill at the bottom (place over guide, progress ring, three lines) that springs into the sheet.
   From 901px wide none of this shows (tb-nav.css has the desktop bar). */

.tb-isl, .tb-isl__scrim { display: none; }

@media (max-width: 900px) {
  /* ---- the old header pieces the Island replaces ---- */
  .tb-nav__bg, .tb-nav__isl { display: none !important; }
  header.tb-header.tb-nav .tb-header__nav, header.tb-header.tb-nav .tb-menu-btn, header.tb-header.tb-nav .tb-logo__mark { display: none !important; }
  header.tb-header.tb-nav .tb-nav__act > :not([data-open-search]) { display: none !important; }

  /* ---- top of the page: the header is part of the hero, not a bar ---- */
  body.has-tb-nav { --hd: 0px; padding-top: 0; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }  /* the Island must not cover the last footer links */
  header.tb-header.tb-nav {
    position: absolute; top: 0; left: 0; right: 0; z-index: 30; background: none; border: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none;
  }
  header.tb-header.tb-nav .tb-nav__row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: none; margin: 0;
    padding: 12px 12px 0 16px; box-sizing: border-box;
  }
  header.tb-header.tb-nav .tb-nav__row > * { pointer-events: auto; }
  header.tb-header.tb-nav .tb-nav__logo {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0; color: #fff; text-decoration: none;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
  }
  header.tb-header.tb-nav .tb-logo__name { color: inherit; font-size: 16px; font-weight: 600; letter-spacing: 0; display: inline; }
  header.tb-header.tb-nav .tb-nav__act { display: flex; align-items: center; margin: 0; gap: 0; }
  header.tb-header.tb-nav [data-open-search] {
    display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; margin: 0; border: 0; border-radius: 50%;
    background: rgba(17, 19, 18, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    color: #fff; font-size: 18px; line-height: 1; box-shadow: none;
  }
  header.tb-header.tb-nav [data-open-search] .tb-nav__lbl { display: none; }
  /* a light hero: the wordmark gets the dark backing, so it keeps 4.5:1 */
  body[data-hero="light"] header.tb-header.tb-nav .tb-nav__logo {
    padding: 0 14px; border-radius: 999px; background: rgba(17, 19, 18, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    text-shadow: none;
  }
  /* no photo band: a 56px solid row (wordmark, search), not sticky */
  body[data-hero="none"] header.tb-header.tb-nav {
    position: relative; height: 56px; background: var(--paper); border-bottom: 1px solid var(--rule); pointer-events: auto;
  }
  body[data-hero="none"] header.tb-header.tb-nav .tb-nav__row { height: 56px; padding: 0 12px 0 16px; }
  body[data-hero="none"] header.tb-header.tb-nav .tb-nav__logo { color: var(--ink); text-shadow: none; }
  body[data-hero="none"] header.tb-header.tb-nav [data-open-search] { background: var(--paper-3); color: var(--ink); -webkit-backdrop-filter: none; backdrop-filter: none; }

  /* ---- clearance: the trip pill and the eSIM strip sit above the Island ---- */
  :root, body.has-tb-nav, body.has-tb-nav[data-hub] { --tbt-b: calc(86px + env(safe-area-inset-bottom)); }
  body.has-tb-nav .tb-offer { bottom: var(--tbt-b); }
  body.has-tb-nav:has(.tb-offer.is-shown), :root:has(body.has-tb-nav .tb-offer.is-shown) { --tbt-b: calc(256px + env(safe-area-inset-bottom)); }
  html.tb-isl-lock, html.tb-isl-lock body { overflow: hidden; }

  /* ---- the Island ---- */
  .tb-isl {
    --iw: min(354px, calc(100vw - 16px)); --ih: min(640px, 86dvh); --p: 0%;
    display: block; position: fixed; z-index: 80; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
    width: 262px; height: 54px; transform: translateX(-50%); border-radius: 27px; overflow: hidden; color: #fff;
    background: rgba(17, 19, 18, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .08);
    transition: width .42s cubic-bezier(.22, 1, .36, 1), height .42s cubic-bezier(.22, 1, .36, 1), bottom .42s cubic-bezier(.22, 1, .36, 1), border-radius .42s cubic-bezier(.22, 1, .36, 1);
    -webkit-tap-highlight-color: transparent;
  }
  .tb-isl.is-mini { width: 206px; height: 44px; }
  .tb-isl.is-next { width: 262px; height: 54px; }
  .tb-isl.is-open {
    width: var(--iw); height: var(--ih); bottom: calc(8px + env(safe-area-inset-bottom)); border-radius: 28px;
    transition: width .5s cubic-bezier(.32, 1.12, .4, 1), height .5s cubic-bezier(.32, 1.12, .4, 1), bottom .45s cubic-bezier(.22, 1, .36, 1), border-radius .45s cubic-bezier(.22, 1, .36, 1);
  }
  .tb-isl.is-drag { transition: none; }
  .tb-isl button, .tb-isl a { -webkit-tap-highlight-color: transparent; }

  .tb-isl__pill {
    position: absolute; inset: 0; display: flex; align-items: center; gap: 11px; width: 100%; margin: 0; padding: 0 18px 0 14px;
    border: 0; background: none; color: inherit; font: inherit; text-align: left; white-space: nowrap; cursor: pointer;
    transition: opacity .2s ease;
  }
  .tb-isl.is-mini .tb-isl__pill { gap: 9px; padding: 0 14px 0 10px; }
  .tb-isl.is-open .tb-isl__pill { opacity: 0; pointer-events: none; }
  .tb-isl__ring {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    background: conic-gradient(#fff var(--p), rgba(255, 255, 255, .22) 0);
    -webkit-mask: radial-gradient(circle, transparent 7.5px, #000 8px); mask: radial-gradient(circle, transparent 7.5px, #000 8px);
  }
  .tb-isl__t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
  .tb-isl__t em { font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, .6); }
  .tb-isl__t b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  .tb-isl.is-mini .tb-isl__t em { display: none; }
  .tb-isl.is-next .tb-isl__t em { display: block; color: #fff; }
  .tb-isl__burger { margin-left: auto; flex: none; display: flex; flex-direction: column; justify-content: space-between; width: 18px; height: 14px; }
  .tb-isl__burger i { display: block; flex: none; height: 2px; border-radius: 1px; background: #fff; }
  .tb-isl__burger i:nth-child(3) { width: 60%; }
  .tb-isl.is-mini .tb-isl__burger { width: 16px; height: 12px; }
  .tb-isl.is-next .tb-isl__burger i { background: rgba(255, 255, 255, .6); }
  .tb-isl.is-pulse { animation: tb-isl-pulse 1.5s cubic-bezier(.3, 0, .3, 1) .5s 3; }
  @keyframes tb-isl-pulse {
    0% { box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .6), 0 0 0 0 rgba(17, 19, 18, .5); transform: translateX(-50%) scale(1); }
    18% { transform: translateX(-50%) scale(1.06); }
    100% { box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .6), 0 0 0 22px rgba(17, 19, 18, 0); transform: translateX(-50%) scale(1); }
  }

  .tb-isl__scrim { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(17, 19, 18, .36); opacity: 0; transition: opacity .4s cubic-bezier(.22, 1, .36, 1); }
  .tb-isl__scrim[hidden] { display: none; }
  .tb-isl__scrim.is-on { opacity: 1; }

  /* ---- the sheet ---- */
  .tb-isl__sheet {
    position: absolute; left: 0; top: 0; width: var(--iw); height: var(--ih); display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transition: opacity .15s ease; touch-action: pan-y;
  }
  .tb-isl.is-open .tb-isl__sheet { opacity: 1; pointer-events: auto; transition: opacity .28s ease .14s; }
  .tb-isl__grab { flex: none; display: block; height: 22px; position: relative; touch-action: none; }
  .tb-isl__grab::before { content: ""; position: absolute; left: 50%; top: 9px; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: rgba(255, 255, 255, .3); }
  .tb-isl__tools { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px 6px; }
  .tb-isl__tools > * { flex: none; }
  .tb-isl__tb, .tb-isl__lang {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 44px; height: 44px; padding: 0 12px; margin: 0;
    border: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .9); font: inherit; font-size: 13.5px;
    line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  }
  .tb-isl__tb--ic { padding: 0; width: 44px; font-size: 17px; }
  .tb-isl__tb .k { font-family: var(--jp, serif); font-size: 14px; }
  .tb-isl__share { margin-left: auto; }
  .tb-isl__chips {
    flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 4px 12px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tb-isl__chips::-webkit-scrollbar { display: none; }
  .tb-isl__chip {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: 999px;
    background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .82); font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer;
  }
  .tb-isl__chip.is-on { background: #fff; color: var(--ink); font-weight: 600; }
  .tb-isl__chip.is-stay { background: #F6EEDC; color: #5B4214; }
  .tb-isl__chip.is-stay.is-on { background: #fff; color: var(--ink); }
  .tb-isl__chip .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; }
  .tb-isl__chip .g.t { background: #9A7426; }
  .tb-isl__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 16px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: none; }
  .tb-isl__list::-webkit-scrollbar { display: none; }
  .tb-isl__list > * { flex: none; }
  .tb-isl__list .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
  .tb-isl a:focus-visible, .tb-isl button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

  /* place cards */
  .tb-isl__card { animation: tb-isl-rise .42s cubic-bezier(.22, 1, .36, 1) backwards; animation-delay: calc(var(--n, 0) * 55ms); }
  @keyframes tb-isl-rise { from { opacity: 0; transform: translateY(14px); } }
  .tb-isl__ph { position: relative; display: block; height: 132px; border-radius: 16px; overflow: hidden; color: #fff; background: #3a403d center / cover no-repeat; text-decoration: none; }
  .tb-isl__ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .66)); }
  .tb-isl__card.is-here .tb-isl__ph { box-shadow: inset 0 0 0 2px #fff; }
  .tb-isl__ph .n { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 11px; display: flex; align-items: baseline; gap: 6px; font-size: 19px; font-weight: 500; }
  .tb-isl__ph .n .jp { font-size: 12px; opacity: .8; }
  .tb-isl__ph .n em { font-style: normal; margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; background: rgba(255, 255, 255, .22); padding: 3px 7px; border-radius: 999px; }
  .tb-isl__g { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  .tb-isl__g a {
    display: inline-flex; align-items: center; min-height: 40px; font-size: 13.5px; line-height: 1; padding: 0 13px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none;
  }
  .tb-isl__g a.all { background: #fff; color: var(--ink); }

  /* Stays: the Destination stays spotlight */
  .tb-isl__feat .tb-isl__ph { height: 150px; }
  .tb-isl__feat .tb-isl__ph .n { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 21px; }
  .tb-isl__feat .tb-isl__ph .n .k { color: #F3D9A4; }
  .tb-isl__picks { display: flex; flex-direction: column; margin-top: 4px; }
  .tb-isl__pick { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 64px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
  .tb-isl__pick i { display: block; height: 52px; border-radius: 10px; background: #3a403d center / cover no-repeat; }
  .tb-isl__pick b { font-size: 15px; font-weight: 500; }
  .tb-isl__feat .tb-isl__g a:not(.all) { background: rgba(246, 238, 220, .14); color: #F6EEDC; box-shadow: inset 0 0 0 1px rgba(246, 238, 220, .3); }

  /* Guides: today's hubnav sheet */
  .tb-isl__gh { display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 4px; }
  .tb-isl__gh b { font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
  .tb-isl__bar { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; }
  .tb-isl__bar i { display: block; height: 100%; width: var(--p, 0%); background: #9FD3A8; border-radius: 4px; }
  .tb-isl__next { display: grid; grid-template-columns: 54px minmax(0, 1fr) 34px; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none; }
  .tb-isl__next .im { display: block; height: 46px; border-radius: 8px; background: #3a403d center / cover no-repeat; }
  .tb-isl__next small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .tb-isl__next b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-isl__next em { font-style: normal; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--paper); display: grid; place-items: center; }
  .tb-isl__gk { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0 4px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
  .tb-isl__r { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
  .tb-isl__r .im { display: block; width: 56px; height: 44px; border-radius: 6px; background: #3a403d center / cover no-repeat; }
  .tb-isl__r b { display: block; font-weight: 500; font-size: 14px; line-height: 1.2; }
  .tb-isl__r small { display: block; font-size: 12px; color: rgba(255, 255, 255, .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-isl__r em { font-style: normal; font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: rgba(255, 255, 255, .45); white-space: nowrap; }
  .tb-isl__r.is-read em { color: #9FD3A8; }
  .tb-isl__r.is-here { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; border-bottom-color: transparent; background: rgba(255, 255, 255, .12); }
  .tb-isl__r.is-here em { color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  .tb-isl, .tb-isl.is-open, .tb-isl.is-mini, .tb-isl__sheet, .tb-isl__pill, .tb-isl__scrim { transition: opacity .15s ease !important; }
  .tb-isl.is-pulse { animation: none !important; }
  .tb-isl__card { animation: none !important; }
}
