/* ==========================================================================
   WornSole — Trailhead theme. Loaded after app.css and overrides its tokens and
   components site-wide. Forest, moss, sand and a hi-vis orange; condensed sign
   type for headings and controls over a text serif; signposts, contour lines.
   Logical properties throughout (Arabic is RTL). No inline styles (strict CSP).
   ========================================================================== */

:root {
  --forest: #1f3a2d; --forest-2: #142a20; --moss: #7d9560; --bark: #6b4a2b;
  --orange: #ff6a13; --orange-ink: #1a0d00;
  --ui: #1f3a2d;        /* filled controls and frames */
  --ui-ink: #f6f2e2;    /* text on --ui */
  --frame: #1f3a2d;     /* borders around inputs and search rows */
  --head: #1f3a2d;      /* headings on the page background */

  --paper: #e9e3cd; --paper-2: #ddd6bb; --surface: #f6f2e2; --surface-2: #efe9d3;
  --ink: #17281f; --ink-2: #34483b; --muted: #5d6b5f; --line: #cfc8ab; --line-2: #a9a283;
  --accent: #c24b00; --accent-ink: #ffffff; --accent-soft: #ffe0cc;
  --teal: #1f3a2d; --teal-soft: #dbe5cf; --gold: #c99a2e;
  --focus: #0b57d0;

  --font-sign: "DIN Alternate", "DIN Condensed", Bahnschrift, "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  --font-text: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-sans: var(--font-sign);
  --font-serif: var(--font-sign);

  --radius: 4px; --radius-sm: 3px; --radius-lg: 6px;
  --shadow-sm: 0 1px 0 rgba(20, 42, 32, .08);
  --shadow: 0 10px 22px -14px rgba(20, 42, 32, .6);
  --shadow-lg: 0 24px 50px -20px rgba(20, 42, 32, .6);
}
@media (prefers-color-scheme: dark) {
  :root {
    --forest-2: #0a130e; --ui: #2c5240; --ui-ink: #f1ecd8; --frame: #5f8a6f; --head: #ece7d2;
    --paper: #0f1c16; --paper-2: #14251d; --surface: #182c22; --surface-2: #1d352a;
    --ink: #ece7d2; --ink-2: #cfd3be; --muted: #98a595; --line: #27402f; --line-2: #3a5a45;
    --accent: #ff8a3d; --accent-ink: #1a0d00; --accent-soft: #3d2410;
    --teal: #a8c48a; --teal-soft: #1d352a; --focus: #7fb2f0;
    --shadow: 0 10px 24px -14px rgba(0, 0, 0, .8); --shadow-lg: 0 24px 50px -20px rgba(0, 0, 0, .9);
  }
}

/* ---------------------------------------------------------------- base type */
body { font-family: var(--font-text); line-height: 1.55; }
h1, h2, h3, h4 { font-family: var(--font-sign); font-weight: 700; letter-spacing: -.005em; line-height: 1.04; color: var(--head); }
h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: 1.4rem; }
.eyebrow { font: 600 1rem/1 var(--font-sign); letter-spacing: .02em; text-transform: none; color: var(--accent); }
.eyebrow::before { height: 3px; width: 22px; border-radius: 0; }
::selection { background: var(--orange); color: var(--orange-ink); }
.link-btn { color: var(--accent); }

/* ---------------------------------------------------------------- header */
.announcement { background: var(--orange); color: var(--orange-ink); font: 600 1rem/1.3 var(--font-sign); }
.site-header { background: var(--forest); border-bottom: 0; backdrop-filter: none; color: #ece7d2; }
.site-header .brand, .site-header .brand:hover { color: #f6f2e2; font: 700 1.55rem/1 var(--font-sign); letter-spacing: -.005em; }
.site-header .brand b { color: var(--orange); }
.site-header .brand img, .site-footer .brand img { width: 40px; height: 40px; }
.main-nav a { border-radius: 3px; color: #e2dcc3; font: 600 1.05rem/1 var(--font-sign); }
.main-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.main-nav a[aria-current="page"] { background: var(--orange); color: var(--orange-ink); }
.site-header .btn-ghost { color: #e2dcc3; }
.site-header .btn-ghost:hover { --btn-bg: rgba(255, 255, 255, .1); color: #fff; }
.site-header .btn-dark { --btn-bg: var(--orange); --btn-fg: var(--orange-ink); --btn-bd: var(--orange); }
.site-header .btn-dark:hover { --btn-bg: #ff8340; --btn-bd: #ff8340; }
.popover { color: var(--ink); border-radius: var(--radius); border: 2px solid var(--frame); }
@media (max-width: 820px) {
  .main-nav { background: var(--forest-2); border-bottom: 0; box-shadow: var(--shadow-lg); }
}

/* ---------------------------------------------------------------- controls */
.btn { border-radius: 3px; font-family: var(--font-sign); font-size: 1.05rem; letter-spacing: .005em; border-width: 2px; }
.btn:hover { border-color: var(--ui); }
.btn-primary { --btn-bg: var(--orange); --btn-fg: var(--orange-ink); --btn-bd: #c24b00; box-shadow: none; font-weight: 700; }
.btn-primary:hover { --btn-bg: #ff8340; --btn-bd: #c24b00; }
.btn-dark { --btn-bg: var(--ui); --btn-fg: var(--ui-ink); --btn-bd: var(--ui); }
.btn-dark:hover { --btn-bg: var(--orange); --btn-fg: var(--orange-ink); --btn-bd: var(--orange); }
.btn-ghost:hover { --btn-bg: var(--paper-2); }
.btn-sm { font-size: .98rem; }
.chip, .opt-btn, .badge, .tabs, .tab { border-radius: 3px; font-family: var(--font-sign); }
.chip[aria-pressed="true"], .chip.active { background: var(--ui); color: var(--ui-ink); border-color: var(--ui); }
.opt-btn { background: var(--paper-2); font-size: 1rem; border-color: var(--line-2); }
.opt-btn:hover { border-color: var(--orange); }
.tabs { background: var(--paper-2); }
.tab { font-size: 1.02rem; }
.tab[aria-selected="true"] { background: var(--ui); color: var(--ui-ink); box-shadow: none; }
.tab[aria-selected="true"] small { color: inherit; opacity: .8; }

.input, .select, textarea.input { border: 2px solid var(--line-2); border-radius: 3px; background-color: var(--surface); }
.input:focus, .select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--accent-soft); }
.field > span, .label { font: 600 1rem/1.2 var(--font-sign); letter-spacing: .01em; }
.check input { accent-color: var(--ui); }
.switch input:checked + .track { background: var(--ui); }
.form-card, .card { border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-link:hover { border-color: var(--orange); box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- search */
.search-panel { background: var(--surface); border: 0; border-top: 8px solid var(--orange); border-radius: 4px; box-shadow: 0 30px 50px -28px rgba(10, 19, 14, .65); padding: 1.1rem; }
.search-panel.compact { border-top-width: 4px; box-shadow: var(--shadow-sm); padding: .75rem; border-radius: 4px; }
.search-row { border: 2px solid var(--frame); border-radius: 3px; background: var(--surface); }
.sf-cell:focus-within { border-radius: 2px; background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--orange); }
.sf-cell label, .sf-cell .sf-label { font-family: var(--font-sign); font-size: .9rem; letter-spacing: .01em; text-transform: none; color: var(--muted); }
.sf-input, .sf-date-val { font-family: var(--font-sign); font-size: 1.3rem; font-weight: 600; letter-spacing: -.005em; }
.sf-swap { border-radius: 3px; border: 2px solid var(--frame); }
.sf-swap:hover { color: var(--orange-ink); background: var(--orange); border-color: var(--orange); }
.sf-submit .btn { border-radius: 3px; }
.sf-cell + .sf-cell::before { border-inline-start: 2px dotted var(--line-2); }
.ac-list, .datepicker { border: 2px solid var(--frame); border-radius: 4px; }
.ac-item, .dp-day { border-radius: 3px; }
.ac-code { border-radius: 3px; font-family: var(--font-sign); }
.dp-day.start, .dp-day.end { background: var(--orange); color: var(--orange-ink); }
.dp-day.start small, .dp-day.end small { color: var(--orange-ink); }
.dp-day.in-range { background: var(--accent-soft); }

/* ---------------------------------------------------------------- results, tickets */
.itin { border-radius: 4px; border: 1px solid var(--line-2); }
.itin:hover { border-color: var(--ui); box-shadow: var(--shadow); }
.itin.best { border-color: var(--line-2); border-inline-start: 8px solid var(--orange); }
.itin-price { font: 700 1.9rem/1 var(--font-sign); letter-spacing: -.01em; }
.leg-time, .leg-code, .itin-tags .badge { font-family: var(--font-sign); }
.leg-time { font-size: 1.35rem; font-weight: 600; }
.leg-line .track::after { color: var(--orange); }
.itin-details { border-radius: 0 0 4px 4px; }
.offer { border-radius: 3px; border: 1px solid var(--line-2); }
.offer-price { font-family: var(--font-sign); font-weight: 700; }
.ds-day { border-radius: 3px; border: 2px solid var(--line); font-family: var(--font-sign); }
.ds-day.current { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.ds-day:hover { border-color: var(--orange); }
.insight, .stat, .alert-card { border-radius: 4px; }
.insight h3 { font-family: var(--font-sign); font-size: 1.25rem; }
.stat-value { font-family: var(--font-sign); }
.filters .filter-group h3 { font-size: 1.25rem; }
.group-title { font-family: var(--font-sign); font-size: 1.5rem; }
.results-count { font-family: var(--font-sign); }
.chart-bar { fill: var(--ui); }
.month-bar .bar { border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--ui) 70%, transparent); }
.month-bar.cheapest .bar { background: var(--orange); }
.grid-table td.sel a { outline-color: var(--orange); }
.price-pin { border-radius: 3px; border: 2px solid var(--frame); font-family: var(--font-sign); font-size: 13px; }
.price-pin.active { background: var(--orange); color: var(--orange-ink); border-color: var(--orange-ink); }
.explore-item { border-radius: 3px; border-width: 2px; }
.explore-item:hover, .explore-item.active { border-color: var(--orange); }
.explore-item h3 { font-family: var(--font-sign); font-size: 1.25rem; }
.explore-item .price { font-family: var(--font-sign); font-size: 1.3rem; }

/* tables */
.data-table th, .deal-table th, .grid-table th { text-transform: none; letter-spacing: 0; font: 600 .95rem/1.2 var(--font-sign); }
.data-table { border-radius: 3px; }

/* destination cards (also used on /explore and route pages) */
.dest-card { border-radius: 4px; border-width: 2px; border-color: var(--line-2); }
.dest-card:hover { border-color: var(--orange); }
.dest-art { font-family: var(--font-sign); font-size: 1.7rem; }
.art-0 { background: linear-gradient(160deg, #2c5a47, #1f3a2d); }
.art-1 { background: linear-gradient(160deg, #ff7a2e, #c24b00); }
.art-2 { background: linear-gradient(160deg, #6f8a54, #3f5a35); }
.art-3 { background: linear-gradient(160deg, #8a6a3a, #5a3f21); }
.art-4 { background: linear-gradient(160deg, #3d6b78, #214250); }
.art-5 { background: linear-gradient(160deg, #a58a3a, #6b5517); }
.dest-price { font-family: var(--font-sign); font-size: 1.5rem; }
.feature .feature-icon, .feature:nth-child(n) .feature-icon { width: 52px; height: 52px; border-radius: 3px; background: transparent; border: 3px solid var(--ui); color: var(--ui); }
@media (prefers-color-scheme: dark) { .feature .feature-icon, .feature:nth-child(n) .feature-icon { color: var(--moss); border-color: var(--moss); } }

/* route lists (SEO pages) */
.route-list a { border-radius: 0; background: transparent; border: 0; border-bottom: 2px solid var(--line); padding-inline: 0; font: 600 1.25rem/1.2 var(--font-sign); }
.route-list a:hover { border-color: var(--orange); color: var(--accent); }
.route-list .price { font-family: var(--font-sign); }
.faq summary { font: 700 1.3rem/1.2 var(--font-sign); }
.faq summary::after { color: var(--orange); }
.faq details { border-bottom: 2px solid var(--line); }

/* account, auth, admin */
.side-nav a { border-radius: 3px; font: 600 1.05rem/1.2 var(--font-sign); }
.side-nav a[aria-current="page"] { background: var(--ui); color: var(--ui-ink); }
.admin-nav h2 { text-transform: none; letter-spacing: 0; font: 700 1.1rem/1 var(--font-sign); }
.auth-card h1 { font-size: 2.6rem; }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.route-hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); }
.error-code { font-family: var(--font-sign); color: var(--orange); }

/* ---------------------------------------------------------------- footer, cookie banner */
.site-footer { background: var(--forest-2); color: #b9c4aa; margin-top: 4rem; padding-block: 3.5rem 2rem; border-top: 8px solid var(--orange); }
.site-footer a:hover { color: var(--orange); }
.site-footer .brand, .site-footer .brand:hover { color: #f6f2e2; font: 700 1.55rem/1 var(--font-sign); }
.site-footer .brand b { color: var(--orange); }
.footer-grid h4 { text-transform: none; letter-spacing: 0; font: 700 1.2rem/1 var(--font-sign); color: #f6f2e2; }
.footer-bottom { border-top-color: rgba(255, 255, 255, .14); }
.footer-prefs .select { border-radius: 3px; }
.cookie-banner { border-radius: 4px; border: 2px solid var(--frame); border-top: 6px solid var(--orange); }
.skip-link { border-radius: 3px; }

/* ==========================================================================
   Home
   ========================================================================== */
.th-hero { position: relative; overflow-x: clip; background: var(--forest); color: #ece7d2; padding-top: clamp(2.5rem, 7vw, 5rem); }
.th-map { position: absolute; inset: 0; width: 100%; height: 100%; }
[dir="rtl"] .th-map { transform: scaleX(-1); }
.th-contours path { fill: none; stroke: #8fae78; stroke-width: 1; opacity: .3; }
.th-contours .major { stroke-width: 2; opacity: .5; }
.th-trail { fill: none; stroke: var(--orange); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; animation: th-draw 3.2s .4s ease-in-out backwards; }
@keyframes th-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.th-pins circle { fill: var(--forest); stroke: var(--orange); stroke-width: 4; }
.th-pins .top { fill: var(--orange); }
.th-pins .flag { fill: var(--orange); stroke: var(--orange); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.th-inner { position: relative; padding-bottom: clamp(2rem, 4vw, 3rem); }
.th-inner h1 { font-size: clamp(3.2rem, 9.5vw, 8rem); line-height: .9; letter-spacing: -.02em; max-width: 9ch; margin-bottom: .3em; color: #f6f2e2; }
.th-inner .lede { max-width: 44ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: #cdd6bd; margin: 0; }
.th-search { position: relative; padding-bottom: clamp(2rem, 4vw, 3rem); }
/* the panel is light even in dark mode so the form reads as a printed permit */
.th-search .search-panel { --surface: #f6f2e2; --surface-2: #efe9d3; --paper-2: #e6dfc4; --ink: #17281f; --ink-2: #34483b; --muted: #5d6b5f; --line: #cfc8ab; --line-2: #b7b08f; --frame: #1f3a2d; --accent: #c24b00; --accent-soft: #ffe0cc; color: var(--ink); }

.th-sec { padding-block: clamp(2.75rem, 6vw, 5rem); }
.th-sec h2 { margin: 0; }
.th-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.th-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 42px; padding: .35rem 1rem; background: var(--ui); color: var(--ui-ink); border-radius: 3px; text-decoration: none; font: 600 1.05rem/1 var(--font-sign); }
.th-btn:hover { background: var(--orange); color: var(--orange-ink); }

/* signpost deals */
.th-post { position: relative; display: grid; gap: 14px; padding-block: 1rem 2rem; }
.th-post::before { content: ""; position: absolute; inset-block: -.5rem 0; inset-inline-start: calc(50% - 22px); width: 44px; background: linear-gradient(90deg, #5a3d22, #7a5530 40%, #5a3d22); border-radius: 4px 4px 0 0; }
.th-board { position: relative; width: min(82%, 780px); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; padding: 1rem 3.2rem 1rem 1.4rem; color: #17281f; text-decoration: none; background: #efe7c8; clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 50%, calc(100% - 34px) 100%, 0 100%); transition: transform .2s ease; }
.th-board:nth-child(even) { margin-inline-start: auto; padding: 1rem 1.4rem 1rem 3.2rem; background: #c9d6b0; clip-path: polygon(34px 0, 100% 0, 100% 100%, 34px 100%, 0 50%); }
[dir="rtl"] .th-board { padding: 1rem 1.4rem 1rem 3.2rem; clip-path: polygon(34px 0, 100% 0, 100% 100%, 34px 100%, 0 50%); }
[dir="rtl"] .th-board:nth-child(even) { padding: 1rem 3.2rem 1rem 1.4rem; clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 50%, calc(100% - 34px) 100%, 0 100%); }
.th-board:nth-child(3n) { background: #e8d9a8; }
.th-board:hover { transform: translateX(10px); color: #17281f; }
.th-board:nth-child(even):hover { transform: translateX(-10px); }
[dir="rtl"] .th-board:hover { transform: translateX(-10px); }
[dir="rtl"] .th-board:nth-child(even):hover { transform: translateX(10px); }
.th-where b { display: block; font: 700 clamp(1.7rem, 3vw, 2.4rem)/1 var(--font-sign); }
.th-where small, .th-when small { display: block; color: #4a5a4c; font-size: .95rem; }
.th-when { font-size: 1.05rem; }
.th-fare { display: grid; justify-items: end; padding: .45rem .9rem; background: var(--orange); color: var(--orange-ink); border-radius: 3px; font: 700 1.7rem/1 var(--font-sign); }
.th-fare small { font: 500 .78rem/1.2 var(--font-text); }
@media (max-width: 820px) {
  .th-post::before { display: none; }
  .th-board, .th-board:nth-child(even) { width: 100%; grid-template-columns: 1fr auto; padding-block: .9rem; }
  .th-when { grid-column: 1; grid-row: 2; }
  .th-fare { grid-column: 2; grid-row: 1 / 3; }
}

/* map legend (tools) */
.th-legend-sec { background: var(--paper-2); }
.th-legend-sec h2 { margin-bottom: 2rem; }
.th-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.th-key { border-top: 6px solid var(--ui); padding-top: 1rem; }
.th-sym { display: inline-grid; place-items: center; width: 52px; height: 52px; border: 3px solid var(--ui); border-radius: 4px; color: var(--ui); margin-bottom: .9rem; }
@media (prefers-color-scheme: dark) { .th-key { border-top-color: var(--moss); } .th-sym { border-color: var(--moss); color: var(--moss); } }
.th-key h3 { font-size: 1.6rem; margin-bottom: .35rem; }
.th-key p { margin: 0; color: var(--ink-2); }

.th-routes { list-style: none; margin: 0; padding: 0; columns: 2 340px; column-gap: 3rem; }
.th-routes li { break-inside: avoid; }
.th-routes a { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 2px solid var(--line); text-decoration: none; font: 600 1.25rem/1.2 var(--font-sign); }
.th-routes a:hover { color: var(--accent); border-color: var(--orange); }
.th-pair { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.th-pair .icon { color: var(--moss); }
.th-routes b { white-space: nowrap; font-weight: 600; }
.th-faq h2 { margin-bottom: 1.5rem; }

/* Destination guide on the flights-from / flights-to hubs */
.guide .guide-summary { max-width: 62ch; font-size: 1.0625rem; line-height: 1.65; }
.guide .guide-facts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 1.5rem 0 0; }
.guide .guide-facts > div { background: var(--surface); border-inline-start: 6px solid var(--orange); padding: 1rem 1.25rem; border-radius: 3px; }
.guide dt { font-family: var(--font-sign); font-weight: 700; margin-bottom: .25rem; }
.guide dd { margin: 0; line-height: 1.6; }
