/* Wrenlow Cottage — first-party holiday-let template (S112).
   First-party layout and interaction system with locally bundled, provenance-recorded Pexels stills.
   Structural system shared with estate-listing-studio; palette + editorial treatment are coastal. */

:root {
  /* Theming for the shared accessibility panel (library/shared/a11y/). */
  --a11y-ink: var(--ink);
  --a11y-surface: var(--card);
  --a11y-line: var(--line);
  --a11y-radius: var(--radius);
  --a11y-sans: var(--sans);

  --ink: #12303a;
  --sea: #1f6b74;
  --sea-deep: #16505a;
  --sand: #f4ede0;
  --shell: #fbf7f0;
  --card: #ffffff;
  --line: #dfd4c1;
  --coral: #b05333;
  --coral-bright: #e8794f;
  --muted: #4a6870;
  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 1.0625rem; line-height: 1.55; color: var(--ink); background: var(--shell); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
a { color: inherit; }
ul, ol { list-style: none; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 10; background: var(--ink); color: var(--shell); padding: 0.5rem 1rem; border-radius: 0 0 var(--radius) var(--radius); text-decoration: none; transition: top 0.15s ease; }
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid var(--coral-bright); outline-offset: 2px; }

/* ---------- Header + navigation ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; background: var(--shell); border-bottom: 1px solid var(--line); position: relative; }
.wordmark { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; text-decoration: none; color: var(--sea-deep); white-space: nowrap; }
.nav-disclosure summary { list-style: none; cursor: pointer; user-select: none; font-weight: 600; padding: 0.5rem 1rem; border: 1.5px solid var(--sea); border-radius: var(--radius); color: var(--sea-deep); }
.nav-disclosure summary::-webkit-details-marker { display: none; }
.nav-disclosure[open] summary { background: var(--sea); color: var(--shell); }
.nav-disclosure nav { position: absolute; right: 1rem; left: 1rem; top: calc(100% + 0.4rem); z-index: 9; display: flex; flex-direction: column; gap: 0.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; box-shadow: 0 10px 24px rgba(18, 48, 58, 0.14); }
.nav-disclosure nav a:not(.button) { text-decoration: none; font-weight: 600; padding: 0.55rem 0.75rem; border-radius: 8px; }
.nav-disclosure nav a:not(.button):hover { background: var(--sand); }

/* A closed <details> does not render its children, so pure CSS cannot inline the menu at desktop;
   main.js opts in with .nav-inline + [open]. Without JS the summary button stays usable. */
.nav-disclosure.nav-inline summary { visibility: hidden; pointer-events: none; }
.nav-disclosure.nav-inline nav { position: absolute; right: 0; left: auto; top: 50%; transform: translateY(-50%); flex-direction: row; align-items: center; gap: 0.35rem; background: none; border: 0; padding: 0; box-shadow: none; }
.nav-disclosure.nav-inline nav a { padding: 0.45rem 0.7rem; }

.header-call { display: none; }
@media (max-width: 799px) { .site-header { gap: 0.6rem; } .header-call { display: inline-block; margin-left: auto; } }
@media (max-width: 479px) { .site-header { padding: 0.8rem 0.9rem; gap: 0.45rem; } .wordmark { font-size: 1.05rem; } .header-call { font-size: 0.9rem; } .nav-disclosure summary { padding: 0.42rem 0.75rem; font-size: 0.95rem; } }

/* ---------- Buttons ---------- */
.button { display: inline-block; text-decoration: none; text-align: center; font-weight: 700; font-family: var(--sans); font-size: 1rem; background: var(--coral); color: #fff; border: 1.5px solid var(--coral); border-radius: var(--radius); padding: 0.8rem 1.4rem; cursor: pointer; transition: transform 0.12s ease, background 0.12s ease; }
.button:hover { background: var(--coral-bright); transform: translateY(-1px); }
.button-small { padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.button-ghost { background: transparent; color: var(--sea-deep); border-color: var(--sea); }
.button-ghost:hover { background: rgba(31, 107, 116, 0.08); }
.button-light { background: var(--shell); color: var(--sea-deep); border-color: var(--shell); }
.button-light:hover { background: #fff; }
.call-link { font-weight: 700; color: var(--sea); text-decoration: none; white-space: nowrap; }
.call-link:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { max-width: 72rem; margin: 0 auto; padding: 2.5rem 1.25rem 2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding-top: 3.25rem; } }
.hero-copy { min-width: 0; }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--coral); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); max-width: 18ch; }
.hero-sub { margin-top: 1rem; font-size: 1.15rem; max-width: 46ch; color: #33505a; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero-trust { margin-top: 1rem; font-size: 0.92rem; color: var(--muted); font-weight: 600; }
.hero-art { position: relative; min-height: 300px; margin: 0; overflow: hidden; border-radius: var(--radius); background: #dfe7e6; }
.hero-art .card-art { height: 100%; min-height: 320px; }
.media-caption { position: absolute; right: 0.75rem; bottom: 0.75rem; left: 0.75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.55rem 0.7rem; border-radius: 8px; background: rgba(18, 48, 58, 0.88); color: #fff; font-size: 0.76rem; line-height: 1.3; letter-spacing: 0.04em; }
.media-caption strong { letter-spacing: 0.12em; }

/* ---------- Stay-fit planner ---------- */
.stay-planner { min-width: 0; margin-top: 1.5rem; max-width: 42rem; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 30px rgba(18, 48, 58, 0.1); }
.planner-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.planner-heading > div { min-width: 0; }
.planner-heading p:last-child { margin-top: 0.2rem; color: var(--muted); font-size: 0.92rem; }
.planner-kicker { color: var(--sea-deep); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.planner-mark { flex: 0 0 auto; font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--coral); line-height: 1; }
.planner-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; }
.planner-field label { display: block; font-size: 0.88rem; font-weight: 700; }
.planner-field { min-width: 0; }
.planner-field input, .planner-field select { width: 100%; min-width: 0; min-height: 44px; margin-top: 0.3rem; padding: 0.55rem 0.65rem; color: var(--ink); background: var(--shell); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.planner-field input:focus, .planner-field select:focus,
.planner-field input.has-focus-ring, .planner-field select.has-focus-ring { outline: 3px solid var(--coral-bright); outline-offset: 2px; }
.planner-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.9rem; }
.planner-actions .button { flex: 1 1 10rem; }
.planner-note { margin-top: 0.75rem; color: var(--muted); font-size: 0.8rem; }
.planner-status { display: grid; gap: 0.35rem; margin-top: 0.7rem; color: var(--sea-deep); font-size: 0.92rem; }
.planner-followup { width: fit-content; color: var(--sea-deep); font-weight: 800; text-underline-offset: 3px; }

/* ---------- Badges ---------- */
.badges { background: var(--sea-deep); }
.badge-row { max-width: 72rem; margin: 0 auto; padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; color: var(--shell); font-weight: 600; }
.badge-row li { display: flex; align-items: baseline; gap: 0.4rem; }
.badge-num { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: #f2c9a0; }

/* ---------- The space ---------- */
.the-space, .nearby { max-width: 72rem; margin: 0 auto; padding: 2.75rem 1.25rem; }
.the-space h2, .nearby h2, .book-direct h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
.space-head { max-width: 60ch; }
.space-head p { margin-top: 0.75rem; color: #33505a; }

.gallery { margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.gallery-main { min-height: 260px; border-radius: var(--radius); }
.gallery-wide .gallery-main { min-height: 320px; }
.gallery-thumbs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.gallery-thumbs-four { grid-template-columns: 1fr 1fr 1fr 1fr; }
.gallery-thumbs .card-art { height: 120px; border-radius: 10px; }

.feature-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 1.75rem; }
@media (min-width: 700px) { .feature-grid { grid-template-columns: 1fr 1fr 1fr; } }
.feature-grid li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.feature-grid h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }

/* ---------- Nearby ---------- */
.nearby { background: var(--sand); max-width: none; }
.nearby > * { max-width: 72rem; margin-left: auto; margin-right: auto; }
.nearby-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .nearby-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .nearby-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }
.nearby-grid li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.nearby-dist { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); }
.nearby-grid h3 { font-size: 1.15rem; margin: 0.3rem 0 0.4rem; }

/* ---------- Media ---------- */
.card-art { background-color: #dfe7e6; background-repeat: no-repeat; display: block; width: 100%; object-fit: cover; }
/* ---------- Book-direct band ---------- */
.book-direct { background: var(--sea-deep); color: var(--shell); }
.book-direct { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 2.75rem 1.25rem; }
.book-direct > * { max-width: 72rem; }
.book-direct > div { flex: 1 1 30rem; margin: 0 auto; }
.book-direct p { margin-top: 0.6rem; max-width: 52ch; color: #d5e6e7; }
.tick-list { margin-top: 1rem; display: grid; gap: 0.5rem; }
.tick-list li { padding-left: 1.6rem; position: relative; }
.tick-list li::before { content: "✓"; position: absolute; left: 0; color: #f2c9a0; font-weight: 700; }

/* ---------- Detail page ---------- */
.detail-page, .book-page { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.breadcrumb a { font-weight: 600; text-decoration: none; color: var(--sea-deep); }
.breadcrumb a:hover { text-decoration: underline; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem; margin-top: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.detail-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.detail-sub { margin-top: 0.4rem; color: var(--muted); font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.chip-row li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.9rem; font-weight: 600; }
.detail-cta { text-align: right; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.rate-from { color: var(--muted); }
.rate-from strong { font-family: var(--serif); font-size: 1.6rem; color: var(--ink); }

.detail-body { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 1.75rem; }
@media (min-width: 860px) { .detail-body { grid-template-columns: 1.6fr 1fr; } }
.detail-body h2 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.detail-body h3 { font-size: 1.15rem; margin: 1.2rem 0 0.4rem; }
.detail-body p + p { margin-top: 0.75rem; }
.feature-list li { padding-left: 1.2rem; position: relative; margin-top: 0.35rem; }
.feature-list li::before { content: "·"; position: absolute; left: 0.2rem; color: var(--coral); font-weight: 700; }
.amenity-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }
.amenity-list li { padding-left: 1.4rem; position: relative; font-weight: 500; }
.amenity-list li::before { content: "✓"; position: absolute; left: 0; color: var(--sea); font-weight: 700; }

/* ---------- Forms (preview-safe) ---------- */
.inquiry { min-width: 0; margin-top: 2.5rem; padding: 1.75rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.inquiry > p { max-width: 56ch; margin-top: 0.4rem; }
.inquiry-form { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.25rem; }
.field-wide { grid-column: 1 / -1; }
.field { min-width: 0; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; }
.label-optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea { width: 100%; min-width: 0; margin-top: 0.35rem; padding: 0.7rem 0.75rem; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.inquiry-form .button { grid-column: 1 / -1; justify-self: start; }
.form-status { grid-column: 1 / -1; font-weight: 600; color: var(--sea-deep); min-height: 1.4em; }

@media (min-width: 600px) {
  .inquiry-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- Book page ---------- */
.book-hero { padding: 1.5rem 0 1rem; }
.book-hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.book-body { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-top: 1.5rem; }
@media (min-width: 860px) { .book-body { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.book-body .inquiry-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-top: 0; align-self: start; }
.book-aside h2 { font-size: 1.4rem; }
.book-aside .tick-list li::before { color: var(--coral); }
.book-aside .tick-list li { color: var(--ink); }
.book-reassure { margin-top: 1rem; color: var(--muted); }

/* ---------- Footer ---------- */
footer { background: var(--ink); color: #c6d6d8; padding: 2.25rem 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem; }
.wordmark-footer { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--shell); }
footer .call-link { color: #7fb8bd; }
.footer-truth { max-width: 36ch; font-size: 0.88rem; color: #8aa2a6; align-self: end; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .button:hover { transform: none; }
}

/* Build credit — carried by every template in this library, matching the deployed demos.
   Colour is inherited rather than fixed so this single rule works on every footer palette. */
.footer-powered { margin-top: 0.9rem; font-size: 0.85rem; opacity: 0.8; }
.footer-powered a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-powered a:hover { opacity: 0.85; }

/* --- Touch targets ------------------------------------------------ S116
   A standalone control needs 44x44 CSS px (Apple HIG; WCAG 2.5.5 AAA, and 2.5.8 AA
   sets a 24px floor). The S116 polish pass measured the header phone link at 23px
   and the Menu button at 35px on a 390px viewport, on every template in the library.
   On a trades site the phone number IS the conversion — it was rendering at half the
   required size at exactly the width most visitors arrive on.

   Layout only, no colour, so this block is copy-paste identical across every palette
   in the library. Inline links inside prose are deliberately NOT touched: both WCAG
   target-size rules exempt them, and padding them out would wreck the body copy. */
@media (max-width: 799px) {
  .header-call,
  .nav-disclosure summary,
  .nav-disclosure nav .call-link,
  .button,
  .button-small,
  button[type="submit"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- Accessibility: the two modes only this palette can define ------ S186
   Everything else the panel does is name-independent and lives in the shared
   library/shared/a11y/a11y.css. These two must name THIS template's own variables — the 20
   templates do not share a vocabulary. check-library-a11y.mjs fails the build without both.
   ⚠ A boundary token goes to INK even when its value is light. */
html[data-a11y-contrast="high"] {
  --ink: #000; --sea: #000; --sea-deep: #000; --coral: #000; --coral-bright: #000;
  --muted: #000; --line: #000;
  --sand: #fff; --shell: #fff; --card: #fff;
}
html[data-a11y-contrast="high"] footer,
html[data-a11y-contrast="high"] .footer-truth,
html[data-a11y-contrast="high"] .footer-powered { color: #fff; }
html[data-a11y-contrast="high"] .button { background: #000; color: #fff; border-color: #000; }
html[data-a11y-contrast="high"] .button-ghost { background: #fff; color: #000; border-color: #000; }
html[data-a11y-contrast="high"] .button-light { background: #fff; color: #000; border-color: #fff; }
html[data-a11y-contrast="high"] .media-caption { background: #000; }

/* Okabe-Ito. ⚠ Sea teal and coral is a cyan/red pair that narrows under protanopia, and on a
   direct-booking site the coral IS the book-now signal. */
html[data-a11y-colour="safe"] {
  --sea: #23282a; --sea-deep: #16191a; --coral: #0072b2; --coral-bright: #3a97ce;
}
