/* ============================================================
   TRIP MAKER — the home page
   Loaded after css/style.css, and only by index.html.

   The site used to serve one 217kB stylesheet to every page. Nine tenths of what a
   visitor waited for before the first pixel was rules for a page they were not on,
   and on a phone that stylesheet was the longest thing standing between them and
   the page. So each page now gets the shared sheet plus this one.

   The test for a new rule is whether a second page can produce the classes it
   names. If it can, it belongs in style.css. Two things follow from these sheets
   loading AFTER the shared one, and both are why a rule can look like it belongs
   here and not:
     · a rule here wins a tie the shared sheet used to win, so anything that used to
       sit before a shared rule it ties with stays in style.css;
     · a selector list that spans two pages is dealt out, each part filed with its
       own page, so a rule written to be the last word still is.
   ============================================================ */

/* The ramp lands on transparent 4px before the clip's edge (not at 100%) for
   the same Android overscroll-stretch reason described at .hero-veil: the mask
   can sit a pixel off the content while the page rubber-bands, and a ramp that
   only reaches zero exactly at the edge then leaves the last row faintly
   visible. A short fully-transparent band means the edge cuts through pixels
   that are already invisible, wherever the mask happens to land. */

.hero-kicker {
  font-weight: 600; letter-spacing: .28em; font-size: .8rem;
  color: var(--mint); text-transform: uppercase;
  opacity: 0; animation: rise .8s ease .1s forwards;
}
.hero-sub {
  color: var(--paper-dim); font-size: clamp(1rem, 2.2vw, 1.25rem); font-weight: 300;
  max-width: 46ch; opacity: 0; animation: rise .8s ease .4s forwards;
}
/* Accessibility "stop animations": keep the copy visible without the rise-in. */
html.aaa-motion .hero-kicker,
html.aaa-motion .hero-sub,
html.aaa-motion .search-box {
  opacity: 1;
  transform: none;
  animation: none;
}

/* ---------- search widget ---------- */

.search-box {
  margin-top: 38px; width: min(640px, 100%);
  padding: 10px; border-radius: 26px;
  opacity: 0; animation: rise .8s ease .55s forwards;
}
.search-tabs { display: flex; gap: 6px; padding: 0 6px 8px; }
.search-tab {
  flex: 1; background: transparent; border: none; cursor: pointer;
  color: var(--paper-dim); font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 9px 6px; border-radius: 14px; transition: all .2s ease;
  text-align: center; text-decoration: none; white-space: nowrap;
}@media (max-width: 520px) {
  .search-tabs { gap: 2px; padding: 0 2px 8px; }
  .search-tab { font-size: .78rem; padding: 8px 2px; white-space: normal; line-height: 1.25; }
}


.search-row { display: flex; gap: 8px; position: relative; }
.search-input {
  flex: 1; min-width: 0; background: rgba(6, 13, 11, .55);
  border: 1px solid var(--glass-border); border-radius: 18px;
  color: var(--paper); font-family: var(--font-body); font-size: 1.05rem;
  padding: 15px 20px; outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.search-input:focus { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255, 180, 95, .13); }
.prompt-submit {
  flex: 0 0 96px; border: 1px solid var(--amber); border-radius: 18px;
  background: var(--amber); color: #132019; cursor: pointer;
  font-family: var(--font-body); font-size: 1.05rem; font-weight: 800;
  transition: filter .15s ease, transform .15s ease;
}
.prompt-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.prompt-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.prompt-submit[hidden] { display: none; }
.search-input.code-mode {
  direction: ltr; text-align: center; letter-spacing: .55em; font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}
.search-hint { padding: 10px 10px 2px; font-size: .85rem; color: rgba(245, 239, 227, .45); min-height: 1.6em; }

/* autocomplete dropdown: an overlay glued to the input's bottom edge, so it reads
   as one combobox control — it floats above the hero instead of pushing it.
   position: fixed (top/left/width set in JS from the input's rect) with home.js
   moving the element to <body> when it opens — the hero is an isolated stacking
   context (isolation: isolate, for the ken-burns clip) that traps even fixed
   descendants below the site header's z-index, so staying inside it meant the
   dropdown scrolled away and vanished behind the header. z-index above the
   header keeps it visible and glued to the input as the page scrolls. */
.search-results {
  position: fixed; z-index: 150;
  display: none; text-align: right;
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(8, 17, 14, .97);
  border: 1px solid var(--amber); border-top: none;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, .65);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
/* while the dropdown is open the input fuses into it: flat bottom, shared border */
.search-box.dd-open .search-input {
  border-radius: 18px 18px 0 0;
  border-color: var(--amber); box-shadow: none;
}
.search-result {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  text-decoration: none; color: var(--paper); transition: background .12s ease;
}
.search-result + .search-result { border-top: 1px solid rgba(245, 239, 227, .06); }
.search-result:hover, .search-result.sr-active { background: var(--glass-strong); }
.search-result .sr-go {
  margin-inline-start: auto; color: var(--paper-dim);
  opacity: 0; transform: translateX(4px); transition: opacity .15s ease, transform .15s ease;
}
.search-result:hover .sr-go, .search-result.sr-active .sr-go { opacity: 1; transform: none; }
/* the "plan a new trip" options lead the list: an amber wash and a heavier title
   mark them as the recommended path without saying so out loud. Country matches
   stack up to 3 such rows — thin amber seams between them, one dashed seam after */
.search-result.plan-cta {
  padding: 13px 14px;
  background: linear-gradient(135deg, rgba(255, 180, 95, .17), rgba(255, 180, 95, .05));
}
.search-result.plan-cta + .search-result.plan-cta { border-top: 1px solid rgba(255, 180, 95, .16); }
.search-result.plan-cta:hover, .search-result.plan-cta.sr-active {
  background: linear-gradient(135deg, rgba(255, 180, 95, .26), rgba(255, 180, 95, .1));
}
.search-result.plan-cta .sr-title { color: var(--amber); font-size: 1.02rem; }
.search-result.plan-cta .sr-go { color: var(--amber); }
.search-result.plan-cta .pc-icon {
  width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(255, 180, 95, .14); border-radius: 12px;
  border: 1px solid rgba(255, 180, 95, .4); color: var(--amber);
  box-shadow: 0 0 18px -4px rgba(255, 180, 95, .45);
}
/* country flag in the thumb square (emoji on mobile, SVG image on desktop) */
.search-result .sr-flag {
  width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(255, 180, 95, .1); border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255, 180, 95, .35);
}
/* quiet section label above the existing-trip results; the dashed amber seam
   closes the creation section above it */
.search-results .sr-group-label {
  padding: 10px 14px 4px; font-size: .74rem; font-weight: 600;
  letter-spacing: .12em; color: rgba(245, 239, 227, .42);
  border-top: 1px dashed rgba(255, 180, 95, .35);
}
.search-results .sr-group-label + .search-result { border-top: none; }
.search-results .sr-empty { border-top: 1px dashed rgba(255, 180, 95, .35); }
.search-results .skl-thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.search-result .sr-title { font-weight: 700; font-size: .98rem; }
.search-result .sr-meta { font-size: .82rem; color: var(--paper-dim); margin-top: 1px; }
.search-results .search-result { border-radius: 0; }
.search-results .sr-empty {
  padding: 12px 14px 10px; font-size: .85rem; color: var(--paper-dim);
}
.search-results .skl-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }

.scroll-cue {
  position: absolute; bottom: 26px; right: 50%; transform: translateX(50%);
  color: rgba(245, 239, 227, .5); font-size: .85rem; letter-spacing: .1em;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: bob 2.4s ease-in-out infinite;
  transition: opacity .2s ease;
}
/* the open dropdown floats right above the cue — fade it out instead of colliding */
.search-box.dd-open ~ .scroll-cue { opacity: 0; }
.popular-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 12px 7px;
}
.popular-label {
  font-size: .72rem; font-weight: 600; letter-spacing: .12em;
  color: rgba(245, 239, 227, .5);
}
/* the arrows exist for the pointer only — a finger swipes the strip, and on a
   phone two more buttons here would cost more room than they earn */
.popular-nav { display: flex; gap: 6px; }
.popular-nav button {
  width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--paper);
  transition: background .15s ease, color .15s ease, opacity .15s ease;
}
.popular-nav button:hover:not(:disabled) { background: var(--amber); color: var(--ink); border-color: transparent; }
.popular-nav button:disabled { opacity: .3; cursor: default; }@media (hover: none) { .popular-nav { display: none; }
}

.popular-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 6px 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.popular-strip::-webkit-scrollbar { display: none; }
/* every tile is the same size, however long its name — a route across three
   countries wraps onto a second line instead of widening the tile, so the strip
   stays a grid of equal cards rather than a row of mismatched blocks */
.pop-tile {
  flex: 0 0 130px; height: 94px; position: relative; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--glass-border);
  text-decoration: none; color: var(--paper); background: var(--ink-2);
  transition: transform .2s ease, border-color .2s ease;
}
.pop-tile:hover { transform: translateY(-2px); border-color: rgba(255, 180, 95, .55); }
.pop-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  background-size: cover; background-position: center;
  transition: transform .4s ease;
}
/* on the tile, not on the photo — see .dest-card::after */
.pop-tile::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 21, 18, .05) 12%, rgba(10, 21, 18, .9) 100%);
}
.pop-tile:hover .pop-img { transform: scale(1.06); }
.pop-text {
  position: absolute; right: 8px; left: 8px; bottom: 7px; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px;
  font-size: .8rem; font-weight: 700; line-height: 1.22;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}
/* the flex-basis is the wrap threshold: a name that can't sit beside its flags
   drops to its own line and gets the tile's full width there */
.pop-name {
  flex: 1 1 68px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pop-flags { display: inline-flex; gap: 3px; flex-shrink: 0; }
/* the routes are the odd ones out in a strip of single destinations — the badge
   says so before the flags are read */
.pop-badge {
  position: absolute; top: 6px; right: 7px; z-index: 1;
  font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 180, 95, .92); color: #132019;
}@media (max-width: 640px) {
  .pop-tile { flex-basis: 118px; height: 90px; }
}

.section-head {
  width: min(1120px, calc(100% - 40px)); margin: 0 auto 26px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15;
}
.section-head p { color: var(--paper-dim); font-weight: 300; margin-top: 6px; }
.strip-nav { display: flex; gap: 8px; }
.strip-nav button {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--paper);
  font-size: 1.2rem; transition: all .2s ease;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.strip-nav button:hover { background: var(--amber); color: var(--ink); border-color: transparent; }

.strip-wrap { position: relative; }
.strip-wrap::before, .strip-wrap::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 70px; z-index: 2; pointer-events: none;
}
.strip-wrap::before { right: 0; background: linear-gradient(270deg, var(--ink), transparent); }
.strip-wrap::after { left: 0; background: linear-gradient(90deg, var(--ink), transparent); }

/* ---------- how-it-works ---------- */

.steps-grid {
  width: min(1120px, calc(100% - 40px)); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.step-card { padding: 28px 24px; position: relative; overflow: hidden; }
.step-num {
  font-family: var(--font-display); font-size: 3.6rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 180, 95, .5);
  position: absolute; top: 14px; left: 18px; opacity: .8;
}
.step-card h3 { font-family: var(--font-display); font-size: 1.25rem; margin: 8px 0 10px; }
.step-card p { color: var(--paper-dim); font-weight: 300; line-height: 1.65; font-size: .97rem; }
.step-icon { font-size: 1.8rem; }

/* home search results: real row, real 52px thumb slot */
.skl-thumb { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; }
.skl-sr-text { display: flex; flex-direction: column; gap: 6px; }
.skl-sr-title { width: 190px; height: 15px; }
.skl-sr-meta { width: 124px; height: 12px; }@media (max-width: 900px) {
  .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .strip-nav { display: none; }
}


/* homepage additions: audience cards, destination links, FAQ */
.audience-grid {
  width: min(1120px, calc(100% - 40px)); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.audience-card { padding: 26px 24px; text-decoration: none; color: var(--paper); display: block; position: relative; overflow: hidden; min-height: 230px; transition: transform .18s, border-color .18s; }
.audience-card > * { position: relative; z-index: 1; }
.audience-card .ac-bg { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; background-size: cover; background-position: center; opacity: .55; transition: transform .35s ease, opacity .35s ease; }
/* on the card, not on the photo — see .dest-card::after */
.audience-card::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgba(10, 21, 18, .25) 0%, rgba(10, 21, 18, .82) 70%, rgba(10, 21, 18, .95) 100%); }
.audience-card:hover .ac-bg { transform: scale(1.05); opacity: .7; }
.audience-card h3, .audience-card p { text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.audience-card p { color: var(--paper); }
.audience-card { display: flex; flex-direction: column; justify-content: flex-end; }
.audience-card:hover { transform: translateY(-3px); border-color: rgba(255, 180, 95, .45); }
.audience-card h3 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 8px; }
.audience-card p { color: var(--paper-dim); font-weight: 300; line-height: 1.65; font-size: .97rem; margin: 0 0 12px; }
.audience-card .ac-more { color: var(--amber); font-weight: 600; font-size: .92rem; }@media (max-width: 820px) { .audience-grid { grid-template-columns: 1fr; }
}

.home-dests { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.home-faq { width: min(880px, calc(100% - 40px)); margin: 0 auto; }
.home-faq h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 10px; }
.home-faq > p { color: var(--paper-dim); font-weight: 300; line-height: 1.7; margin-bottom: 10px; }
.home-what p a { color: var(--amber); text-decoration: none; border-bottom: 1px solid rgba(255, 180, 95, .4); }
.home-what p a:hover { border-bottom-color: var(--amber); }
@keyframes bob { 0%, 100% { transform: translate(50%, 0); } 50% { transform: translate(50%, 8px); } }

/* ---------- share the app: the closing band ---------- */
/* The last card on the page is the only one that asks the visitor for something,
   so it is the only one allowed to glow — and it is centred, like the hero, so the
   two ends of the page bookend each other. One column at every width: the same
   shape on a phone as on a desktop, nothing to re-flow and nothing to break. */
.share-band {
  position: relative; overflow: hidden;
  width: min(720px, calc(100% - 40px)); margin: 0 auto;
  padding: 38px 34px 28px; text-align: center;
  border-color: rgba(255, 180, 95, .3);
}
/* the wash sits UNDER the content (a sibling layer, not a background on .glass):
   .glass already owns background + backdrop-filter, and a second background on the
   same element would have to replace the tint the blur reads through */
.share-band::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(130% 95% at 50% -15%, rgba(255, 180, 95, .2), transparent 60%),
    radial-gradient(100% 80% at 50% 125%, rgba(143, 216, 196, .13), transparent 58%);
}
.share-band > * { position: relative; }
/* the mark: the share glyph with its three nodes drawn as map pins, because what
   this card hands over is three places on a map. It is inline SVG and not the
   compass emoji it replaced — an emoji is a different picture on every platform,
   and this one has to look deliberate on all of them.
   No ring. A hard 1px circle here drew a second edge inside a card that already has
   one, and the drop shadow under it turned the whole thing into a sticker. What is
   left is a bloom that fades to nothing, so the mark is anchored without being
   framed — the same move the card's own ::before wash makes. */
.share-mark {
  display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 12px;
  color: var(--amber); border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255, 180, 95, .26), rgba(255, 180, 95, .07) 60%, transparent);
}
/* not .ic: that class sets its stroke for icons drawn at 17px, and the same ratio at
   48px comes out spindly. 1.55 on a 32 viewBox is ~2.3px on screen — the weight the
   pins need to keep their necks open without going fat. */
.share-mark svg {
  width: 48px; height: 48px;
  fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round;
}
.share-mark circle { fill: currentColor; stroke: none; }
/* the soft wide line under each link, the same trace the route wears on the real
   trip map. Dim and behind, so it reads as glow rather than as a second line. */
.share-mark .sm-trace { stroke-width: 4.6; opacity: .26; }
.share-band h2 {
  font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.15;
}
.share-band h2 .accent { color: var(--amber); }
.share-band > p {
  color: var(--paper-dim); font-weight: 300; line-height: 1.7;
  max-width: 54ch; margin: 10px auto 0;
}
.share-band-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 24px;
}
.share-app-feedback {
  min-height: 1.35em; margin-top: 10px;
  color: var(--mint); font-size: .85rem;
}

/* the reward line: what the link earns the person sending it. Three seats fill as
   friends sign up, so the progress is read before the sentence is. */
.share-reward {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; padding-top: 16px; margin-top: 6px;
  border-top: 1px solid var(--glass-border);
  font-size: .89rem; color: var(--mint);
}
/* display:flex above would otherwise beat the UA sheet's [hidden] { display: none } */
.share-reward[hidden] { display: none; }
.share-pips { display: inline-flex; gap: 5px; }
.share-pips i { width: 9px; height: 9px; border-radius: 50%; background: rgba(245, 239, 227, .2); }
.share-pips i.on { background: var(--mint); box-shadow: 0 0 10px -1px rgba(143, 216, 196, .9); }
/* the allowance is already doubled — nothing left to earn, so it reads as the
   page's reward colour rather than as progress */
.share-reward.is-bonus { color: var(--amber); }
.share-reward.is-bonus .share-pips i.on {
  background: var(--amber); box-shadow: 0 0 10px -1px rgba(255, 180, 95, .9);
}

/* side by side, the two buttons need more width than a phone has once the amber
   one is btn-lg — so they stack, full width, in the order they are meant to be used */
@media (max-width: 560px) {
  .share-band { padding: 32px 20px 26px; }
  .share-band-actions { flex-direction: column; }
  .share-band-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- the pull-out share flag ---------- */
/* The band at the foot of the page, reachable without scrolling to it. It does not
   open a window beside itself — it unrolls: the tab stays put and a rail of actions
   slides out from behind it, so tab and rail read as one pill still hugging the
   edge rather than as a card that appeared out of nowhere.
   Physical left/right properties throughout, not logical ones — this is pinned to an
   edge of the SCREEN, and under `dir="rtl"` the logical ones would swing it across to
   the other side, straight under the header's buttons. It sits below the header
   (z-index 90, under the header's 100 and the search dropdown's 150) and clear of the
   accessibility widget's button, which owns the bottom-right corner. */
.share-flag {
  position: fixed; z-index: 90;
  top: calc(92px + env(safe-area-inset-top)); left: 0;
  display: flex; align-items: stretch;
  /* LTR for the same reason .nav-actions is: a flex row lays its children along the
     WRITING direction, so under dir="rtl" the tab landed at the right end of the
     group and the rail unrolled leftwards, off the screen edge it is pinned to.
     The group's order is physical — tab against the edge, rail out from behind it —
     so the group says so, and the Hebrew label takes its own direction back below. */
  direction: ltr;
  transition: opacity .25s ease, transform .25s ease;
}
.share-flag[hidden] { display: none; }
/* the band itself is on screen — two of the same ask in view at once is one too many */
.share-flag.band-visible { opacity: 0; transform: translateX(-14px); pointer-events: none; }

.share-flag-tab,
.share-flag-rail {
  border: 1px solid rgba(255, 180, 95, .45); border-left: none;
  /* 180deg and not 135: the two are separate boxes of equal height, and a diagonal
     ramp restarts in each of them — open, the seam between tab and rail showed as a
     step in the tint, and the one pill read as two blocks. Down the same height,
     both paint the identical ramp and the seam disappears. */
  background: linear-gradient(180deg, rgba(255, 180, 95, .3), rgba(232, 133, 58, .18));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .75), inset 0 1px 0 var(--glass-highlight);
}
.share-flag-tab {
  /* above the rail in paint order, so the rail slides out from BEHIND it */
  position: relative; z-index: 1;
  direction: rtl;
  display: flex; align-items: center; gap: 0;
  padding: 9px 10px 9px 9px; cursor: pointer;
  border-radius: 0 16px 16px 0;
  color: var(--paper); font-family: var(--font-body);
  transition: gap .22s ease, padding .22s ease, background .2s ease, border-radius .2s ease;
}
.share-flag-tab .ic { width: 18px; height: 18px; color: var(--amber); }
/* open, the tab is the left end of one pill: its right edge stops being an edge */
.share-flag.open .share-flag-tab { border-radius: 0; border-right-color: transparent; }
/* the label grows out of the edge from zero — no width to guess, and nothing to
   measure when the font finally lands. A touch device never hovers, so there it
   simply never opens: on a phone the flag is the glyph alone, and the rail is one
   tap away. */
.share-flag-label {
  display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap;
  font-weight: 700; font-size: .88rem; opacity: 0;
  transition: max-width .25s ease, opacity .2s ease;
}
.share-flag:hover:not(.open) .share-flag-label,
.share-flag-tab:focus-visible .share-flag-label { max-width: 110px; opacity: 1; }
.share-flag:hover:not(.open) .share-flag-tab,
.share-flag-tab:focus-visible { gap: 7px; padding-right: 14px; }
/* open, the tab keeps the rail's exact tint — brightening it would put the seam
   back. Focus is the one thing allowed to override that, because it has to. */
.share-flag:hover:not(.open) .share-flag-tab,
.share-flag-tab:focus-visible {
  background: linear-gradient(180deg, rgba(255, 180, 95, .4), rgba(232, 133, 58, .26));
}

.share-flag-rail {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px 5px 5px; border-radius: 0 16px 16px 0;
  animation: rail-out .22s ease-out;
}
.share-flag-rail[hidden] { display: none; }
/* out from under the tab, not down from above it */
@keyframes rail-out { from { opacity: 0; transform: translateX(-24px); } }
.share-flag-act {
  width: 34px; height: 34px; flex: none; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: var(--paper);
  transition: background .18s ease, transform .18s ease;
}
.share-flag-act:hover { background: rgba(255, 255, 255, .2); }
.share-flag-act:active { transform: scale(.94); }
.share-flag-act:disabled { opacity: .5; cursor: wait; pointer-events: none; }
.share-flag-act .ic, .share-flag-act .wa-icon { width: 17px; height: 17px; }
.sfa-wa { background: linear-gradient(135deg, var(--amber), var(--amber-deep)); color: #241302; }
.sfa-wa:hover { background: linear-gradient(135deg, var(--amber), var(--amber-deep)); filter: brightness(1.08); }
/* the copy button answers on itself: the chain becomes a tick, or turns the colour
   the app uses for "that did not work" — there is no room here for a sentence, and
   the sentence a screen reader needs is in the .sr-only status beside it */
.share-flag-act .ic-done { display: none; }
.share-flag-act.is-done .ic-link { display: none; }
.share-flag-act.is-done .ic-done { display: block; color: var(--mint); }
.share-flag-act.is-failed { color: var(--danger); }

@media (max-width: 560px) {
  .share-flag { top: calc(86px + env(safe-area-inset-top)); }
  .share-flag-tab { padding: 7px 9px 7px 8px; }
  .share-flag-tab .ic { width: 16px; height: 16px; }
  .share-flag-act { width: 32px; height: 32px; }
}
/* "stop animations" in the accessibility widget: the flag still opens, it just
   stops sliding while it does */
html.aaa-motion .share-flag,
html.aaa-motion .share-flag-tab,
html.aaa-motion .share-flag-label { transition: none; }
html.aaa-motion .share-flag-rail { animation: none; }
