/* ============================================================
   Morrowfen - town website
   Palette: reed-gold, marsh-mud, slate-grey, fen-cream, heron-white
   Type:    system serif + humanist sans, no external font requests
   ============================================================ */

/* --- Tokens ----------------------------------------------- */
:root {
  --reed-gold:   #c89c2b;
  --marsh-mud:   #3a2a1c;
  --slate-grey:  #4d5660;
  --fen-cream:   #f4ead4;
  --heron-white: #f5f1e6;
  --dusk-blue:   #2c3e50;
  --dusk-rose:   #b86a5e;
  --paper:       #fbf6e7;
  --ink:         #2b241b;
  --rule:        #c2b48b;
  --focus:       #1a4d6b;

  --serif: Georgia, "Iowan Old Style", "Source Serif Pro", "Palatino Linotype", "Book Antiqua", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --maxw:  64rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --leading: 1.6;
  --r-sm: 4px;
  --r-md: 8px;
  --shadow: 0 1px 0 rgba(0,0,0,.05), 0 6px 24px rgba(58,42,28,.08);
}

/* --- Reset (sane, minimal) ------------------------------- */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 1.25em; }
button { font: inherit; cursor: pointer; }

/* --- Skip nav -------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px; left: 0;
  background: var(--marsh-mud);
  color: var(--heron-white);
  padding: .75rem 1rem;
  z-index: 100;
  text-decoration: none;
  border: 2px solid var(--reed-gold);
  border-radius: var(--r-sm);
}
.skip-link:focus {
  top: .5rem; left: .5rem;
}

/* --- Body / paper ---------------------------------------- */
html { background: var(--paper); }
body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: var(--leading);
  font-size: clamp(15px, 1.05vw + .5rem, 18px);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(200,156,43,.07), transparent 60%),
    radial-gradient(ellipse at 90% 20%, rgba(74,86,96,.06), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(58,42,28,.025) 38px 39px),
    var(--paper);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* --- Layout --------------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
main { flex: 1 0 auto; padding-block: clamp(1.5rem, 4vw, 3rem); }

/* --- Header / nav --------------------------------------- */
.site-header {
  background: linear-gradient(180deg, var(--marsh-mud), #2c2117);
  color: var(--heron-white);
  border-bottom: 4px solid var(--reed-gold);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 1rem;
  padding-block: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; color: inherit;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.5vw + 1rem, 1.6rem);
  letter-spacing: .01em;
}
.brand:focus-visible { outline: 3px solid var(--reed-gold); outline-offset: 4px; border-radius: var(--r-sm); }
.brand .seal { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small {
  font-family: var(--sans);
  font-size: .65em;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--reed-gold);
  margin-top: 2px;
}

.site-nav {
  margin-left: auto;
}
.site-nav ul {
  list-style: none; display: flex; flex-wrap: wrap; gap: .25rem;
  padding: 0; margin: 0;
}
.site-nav a {
  display: inline-block;
  color: var(--heron-white);
  text-decoration: none;
  padding: .5rem .75rem;
  border-radius: var(--r-sm);
  font-size: .95rem;
}
.site-nav a:hover { background: rgba(244,234,212,.08); }
.site-nav a:focus-visible {
  outline: 3px solid var(--reed-gold); outline-offset: 2px;
}
.site-nav a[aria-current="page"] {
  background: rgba(200,156,43,.18);
  color: var(--reed-gold);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(244,234,212,.4);
  color: var(--heron-white);
  padding: .5rem .75rem;
  border-radius: var(--r-sm);
  margin-left: auto;
}
.nav-toggle:focus-visible { outline: 3px solid var(--reed-gold); outline-offset: 2px; }
@media (max-width: 760px) {
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { display: block; padding: .65rem .75rem; }
  .nav-toggle { display: inline-flex; align-items: center; gap: .5rem; }
  .nav-toggle .bar { width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 0, 0 6px 0 0; }
}

/* --- Footer --------------------------------------------- */
.site-footer {
  background: var(--marsh-mud);
  color: var(--heron-white);
  padding-block: 1.5rem;
  margin-top: 3rem;
  border-top: 4px solid var(--reed-gold);
  font-size: .9rem;
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-footer a { color: var(--reed-gold); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer a:focus-visible { outline: 3px solid var(--reed-gold); outline-offset: 2px; }
.colophon { font-size: .8rem; color: rgba(245,241,230,.7); max-width: 32em; }

/* --- Typographic defaults ------------------------------- */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--marsh-mud); line-height: 1.2; }
h1 { font-size: clamp(1.85rem, 2.4vw + 1rem, 2.6rem); margin-block: .2em .6em; }
h2 { font-size: clamp(1.4rem, 1.4vw + .8rem, 1.85rem); margin-block: 1.4em .5em; }
h3 { font-size: clamp(1.15rem, .9vw + .7rem, 1.4rem); margin-block: 1.2em .4em; }
h4 { font-size: 1.05rem; margin-block: 1em .3em; }
p, ul, ol, blockquote, figure { margin-block: .8em; }
p { max-width: 62ch; }
a { color: var(--dusk-blue); text-underline-offset: 2px; }
a:hover { color: var(--marsh-mud); }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

blockquote {
  border-left: 3px solid var(--reed-gold);
  padding: .5em 1em;
  background: rgba(200,156,43,.06);
  font-style: italic;
  color: var(--slate-grey);
}

/* --- Lead ------------------------------------------------ */
.lede {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1vw + .7rem, 1.3rem);
  color: var(--slate-grey);
  max-width: 60ch;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

/* --- Masthead (Gazette) -------------------------------- */
.masthead {
  background: var(--heron-white);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.masthead::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: repeating-linear-gradient(90deg, var(--reed-gold) 0 12px, var(--marsh-mud) 12px 24px);
}
.masthead .title-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.masthead .title-row .seal { width: 64px; height: 64px; flex-shrink: 0; }
.masthead h1 {
  margin: 0; font-size: clamp(1.75rem, 2vw + 1rem, 2.4rem);
  letter-spacing: .01em;
}
.masthead .strap {
  margin-top: .25rem;
  font-family: var(--serif); font-style: italic;
  color: var(--slate-grey);
  font-size: 1rem;
}
.masthead .meta {
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--slate-grey);
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.masthead .meta strong { color: var(--marsh-mud); }

/* --- Cards / panels ------------------------------------- */
.card {
  background: var(--heron-white);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.grid {
  display: grid; gap: 1.25rem;
}
.grid.two   { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

/* --- Article body --------------------------------------- */
.article {
  background: var(--heron-white);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}
.article header { border-bottom: 1px solid var(--rule); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.article .byline { color: var(--slate-grey); font-size: .9rem; }
.article .byline strong { color: var(--marsh-mud); }
.article .dateline {
  display: inline-block;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--reed-gold);
  background: rgba(200,156,43,.12);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: .75rem;
}
.article p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 2.6em;
  float: left;
  line-height: .9;
  padding: .1em .15em 0 0;
  color: var(--marsh-mud);
  font-weight: 700;
}

/* --- Pull quote ----------------------------------------- */
.pullquote {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--reed-gold);
  background: var(--fen-cream);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--marsh-mud);
}

/* --- Public notice box ---------------------------------- */
.public-notice {
  border: 2px solid var(--marsh-mud);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  background: var(--fen-cream);
  position: relative;
}
.public-notice::before {
  content: "PUBLIC NOTICE";
  position: absolute; top: -.7em; left: 1rem;
  background: var(--marsh-mud); color: var(--heron-white);
  padding: 2px 10px; border-radius: 999px;
  font-size: .7rem; letter-spacing: .12em;
}

/* --- Letter --------------------------------------------- */
.letter {
  background: var(--fen-cream);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--dusk-blue);
  padding: 1.25rem 1.5rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}
.letter .signed { font-style: normal; color: var(--marsh-mud); margin-top: 1rem; font-weight: 600; }

/* --- Classifieds ---------------------------------------- */
.classified { font-family: var(--mono); font-size: .92rem; }
.classified li { padding: .25rem 0; border-bottom: 1px dotted var(--rule); list-style: none; }
.classified ul { list-style: none; padding: 0; }
.classified li:last-child { border-bottom: 0; }
.classified .cat { color: var(--reed-gold); font-weight: 600; }

/* --- Map figure ----------------------------------------- */
.map-figure {
  background: var(--heron-white);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.map-figure figcaption {
  font-size: .85rem;
  color: var(--slate-grey);
  margin-top: .75rem;
  text-align: center;
}

/* --- Resident / place profile --------------------------- */
.profile {
  background: var(--heron-white);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: clamp(1rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
}
.profile h1 { margin-top: 0; }
.profile .role {
  display: inline-block;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--marsh-mud);
  background: rgba(58,42,28,.08);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: .5rem;
}
.profile .facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  font-size: .95rem;
  margin-block: 1rem 1.5rem;
  padding-block: 1rem;
  border-block: 1px solid var(--rule);
}
.profile .facts dt { color: var(--slate-grey); font-weight: 600; }
.profile .facts dd { margin: 0; }

/* --- Calendar ------------------------------------------- */
.calendar { list-style: none; padding: 0; }
.calendar li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--rule);
}
.calendar li:last-child { border-bottom: 0; }
.calendar time { color: var(--reed-gold); font-weight: 700; font-family: var(--serif); white-space: nowrap; }
.calendar time small { display: block; font-weight: 400; color: var(--slate-grey); font-family: var(--sans); font-size: .8em; }
@media (max-width: 540px) {
  .calendar li { grid-template-columns: 1fr; gap: .25rem; }
}

/* --- Mystery clues list --------------------------------- */
.clues {
  list-style: none; padding: 0;
  display: grid; gap: .5rem; margin-block: 1rem;
}
.clues li {
  background: var(--fen-cream);
  border-left: 3px solid var(--reed-gold);
  padding: .65rem 1rem;
}
.clues li time { font-weight: 700; color: var(--marsh-mud); margin-right: .5rem; }

/* --- Tables --------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
th, td {
  text-align: left;
  padding: .55rem .65rem;
  border-bottom: 1px solid var(--rule);
}
th {
  font-family: var(--serif);
  background: rgba(200,156,43,.08);
  color: var(--marsh-mud);
}

/* --- Utility -------------------------------------------- */
.muted { color: var(--slate-grey); }
.small { font-size: .85rem; }
.center { text-align: center; }
.spaced > * + * { margin-top: 1rem; }
.tag {
  display: inline-block;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--reed-gold);
  color: var(--marsh-mud);
  font-weight: 700;
}
.divider {
  height: 1px;
  background: var(--rule);
  margin-block: 1.5rem;
}

/* --- Crest / seal --------------------------------------- */
.seal-text {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: .05em;
}

/* --- Buttons -------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--marsh-mud);
  color: var(--heron-white);
  text-decoration: none;
  padding: .55rem 1rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: .95rem;
}
.btn:hover { background: var(--reed-gold); color: var(--marsh-mud); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn.secondary {
  background: transparent;
  color: var(--marsh-mud);
  border-color: var(--marsh-mud);
}
.btn.secondary:hover { background: var(--marsh-mud); color: var(--heron-white); }

/* --- Print ---------------------------------------------- */
@media print {
  body { background: white; color: black; }
  .site-header, .site-footer, .nav-toggle { display: none; }
  main { padding: 0; }
}

/* --- Reduced motion ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --- High contrast preference ---------------------------- */
@media (prefers-contrast: more) {
  :root { --ink: #1a1410; --marsh-mud: #1f1812; --rule: #8a7d52; }
}
