/* ============================================================
   Keldwick — visitkeldwick.co.uk
   Palette anchored on the laminated "Schedule of Covenants" card:
   cream/parchment grounds, conservation green, muted gold.
   ============================================================ */

:root {
  --paper: #F2EAD7;
  --cream: #FBF7EC;
  --ground: #E2D8BF;
  --ink: #2B271F;
  --green: #2D4A36;
  --gold: #AE8836;
  --gold-bright: #C79B3E;
  --muted: #7a7160;
  --line: #E0D4B6;
  --frame: #C4B690;
  --plate: #E6DEC6;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* The hidden attribute must beat the id-level `display` rules on #gate/#reader. */
[hidden] { display: none !important; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
}
::selection { background: var(--gold); color: var(--cream); }
img { max-width: 100%; }

/* ---------- public village shell ---------- */
#village { min-height: 100vh; padding: 0 0 40px; }
.paper {
  max-width: 940px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 0 1px #cdbf9b, 0 10px 40px rgba(43, 39, 31, .16);
}

/* masthead */
.masthead {
  text-align: center;
  padding: 24px 24px 16px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.masthead-row {
  display: flex; align-items: center; justify-content: center; gap: 18px;
}
.wordmark {
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 44px;
  letter-spacing: .08em; color: var(--green); line-height: 1;
}
.tagline {
  font-style: italic; font-size: 17px; color: var(--muted); margin-top: 11px;
}

/* bound-ring emblem */
.emblem-img { width: 58px; height: 58px; flex: 0 0 auto; display: block; }
.emblem-img-sm { width: 54px; height: 54px; margin: 0 auto 16px; display: block; }

/* nav */
.nav {
  background: var(--green); color: #E8DFC4;
  display: flex; justify-content: center; flex-wrap: wrap;
  font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
}
.nav-link {
  position: relative; padding: 13px 22px; cursor: pointer;
  color: var(--cream); text-decoration: none; display: block;
}
.nav-link.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--gold-bright);
}

/* ---------- home ---------- */
/* toast-style notice, matched to the width of the hero image below it */
.img-notice {
  margin: 22px 28px 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 18px;
  background: #fff;
  border: 1px solid #E3D3A0;
  border-left: 4px solid #C0392B;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(43, 39, 31, .18);
  color: #6f6233;
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.5;
  text-align: left;
}
.img-notice b { font-style: normal; font-weight: 600; color: #5e5128; }
.img-notice .siren {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(226, 59, 46, .85));
  animation: sirenFlash 0.9s steps(1, end) infinite;
}
@keyframes sirenFlash {
  0%, 49%  { opacity: 1;  transform: scale(1); }
  50%, 100% { opacity: .35; transform: scale(.86); }
}
@media (prefers-reduced-motion: reduce) {
  .img-notice .siren { animation: none; }
}
.hero-wrap { padding: 18px 28px 0; }
.hero-frame { border: 1px solid var(--frame); padding: 6px; background: var(--cream); }
.hero {
  position: relative; height: 300px; background-color: #DFD7BE;
  background-image:
    repeating-linear-gradient(135deg, rgba(43,39,31,.07) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(48deg, rgba(45,74,54,.05) 0 1px, transparent 1px 10px);
  box-shadow: inset 0 0 80px rgba(43,39,31,.20);
}
.hero-caption {
  position: absolute; left: 12px; top: 12px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  background: var(--cream); border: 1px solid var(--frame); padding: 3px 9px;
}
.hero-welcome { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; }
.hero-welcome span {
  display: inline-block; background: var(--cream); border: 1px solid #AE8836;
  padding: 6px 20px; font-style: italic; font-size: 18px; color: var(--green);
}

.intro { text-align: center; padding: 30px 70px 8px; }
.intro p { font-size: 19.5px; line-height: 1.62; margin: 0; color: #3a352b; }

.threes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 24px 28px 4px; }
.three { margin: 0; text-align: center; }
.three-title { font-family: 'Cinzel', serif; font-size: 17px; color: var(--green); margin-top: 11px; }
.three-sub { font-size: 14px; color: var(--muted); font-style: italic; }

.plate { border: 1px solid var(--frame); padding: 5px; background: var(--cream); }
.plate-img {
  height: 140px; background-color: var(--plate);
  background-image: repeating-linear-gradient(135deg, rgba(43,39,31,.08) 0 1px, transparent 1px 6px);
  box-shadow: inset 0 0 44px rgba(43,39,31,.22);
}
.plate-tall .plate-img { height: 200px; }
.plate-tall figcaption {
  text-align: center; font-style: italic; font-size: 13px; color: var(--muted); padding: 7px 4px 2px;
}
figure.plate { margin: 0; }

.rule { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 28px 28px 0; color: var(--gold); }
.rule span { height: 1px; width: 110px; background: var(--gold); }
.rule i { font-style: normal; font-size: 14px; }

.latest { padding: 18px 70px 6px; text-align: center; }
.latest-head { font-family: 'Cinzel', serif; font-size: 16px; letter-spacing: .06em; color: var(--green); margin-bottom: 10px; }
.latest p { font-size: 16px; line-height: 1.6; margin: 0; color: #5a5446; }
.date { color: var(--gold); font-weight: 600; }

/* ---------- inner pages ---------- */
.page { padding: 30px 56px 8px; }
.page[data-page="home"], .page[data-page="whatson"] { padding-left: 0; padding-right: 0; }
.page-title { font-family: 'Cinzel', serif; font-weight: 600; font-size: 30px; color: var(--green); text-align: center; margin: 0 0 6px; }
.page-sub { text-align: center; font-style: italic; color: #8a8068; margin-bottom: 24px; }
.body { font-size: 17.5px; line-height: 1.64; margin: 0 0 16px; }
.sub { font-family: 'Cinzel', serif; font-weight: 500; font-size: 18px; color: var(--green); margin: 0 0 8px; }

.split { display: grid; grid-template-columns: 1fr 280px; gap: 30px; align-items: start; margin: 24px 0 8px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }

.quote {
  max-width: 560px; margin: 18px auto 4px; background: #FCFAF1;
  border: 1px solid #B9AC86; border-radius: 8px;
  box-shadow: 0 2px 0 #D8CBA8, 0 4px 12px rgba(43,39,31,.14);
  padding: 30px 34px; text-align: center;
}
.quote-mark { color: var(--gold); font-size: 24px; line-height: 1; margin-bottom: 12px; }
.quote p { font-style: italic; font-size: 19px; line-height: 1.55; color: #33302a; margin: 0; }
.quote cite { display: block; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #9a8f76; margin-top: 16px; font-style: normal; }

/* visit */
.seelist { font-size: 16px; line-height: 1.5; }
.see { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dotted #D6C9AC; }
.see.no-border { border-bottom: 0; }
.see .dot { color: var(--gold); }
.see b { font-weight: 600; }
.map-frame { margin: 26px 0 4px; border: 1px solid var(--frame); padding: 6px; background: var(--cream); }
.map {
  height: 210px; background-color: var(--plate);
  background-image:
    repeating-linear-gradient(0deg, rgba(45,74,54,.06) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(45,74,54,.06) 0 1px, transparent 1px 22px);
  box-shadow: inset 0 0 44px rgba(43,39,31,.18);
  display: flex; align-items: center; justify-content: center;
}
.map-label { background: var(--cream); border: 1px solid var(--frame); font-style: italic; font-size: 14px; color: #6b6354; padding: 5px 16px; }
.map-label em { font-style: normal; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }

/* what's on */
.calendar { max-width: 620px; margin: 0 auto; }
.event { display: flex; gap: 18px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.event.no-border { border-bottom: 0; }
.event .when { flex: 0 0 86px; font-family: 'Cinzel', serif; color: var(--gold); font-size: 15px; }
.event b { font-weight: 600; }
.muted { color: #6a6353; }
.note-line { text-align: center; font-style: italic; font-size: 14px; color: #9a8f76; margin-top: 22px; }

/* parish */
.roster { font-size: 16px; line-height: 1.7; color: #33302a; }
.roster b { font-weight: 600; }
.records {
  margin: 30px auto 6px; max-width: 620px; background: var(--cream);
  border: 1px solid #D6C9AC; padding: 20px 24px;
}
.records-link {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 15px; letter-spacing: .04em; color: var(--green);
  border-bottom: 1px solid var(--gold); padding-bottom: 2px; text-decoration: none;
}
.records-link span { color: var(--gold); }

.footer {
  border-top: 1px solid var(--line); margin-top: 18px; padding: 18px 56px 22px;
  text-align: center; font-size: 13px; color: #8a8068;
}

/* ---------- password gate ---------- */
#gate {
  min-height: 100vh; background: var(--ground);
  display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}
.gate-card {
  width: 100%; max-width: 440px; background: var(--cream);
  border: 1px solid #B9AC86; box-shadow: 0 10px 40px rgba(43,39,31,.18);
}
.gate-head {
  background: var(--green); color: #E8DFC4; text-align: center; padding: 12px;
  font-family: 'Cinzel', serif; letter-spacing: .1em; font-size: 15px;
}
.gate-body { padding: 30px 34px 32px; text-align: center; }
.gate-kicker { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #9a8f76; margin-bottom: 14px; }
.gate-text { font-size: 16px; line-height: 1.55; color: #4a443a; margin: 0 0 20px; }
#gate-pw {
  width: 100%; padding: 11px 13px; font-family: 'EB Garamond', serif; font-size: 16px;
  color: var(--ink); background: #fff; border: 1px solid var(--frame); outline: none;
  text-align: center; letter-spacing: .05em;
}
.turnstile-holder { display: flex; justify-content: center; margin-top: 16px; min-height: 0; }
.turnstile-holder:empty { margin-top: 0; }
.gate-error { color: #9a3b2e; font-size: 14px; font-style: italic; margin-top: 10px; }
.gate-enter {
  width: 100%; margin-top: 18px; background: var(--green); color: var(--cream);
  padding: 11px; cursor: pointer; font-family: 'Cinzel', serif; letter-spacing: .08em;
  font-size: 14px; border: 0;
}
.gate-enter:disabled { opacity: .6; cursor: default; }
.gate-back { display: inline-block; margin-top: 18px; font-size: 14px; font-style: italic; color: var(--muted); cursor: pointer; text-decoration: none; }

/* ---------- terminal reading area ---------- */
#reader {
  position: fixed; inset: 0; background: #352c19; color: #e9d6a8;
  font-family: 'IBM Plex Mono', monospace; display: flex; flex-direction: column; z-index: 50;
}
.term-top {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px; border-bottom: 1px solid rgba(240,178,74,.28); background: #1b150b;
  font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
}
.term-brand { color: #c9a356; }
.term-brand .dim { color: #6f6038; }
.term-logout {
  cursor: pointer; color: #c9a356; background: transparent;
  border: 1px solid rgba(240,178,74,.35); padding: 4px 11px;
  font-family: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit;
}
.term-body { flex: 1 1 auto; min-height: 0; display: flex; }

.term-contents {
  flex: 0 0 322px; border-right: 1px solid rgba(240,178,74,.22);
  overflow-y: auto; padding: 20px 0 60px; background: #221b10;
}
.contents-head {
  padding: 0 20px 8px; font-size: 12px; letter-spacing: .22em; color: #8a7a4e;
  border-bottom: 1px solid rgba(240,178,74,.16); margin-bottom: 8px;
}
.contents-item {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 20px;
  cursor: pointer; font-size: 13.5px; color: #e9d6a8;
}
.contents-item .marker { color: #ffcf7a; margin-left: -13px; margin-right: 3px; width: 10px; }
.contents-item .cnum { color: #9a824a; flex: 0 0 22px; }
.contents-foot {
  padding: 18px 20px 0; margin-top: 14px; border-top: 1px solid rgba(240,178,74,.12);
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: #6f6038;
}

.term-pane { flex: 1 1 auto; overflow-y: auto; padding: 46px 32px 130px; }
.reader-inner { max-width: 680px; margin: 0 auto; }
.ch-label { font-size: 12px; letter-spacing: .3em; color: #8a7a4e; margin-bottom: 10px; }
.ch-title {
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 27px;
  letter-spacing: .04em; color: #ffd27a; text-shadow: 0 0 14px rgba(255,180,80,.4); margin-bottom: 8px;
}
.ch-rule { height: 1px; background: rgba(240,178,74,.28); margin: 18px 0 30px; }
#ch-body p { font-size: 16px; line-height: 1.92; color: #f4e7c6; margin: 0 0 1.35em; }
#ch-body em { font-style: italic; }
#ch-body .scene-break { text-align: center; color: #8a7a4e; letter-spacing: 1.1em; margin: 2em 0 2.4em; font-size: 13px; }
.ch-end {
  text-align: center; color: #7d6c40; font-size: 12.5px; letter-spacing: .18em;
  margin: 14px 0 0; padding-top: 22px; border-top: 1px solid rgba(240,178,74,.16);
}
.ch-nav {
  display: flex; justify-content: space-between; align-items: center; margin-top: 40px;
  padding-top: 22px; border-top: 1px solid rgba(240,178,74,.16); font-size: 13px; letter-spacing: .08em;
}
.ch-prev, .ch-next {
  background: transparent; border: 0; font-family: inherit; font-size: 13px; letter-spacing: .08em;
  color: #c9a356; cursor: pointer; padding: 0;
}
.ch-prev:disabled, .ch-next:disabled { color: #4f4528; cursor: default; }

.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply; opacity: .32;
}
.vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 180px rgba(0,0,0,.32); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .wordmark { font-size: 34px; }
  .intro { padding: 24px 24px 8px; }
  .latest { padding: 18px 24px 6px; }
  .page { padding: 26px 22px 8px; }
  .split, .cols { grid-template-columns: 1fr; }
  .footer { padding: 18px 22px 22px; }
  .term-contents { flex-basis: 200px; }
  .term-pane { padding: 30px 20px 110px; }
}
