/* ==========================================================================
   Shared base for TzFlow concept sites.
   Each concept sets its own look in its theme file (tokens + components).
   Tokens used here: --bg --surface --ink --muted --accent --accent-ink
                     --line --font-body --font-display --r (radius)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  font-size: 1rem; line-height: 1.6; color: var(--ink); background: var(--bg);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 3px; }
[hidden] { display: none !important; }
/* Big headlines never overflow: each theme sizes them with clamp(), and as a last resort long words break/hyphenate. */
h1, h2, h3, .btn { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.btn { max-width: 100%; }

.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 200; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 760px) { .wrap { padding-inline: 28px; } }
/* Photo that fills its width and crops to whatever height the theme gives it (via aspect-ratio, or an explicit
   height on boxes with a fixed size, e.g. the safari gallery). It must NOT use height:100%: inside a grid or flex
   item that percentage resolves against the stretched item and overrides the aspect-ratio, pushing captions
   below the photo out of their box and under the next section. */
.cover { width: 100%; height: auto; object-fit: cover; }

/* ---------- Concept honesty banner (slim strip above the header; scrolls away with the page, never covers content) ---------- */
.concept-banner {
  position: relative; z-index: 61;
  display: flex; align-items: center; justify-content: center; gap: .25rem .6rem; flex-wrap: wrap;
  padding: 4px 44px 4px 12px; min-height: 40px;
  background: #0D1B3D; color: #DCE1EE; text-align: center;
  font: 500 12.5px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: 0;
}
.concept-banner p { min-width: 0; }
.concept-banner strong { color: #fff; }
.concept-banner a {
  flex: none; display: inline-flex; align-items: center; min-height: 30px; padding: .2rem .65rem;
  background: #2ED39C; color: #0D1B3D; font-weight: 700; text-decoration: none; border-radius: 6px; white-space: nowrap;
}
.concept-banner a:hover { background: #3DD6A3; }
.concept-banner a:focus-visible, .cb-close:focus-visible { outline-color: #fff; outline-offset: 2px; }
.cb-close { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #AEB7CE; font-size: 13px; line-height: 1; display: grid; place-items: center; }
.cb-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.cb-closed .concept-banner { display: none; }
/* Phones: one compact row — short notice on the left, button on the right */
@media (max-width: 599px) {
  .concept-banner { flex-wrap: nowrap; justify-content: flex-start; text-align: left; padding: 5px 40px 5px 12px; font-size: 12px; }
  .concept-banner p { flex: 1; }
  .concept-banner a { min-height: 32px; padding: .2rem .55rem; }
  .cb-ask { display: none; }
}

/* ---------- Header + mobile menu mechanics (visuals live in each theme) ---------- */
.c-header { position: sticky; top: 0; z-index: 60; }
.c-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.c-nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.c-nav a { text-decoration: none; display: inline-block; padding: .5rem 0; }
.c-tools { display: flex; align-items: center; gap: .5rem; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid currentColor; background: transparent; place-items: center; }
.menu-btn i, .menu-btn i::before, .menu-btn i::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: transform .25s, background-color .2s; }
.menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0; }
.menu-btn i::before { top: -6px; } .menu-btn i::after { top: 6px; }
.menu-btn[aria-expanded="true"] i { background: transparent; }
.menu-btn[aria-expanded="true"] i::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] i::after { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 899px) {
  .js .menu-btn { display: grid; }
  .js .c-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--nav-bg, var(--surface)); border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px rgba(0,0,0,.12); display: none; }
  .js .c-nav.is-open { display: block; }
  .js .c-nav ul { flex-direction: column; gap: 0; padding: .5rem 16px 1rem; }
  .js .c-nav a { display: block; padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .c-hide-sm { display: none !important; }
}

/* ---------- Language switch ---------- */
.lang-sw { display: inline-flex; border: 1.5px solid currentColor; border-radius: 999px; padding: 2px; }
.lang-sw button { min-width: 38px; min-height: 32px; border: 0; background: transparent; border-radius: 999px; font-weight: 700; font-size: .75rem; letter-spacing: .06em; }
.lang-sw button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .75em 1.3em; border: 1.5px solid transparent; border-radius: var(--r-btn, 10px);
  font-weight: 700; text-decoration: none; line-height: 1.15; text-align: center;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px) scale(.97); }
@media (hover: hover) { .motion .btn:hover { transform: translateY(-2px); } .motion .btn:active { transform: translateY(0) scale(.97); } }
.btn--accent { background: var(--accent); color: var(--accent-ink, #fff); }
.btn--accent:hover { filter: brightness(1.08); }
.btn--line { border-color: currentColor; background: transparent; }
.btn--line:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--block { width: 100%; }
.wa-ico { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Tabs ---------- */
[role="tablist"] { display: flex; flex-wrap: wrap; gap: .4rem; }
[role="tab"] { min-height: 44px; }

/* ---------- Chips (filters, radio pills) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span, button.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem;
  border: 1.5px solid var(--line-strong, rgba(0,0,0,.2)); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: .92rem;
}
.chip input:checked + span, button.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Forms ---------- */
.f-grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .f-grid--2 { grid-template-columns: 1fr 1fr; } .f-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.f-field { display: grid; gap: .4rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.f-field > label, .f-legend { font-weight: 650; font-size: .93rem; padding: 0; }
.f-hint { font-size: .82rem; color: var(--muted); }
.f-input {
  width: 100%; min-height: 50px; padding: .7rem .9rem;
  border: 1.5px solid var(--line-strong, rgba(0,0,0,.22)); border-radius: var(--r-input, 10px);
  background: var(--input-bg, #fff); color: var(--ink); font-size: 16px; /* no iOS zoom */
}
textarea.f-input { min-height: 120px; resize: vertical; line-height: 1.5; }
select.f-input { appearance: none; padding-right: 2.4rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23666' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .95rem center; background-size: 12px; }
.f-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring, rgba(0,0,0,.12)); }
.f-input[aria-invalid="true"], .f-field.is-invalid .chip span { border-color: #C62828; }
.f-err { color: #B42318; font-size: .85rem; font-weight: 650; }
.f-summary { padding: .8rem 1rem; border-radius: 10px; background: #FDECEA; color: #8A1C12; font-weight: 600; }
.demo-note { font-size: .82rem; color: var(--muted); }

/* ---------- "Demo submitted" panel + automation preview ---------- */
.success { display: grid; gap: 1rem; }
.success:focus { outline: none; }
.auto-preview { display: grid; gap: .6rem; padding: 1rem; border-radius: 16px; background: #E9E2D7; background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 14px 14px; color: #1d1d1d; }
.auto-preview__label { font: 700 .7rem/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; color: #4a4a4a; }
.bubble { justify-self: end; max-width: 92%; background: #D3F4E6; padding: .6rem .8rem; border-radius: 14px 14px 4px 14px; font-size: .92rem; line-height: 1.45; box-shadow: 0 1px 0 rgba(0,0,0,.08); white-space: pre-line; }
.bubble small { display: block; text-align: right; font-size: .7rem; color: #5b6b63; margin-top: .25rem; }
.bubble--later { background: #fff; justify-self: start; border-radius: 14px 14px 14px 4px; }

/* ---------- Lightbox ---------- */
.lb { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: rgba(8,8,8,.94); color: #fff; }
.lb::backdrop { background: rgba(0,0,0,.6); }
.lb figure { height: 100%; display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; padding: 64px 12px 18px; gap: .75rem; }
.lb img { max-height: calc(100vh - 150px); max-width: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lb figcaption { font-size: .92rem; opacity: .85; text-align: center; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; line-height: 1; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-close { top: 10px; right: 10px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-count { position: absolute; top: 22px; left: 16px; font: 600 .8rem/1 ui-monospace, Menlo, monospace; opacity: .75; }
[data-lightbox] { cursor: zoom-in; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 20px); z-index: 95; opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; font-size: .92rem; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Concept footer note ---------- */
.concept-foot { font-size: .82rem; opacity: .8; }
.concept-foot a { font-weight: 700; }

/* ---------- Motion (only when concept.js adds .motion: JS on, IntersectionObserver available, no reduced-motion) ----------
   Only transform and opacity are animated. Without .motion every element is simply visible.
   Each theme tunes the feel with --rv-dur, --rv-y, --rv-s and --rv-ease. */
.motion .rv { opacity: 0; transform: translate3d(0, var(--rv-y, 20px), 0) scale(var(--rv-s, 1)); }
.motion .rv.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--rv-dur, 500ms) var(--rv-ease, cubic-bezier(.22, .61, .36, 1)) var(--rv-d, 0ms),
              transform var(--rv-dur, 500ms) var(--rv-ease, cubic-bezier(.22, .61, .36, 1)) var(--rv-d, 0ms);
}
/* Tab panels (menus, seasons, fees) fade in when switched */
.motion [role="tabpanel"]:not([hidden]) { animation: panel-in .4s cubic-bezier(.22, .61, .36, 1); }
@keyframes panel-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print { .concept-banner, .c-header, .toast { display: none !important; } body { padding: 0; } }
