/*
-----------------------------------------------------------------------------------------
Name           : site.css
Purpose        : Styles for the 5 Beston Place, Greenleigh property website
Comments       : Plain CSS, no external fonts or requests. Colours are tokens in section 1;
                 dark mode redefines them.
-----------------------------------------------------------------------------------------
Contents
  1  Tokens      2  Base         3  Header and navigation   4  Hero and page heads
  5  Content     6  Components   7  Distances and map       8  Gallery and lightbox
  9  Forms       10 Footer       11 Placeholders (to fill in)  12 Small screens
-----------------------------------------------------------------------------------------
*/

/* ================================================================== 1 Tokens */
:root {
  --accent: #2f5d50;        /* eucalyptus */
  --accent-strong: #214438;
  --accent-soft: #e5eee9;
  --warm: #9a6b3f;          /* timber */
  --sand: #f1ebe0;

  --text: #26221e;
  --text-muted: #5f574e;
  --page-bg: #fbf9f5;
  --surface: #ffffff;
  --surface-alt: #f4efe7;
  --border: #e3dbcf;
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.06), 0 6px 20px rgba(40, 30, 20, 0.07);

  --link: #2f5d50;
  --on-accent: #ffffff;
  --focus: #c47a1c;

  --radius: 12px;
  --radius-lg: 18px;
  --header-height: 70px;
  --content-width: 1160px;

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Book Antiqua", serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7fc1a8;
    --accent-strong: #a6d8c4;
    --accent-soft: #1d2f29;
    --warm: #d7a574;
    --sand: #2a241d;

    --text: #ece6dd;
    --text-muted: #b5ab9e;
    --page-bg: #151311;
    --surface: #1d1a17;
    --surface-alt: #211d19;
    --border: #353029;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.3);

    --link: #8fcfb5;
    --on-accent: #0f1a16;
    --focus: #e3a24c;
  }
}

/* ================================================================== 2 Base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img, svg, video { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.18; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.3rem); margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); margin: 2.6rem 0 0.8rem; }
h3 { font-size: 1.25rem; margin: 1.8rem 0 0.5rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--warm); }

.container { width: min(100% - 32px, var(--content-width)); margin-inline: auto; }
.narrow { max-width: 74ch; }

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 0.6rem 1rem; background: var(--accent); color: var(--on-accent); border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ================================================================== 3 Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--page-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-height); }

.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--text); text-decoration: none; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-serif); font-size: 1.2rem; }
.brand-text span { font-size: 0.8rem; color: var(--text-muted); }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: 0.2rem; list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { display: block; padding: 0.5rem 0.7rem; border-radius: 8px; color: var(--text); font-size: 0.95rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.site-nav .nav-cta a { background: var(--accent); color: var(--on-accent); margin-left: 0.4rem; font-weight: 600; }
.site-nav .nav-cta a:hover, .site-nav .nav-cta a[aria-current="page"] { background: var(--accent-strong); color: var(--on-accent); }

.menu-toggle { display: none; margin-left: auto; align-items: center; gap: 0.5rem; padding: 0.5rem 0.8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.menu-toggle svg { width: 20px; height: 20px; }

/* ================================================================== 4 Hero and page heads */
.hero { position: relative; min-height: min(78vh, 720px); display: grid; align-items: end; color: #fff; overflow: hidden; background: #3a4a43; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0.62) 100%); }
.hero-content { position: relative; z-index: 1; padding: 3rem 0 2.6rem; }
.hero .eyebrow { color: #f3dfc6; }
.hero h1 { color: #fff; max-width: 18ch; text-shadow: 0 2px 18px rgba(0,0,0,0.35); }
.hero .lead { color: rgba(255,255,255,0.92); max-width: 56ch; }

.eyebrow { display: inline-block; margin-bottom: 0.6rem; color: var(--warm); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.lead { font-size: 1.2rem; color: var(--text-muted); line-height: 1.6; }

.facts-bar { position: relative; z-index: 2; margin-top: -1px; background: var(--surface); border-bottom: 1px solid var(--border); }
.facts { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; }
.facts li { flex: 1 1 140px; margin: 0; padding: 1.1rem 1.2rem; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.facts li:last-child { border-right: 0; }
.facts .v { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.facts .k { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

.page-head { padding: 2.6rem 0 2rem; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.page-head .lead { max-width: 64ch; margin: 0; }
.breadcrumb { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.breadcrumb a { color: var(--text-muted); }

/* ================================================================== 5 Content */
.section { padding: 3.5rem 0; }
.section.alt { background: var(--surface-alt); border-block: 1px solid var(--border); }
.section > .container > h2:first-child, .section-head h2 { margin-top: 0; }
.section-head { max-width: 64ch; margin-bottom: 1.8rem; }
.section-head p { color: var(--text-muted); margin: 0; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem; align-items: start; }

.note { font-size: 0.92rem; color: var(--text-muted); }
.disclaimer { font-size: 0.88rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 2rem; }

/* ================================================================== 6 Components */
.button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.3rem; border: 1px solid transparent; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background 0.15s, transform 0.15s; }
.button:hover { background: var(--accent-strong); color: var(--on-accent); transform: translateY(-1px); }
.button.light { background: rgba(255,255,255,0.95); color: #1d2a25; }
.button.light:hover { background: #fff; color: #1d2a25; }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.button.secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
.button svg { width: 18px; height: 18px; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.card-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; padding: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; }
.card h3 { margin: 0.8rem 0 0.35rem; }
.card p { color: var(--text-muted); font-size: 0.98rem; }
.card .card-link { margin-top: auto; font-weight: 600; text-decoration: none; }
.card .card-link::after { content: " →"; }
.card .card-link::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(.card-link):hover { transform: translateY(-2px); }
.icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.icon svg { width: 24px; height: 24px; }

.highlights { list-style: none; padding: 0; display: grid; gap: 0.7rem 2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.highlights li { position: relative; padding-left: 1.9rem; margin: 0; }
.highlights li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3L15 7'/%3E%3C/svg%3E") center / 80% no-repeat; }

.panel { padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.panel h2, .panel h3 { margin-top: 0; }
.sticky { position: sticky; top: calc(var(--header-height) + 20px); }

.details { width: 100%; border-collapse: collapse; }
.details th, .details td { padding: 0.7rem 0.4rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.details th { width: 42%; color: var(--text-muted); font-weight: 500; }

.photo-strip { display: grid; gap: 0.6rem; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 2.2 / 1; }
.photo-strip a { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface-alt); }
.photo-strip a:first-child { grid-row: span 2; }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.photo-strip a:hover img { transform: scale(1.03); }
.photo-strip .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.45); color: #fff; font-weight: 600; font-size: 1.1rem; }

details.faq { border-bottom: 1px solid var(--border); padding: 0.4rem 0; }
details.faq summary { cursor: pointer; font-weight: 600; padding: 0.7rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq > div { padding: 0 0 0.8rem; color: var(--text-muted); }

/* ================================================================== 7 Distances and map */
.distance-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.distance-table caption { text-align: left; font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; padding: 0 0 0.6rem; }
.distance-table th, .distance-table td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; }
.distance-table thead th { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.distance-table td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.distance-table .bar { display: block; height: 6px; margin-top: 0.35rem; border-radius: 3px; background: var(--accent); opacity: 0.75; }
.table-wrap { position: relative; overflow-x: auto; }   /* relative: keeps hidden labels inside the scroll box */

.time-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 1.5rem 0 2rem; }
.time-card { padding: 1.3rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.time-card .min { font-family: var(--font-serif); font-size: 2.6rem; font-weight: 600; line-height: 1; color: var(--accent); }
.time-card .min small { font-size: 1rem; color: var(--text-muted); font-family: var(--font); }
.time-card .to { font-weight: 600; margin-top: 0.4rem; }
.time-card .km { color: var(--text-muted); font-size: 0.92rem; }

.map-figure { margin: 0; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.map-figure figcaption { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.5rem; }
.map { width: 100%; height: auto; display: block; }
.map .land { fill: var(--surface-alt); }
.map .ring { fill: none; stroke: var(--border); stroke-dasharray: 4 5; }
.map .ring-label { fill: var(--text-muted); font-size: 11px; }
.map .line { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 4; opacity: 0.7; }
.map .dot { fill: var(--warm); }
.map .home { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.map .label { fill: var(--text); font-size: 13px; font-weight: 600; }
.map .sub { fill: var(--text-muted); font-size: 11px; }
.map .north { fill: var(--text-muted); font-size: 12px; font-weight: 700; }

/* ================================================================== 8 Gallery and lightbox */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.filters li { margin: 0; }
.filters button { padding: 0.45rem 0.95rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 0.93rem; cursor: pointer; }
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filters .count { opacity: 0.7; margin-left: 0.3rem; font-size: 0.85em; }

.gallery-group h2 { margin: 2.2rem 0 1rem; }
.gallery-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-grid a { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: var(--surface-alt); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.gallery-grid a:hover img { transform: scale(1.04); }
.gallery-grid .play { position: absolute; inset: 0; display: grid; place-items: center; }
.gallery-grid .play span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; }
.gallery-grid .play svg { width: 24px; height: 24px; margin-left: 3px; }
.gallery-empty { padding: 3rem 1.5rem; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted); }

.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 11, 10, 0.96); color: #fff; }
.lightbox::backdrop { background: rgba(0,0,0,0.9); }
.lb-stage { position: absolute; inset: 56px 64px 72px; display: grid; place-items: center; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.9rem 1.2rem; display: flex; justify-content: space-between; gap: 1rem; font-size: 0.95rem; color: rgba(255,255,255,0.85); }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.12); color: #fff; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,0.25); }
.lb-btn svg { width: 24px; height: 24px; }
.lb-close { top: 10px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ================================================================== 9 Forms */
.form { display: grid; gap: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field .hint { font-weight: 400; color: var(--text-muted); font-size: 0.9rem; }
.field input, .field textarea, .field select { width: 100%; padding: 0.75rem 0.9rem; border: 1px solid color-mix(in srgb, var(--text-muted) 45%, transparent); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.field textarea { min-height: 150px; resize: vertical; }
.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.form .button { justify-self: start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-list { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: 0.9rem; }
.contact-list li { display: flex; gap: 0.9rem; align-items: center; margin: 0; }
.contact-list small { display: block; color: var(--text-muted); font-size: 0.85rem; }
.contact-list .value, .contact-list a { font-weight: 600; font-size: 1.05rem; }

/* ================================================================== 10 Footer */
.site-footer { padding: 2.5rem 0 2rem; background: var(--surface-alt); border-top: 1px solid var(--border); font-size: 0.92rem; color: var(--text-muted); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.site-footer li { margin: 0; }
.site-footer a { color: var(--text); }
.site-footer p { margin: 0.3rem 0 0; }

.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 22px; height: 22px; }

/* ================================================================== 11 Placeholders (to fill in)
   Anything marked class="todo" still needs the owner's details. They are highlighted so
   they are easy to spot; check.py lists them. Remove the class once filled in. */
.todo { background: #fff2a8; color: #5a4700; border-radius: 4px; padding: 0 0.3em; font-weight: 600; font-style: normal; }
@media (prefers-color-scheme: dark) { .todo { background: #5a4a00; color: #ffe98a; } }

/* ================================================================== 12 Small screens */
@media (max-width: 1040px) {
  .menu-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--page-bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 0.75rem 16px 1rem; }
  .site-nav a { padding: 0.75rem 0.9rem; font-size: 1.02rem; }
  .site-nav .nav-cta a { margin: 0.4rem 0 0; text-align: center; }
  .no-js .menu-toggle { display: none; }
  .no-js .site-nav { display: block; position: static; box-shadow: none; border: 0; }
  .no-js .header-inner { flex-wrap: wrap; }
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .sticky { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .hero { min-height: 70vh; }
  .facts li { flex-basis: 50%; border-right: 0; border-bottom: 1px solid var(--border); }
  .photo-strip { grid-template-columns: 1fr 1fr; grid-template-rows: auto; aspect-ratio: auto; }
  .photo-strip a { aspect-ratio: 4 / 3; }
  .photo-strip a:first-child { grid-column: span 2; grid-row: auto; }
  .field-row { grid-template-columns: 1fr; }
  .button-row .button { flex: 1 1 100%; justify-content: center; }
  .lb-stage { inset: 56px 8px 72px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-bar { padding-inline: 64px; justify-content: center; text-align: center; flex-direction: column; gap: 0.2rem; }
  .brand-text span { display: none; }
}

@media print {
  .site-header, .menu-toggle, .to-top, .button-row, form, .filters, .lightbox { display: none !important; }
  .hero { min-height: 0; color: #000; background: none; }
  .hero::after, .hero-img { display: none; }
  .hero h1, .hero .lead { color: #000; text-shadow: none; }
  body { background: #fff; }
}
