/* Shared foundation for all three TRB websites.
   Each site's own site.css sets the design tokens (colors, type) that give it a distinct identity. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .6em; font-weight: var(--display-weight, 600); letter-spacing: var(--display-tracking, -0.01em); text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--maxw, 72rem); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 32px; } }
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.eyebrow { font-family: var(--font-label, var(--font-body)); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted-strong, var(--ink)); max-width: 40rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 8px; top: -100px; z-index: 100; padding: .6rem 1rem; background: var(--ink); color: var(--bg); border-radius: 4px; }
.skip-link:focus { top: 8px; }

/* ---- Draft banner (removed for launch by setting "draft": false in src/site-config.json) ---- */
.draft-banner { background: #fff1c2; color: #3d3000; font: 500 .8rem/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; padding: .55rem 16px; text-align: center; border-bottom: 1px solid #e6cf7a; }
.draft-banner strong { font-weight: 700; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .75rem 1.4rem; border-radius: var(--radius-btn, 2px); border: 1px solid transparent; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; text-align: center; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover, var(--accent)); }
.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.text-link { font-weight: 600; text-underline-offset: .2em; }

/* ---- Header and mobile navigation ---- */
.site-header { position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.site-header__brand { text-decoration: none; display: inline-flex; flex-direction: column; line-height: 1.1; }
.nav-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .8rem; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-btn, 2px); cursor: pointer; font-size: .9rem; }
.nav-toggle__bars { width: 18px; height: 12px; position: relative; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid currentColor; }
.site-nav { display: none; }
.site-nav.is-open { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--nav-bg, var(--bg)); border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(0,0,0,.12); }
.site-nav ul { list-style: none; display: flex; flex-direction: column; padding: .5rem 16px 1.25rem; }
.site-nav a { display: block; padding: .8rem 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.site-nav a[aria-current="page"] { font-weight: 700; }
.site-nav .btn { margin-top: 1rem; border-bottom: 0; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; position: static; background: none; border: 0; box-shadow: none; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 1.75rem; padding: 0; }
  .site-nav a { padding: .25rem 0; border: 0; font-size: .95rem; }
  .site-nav .btn { margin: 0 0 0 .5rem; padding: .55rem 1.1rem; min-height: 42px; }
}

/* ---- Missing-asset placeholder (draft only; replaced automatically when the photo is added) ---- */
.missing-asset {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 160px; width: 100%; height: 100%; padding: 1rem; text-align: center;
  color: var(--missing-ink, var(--muted));
  background: repeating-linear-gradient(135deg, color-mix(in srgb, currentColor 9%, transparent) 0 10px, color-mix(in srgb, currentColor 3%, transparent) 10px 20px);
  border: 2px dashed color-mix(in srgb, currentColor 45%, transparent);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .75rem; line-height: 1.35;
}
.missing-asset__tag { font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: .15rem .5rem; border: 1px solid currentColor; }
.missing-asset__label { font-size: .85rem; max-width: 30ch; font-family: var(--font-body); font-weight: 600; }
.missing-asset__path { opacity: .8; word-break: break-all; }
.asset-img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Notices ---- */
.notice { border-left: 4px solid var(--accent); background: var(--surface); padding: 1rem 1.25rem; font-size: .95rem; }
.notice--warn { border-left-color: #b7791f; }
.notice p:last-child { margin-bottom: 0; }

/* ---- Booking / introduction preview (shared component; see shared/booking-preview.js) ---- */
.booking { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 4px); }
.booking__status { display: flex; gap: .6rem; align-items: flex-start; padding: .9rem 1.25rem; background: #fff1c2; color: #3d3000; border-bottom: 1px solid #e6cf7a; font-size: .9rem; border-radius: var(--radius, 4px) var(--radius, 4px) 0 0; }
.booking__status strong { white-space: nowrap; }
.booking__steps { display: flex; list-style: none; gap: .25rem; padding: 1rem 1.25rem 0; font-size: .75rem; color: var(--muted); overflow-x: auto; }
.booking__steps li { flex: 1 0 auto; padding-bottom: .5rem; border-bottom: 3px solid var(--line); white-space: nowrap; }
.booking__steps li[aria-current="step"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.booking__steps li.is-done { color: var(--ink); border-bottom-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.booking__body { padding: 1.25rem; }
.booking__body fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.booking__body legend { font-family: var(--font-display); font-size: 1.3rem; font-weight: var(--display-weight, 600); margin-bottom: .35rem; padding: 0; }
.booking__hint { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.choice-list { display: grid; gap: .6rem; }
@media (min-width: 640px) { .choice-list--2 { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius, 4px); background: var(--bg); cursor: pointer; }
.choice:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.choice input { margin-top: .3rem; accent-color: var(--accent); width: 1.1rem; height: 1.1rem; flex: none; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice__main { flex: 1; }
.choice__title { font-weight: 650; display: block; }
.choice__meta { font-family: var(--font-mono, inherit); font-size: .82rem; color: var(--muted); }
.choice__price { font-family: var(--font-mono, inherit); font-weight: 600; white-space: nowrap; }
.days { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1rem; scroll-snap-type: x mandatory; }
.day { flex: 0 0 auto; scroll-snap-align: start; min-width: 4.6rem; padding: .55rem .5rem; border: 1px solid var(--line); border-radius: var(--radius, 4px); background: var(--bg); text-align: center; cursor: pointer; line-height: 1.25; font-size: .85rem; }
.day[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.day[disabled] { opacity: .4; cursor: not-allowed; }
.day b { display: block; font-size: 1.15rem; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); gap: .5rem; }
.slot { min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius, 4px); background: var(--bg); cursor: pointer; font-family: var(--font-mono, inherit); font-size: .88rem; }
.slot[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.slot-group { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .5rem; }
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: .6rem .75rem; border: 1px solid var(--line-strong, var(--line)); border-radius: var(--radius, 4px); background: var(--bg); }
.field textarea { min-height: 6rem; resize: vertical; }
.field__note { font-size: .82rem; color: var(--muted); }
.booking__nav { display: flex; gap: .75rem; justify-content: space-between; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--line); }
.booking__nav .btn { min-width: 7rem; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1.25rem; font-size: .95rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.outcome { border: 2px solid #b7791f; background: #fff8e6; color: #3d3000; padding: 1rem 1.1rem; border-radius: var(--radius, 4px); margin-bottom: 1.25rem; }
.outcome h3 { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 1.05rem; margin-bottom: .35rem; letter-spacing: 0; }
.outcome p:last-child { margin: 0; }
.actions { display: grid; gap: .6rem; }
@media (min-width: 640px) { .actions { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); } }
.sent-note { margin-top: 1rem; font-size: .9rem; }
.error-text { color: #b42318; font-size: .88rem; margin-top: .5rem; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; font-size: .85rem; color: var(--muted); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; align-items: baseline; }
.site-footer p { margin: 0; }
.site-footer__presented { letter-spacing: .02em; }
.site-footer__presented a { text-decoration: none; }
.site-footer__presented a:hover { text-decoration: underline; }
.site-footer__meta a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
.booking__review-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: var(--display-weight, 600); margin-bottom: .75rem; }
/* Let wide rows (like the day picker) scroll inside the box instead of widening the page on phones. */
.page-grid > *, .booking, .booking__body, .days { min-width: 0; max-width: 100%; }
/* Hero placeholders sit in the top-right corner so they never cover the headline. */
.missing-asset.hero-asset { justify-content: flex-start; align-items: flex-end; text-align: right; padding: 3rem 1.25rem 1rem; gap: .25rem; }
.missing-asset.hero-asset .missing-asset__label { max-width: 24ch; font-size: .72rem; }
.missing-asset.hero-asset .missing-asset__path { max-width: 26ch; font-size: .65rem; }
/* Per-photo framing, so a crop keeps the important detail in view */
.asset-img.pos-70 { object-position: 70% 50%; }
.asset-img.pos-80 { object-position: 80% 50%; }
.asset-img.pos-60 { object-position: 60% 50%; }
.asset-img.pos-y100 { object-position: 50% 100%; }
.asset-img.pos-35 { object-position: 35% 50%; }

/* Phone touch targets: anything tappable is at least 44px tall (Apple/Google guidance). */
.site-header__brand, .stage-wordmark { min-height: 44px; justify-content: center; }
.text-link, .caption a { display: inline-block; padding-block: .75rem; }
