/* Rowley Park — concept stylesheet
   Layout idea: a heritage publication. Ivory paper, heritage-green ink,
   gold used only for hairline rules. Editorial measure (~66ch), alternating
   photograph/text spreads, generous white space. */
:root {
  --green: #243D32;
  --green-deep: #1B2F26;
  --ivory: #F7F3EA;
  --stone: #E7E0D3;
  --gold: #B49A64;
  --burgundy: #673A42;
  --ink: #292B29;
  --ink-soft: #4C4F4B;
  --rule: rgba(36, 61, 50, .18);

  --display: "Cormorant Garamond", "Libre Baskerville", Georgia, serif;
  --heading: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --body: Georgia, "Times New Roman", serif;
  --label: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --measure: 66ch;
  --wrap: 1180px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1.0625rem/1.75 var(--body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--burgundy); }
:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--heading); color: var(--green); font-weight: 400; line-height: 1.25; text-wrap: balance; margin: 0; }
p { margin: 0; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--green); color: var(--ivory); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: var(--gutter); top: .5rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }

/* ---------- Concept banner ---------- */
.concept-note {
  background: var(--green-deep); color: #E9E2D2;
  font: 500 .8125rem/1.4 var(--label); letter-spacing: .02em;
  text-align: center; padding-block: .5rem;
  padding-left: var(--gutter); padding-right: var(--gutter-r);
}
.concept-note strong { color: #fff; font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(247, 243, 234, .97);
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 1px 0 rgba(180, 154, 100, .35), 0 6px 18px -14px rgba(36, 61, 50, .35);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 84px; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--green); }
.brand img { width: 64px; height: auto; }
.brand-name { font: 500 1.75rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--green); }

.nav-toggle {
  display: none; align-items: center; gap: .5rem;
  background: none; border: 1px solid var(--rule); border-radius: 2px;
  font: 600 .8125rem/1 var(--label); letter-spacing: .12em; text-transform: uppercase;
  color: var(--green); padding: .75rem .9rem; min-height: 44px; cursor: pointer;
}
.nav-toggle .bars { width: 18px; height: 12px; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after, .nav-toggle .bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle .bars::before { top: 0; } .nav-toggle .bars span { top: 5px; } .nav-toggle .bars::after { top: 10px; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-5px) rotate(-45deg); }

.primary-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.primary-nav li { position: relative; }
.primary-nav a, .primary-nav .top-link {
  display: block; font: 500 .9375rem/1.2 var(--label); letter-spacing: .03em;
  color: var(--green); text-decoration: none; padding: .7rem .7rem;
}
.primary-nav > ul > li > a { position: relative; }
.primary-nav > ul > li > a::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .35rem; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.primary-nav > ul > li:hover > a::after,
.primary-nav > ul > li:focus-within > a::after,
.primary-nav a[aria-current="page"]::after { transform: scaleX(1); }
.primary-nav a[aria-current="page"] { color: var(--burgundy); }

.sub {
  list-style: none; margin: 0; padding: .5rem 0; position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--ivory); border: 1px solid var(--rule); border-top: 2px solid var(--gold);
  box-shadow: 0 14px 30px -18px rgba(36, 61, 50, .45);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
}
.primary-nav li:hover > .sub, .primary-nav li:focus-within > .sub {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.sub a { padding: .55rem 1.1rem; font-size: .9rem; }
.sub a:hover { background: var(--stone); color: var(--green); }
.sub-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: var(--green-deep); overflow: hidden; }
.hero picture img { width: 100%; height: clamp(440px, 64vh, 680px); object-fit: cover; object-position: 50% 45%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 32, 26, .05) 30%, rgba(20, 32, 26, .72) 100%);
}
.hero-text { position: absolute; inset: auto 0 0 0; z-index: 1; padding-block: 0 clamp(2.25rem, 6vw, 4.25rem); }
.hero-title {
  font: 500 clamp(2.9rem, 7.5vw, 6rem)/.95 var(--display); letter-spacing: .16em; text-transform: uppercase;
  color: #fff; margin: 0;
}
.hero-rule { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0 .9rem; color: var(--gold); width: min(420px, 80%); }
.hero-rule::before, .hero-rule::after { content: ""; height: 1px; background: currentColor; flex: 1; }
.hero-rule span { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid currentColor; }
.hero-sub { font: italic 400 clamp(1.15rem, 2.4vw, 1.55rem)/1.4 var(--display); color: #F3EEE3; letter-spacing: .02em; }

/* ---------- Ornamental rule ---------- */
.ornament { display: flex; align-items: center; justify-content: center; gap: .8rem; color: var(--gold); margin-inline: auto; width: min(240px, 60%); }
.ornament::before, .ornament::after { content: ""; height: 1px; background: currentColor; flex: 1; }
.ornament i { width: 6px; height: 6px; transform: rotate(45deg); background: currentColor; }

.eyebrow { font: 600 .75rem/1 var(--label); letter-spacing: .22em; text-transform: uppercase; color: var(--burgundy); }

/* ---------- Welcome ---------- */
.welcome { padding-block: clamp(3.5rem, 8vw, 6.5rem); text-align: center; }
.welcome .eyebrow { display: block; margin-bottom: 1.4rem; }
.welcome-lead {
  font: 400 clamp(1.45rem, 3vw, 2.15rem)/1.4 var(--display); color: var(--green);
  max-width: 30ch; margin: 0 auto 1.6rem; text-wrap: balance;
}
.welcome-body { max-width: 54ch; margin-inline: auto; display: grid; gap: 1rem; color: var(--ink-soft); }
.welcome .ornament { margin-top: 2.5rem; }

/* ---------- Spreads (alternating image + text) ---------- */
.spreads { display: grid; gap: clamp(3.5rem, 8vw, 6.5rem); padding-block: 0 clamp(4rem, 9vw, 7rem); }
.spread { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.75rem, 5vw, 4.5rem); align-items: center; }
.spread.flip .spread-media { order: 2; }
.spread-media { position: relative; margin: 0; overflow: hidden; }
.spread-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.2s var(--ease); }
.spread-media::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(247, 243, 234, .55); pointer-events: none; }
.spread:hover .spread-media img { transform: scale(1.035); }
.spread-text { min-width: 0; max-width: 46ch; }
.spread-text .eyebrow { display: block; margin-bottom: 1rem; }
.spread-text h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); margin-bottom: 1.1rem; }
.spread-text blockquote { margin: 0 0 1.6rem; color: var(--ink-soft); }
.spread-text blockquote p::before { content: "\201C"; }
.spread-text blockquote p::after { content: "\201D"; }
.links { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }

.text-link {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 44px;
  font: 600 .8125rem/1 var(--label); letter-spacing: .16em; text-transform: uppercase;
  color: var(--green); text-decoration: none; border-bottom: 1px solid var(--gold);
}
.text-link::after { content: "\2192"; font-family: var(--body); letter-spacing: 0; transition: transform .3s var(--ease); }
.text-link:hover { color: var(--burgundy); }
.text-link:hover::after { transform: translateX(4px); }

/* ---------- Estate information ---------- */
.estate { background: var(--stone); padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid rgba(180, 154, 100, .5); }
.section-head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section-head .eyebrow { display: block; margin-bottom: .9rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.estate-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.estate-grid li { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.estate-grid a {
  display: grid; gap: .6rem; height: 100%; padding: 1.6rem 1.6rem 1.75rem; text-decoration: none; color: var(--ink);
  background: transparent; transition: background-color .3s var(--ease);
}
.estate-grid a:hover { background: var(--ivory); }
.estate-grid h3 { font-size: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.estate-grid h3::after { content: "\2192"; font-family: var(--body); color: var(--gold); transition: transform .3s var(--ease), color .3s; }
.estate-grid a:hover h3::after { transform: translateX(4px); color: var(--burgundy); }
.estate-grid p { font-size: .95rem; line-height: 1.6; color: var(--ink-soft); }

/* ---------- Facebook band ---------- */
.community { background: var(--green); color: #EDE7DA; padding-block: clamp(3rem, 7vw, 4.5rem); }
.community-inner { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: center; }
.community .eyebrow { color: var(--gold); display: block; margin-bottom: .8rem; }
.community h2 { color: #fff; font: 400 clamp(1.5rem, 3vw, 2.1rem)/1.3 var(--display); }
.community p.note { margin-top: .6rem; font-size: .95rem; color: #CFC7B6; max-width: 52ch; }
.btn-outline {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 48px; padding: .85rem 1.4rem;
  border: 1px solid var(--gold); color: #fff; text-decoration: none;
  font: 600 .8125rem/1 var(--label); letter-spacing: .16em; text-transform: uppercase;
  transition: background-color .3s var(--ease), color .3s;
}
.btn-outline:hover { background: var(--gold); color: var(--green-deep); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-deep); color: #CFC7B6; padding-block: 3.5rem 2rem; font-size: .95rem; }
.footer-top { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(180, 154, 100, .35); }
.footer-brand { display: grid; gap: .9rem; align-content: start; }
.footer-brand img { width: 72px; background: var(--ivory); padding: 6px; }
.footer-brand span { font: 500 1.35rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem 2rem; }
.footer-nav h3 { font: 600 .75rem/1 var(--label); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: .8rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer-nav a { color: #EDE7DA; text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between; font: 400 .85rem/1.5 var(--label); }
.footer-bottom a { color: #EDE7DA; }

/* ---------- Internal page: History ---------- */
.page-hero { position: relative; background: var(--green-deep); color: #fff; overflow: hidden; }
.page-hero img { width: 100%; height: clamp(300px, 46vh, 480px); object-fit: cover; object-position: 50% 40%; opacity: .9; }
.page-hero-text { position: absolute; inset: auto 0 0 0; padding-block: 0 clamp(2rem, 5vw, 3.25rem); }
.page-hero h1 { font: 500 clamp(2.6rem, 6vw, 4.5rem)/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.crumbs { font: 500 .8125rem/1 var(--label); letter-spacing: .14em; text-transform: uppercase; color: #E2D9C6; margin-bottom: 1rem; }
.crumbs a { color: #E2D9C6; text-decoration: none; }

.chronicle { padding-block: clamp(3.5rem, 8vw, 6rem); }
.chronicle-list { list-style: none; margin: 0 auto; padding: 0; max-width: 860px; display: grid; }
.entry { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 2.25rem; padding-block: 1.6rem; border-top: 1px solid var(--rule); }
.entry:first-child { border-top: 0; }
.entry-date { font: 500 1.6rem/1.15 var(--display); color: var(--burgundy); text-align: right; position: relative; }
.entry-date::after { content: ""; display: block; width: 28px; height: 1px; background: var(--gold); margin: .7rem 0 0 auto; }
.entry p { max-width: var(--measure); }
.entry:first-child p::first-letter {
  float: left; font: 500 4.1rem/.82 var(--display); color: var(--green); padding: .35rem .55rem 0 0;
}

.archive { background: var(--stone); padding-block: clamp(3rem, 7vw, 5rem); }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); margin-top: 2rem; }
.archive-grid figure { margin: 0; background: var(--ivory); padding: 10px 10px 12px; box-shadow: 0 10px 24px -18px rgba(36, 61, 50, .6); }
.archive-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: sepia(.15); }

.next-pages { padding-block: clamp(3rem, 7vw, 4.5rem); text-align: center; }
.next-pages .links { justify-content: center; margin-top: 1.5rem; }

/* ---------- Reveal motion (content visible without JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .primary-nav a, .primary-nav .top-link { font-size: .875rem; padding-inline: .5rem; }
  .brand-name { font-size: 1.45rem; }
}

/* ---------- Mobile navigation (below 960px) ---------- */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .header-inner { min-height: 72px; }
  .brand img { width: 52px; }
  .primary-nav {
    position: fixed; inset: 0; top: calc(72px + env(safe-area-inset-top, 0px));
    background: var(--ivory); overflow-y: auto;
    padding: 1rem var(--gutter-r) 3rem var(--gutter);
    transform: translateX(100%); visibility: hidden;
    transition: transform .4s var(--ease), visibility 0s .4s;
    border-top: 1px solid var(--gold);
  }
  .primary-nav.open { transform: none; visibility: visible; transition-delay: 0s; }
  .primary-nav > ul { flex-direction: column; gap: 0; }
  .primary-nav > ul > li { border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .primary-nav > ul > li > a { font: 400 1.2667rem/1.2 var(--heading); padding: 1rem 0; min-height: 56px; display: flex; align-items: center; }
  .primary-nav > ul > li > a::after { display: none; }
  .sub-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    background: none; border: 0; color: var(--green); cursor: pointer;
  }
  .sub-toggle svg { transition: transform .3s var(--ease); }
  .sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .sub {
    grid-column: 1 / -1; position: static; opacity: 1; visibility: visible; transform: none;
    border: 0; box-shadow: none; background: transparent; padding: 0 0 .75rem .25rem; display: none;
  }
  .primary-nav li:hover > .sub { display: none; }
  .sub.open, .primary-nav li:hover > .sub.open { display: block; }
  .sub a { font: 500 .9167rem/1.3 var(--label); padding: .7rem 0 .7rem 1rem; border-left: 1px solid var(--gold); min-height: 44px; display: flex; align-items: center; }
  body.nav-open { overflow: hidden; }

  .spread, .spread.flip { grid-template-columns: 1fr; }
  .spread.flip .spread-media { order: 0; }
  .spread-text { max-width: none; }
  .estate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
  body { font-size: 1.03rem; }
  .brand-name { font-size: 1.2rem; letter-spacing: .12em; }
  .nav-toggle .label { display: none; }
  .hero picture img { height: 78vh; max-height: 620px; min-height: 460px; }
  .hero-title { letter-spacing: .1em; }
  .welcome { text-align: left; }
  .welcome-lead { margin-left: 0; }
  .welcome .eyebrow { margin-bottom: 1rem; }
  .spread-media img { aspect-ratio: 3 / 2; }
  .spread-media::after { inset: 7px; }
  .estate-grid { grid-template-columns: 1fr; }
  .estate-grid a { padding: 1.25rem 1.1rem 1.35rem; }
  .community-inner { grid-template-columns: 1fr; }
  .btn-outline { justify-content: center; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .entry { grid-template-columns: 1fr; gap: .6rem; padding-block: 1.4rem; }
  .entry-date { text-align: left; font-size: 1.45rem; }
  .entry-date::after { margin: .55rem 0 0 0; }
  .archive-grid { grid-template-columns: 1fr; }
}
.entry-body { display: grid; gap: 1rem; min-width: 0; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 32, 26, .1) 35%, rgba(20, 32, 26, .7) 100%); pointer-events: none; }
.page-hero-text { z-index: 1; }
.page-hero.mono img { filter: grayscale(1) contrast(1.05); opacity: .78; }
.primary-nav > ul > li:nth-last-child(-n+2) > .sub { left: auto; right: 0; }
html, body { overflow-x: clip; }
