/* Friends of Pyrford Primary School — site styles
   One stylesheet, no framework, no build step. */

/* The logo artwork in /images has been recoloured to these values, so the mark
   and the interface share one palette. images/logo-original.png is the
   untouched multicolour original if you ever want to go back. */

:root {
  --ink:        #1d2b28;
  --ink-soft:   #4a5b56;
  --ink-faint:  #7b8b85;
  --paper:      #fbf8f2;
  --card:       #ffffff;
  --line:       #e4ded1;
  --line-soft:  #efe9dd;

  --brand:      #17635a;
  --brand-dark: #0f4a43;
  --brand-tint: #e6f0ed;
  --accent:     #d2593a;
  --accent-tint:#fbeae4;
  --gold:       #c9962f;
  --gold-tint:  #f8efd8;
  --sky:        #2c7d8a;
  --sky-tint:   #e2f0f2;
  --leaf:       #4f7f3c;
  --leaf-tint:  #ecf3e5;
  --callout-bg: #17635a;
  --callout-fg: #ffffff;
  --on-brand:   #ffffff;
  --on-accent:  #ffffff;

  --radius:   14px;
  --radius-s: 9px;
  --shadow:   0 1px 2px rgba(29,43,40,.05), 0 8px 24px -12px rgba(29,43,40,.18);
  --shadow-lift: 0 2px 4px rgba(29,43,40,.06), 0 16px 34px -14px rgba(29,43,40,.26);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #eef2f0;
    --ink-soft:   #b3c2bd;
    --ink-faint:  #849691;
    --paper:      #101816;
    --card:       #172220;
    --line:       #293a36;
    --line-soft:  #22302d;
    --brand:      #5fbfae;
    --brand-dark: #8fd8c9;
    --brand-tint: #17302c;
    --accent:     #f0805e;
    --accent-tint:#2e1d17;
    --gold:       #dcb45c;
    --gold-tint:  #2d2618;
    --sky:        #7fc9d4;
    --sky-tint:   #16292d;
    --leaf:       #9ec97e;
    --leaf-tint:  #1e2a1a;
    --callout-bg: #0e3d37;
    --callout-fg: #ecf7f4;
    --on-brand:   #08201d;
    --on-accent:  #2d0f06;
    --shadow:   0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 16px 34px -14px rgba(0,0,0,.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.05rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }

.sr-only {
  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; top: 0; left: 50%; transform: translate(-50%, -120%);
  background: var(--brand); color: #fff; padding: .6rem 1.1rem;
  border-radius: 0 0 var(--radius-s) var(--radius-s); z-index: 100;
  transition: transform .15s;
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 0;
}

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; margin-right: auto; }
.brand:hover { color: inherit; }
.brand-mark { width: 56px; height: auto; flex: none; }
@media (max-width: 420px) { .brand-mark { width: 46px; } }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; }
.brand-sub { font-size: .74rem; color: var(--ink-faint); letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; gap: .15rem; align-items: center; }
.nav a {
  padding: .5rem .72rem; border-radius: 999px; text-decoration: none;
  color: var(--ink-soft); font-size: .93rem; font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--brand-tint); color: var(--brand-dark); }
.nav a[aria-current="page"] { background: var(--brand); color: var(--on-brand); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: .5rem .7rem; color: var(--ink);
  font: inherit; font-size: .9rem; cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: .5rem .8rem 1rem;
    box-shadow: var(--shadow);
  }
  .nav[hidden] { display: none; }
  .nav a { border-radius: var(--radius-s); padding: .75rem .8rem; font-size: 1rem; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.15rem; border-radius: 999px;
  font-size: .95rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); color: var(--on-brand); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent); color: var(--on-accent); filter: brightness(.93); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand-dark); }
.btn-sm { padding: .45rem .85rem; font-size: .87rem; }

/* ---------- hero ---------- */

.hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(2rem, 4vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-tint);
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 { margin-bottom: .55rem; }
.hero-lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

.hero-art {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lift); background: var(--brand-tint);
  aspect-ratio: 4 / 3;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- sections ---------- */

.section { padding: clamp(2.2rem, 4.5vw, 3.6rem) 0; }
.section-alt { background: var(--card); border-block: 1px solid var(--line); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: .3rem 0 0; color: var(--ink-soft); }

/* ---------- event cards ---------- */

.card-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); }

.event-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--brand); color: inherit; }

.event-card-top { display: flex; gap: .9rem; padding: 1.05rem 1.15rem .55rem; }

.datechip {
  flex: none; width: 58px; text-align: center; border-radius: var(--radius-s);
  background: var(--brand-tint); color: var(--brand-dark);
  padding: .4rem .2rem .45rem; line-height: 1.05;
}
.datechip .m { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.datechip .d { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.datechip .y { display: block; font-size: .63rem; color: var(--ink-faint); letter-spacing: .05em; }
.datechip.past { background: var(--line-soft); color: var(--ink-faint); }

.event-card h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
.event-meta { font-size: .84rem; color: var(--ink-faint); margin: 0; }
.event-card p.summary { margin: 0; padding: 0 1.15rem 1.05rem; color: var(--ink-soft); font-size: .94rem; }
.event-card-foot {
  margin-top: auto; padding: .7rem 1.15rem; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  font-size: .85rem; color: var(--ink-faint);
}
.helpwanted { color: var(--accent); font-weight: 600; }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; padding: .22rem .55rem; border-radius: 999px;
  background: var(--gold-tint); color: color-mix(in srgb, var(--gold) 75%, var(--ink));
}
.tag.planned { background: var(--line-soft); color: var(--ink-faint); }
.tag.cancelled { background: var(--accent-tint); color: var(--accent); }

/* Event types get their own colour, so the kind of thing an event is reads at
   a glance without another line of text. */
.tag[data-cat="fair"]        { background: var(--accent-tint); color: var(--accent); }
.tag[data-cat="children"]    { background: var(--sky-tint);    color: var(--sky); }
.tag[data-cat="adults-only"] { background: var(--brand-tint);  color: var(--brand); }
.tag[data-cat="collection"]  { background: var(--leaf-tint);   color: var(--leaf); }
.tag[data-cat="sponsored"]   { background: var(--leaf-tint);   color: var(--leaf); }

/* ---------- calendar ---------- */

.cal-bar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.cal-bar h2 { margin: 0; font-size: 1.4rem; min-width: 8.5ch; }
.cal-nav { display: flex; gap: .35rem; }
.iconbtn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--radius-s); cursor: pointer; font: inherit; font-size: 1rem;
}
.iconbtn:hover { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-dark); }
.viewswitch { margin-left: auto; display: flex; gap: .3rem; background: var(--line-soft); padding: .25rem; border-radius: 999px; }
.viewswitch button {
  border: 0; background: none; font: inherit; font-size: .87rem; font-weight: 600;
  padding: .4rem .85rem; border-radius: 999px; cursor: pointer; color: var(--ink-soft);
}
.viewswitch button[aria-pressed="true"] { background: var(--card); color: var(--brand-dark); box-shadow: var(--shadow); }

.cal {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.cal-head, .cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head div {
  padding: .6rem .3rem; text-align: center; font-size: .74rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.cal-cell {
  min-height: 104px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: .35rem .4rem; display: flex; flex-direction: column; gap: .2rem;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: color-mix(in srgb, var(--line-soft) 45%, transparent); }
.cal-cell.today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-num {
  align-self: flex-start; font-size: .8rem; font-weight: 600; color: var(--ink-faint);
  min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px;
}
.cal-cell.out .cal-num { opacity: .45; }
.cal-ev {
  display: block; font-size: .76rem; line-height: 1.25; text-decoration: none;
  background: var(--brand-tint); color: var(--brand-dark);
  padding: .22rem .38rem; border-radius: 5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis;
}
.cal-ev:hover { background: var(--brand); color: var(--on-brand); }
.cal-ev.accent { background: var(--accent-tint); color: var(--accent); }
.cal-ev.accent:hover { background: var(--accent); color: var(--on-accent); }

@media (max-width: 720px) {
  .cal-cell { min-height: 62px; padding: .25rem; }
  .cal-ev { font-size: 0; padding: 0; height: 7px; border-radius: 4px; }
  .cal-head div { font-size: .65rem; }
}

.agenda { display: grid; gap: .5rem; }
.agenda-row {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 1rem; align-items: center;
  padding: .85rem 1rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-s); text-decoration: none; color: inherit;
}
.agenda-row:hover { border-color: var(--brand); background: var(--brand-tint); color: inherit; }
.agenda-date { font-size: .82rem; font-weight: 700; color: var(--brand); letter-spacing: .02em; }
.agenda-title { font-weight: 600; }
.agenda-sub { font-size: .84rem; color: var(--ink-faint); }
@media (max-width: 620px) {
  .agenda-row { grid-template-columns: 1fr; gap: .25rem; }
  .agenda-row .tag { justify-self: start; }
}

.month-sep {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--ink-faint);
  margin: 1.2rem 0 .1rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line);
}
.month-sep:first-child { margin-top: 0; }

/* ---------- event detail ---------- */

.crumb { font-size: .87rem; color: var(--ink-faint); margin: 1.5rem 0 .8rem; }
.crumb a { color: var(--ink-soft); }

.event-hero { display: grid; gap: 1.4rem; margin-bottom: 2rem; }
.event-hero .tag { align-self: start; }
.event-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .1rem;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.fact { background: var(--card); padding: .9rem 1.1rem; }
.fact dt { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .2rem; }
.fact dd { margin: 0; font-weight: 500; }

.prose { font-size: 1.03rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul { padding-left: 1.15rem; }
.prose li { margin-bottom: .35rem; }
.prose strong { font-weight: 650; }

.layout-2col { display: grid; grid-template-columns: 1fr 340px; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; position: sticky; top: 84px;
}
.panel h3 { margin-top: 0; font-size: 1.1rem; }
@media (max-width: 900px) { .panel { position: static; } }

.slot-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.slot {
  display: flex; gap: .7rem; align-items: baseline;
  padding: .6rem .75rem; border: 1px solid var(--line-soft); border-radius: var(--radius-s);
  background: var(--paper);
}
.slot-count {
  flex: none; font-weight: 700; font-size: .82rem; color: var(--accent);
  background: var(--accent-tint); border-radius: 999px; padding: .1rem .5rem;
}
.slot-role { font-weight: 600; font-size: .93rem; }
.slot-note { font-size: .83rem; color: var(--ink-faint); }

/* ---------- gallery ---------- */

.album { margin-bottom: 2.4rem; }
.photo-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.photo {
  aspect-ratio: 4/3; border-radius: var(--radius-s); overflow: hidden; border: 0; padding: 0;
  background: var(--brand-tint); cursor: pointer; position: relative; display: block;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption {
  position: absolute; inset: auto 0 0 0; padding: 1.6rem .6rem .5rem;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff; font-size: .8rem; text-align: left;
}
.photo-empty { display: grid; place-items: center; color: var(--brand); font-size: .8rem; padding: .5rem; text-align: center; }

.lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(10,16,15,.9);
  display: grid; place-items: center; padding: 1.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 84vh; width: auto; border-radius: var(--radius-s); }
.lightbox figcaption { color: #fff; text-align: center; margin-top: .8rem; font-size: .92rem; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem; background: rgba(255,255,255,.15); color: #fff;
  border: 0; width: 42px; height: 42px; border-radius: 999px; font-size: 1.2rem; cursor: pointer;
}

/* ---------- misc blocks ---------- */

.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.tile h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .94rem; }

.people { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.person { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.person .role { font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }
.person .name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: .15rem 0 .25rem; }
.person .name.vacant { color: var(--accent); }
.person .note { font-size: .88rem; color: var(--ink-soft); margin: 0; }

.callout {
  background: var(--callout-bg); color: var(--callout-fg); border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 2.6rem); text-align: center;
}
.callout h2 { color: #fff; }
.callout p { color: color-mix(in srgb, var(--callout-fg) 84%, transparent); max-width: 56ch; margin-inline: auto; }
.callout .btn-accent { margin-top: .6rem; }

.notice {
  border-left: 3px solid var(--gold); background: var(--gold-tint);
  color: color-mix(in srgb, var(--ink) 88%, var(--gold));
  padding: .9rem 1.1rem; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: .92rem;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--line);
  background: var(--card); padding: 2.4rem 0 2rem;
  font-size: .92rem; color: var(--ink-soft);
}
.footer-grid { display: grid; gap: 1.8rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer-legal { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line-soft); font-size: .82rem; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- states ---------- */

.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-faint); }
.loading { text-align: center; padding: 4rem 1rem; color: var(--ink-faint); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .hero-actions, .nav-toggle { display: none; }
  body { background: #fff; }
}
