/* ==========================================================================
   Parish Council template stylesheet — WCAG 2.2 AA
   Re-skin a new council by editing the tokens in :root only.
   No JavaScript required anywhere on the site.
   v2 — softer, airier, gently animated; same civic dignity.
   ========================================================================== */

:root {
  /* ------- COUNCIL THEME TOKENS (edit these per council) ------- */
  --c-ink: #20261C;         /* body text — contrast vs paper 13.9:1 */
  --c-ink-soft: #4C5546;    /* secondary text — 7.0:1 on paper */
  --c-paper: #F7F5EF;       /* page ground: local stone */
  --c-paper-2: #FBFAF5;     /* faint lift for alternating bands */
  --c-panel: #FFFFFF;       /* cards/panels */
  --c-brand: #2E5237;       /* deep vale green — masthead, h1/h2 */
  --c-brand-deep: #22402A;  /* hover/active */
  --c-link: #1E4A2E;        /* links — 7.9:1 on paper */
  --c-accent: #8A4B24;      /* Heanor brick — eyebrows, small accents (6.19:1 on paper) */
  --c-gold: #FFD98A;        /* on-dark accent (nav marker, dark links) */
  --c-notice: #8C2F24;      /* statutory notice red — dark enough for text */
  --c-notice-bg: #F6E7E3;
  --c-line: #E4DFD3;        /* hairline — lighter than v1 for less weight */
  --c-line-soft: #EFEBE0;
  --c-focus: #B37714;       /* focus ring — high visibility on both grounds */

  /* ------- TYPE ------- */
  --f-display: Rockwell, "Roboto Slab", "Josefin Slab", "Courier New", serif;
  --f-body: Seravek, "Segoe UI", Candara, Verdana, -apple-system, sans-serif;

  /* ------- FORM ------- */
  --maxw: 74rem;
  --measure: 66ch;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow-1: 0 1px 2px rgba(32, 38, 28, .05), 0 2px 8px rgba(32, 38, 28, .05);
  --shadow-2: 0 4px 10px rgba(32, 38, 28, .07), 0 12px 28px rgba(32, 38, 28, .08);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------- Reset & base ------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 1.1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--f-display);
  color: var(--c-brand);
  line-height: 1.16;
  text-wrap: balance;
  margin: 0 0 .5rem;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2.05rem, 4.6vw, 3rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.95rem); margin-top: 2.6rem; }
h3 { font-size: 1.22rem; color: var(--c-ink); margin-top: 1.5rem; }
p, ul, ol, table { max-width: var(--measure); }
p { margin: .75rem 0; }

a {
  color: var(--c-link);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
  transition: color .15s var(--ease), text-decoration-thickness .15s var(--ease);
}
a:hover { color: var(--c-brand-deep); text-decoration-thickness: .16em; }

/* WCAG 2.2: clearly visible, non-obscured focus */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 2px;
}
a:focus-visible, button:focus-visible {
  background: #FFF3D6;
  color: var(--c-ink);
}

/* ------- Skip link ------- */
.skip-link {
  position: absolute;
  left: -999px; top: 0;
  background: var(--c-brand);
  color: #fff;
  padding: .7rem 1.2rem;
  z-index: 100;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ------- Preview banner (demo builds only — delete for live sites) ------- */
.preview-banner {
  background: #313A2C;
  color: #F4EFE2;
  font-size: .93rem;
  padding: .55rem 1rem;
  text-align: center;
}
.preview-banner strong { color: var(--c-gold); letter-spacing: .04em; }
.preview-banner a { color: var(--c-gold); }

/* ------- Masthead ------- */
.masthead {
  background: linear-gradient(160deg, var(--c-brand) 0%, var(--c-brand-deep) 100%);
  color: #fff;
}
.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.9rem 1.25rem 1.6rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.masthead .site-name {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  color: #fff;
  text-decoration: none;
  letter-spacing: .005em;
}
.masthead .site-name:hover { text-decoration: underline; text-underline-offset: .22em; }
.masthead .site-locality {
  color: #D9E3D2;
  font-size: .95rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ------- Nav ------- */
.site-nav {
  background: var(--c-brand-deep);
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 0;
  z-index: 30;
}
.site-nav ul {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 .75rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}
.site-nav a {
  display: block;
  padding: .85rem 1.05rem;               /* ≥24px target */
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 3px solid transparent;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.site-nav a:hover { background: rgba(255,255,255,.11); }
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--c-gold);
  background: rgba(255,255,255,.08);
}

/* ------- Layout ------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.6rem 1.25rem 4.5rem;
}
/* gentle staggered reveal on load */
@media (prefers-reduced-motion: no-preference) {
  main > .two-col, main > h1, main > h2, main > .eyebrow,
  main > .lede, main > .notice, main > .panel, main > .table-wrap,
  main > ul, main > p, main > figure {
    animation: rise .55s var(--ease) both;
  }
  main > .eyebrow { animation-delay: .02s; }
  main > h1 { animation-delay: .06s; }
  main > .lede { animation-delay: .12s; }
  main > .two-col { animation-delay: .16s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.eyebrow {
  color: var(--c-accent);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0 0 .35rem;
}
.lede { font-size: 1.24rem; line-height: 1.55; color: var(--c-ink-soft); max-width: var(--measure); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: 2.4rem;
  align-items: start;
}
@media (max-width: 46rem) { .two-col { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ------- Panels ------- */
.panel {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1.3rem 1.4rem 1.4rem;
  margin: 1.15rem 0;
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--c-brand);
}
.panel { padding-left: 1.6rem; }
.panel, .site-footer-inner { overflow-wrap: anywhere; }
.panel h2, .panel h3 { margin-top: .1rem; }

.notice {
  background: var(--c-notice-bg);
  border: 1px solid #E8CFC9;
  border-left: 5px solid var(--c-notice);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  margin: 1.15rem 0;
}
.notice .eyebrow { color: var(--c-notice); }

.meeting-next {
  background: linear-gradient(165deg, var(--c-brand) 0%, var(--c-brand-deep) 100%);
  color: #fff;
  padding: 1.35rem 1.4rem;
  margin: 1.15rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.meeting-next h2, .meeting-next h3 { color: #fff; margin-top: 0; }
.meeting-next a { color: var(--c-gold); }
.meeting-next .date {
  font-family: var(--f-display);
  font-size: 1.55rem;
  display: block;
  margin: .25rem 0;
}

/* ------- News list ------- */
.news-list { list-style: none; padding: 0; }
.news-list li {
  border-bottom: 1px solid var(--c-line);
  padding: 1rem 0;
}
.news-list li:last-child { border-bottom: 0; }
.news-list time {
  display: block;
  font-size: .85rem;
  color: var(--c-accent);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  margin-bottom: .1rem;
}
.news-list a { font-weight: 700; font-size: 1.12rem; }

/* ------- Document library ------- */
.doc-list { list-style: none; padding: 0; max-width: none; }
.doc-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding: .85rem .4rem;
  border-bottom: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease);
}
.doc-list li:hover { background: var(--c-paper-2); }
.doc-list time {
  min-width: 8rem;
  color: var(--c-ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: .92rem;
  font-weight: 600;
}
.doc-list .doc-meta { color: var(--c-ink-soft); font-size: .88rem; }

/* ------- Tables ------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin: 1.15rem 0;
  background: var(--c-panel);
}
table { border-collapse: collapse; width: 100%; }
caption {
  text-align: left;
  font-weight: 700;
  padding: .9rem 1rem .3rem;
  font-family: var(--f-display);
  color: var(--c-brand);
}
th, td {
  text-align: left;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--c-line-soft);
  vertical-align: top;
}
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
th { background: transparent; font-size: .95rem; color: var(--c-ink); }
thead th { border-bottom: 2px solid var(--c-line); }
tbody tr:nth-child(even) { background: var(--c-paper-2); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }

/* ------- Councillor cards ------- */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.1rem;
  list-style: none;
  padding: 0;
  max-width: none;
}
.people li {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1.1rem 1.2rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.people li:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.people .role { color: var(--c-accent); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.people .name { font-weight: 700; font-size: 1.12rem; margin: .15rem 0; font-family: var(--f-display); color: var(--c-brand); }
.people p { font-size: .93rem; margin: .2rem 0; }

/* ------- Forms (labels above, no placeholder-as-label) ------- */
form { max-width: 38rem; }
.field { margin: 1.1rem 0; }
label { display: block; font-weight: 700; margin-bottom: .3rem; }
.hint { display: block; color: var(--c-ink-soft); font-size: .93rem; margin-bottom: .4rem; }
input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  font: inherit;
  color: var(--c-ink);
  background: #fff;
  border: 2px solid var(--c-ink-soft);
  padding: .65rem .75rem;
  border-radius: var(--radius-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, textarea:hover { border-color: var(--c-ink); }
input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 1px;
  border-color: var(--c-ink);
  background: #fff;
}
button, .button {
  font: inherit;
  font-weight: 700;
  background: var(--c-brand);
  border: 2px solid var(--c-brand);
  color: #fff;
  padding: .72rem 1.5rem;              /* ≥24px target */
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-block;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: background .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
button:hover, .button:hover { background: var(--c-brand-deep); border-color: var(--c-brand-deep); transform: translateY(-1px); box-shadow: var(--shadow-2); }
button:active, .button:active { transform: none; }

/* ------- Quick links ------- */
.quick-links { list-style: none; padding: 0; }
.quick-links li { margin: .55rem 0; }
.quick-links a {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-left-color .18s var(--ease);
}
.quick-links a::after {
  content: "→";
  margin-left: auto;
  color: var(--c-accent);
  transition: transform .18s var(--ease);
}
.quick-links a:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-2);
  border-left-color: var(--c-brand);
  text-decoration: none;
}
.quick-links a:hover::after { transform: translateX(3px); }

/* ------- Figure / photo ------- */
figure { margin: 1.6rem 0; }
figcaption { font-size: .86rem; color: var(--c-ink-soft); padding-top: .5rem; }
.photo-frame img {
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

/* ------- Footer ------- */
.site-footer {
  background: linear-gradient(180deg, #2A3325 0%, #232B1F 100%);
  color: #E7E9DF;
  margin-top: 3.5rem;
}
.site-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.8rem;
  font-size: .95rem;
}
.site-footer h2 {
  color: #fff;
  font-size: 1.02rem;
  letter-spacing: .02em;
  margin: 0 0 .6rem;
}
.site-footer a { color: var(--c-gold); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.site-footer .colophon {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,.16);
  padding-top: 1.1rem;
  color: #C4CBB8;
  font-size: .84rem;
}

/* ------- Utilities ------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.small { font-size: .9rem; color: var(--c-ink-soft); }
.back-to-top {
  display: inline-block;
  margin-top: 2.2rem;
  font-weight: 600;
}

/* ------- Motion preference ------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------- Forced colors (Windows High Contrast) ------- */
@media (forced-colors: active) {
  .site-nav a[aria-current="page"] { border-bottom-color: Highlight; }
  .panel, .notice, .meeting-next, .people li, .table-wrap, .quick-links a { border: 1px solid CanvasText; }
  .panel::before { background: CanvasText; }
}

/* ------- Print ------- */
@media print {
  .site-nav, .skip-link, .preview-banner, .back-to-top { display: none; }
  .masthead, .meeting-next { background: none !important; color: #000; border-bottom: 2px solid #000; box-shadow: none; }
  .masthead .site-name, .meeting-next h2, .meeting-next h3 { color: #000; }
  .panel, .table-wrap, .people li, .quick-links a { box-shadow: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
