/* ==========================================================================
   Phelezela — site.css
   Design system: warm paper canvas, Phelezela marigold, jersey-trim stripes.
   Palette and type are derived from the organisation's own flyers and logo.
   ========================================================================== */

/* ---- Fonts (self-hosted variable fonts) --------------------------------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/BricolageGrotesque-var.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('../fonts/Figtree-var.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --orange: #F7941D;   /* Phelezela marigold — brand anchor */
  --ember:  #D96C0B;   /* deeper orange for hover / knit gradation */
  --ink:    #2B2118;   /* warm near-black */
  --paper:  #FFFDF8;   /* near-white warm canvas */
  --wool:   #F6EFE3;   /* soft neutral for cards / alternate sections */
  --fairway:#76A928;   /* golf lime — Golf Day & Gallery pages only */
  --tee:    #F0F6E3;   /* pale fairway tint */
  --pine:   #3A5A14;   /* deep green, text on tee */
  --muted:  #6E6155;   /* secondary text on paper */
  --line:   #E8DFD2;   /* hairline borders on paper */

  --font-display: 'Bricolage Grotesque', 'Arial Black', 'Arial', sans-serif;
  --font-body: 'Figtree', system-ui, 'Segoe UI', Arial, sans-serif;
}

/* ---- Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0 0 .5em; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  color: var(--ink); background: var(--orange);
  padding: .8rem 1.5rem; border: 2px solid var(--ink); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); background: #FBA53B; }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--wool); box-shadow: none; transform: none; }
.btn-fairway { background: var(--fairway); }
.btn-fairway:hover { background: #85BC33; }

/* ---- Header (ink bar with jersey-trim stripe) ------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: var(--paper);
}
.site-header::after {
  content: ''; display: block; height: 12px;
  background: linear-gradient(to bottom, var(--orange) 0 7px, var(--paper) 7px 9px, var(--ink) 9px 12px);
}
.site-header :focus-visible { outline-color: var(--orange); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 108px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; margin-right: auto; }
.brand img { width: 88px; height: 81px; }
.brand-name {
  font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: .02em;
  display: block; line-height: 1; color: var(--paper);
}
.brand-sub { display: block; font-size: .78rem; color: var(--orange); letter-spacing: .08em; text-transform: uppercase; margin-top: .25rem; }

.nav-toggle {
  display: none;
  background: none; border: 2px solid var(--paper); border-radius: 8px;
  padding: .45rem .6rem; font: inherit; font-weight: 700; cursor: pointer; color: var(--paper);
}
.site-nav ul { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .55rem .8rem; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .97rem; color: var(--paper);
}
.site-nav a:hover { background: rgba(255, 253, 248, .14); }
.site-nav a[aria-current="page"]:not(.btn) {
  color: var(--orange);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}
.site-nav .nav-cta { margin-left: .5rem; }
.site-nav a.btn { padding: .55rem 1.1rem; box-shadow: none; border-color: var(--ink); color: var(--ink); }
.site-nav a.btn:hover { transform: none; background: #FBA53B; }
.site-nav a.btn[aria-current="page"] { background: var(--ember); color: var(--ink); }

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); box-shadow: 0 14px 30px rgba(43, 33, 24, .35); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: .8rem 1.2rem 1.2rem; gap: .15rem; }
  .site-nav a { padding: .8rem .9rem; border-radius: 12px; }
  .site-nav a[aria-current="page"]:not(.btn) { text-underline-offset: 6px; }
  .site-nav .nav-cta { margin: .5rem 0 0; }
}

/* ---- Hero ------------------------------------------------------------------ */
.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero-split { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 820px) { .hero-split { grid-template-columns: 1fr; } }
.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ember); margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 800; font-stretch: 87%;
  max-width: 14ch; margin-bottom: .4em;
}
.hero h1 em { font-style: normal; color: var(--ember); }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 56ch; }
.lede strong { color: var(--ink); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.8rem; }

/* ---- Trim band (section divider — the double stripe of a jersey's collar) --- */
.trim-band {
  height: 12px;
  background: linear-gradient(to bottom, var(--orange) 0 7px, transparent 7px 9px, var(--ink) 9px 12px);
}
.trim-band-fairway {
  background: linear-gradient(to bottom, var(--fairway) 0 7px, transparent 7px 9px, var(--ink) 9px 12px);
}

/* ---- Archive photos (small B&W originals, framed at near-native size) ------- */
.archive-photo { margin: 0; justify-self: center; }
.archive-photo img {
  width: 100%; max-width: 410px;
  border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: 10px 10px 0 var(--orange);
  background: var(--ink);
  filter: grayscale(1) contrast(1.06);
}
.archive-photo figcaption {
  font-size: .85rem; color: var(--muted); padding-top: 1rem; max-width: 410px;
}
/* colour variant for modern, high-resolution photos */
.archive-photo-color img { filter: none; max-width: 560px; }
.archive-photo-color figcaption { max-width: 560px; }
.archive-photo-color figcaption a { color: var(--ember); font-weight: 600; }

/* ---- Sections --------------------------------------------------------------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-wool { background: var(--wool); }
.section-tee { background: var(--tee); color: var(--pine); }
.section-tee .eyebrow { color: var(--pine); }
.section-ink { background: var(--ink); color: var(--paper); }
.section-ink .eyebrow { color: var(--orange); }
.section h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; max-width: 22ch; }
.section-lead { color: var(--muted); max-width: 60ch; font-size: 1.12rem; }
.section-ink .section-lead, .section-tee .section-lead { color: inherit; opacity: .85; }

/* ---- Cards -------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 2.2rem; }
.card {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 16px;
  padding: 1.6rem 1.5rem 1.4rem; box-shadow: 4px 4px 0 var(--line);
  display: flex; flex-direction: column;
}
.card h3 { font-size: 1.35rem; font-weight: 700; }
.card p { color: var(--muted); font-size: .98rem; flex-grow: 1; }
.card .card-link { font-weight: 700; text-decoration: none; color: var(--ember); }
.card .card-link:hover { text-decoration: underline; }
.card-badge {
  align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--wool); border-radius: 999px; padding: .25rem .7rem; margin-bottom: .9rem;
}

/* ---- Impact counter + stats ------------------------------------------------------ */
.impact-center { text-align: center; }
.impact-center h2 { margin-inline: auto; }
.big-count {
  font-family: var(--font-display); font-weight: 800; font-stretch: 80%;
  font-size: clamp(4rem, 13vw, 9rem); line-height: 1; color: var(--ember);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  display: block; margin: 1.5rem 0 .4rem;
}
.big-count-label { font-size: 1.05rem; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-top: 2.6rem; }
.stat { border-top: 3px solid var(--orange); padding-top: .8rem; text-align: left; }
.stat b { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; display: block; }
.stat span { color: var(--muted); font-size: .92rem; }

/* ---- Impact chart --------------------------------------------------------- */
.impact-chart { margin-top: 2.4rem; display: grid; gap: 6px; }
.impact-row { display: grid; grid-template-columns: 3.4em 1fr 4.5em; align-items: center; gap: .8rem; }
.impact-row .year { font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; }
.impact-row .value { font-size: .92rem; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.impact-bar-track { height: 22px; }
.impact-bar {
  height: 100%; border-radius: 4px; min-width: 8px;
  background: linear-gradient(to right, var(--ember), var(--orange) 60%);
  border: 1.5px solid var(--ink);
  transform-origin: left center;
}
.impact-row-target .impact-bar {
  background: transparent; border: 2px dashed var(--ember);
}
.impact-row-target .year, .impact-row-target .value { color: var(--ember); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .impact-chart.animate .impact-bar { animation: knit-in .7s cubic-bezier(.2, .7, .3, 1) backwards; }
  @keyframes knit-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* data table kept as source of truth */
.data-details { margin-top: 1.6rem; }
.data-details summary { font-weight: 700; cursor: pointer; color: var(--ember); }
table.data { border-collapse: collapse; margin-top: 1rem; width: 100%; max-width: 560px; }
table.data caption { text-align: left; font-weight: 700; padding-bottom: .6rem; }
table.data th, table.data td { text-align: left; padding: .45rem .8rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.data td:last-child, table.data th:last-child { text-align: right; }
table.data tfoot th, table.data tfoot td { font-weight: 800; border-top: 3px solid var(--ink); border-bottom: none; }

/* ---- Golf banner / golf facts ------------------------------------------------------ */
.facts { list-style: none; margin: 1.6rem 0; padding: 0; display: grid; gap: .6rem; max-width: 520px; }
.facts li { display: grid; grid-template-columns: 7.5em 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid rgba(58, 90, 20, .18); }
.facts .fact-label { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; align-self: center; }
.facts .fact-value { font-weight: 600; }
.section-golf-split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center; }
@media (max-width: 820px) {
  .section-golf-split { grid-template-columns: 1fr; }
  .section-golf-split .poster-frame { margin-inline: auto; }
}
.poster-frame {
  border: 3px solid var(--ink); border-radius: 14px; overflow: hidden;
  box-shadow: 8px 8px 0 var(--fairway); background: #fff; max-width: 420px;
}

/* ---- Support / donate --------------------------------------------------------------- */
.bank-card {
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 16px; padding: 1.6rem 1.7rem;
  max-width: 480px; box-shadow: 5px 5px 0 var(--orange);
}
.bank-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.2rem; }
.bank-card dt { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); align-self: center; }
.bank-card dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.section-ink a { color: var(--orange); }
.section-ink .btn { color: var(--ink); }

/* ---- Interior pages ------------------------------------------------------------------- */
.page-hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); }
.page-hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 800; font-stretch: 87%; max-width: 18ch; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.7rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.8em; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose a { color: var(--ember); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* committee table */
table.committee { border-collapse: collapse; width: 100%; max-width: 560px; }
table.committee th, table.committee td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
table.committee th { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---- Forms -------------------------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; max-width: 560px; margin-top: 1.5rem; }
.form-row { display: grid; gap: .35rem; }
.form label { font-weight: 700; font-size: .95rem; }
.form input, .form textarea, .form select {
  font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 10px; padding: .7rem .9rem; width: 100%;
}
.form input:focus-visible, .form textarea:focus-visible { outline-offset: 1px; }
.form .hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.form .hp { position: absolute; left: -9999px; height: 1px; overflow: hidden; }
.form-note { font-size: .9rem; color: var(--muted); max-width: 56ch; }
.form-status { padding: .8rem 1.1rem; border-radius: 10px; font-weight: 600; margin: 0; }
.form-status-ok { background: #EAF3DC; color: var(--pine); border: 2px solid var(--fairway); }
.form-status-err { background: #FAE7DC; color: #8B3A0F; border: 2px solid var(--ember); }

/* ---- Gallery --------------------------------------------------------------------------------- */
.gallery-note {
  max-width: 56ch; margin-top: 1.6rem;
  background: var(--wool); border-left: 4px solid var(--orange); border-radius: 0 10px 10px 0;
  padding: .9rem 1.2rem; font-size: .95rem; color: var(--muted);
}

.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter-bar button {
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 999px; padding: .45rem 1.1rem;
}
.filter-bar button:hover { background: var(--wool); }
.filter-bar button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.album-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.album-card {
  display: block; text-decoration: none;
  border: 2px solid var(--ink); border-radius: 16px; overflow: hidden;
  background: var(--paper); box-shadow: 4px 4px 0 var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.album-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--orange); }
.album-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: 2px solid var(--ink); }
.album-card-body { padding: 1rem 1.2rem 1.1rem; }
.album-card h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 .25rem; }
.album-card-meta { color: var(--muted); font-size: .9rem; margin: 0; }

.back-link {
  display: inline-block; margin-bottom: 1.5rem;
  font-weight: 700; color: var(--ember); text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.album { margin-top: 0; }
.album h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.album-meta { color: var(--muted); margin-top: -0.4rem; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; margin-top: 1.4rem; }
.thumb {
  padding: 0; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden;
  cursor: zoom-in; background: var(--wool); display: block; width: 100%;
}
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s ease; }
.thumb:hover img { transform: scale(1.04); }

.lightbox { border: none; border-radius: 14px; padding: 0; background: var(--ink); max-width: min(92vw, 1100px); }
.lightbox::backdrop { background: rgba(26, 18, 11, .85); }
.lightbox figure { margin: 0; }
.lightbox img { max-height: 78vh; width: auto; max-width: 100%; margin-inline: auto; }
.lightbox figcaption { color: var(--paper); font-size: .95rem; padding: .8rem 1.2rem; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem 1rem; }
.lightbox-bar button {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--paper); color: var(--ink); border: none; border-radius: 999px; padding: .45rem 1rem;
}
.lightbox-bar button:hover { background: var(--orange); }

/* ---- Footer -------------------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--paper); margin-top: 0; }
.footer-trim { height: 12px; background: linear-gradient(to bottom, var(--orange) 0 7px, transparent 7px 9px, var(--wool) 9px 12px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding-block: 3rem 2rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.site-footer h3 { font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.site-footer p, .site-footer li { font-size: .95rem; opacity: .92; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--orange); }
.footer-bottom { border-top: 1px solid rgba(255, 253, 248, .18); padding-block: 1.1rem; font-size: .85rem; opacity: .75; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }
.footer-bottom p { margin: 0; }

/* ---- Utilities -------------------------------------------------------------------------------------- */
.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.center .btn { margin-top: 1rem; }

/* ---- Responsive refinements --------------------------------------------------------------------------
   Base styles target ~880–1400px. Below: tablet/phone adjustments; at the
   bottom: comfortable scaling for large monitors. */

/* small tablets / large phones */
@media (max-width: 640px) {
  .header-inner { min-height: 76px; padding-block: 8px; }
  .brand img { width: 54px; height: 50px; }
  .brand-name { font-size: 1.15rem; }
  .brand-sub { font-size: .64rem; }

  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 1.2rem 1rem; }
  .facts li { grid-template-columns: 6em 1fr; gap: .6rem; }
  .impact-row { grid-template-columns: 2.9em 1fr 3.9em; gap: .5rem; }
  .impact-row .year, .impact-row .value { font-size: .82rem; }
  .impact-bar-track { height: 18px; }

  .card { padding: 1.3rem 1.2rem 1.1rem; }
  .bank-card { padding: 1.3rem 1.2rem; }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* phones */
@media (max-width: 480px) {
  .wrap { padding-inline: 18px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { text-align: center; }
  .archive-photo img, .archive-photo figcaption { max-width: 100%; }
  .poster-frame { box-shadow: 6px 6px 0 var(--fairway); }
  .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .7rem; }
  .lightbox-bar button { padding: .45rem .8rem; font-size: .9rem; }
  .bank-card dl { grid-template-columns: 1fr; gap: 0 0; }
  .bank-card dt { margin-top: .7rem; }
  .bank-card dt:first-of-type { margin-top: 0; }
}

/* widescreen monitors — let the layout breathe and the type grow slightly */
@media (min-width: 1560px) {
  .wrap { max-width: 1240px; }
}
@media (min-width: 1920px) {
  html { font-size: 17.5px; }
  .wrap { max-width: 1340px; }
}

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