/* ==========================================================================
   The Hatfield House — hatfieldhouse.net
   Design system: "1841 bones, 2024 finish"
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-v38-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-v38-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-v20-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-v20-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #23201c;
  --ink-soft: #3a352f;
  --brick: #7e3b2c;
  --brick-dk: #612d21;
  --cream: #f6f1e7;
  --cream-dk: #efe7d7;
  --paper: #ffffff;
  --brass: #a98a54;
  --brass-dk: #8a6f3f;
  --line: #e2d8c3;
  --muted: #6b655b;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(1.9rem, 1.5rem + 2vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.7rem + 3.2vw, 4rem);
  --space: clamp(4rem, 3rem + 4vw, 7rem);
  --radius: 6px;
  --shadow: 0 2px 6px rgba(35, 32, 28, 0.06), 0 12px 32px rgba(35, 32, 28, 0.08);
  --maxw: 72rem;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img, picture, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { max-width: 65ch; }
a { color: var(--brick); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brick-dk); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
ul, ol { padding-left: 1.2em; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 0.6rem 1rem;
  border-radius: var(--radius); transition: top 0.15s;
}
.skip-link:focus { top: 1rem; color: var(--cream); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  padding: 0.85rem 1.7rem; border-radius: var(--radius);
  text-decoration: none; text-align: center;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn--primary { background: var(--brick); color: #fff; }
.btn--primary:hover { background: var(--brick-dk); color: #fff; }
.btn--ghost { border-color: currentColor; color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }
.btn--light { border-color: #fff; color: #fff; background: transparent; }
.btn--light:hover { background: #fff; color: var(--ink); }
.btn--big { padding: 1rem 2.2rem; font-size: 1.05rem; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brass-dk); margin-bottom: 0.9rem;
}
.eyebrow::after {
  content: ""; display: inline-block; width: 2.2rem; height: 1px;
  background: var(--brass); margin-left: 0.7rem; vertical-align: middle;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 241, 231, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.2rem;
}
.wordmark {
  font-family: var(--serif); font-weight: 700; font-size: 1.12rem;
  letter-spacing: 0.06em; color: var(--ink); text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--brick); }
.wordmark small {
  display: block; font-family: var(--sans); font-weight: 600;
  font-size: 0.62rem; letter-spacing: 0.3em; color: var(--brass-dk);
  text-transform: uppercase;
}
.site-nav ul { display: flex; gap: 1.6rem; list-style: none; padding: 0; }
.site-nav a {
  font-weight: 600; font-size: 0.95rem; color: var(--ink);
  text-decoration: none; padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--brass); color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--brick); }
.nav-toggle {
  display: none; background: none; border: 0; padding: 0.5rem;
  cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 47.9rem) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 0; }
  .site-nav a {
    display: block; padding: 0.9rem clamp(1.1rem, 4vw, 2rem);
    border-bottom: 0; border-left: 3px solid transparent;
  }
  .site-nav a[aria-current="page"] { border-left-color: var(--brick); }
}

/* ---------- Hero (home) ---------- */
.hero { position: relative; min-height: min(92svh, 46rem); display: flex; align-items: flex-end; }
.hero picture, .hero > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24, 20, 16, 0.78) 0%, rgba(24, 20, 16, 0.25) 45%, rgba(24, 20, 16, 0.12) 100%);
}
.hero .container { position: relative; z-index: 1; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { color: #fff; max-width: 17ch; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.hero .tagline {
  color: #f3ede1; font-size: var(--step-1); max-width: 44ch;
  margin-top: 1rem; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}
.hero .eyebrow { color: #d9c193; }
.hero .eyebrow::after { background: #d9c193; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.8rem; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; display: flex; align-items: flex-end; min-height: clamp(16rem, 40vh, 24rem); }
.page-hero picture { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-hero img { width: 100%; height: 100%; object-fit: cover; }
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24, 20, 16, 0.72), rgba(24, 20, 16, 0.18));
}
.page-hero .container { position: relative; z-index: 1; padding-block: 2.2rem; }
.page-hero h1 { color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35); }
.page-hero .eyebrow { color: #d9c193; }
.page-hero .eyebrow::after { background: #d9c193; }

/* ---------- Section bands ---------- */
.band { padding-block: var(--space); }
.band--white { background: var(--paper); }
.band--ink { background: var(--ink); color: var(--cream); }
.band--ink h2, .band--ink h3 { color: #fff; }
.band--ink .eyebrow { color: #d9c193; }
.band--ink .eyebrow::after { background: #d9c193; }
.band-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.band-head p { margin-top: 1rem; color: var(--muted); font-size: var(--step-1); line-height: 1.5; }
.band--ink .band-head p { color: #cfc8ba; }

/* ---------- Trust strip ---------- */
.trust-strip { background: var(--ink); color: var(--cream); }
.trust-strip .container {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem; padding-block: 1.8rem;
}
@media (min-width: 48rem) { .trust-strip .container { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; align-items: center; gap: 0.8rem; font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.trust-item svg { width: 28px; height: 28px; flex: none; color: var(--brass); }

/* ---------- Card grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem;
}
.band--white .card { background: var(--cream); }
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.98rem; }
.card svg { width: 32px; height: 32px; color: var(--brick); margin-bottom: 1rem; }

/* ---------- Feature split (photo + text) ---------- */
.split { display: grid; gap: clamp(1.6rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 48rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--rev > .split-media { order: 2; }
}
.split-media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.split-body .eyebrow { margin-bottom: 0.7rem; }
.split-body h2 { margin-bottom: 1rem; }
.split-body p { margin-bottom: 1rem; }
.split-body p:last-of-type { margin-bottom: 1.6rem; }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; display: grid; gap: 0.65rem; }
@media (min-width: 40rem) { .checklist--2col { grid-template-columns: 1fr 1fr; } }
.checklist li { display: flex; gap: 0.65rem; align-items: baseline; }
.checklist li::before {
  content: "✓"; color: var(--brick); font-weight: 700; flex: none;
  transform: translateY(-1px);
}

/* ---------- Apartment cards (rooms page) ---------- */
.apt-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.apt-card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.apt-card-body { padding: 1.6rem; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; }
.apt-card-body .spec {
  font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass-dk);
}
.apt-card-body p { color: var(--muted); font-size: 0.98rem; }

/* ---------- Stat numbers ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.5rem; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: var(--step-3); font-weight: 700; color: var(--brick); line-height: 1; }
.band--ink .stat b { color: #d9c193; }
.stat span { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.band--ink .stat span { color: #cfc8ba; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1.4rem; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--serif); font-weight: 700;
  font-size: 2rem; color: var(--brass); margin-bottom: 0.6rem;
}
.steps h3 { margin-bottom: 0.4rem; }
.steps p { color: var(--muted); font-size: 0.98rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 50rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  font-family: var(--serif); font-weight: 600; font-size: var(--step-1);
  padding: 1.1rem 2.6rem 1.1rem 0; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.2rem; top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans); font-weight: 400; font-size: 1.7rem; color: var(--brass);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 0 1.3rem; color: var(--ink-soft); max-width: 60ch; }
.faq details p + p { margin-top: -0.5rem; }

/* ---------- Timeline (history) ---------- */
.timeline { list-style: none; padding: 0; position: relative; max-width: 46rem; }
.timeline::before {
  content: ""; position: absolute; left: 0.45rem; top: 0.4rem; bottom: 0.4rem;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 2.2rem 2.4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 0.42rem;
  width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--brass); border: 3px solid var(--cream);
}
.band--white .timeline li::before { border-color: var(--paper); }
.timeline b {
  display: block; font-family: var(--serif); font-size: var(--step-2);
  font-weight: 700; color: var(--brick); line-height: 1.1; margin-bottom: 0.35rem;
}
.timeline p { color: var(--ink-soft); }

/* ---------- Photo divider ---------- */
.photo-divider { position: relative; }
.photo-divider img { width: 100%; height: clamp(16rem, 45vh, 26rem); object-fit: cover; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--brick); color: #fff; text-align: center; padding-block: clamp(3rem, 6vw, 4.5rem); }
.cta-band h2 { color: #fff; margin-bottom: 0.8rem; }
.cta-band p { margin-inline: auto; margin-bottom: 1.8rem; color: #f3e3dc; }
.cta-band .btn--primary { background: #fff; color: var(--brick); }
.cta-band .btn--primary:hover { background: var(--cream); color: var(--brick-dk); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 1.2rem; }
@media (min-width: 40rem) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
}
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid #cfc4ab;
  border-radius: var(--radius); padding: 0.7rem 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.88rem; color: var(--muted); }
.form-status { font-weight: 600; margin-top: 1rem; }
.form-status.ok { color: #2e6b34; }
.form-status.err { color: var(--brick); }

/* ---------- Contact info block ---------- */
.contact-aside { display: grid; gap: 1.5rem; align-content: start; }
.contact-aside .card p { color: var(--ink-soft); }
.contact-aside .card a { font-weight: 600; }
address { font-style: normal; }

/* ---------- Gallery ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.8rem; }
.filter-bar button {
  font: inherit; font-weight: 600; font-size: 0.9rem;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.45rem 1.1rem; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.filter-bar button:hover { border-color: var(--brass); }
.filter-bar button[aria-pressed="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.gallery-grid { display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 34rem) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 56rem) { .gallery-grid { grid-template-columns: 1fr 1fr 1fr; } }
.ph { display: block; border-radius: var(--radius); overflow: hidden; position: relative; }
.ph img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  transition: transform 0.3s ease;
}
.ph:hover img { transform: scale(1.03); }
.gallery-grid[data-filter]:not([data-filter="all"]) .ph { display: none; }
.gallery-grid[data-filter="ext"]  .ph[data-cat="ext"],
.gallery-grid[data-filter="town"] .ph[data-cat="town"],
.gallery-grid[data-filter="liv"]  .ph[data-cat="liv"],
.gallery-grid[data-filter="kit"]  .ph[data-cat="kit"],
.gallery-grid[data-filter="bed"]  .ph[data-cat="bed"],
.gallery-grid[data-filter="bath"] .ph[data-cat="bath"],
.gallery-grid[data-filter="hist"] .ph[data-cat="hist"] { display: block; }

/* ---------- Lightbox ---------- */
#lightbox {
  border: 0; padding: 0; background: transparent;
  max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh;
  display: none; align-items: center; justify-content: center;
}
#lightbox[open] { display: flex; }
#lightbox::backdrop { background: rgba(18, 15, 12, 0.93); }
#lightbox figure { margin: 0; position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#lightbox img {
  max-width: min(92vw, 90rem); max-height: 86dvh;
  width: auto; height: auto; border-radius: 4px;
}
#lightbox .lb-count {
  position: absolute; top: 1rem; left: 1.2rem; color: #cfc8ba;
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.06em;
}
#lightbox button {
  position: absolute; background: rgba(246, 241, 231, 0.12);
  border: 0; border-radius: 50%; width: 2.9rem; height: 2.9rem;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background-color 0.15s;
}
#lightbox button:hover { background: rgba(246, 241, 231, 0.28); }
#lightbox button svg { width: 22px; height: 22px; }
#lightbox .lb-close { top: 0.9rem; right: 1rem; }
#lightbox .lb-prev { left: 0.8rem; top: 50%; transform: translateY(-50%); }
#lightbox .lb-next { right: 0.8rem; top: 50%; transform: translateY(-50%); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfc8ba; padding-block: 3.5rem 2rem; font-size: 0.95rem; }
.site-footer .cols {
  display: grid; gap: 2.2rem; margin-bottom: 2.5rem;
}
@media (min-width: 48rem) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: 0.8rem; }
.site-footer .f-wordmark { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: #fff; letter-spacing: 0.04em; }
.site-footer .f-est { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass); font-weight: 600; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
.site-footer a { color: #e8e1d3; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .fine {
  border-top: 1px solid rgba(246, 241, 231, 0.14);
  padding-top: 1.4rem; font-size: 0.85rem; color: #9c958a;
  display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; justify-content: space-between;
}

/* ---------- Misc ---------- */
.note-strip {
  background: var(--cream-dk); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.3rem; font-size: 0.95rem; color: var(--ink-soft);
}
.error-page { text-align: center; padding-block: var(--space); }
.error-page h1 { font-size: var(--step-4); }
.error-page p { margin: 1rem auto 2rem; }
