/* components.css — shared public components (doc 01 → Components). */

/* ---------- Page header / bands ---------- */
.page-header { padding-block: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 48px); }
.page-header h1 { margin-bottom: 0; }
.lead { font-family: var(--font-serif); font-size: clamp(20px, 2.4vw, 24px); line-height: 1.5; color: var(--charcoal); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cta-band { background: var(--cream-2); padding-block: var(--section-pad); border-top: 1px solid var(--gold-pale); }
.cta-band .cta-text { margin-bottom: 28px; }
.bg-ivory { background: var(--ivory); }
.bg-cream-2 { background: var(--cream-2); }
.section-title { text-align: center; margin-bottom: clamp(28px, 4vw, 48px); }
.section-title h2 { margin: 0; }
.section-title .rule { margin-bottom: 0; }

/* ---------- Card ---------- */
.card { background: var(--ivory); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .25s, transform .25s var(--ease); }
.card:hover { box-shadow: var(--shadow-deep); }
.card-body { padding: 22px; }
.grid-cards { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------- Raised surfaces (Christopher 11-18) ----------
   The ivory cards, panels and fields (and the rose-pale strips) take the --ivory-* text set (lib/look.php look_text_colors):
   the page's own colors on most palettes, their own when ivory and the page ground differ (a light card on a dark page). */
.skip-link, .bg-ivory, .card, .modal-panel, .cookie-bar, .announce, .facts, .test-ribbon, .step-dot, .book-step, .hours-card, .map-card,
.pill-tabs button, .field input, .field select, .field textarea, .inline-field input, .g-pop {
  --charcoal: var(--ivory-ink); --charcoal-2: var(--ivory-muted); --text-muted: var(--ivory-muted); --text-mid: var(--ivory-mid); --text-dim: var(--ivory-dim);
  --text-heading: var(--ivory-heading); --text-accent: var(--ivory-accent); --text-gold: var(--ivory-gold); --text-gold-lg: var(--ivory-gold-lg); --text-link: var(--ivory-link);
  color: var(--charcoal);
}
/* …and the page-ground pieces inside them (booking choices, open days, notes, lock cards) take the page set back */
.pc-card, .slot, .cal-nav, .cal-day.is-open, .policy, .hold-timer, .step-n, .field select option {
  --charcoal: var(--page-ink); --charcoal-2: var(--page-muted); --text-muted: var(--page-muted); --text-mid: var(--page-mid); --text-dim: var(--page-dim);
  --text-heading: var(--page-heading); --text-accent: var(--page-accent); --text-gold: var(--page-gold); --text-gold-lg: var(--page-gold-lg); --text-link: var(--page-link);
  color: var(--charcoal);
}
/* the phone menu is an ivory panel; on desktop the same menu sits on the page ground, and its dropdowns are ivory again */
@media (max-width: 900px) {
  .site-nav { --charcoal: var(--ivory-ink); --charcoal-2: var(--ivory-muted); --text-muted: var(--ivory-muted); --text-gold: var(--ivory-gold); --text-gold-lg: var(--ivory-gold-lg); --text-link: var(--ivory-link); color: var(--charcoal); }
}
@media (min-width: 901px) {
  .nav-folder .nav-sub { --charcoal: var(--ivory-ink); --charcoal-2: var(--ivory-muted); --text-muted: var(--ivory-muted); --text-gold: var(--ivory-gold); --text-gold-lg: var(--ivory-gold-lg); --text-link: var(--ivory-link); color: var(--charcoal); }
}

/* ---------- Photo tile ---------- */
.photo-tile { position: relative; display: block; overflow: hidden; background: var(--cream-2); color: var(--on-photo); text-decoration: none; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.photo-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(59,56,53,.78), rgba(59,56,53,.4) 28%, rgba(59,56,53,0) 60%); opacity: .9; transition: opacity .3s; pointer-events: none; }
.photo-tile:hover img { transform: scale(1.03); }
.photo-tile:hover::after { opacity: 1; }
.photo-tile .tile-label { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 20px; text-align: center; }
.photo-tile .tile-label h3 { color: var(--on-photo); margin: 0; font-size: clamp(26px, 3vw, 32px); text-shadow: var(--photo-halo); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; color: var(--charcoal); }
.field input, .field select, .field textarea, .inline-field input {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--gold-pale); border-radius: var(--radius-sm);
  background: var(--ivory); color: var(--charcoal); font: 400 16px/1.4 var(--font-sans); transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field select option { background: var(--cream-2); color: var(--charcoal); }
.field input:focus, .field select:focus, .field textarea:focus, .inline-field input:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.field .help { font-size: 13px; color: var(--text-muted); margin: 6px 0 0; }
.field .error, .field-error { font-size: 13px; color: var(--danger); margin: 6px 0 0; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; min-width: 0; }
.inline-field .btn { flex: 0 0 auto; }
.form-status { font-size: 14px; margin: 10px 0 0; min-height: 1.4em; }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--success); }
.cf-turnstile { margin: 10px 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(247,242,234,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal[hidden] { display: none; }
.modal-panel { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--ivory); color: var(--charcoal); border-radius: var(--radius); box-shadow: var(--shadow-deep); padding: 36px 28px 28px; text-align: center; animation: pop .25s var(--ease); }
.modal-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--text-muted); cursor: pointer; border-radius: 50%; }
.modal-close:hover { color: var(--charcoal); background: var(--cream-2); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 900px) { .toast-wrap { left: auto; right: 24px; transform: none; } }
.toast { background: var(--charcoal); color: var(--ivory); padding: 12px 16px; border-radius: 6px; box-shadow: var(--shadow-deep); font-size: 14px; animation: pop .25s var(--ease); }
.toast-error { background: var(--danger); }

/* ---------- Lightbox (portfolio, about, galleries) ---------- */
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(59,56,53,.96); display: grid; grid-template-rows: auto 1fr auto; color: var(--on-photo); }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 0 16px; font-size: 13px; letter-spacing: .12em; }
/* The stage's single track is sized to the stage (not to the photo), so the photo's max-height: 100% can bite. */
.lb-stage { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0; padding: 8px 56px; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-caption { text-align: center; padding: 10px 16px 20px; font-size: 14px; color: var(--on-photo-muted); min-height: 1.4em; }
.lb-btn { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; color: var(--on-photo); cursor: pointer; border-radius: 50%; }
.lb-btn:hover { background: rgba(255,255,255,.1); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 4px; } .lb-next { right: 4px; }
@media (max-width: 600px) { .lb-stage { padding: 8px 0; } .lb-prev, .lb-next { top: auto; bottom: -44px; transform: none; } }

/* ---------- Masonry ---------- */
.masonry { columns: 1; column-gap: 12px; }
.masonry > * { break-inside: avoid; margin-bottom: 12px; display: block; }
@media (min-width: 600px) { .masonry { columns: 2; } }
@media (min-width: 1000px) { .masonry { columns: 3; } }
.masonry-item { cursor: zoom-in; overflow: hidden; background: var(--cream-2); padding: 0; border: 0; width: 100%; }
.masonry-item img { width: 100%; height: auto; transition: transform .5s var(--ease); }
.masonry-item:hover img { transform: scale(1.02); }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--cream-2) 0, var(--ivory) 50%, var(--cream-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Cookie bar ---------- */
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 250; background: var(--ivory); border: 1px solid var(--gold-pale); box-shadow: var(--shadow-deep); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; flex: 1 1 260px; }
.cookie-actions { display: flex; gap: 8px; }
@media (min-width: 900px) { .cookie-bar { left: auto; max-width: 520px; } }

/* ---------- Accordion (FAQs) ---------- */
.accordion details { border-bottom: 1px solid var(--gold-pale); }
.accordion summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-family: var(--font-serif); font-size: 22px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-link); font: 300 26px/1 var(--font-sans); }
.accordion details[open] summary::after { content: "−"; }
.accordion .answer { padding: 0 0 18px; color: var(--text-muted); }

/* ---------- Prose (rich text) ---------- */
.rich h2, .rich h3 { margin-top: 1.4em; }
.rich blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--gold); font-family: var(--font-serif); font-style: italic; font-size: 24px; line-height: 1.4; color: var(--charcoal); }
.rich ul, .rich ol { padding-left: 1.3em; }
.rich li { margin-bottom: .4em; }

/* Editor align marks (sanitizer-whitelisted classes) */
.align-center { text-align: center; }
.align-right { text-align: right; }

/* Call-to-action band with a background photo (2026-12-04): the photo fills the band, a soft shade keeps the words readable. */
.cta-band.has-photo { position: relative; overflow: hidden; isolation: isolate; background: #1E1E1E; border-top: 0; padding-block: clamp(96px, 12vw, 160px); }
.cta-band.has-photo > picture, .cta-band.has-photo > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.cta-band.has-photo picture img, .cta-band.has-photo > img { width: 100%; height: 100%; object-fit: cover; }
.cta-band.has-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .35); pointer-events: none; }
.cta-band.has-photo .script, .cta-band.has-photo .cta-text { color: var(--on-photo); text-shadow: var(--photo-halo); }
.cta-band.has-photo .btn-outline { color: var(--on-photo); border-color: var(--on-photo); }
.cta-band.has-photo .btn-outline:hover { background: var(--on-photo); color: #1E1E1E; }

/* Heading block Alignment (2026-12-04): words, the short rule and the lead follow the chosen side. */
.blk-align-left :is(h1, h2, p, .section-title, .page-header, .page-header-inner) { text-align: left; }
.blk-align-left :is(.rule, .prose, .lead, .page-header-desc) { margin-left: 0; margin-right: auto; }
.blk-align-center :is(h1, h2, p, .section-title, .page-header, .page-header-inner) { text-align: center; }
.blk-align-center :is(.rule, .prose, .lead, .page-header-desc) { margin-left: auto; margin-right: auto; }
.blk-align-right :is(h1, h2, p, .section-title, .page-header, .page-header-inner) { text-align: right; }
.blk-align-right :is(.rule, .prose, .lead, .page-header-desc) { margin-left: auto; margin-right: 0; }
