/* Tech for Good Organisers Network: the site's only stylesheet.
 *
 * The design is Ed's confirmed set (2026-11-28): mark I8, the neon palette and
 * Outfit, on a dark page throughout (Ed's second design pass, 2026-11-28).
 * Each part is defined once, here:
 *   - colours: the four neon colours and the dark page's roles, in :root;
 *   - the typeface: the @font-face rules and --font;
 *   - the mark: docs/img/mark.svg (the 16 px icon is docs/img/mark-small.svg).
 *
 * Neon on the dark page: yellow, green and blue may carry text; pink only large
 * text or shapes. Words are white or light ink; links are neon blue, underlined.
 */

@font-face { /* the statement's three actions only (Ed, 2026-11-30); SIL OFL, fonts/OFL-instrument-serif.txt */
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/outfit-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/outfit-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Latin Extended (for example Welsh ŵ and ŷ): fetched only when the page uses those letters. */
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/outfit-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/outfit-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Neon: the mark's four colours. On the dark page, yellow, green and blue
     may carry text; pink only large text or shapes (4.17:1 on ink). */
  --pink: #FF2E88;
  --yellow: #FFE41F;
  --green: #22F2A0;
  --blue: #1EBEFF;

  /* The dark page. */
  --ink: #1E2A36;          /* page background, and words on neon yellow */
  --raised: #283849;       /* panels and cards */
  --sunken: #17212B;       /* form fields */
  --line: #3E5064;         /* borders and dividers */
  --text: #FFFFFF;         /* body text: 14.59:1 on ink, 11.99:1 on raised */
  --text-soft: #C9D3DD;    /* secondary text: 9.62:1 on ink, 7.90:1 on raised */
  --link: var(--blue);     /* links, underlined: 6.85:1 on ink, 5.63:1 on raised */
  --focus: var(--yellow);

  /* The directory map's community circles. */
  --circle: #000000;
  --circle-edge: #C9D3DD;

  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  /* One left text edge per list (Ed, 2026-11-29): every box in a list has the
     same leading chevron slot, left empty where a box has no chevron. */
  --box-x: 1rem;      /* a box's left padding */
  --chev-w: 1.4rem;   /* the chevron slot (events and directory) */
  --wrap: 52rem; /* one column for everything below the mosaic (Ed, 2026-11-30) */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* a folded section stays folded, whatever its layout */

html { scroll-behavior: smooth; background: var(--ink); color-scheme: dark; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { line-height: 1.25; }
h3 { font-size: 1.15rem; margin: 1.6em 0 0.5em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link { position: absolute; left: 16px; top: -100px; background: var(--yellow); color: var(--ink); padding: 0.5em 1em; z-index: 10; }
.skip-link:focus { top: 8px; }

/* A visible marker for words Ed still has to supply: ink on neon yellow (11.37:1). */
.placeholder {
  background: var(--yellow);
  color: var(--ink);
  border: 1px dashed var(--ink);
  padding: 0 0.3em;
  font-weight: 700;
}

.tbc, .loading { color: var(--text-soft); }

/* The opening mosaic (Ed, 2026-11-30: "recompose the collage/statement/logo
   holistically"; no photo much larger than another). The statement and the
   mark sit in the middle; seven photo tiles of similar size around it. The
   mosaic is contained (not full bleed), with the same rounded corners as the
   boxes below. Each photo is cropped by object-fit and a focal point. */

.collage { padding: clamp(12px, 2vw, 24px) 16px 0; }
.collage-grid {
  max-width: 76rem; margin: 0 auto;
  display: grid; gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(15rem, auto) minmax(15rem, auto) 15rem;
}
.tile { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--sunken); min-height: 0; }
.tile > .collage-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.collage-statement {
  grid-column: 2 / span 2; grid-row: 1 / span 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.5rem, 3vw, 2.75rem) clamp(1.25rem, 3vw, 2.75rem);
}
.statement-inner { width: 100%; max-width: 32rem; margin: 0 auto; } /* centred in its tile (Ed, 2026-11-30) */
.statement-mark { display: block; width: auto; height: clamp(44px, 5vw, 72px); margin: 0 auto; } /* centred; js/site.js sizes it to the first line (Ed, 2026-11-30) */

.tile-tyne           { grid-column: 1; grid-row: 1; }
.tile-dinner         { grid-column: 1; grid-row: 2; }
.tile-studio         { grid-column: 4; grid-row: 1; }
.tile-table          { grid-column: 4; grid-row: 2; }
.tile-street         { grid-column: 1; grid-row: 3; }
.tile-library        { grid-column: 2 / span 2; grid-row: 3; }
.tile-thirdsectorlab { grid-column: 4; grid-row: 3; }
.photo-tyne    { object-position: 52% 45%; transform: scale(1.25); transform-origin: 55% 40%; } /* zoomed into the group: no trousers (Ed, 48 a) */
.photo-dinner  { object-position: 40% 58%; }
.photo-studio  { object-position: 50% 45%; }
.photo-table   { object-position: 42% 50%; }
.photo-street  { object-position: 42% 48%; }
.photo-library { object-position: 50% 15%; } /* heads near the top: crop from the feet */
.photo-thirdsectorlab { object-position: 42% 48%; }

@media (max-width: 52rem) {
  /* Narrower: the statement across the top, then the photos three across. */
  .collage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto repeat(2, 28vw) 26vw; }
  .collage-statement { grid-column: 1 / span 3; grid-row: 1; }
  .tile-tyne { grid-column: 1; grid-row: 2; } .tile-studio { grid-column: 2; grid-row: 2; } .tile-dinner { grid-column: 3; grid-row: 2; }
  .tile-table { grid-column: 1; grid-row: 3; } .tile-street { grid-column: 2; grid-row: 3; } .tile-thirdsectorlab { grid-column: 3; grid-row: 3; }
  .tile-library { grid-column: 1 / span 3; grid-row: 4; }
}
@media (max-width: 40rem) {
  /* A phone: the statement first, then the photos two across, the wide one last. */
  .collage { padding: 0 16px; }
  .collage-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto repeat(4, 40vw); gap: 6px; }
  .collage-statement { grid-column: 1 / span 2; padding: 2.25rem 0 1.75rem; }
  .tile-tyne { grid-column: 1; grid-row: 2; } .tile-studio { grid-column: 2; grid-row: 2; }
  .tile-dinner { grid-column: 1; grid-row: 3; } .tile-table { grid-column: 2; grid-row: 3; }
  .tile-street { grid-column: 1; grid-row: 4; } .tile-thirdsectorlab { grid-column: 2; grid-row: 4; }
  .tile-library { grid-column: 1 / span 2; grid-row: 5; }
}

/* Sections and folds ---------------------------------------------------- */
/* Upcoming Events, Directory and Join are always open; the folds left are
   Past Events, each directory entry and the past communities. */

main { padding-top: 1rem; padding-bottom: 2rem; }

.section { padding: 3.5rem 0 1rem; }
.section::before { /* the four-colour bar replaces the grey rule (Ed, 2026-11-30) */
  content: ""; display: block; width: 64px; height: 6px; border-radius: 3px; margin-bottom: 1.1rem;
  background: linear-gradient(90deg, var(--pink) 0 25%, var(--yellow) 25% 50%, var(--green) 50% 75%, var(--blue) 75% 100%);
}
.section-heading { margin: 0 0 1.5rem; font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.4rem); line-height: 1.1; letter-spacing: -0.02em; }
.past-events { margin-top: 0.75rem; }
.fold-heading { margin: 0; font-size: 1.6rem; }
.fold-toggle {
  all: inherit; /* keep the heading's font */
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; padding: 1.1rem 0; cursor: pointer; color: inherit;
}
.fold-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.fold-toggle::after {
  content: ""; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 2px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) center / 0.75rem 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 0.75rem no-repeat;
}
.fold-toggle[aria-expanded="true"]::after {
  background: linear-gradient(currentColor, currentColor) center / 0.75rem 2px no-repeat;
}
#events { --accent: var(--yellow); }
#join { --accent: var(--green); }
#directory { --accent: var(--blue); }

.fold-body { padding-bottom: 2rem; }

/* "More of this list" folds (Past Events; the past communities): a button as
   wide as the list's boxes, chevron on the left, in the rows' own style,
   directly under the list it belongs to (Ed, 2026-11-29). */
.fold-heading:has(> .fold-more) { font-size: 1.05rem; }
.fold-toggle.fold-more {
  display: flex; width: 100%; box-sizing: border-box; justify-content: flex-start; gap: 0.4rem; /* as wide as the list's boxes (Ed, 2026-11-29) */
  padding: 0.6rem 1rem 0.6rem var(--box-x); background: var(--raised); border-radius: var(--radius); font-weight: 700;
}
.fold-toggle.fold-more::after { content: none; }
/* The chevron, the same on the two folds and every directory entry: a slot
   of fixed width holding a small rotated corner, ▸ closed and ▾ open. */
.fold-chevron { flex: none; display: flex; align-items: center; width: var(--chev-w); align-self: center; }
.fold-chevron::before {
  content: ""; width: 0.45rem; height: 0.45rem; margin-left: 0.1rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
[aria-expanded="true"] > .fold-chevron::before { transform: rotate(45deg) translate(-2px, -2px); }
.fold-more .fold-chevron { width: calc(var(--chev-w) - 0.4rem); } /* the gap makes up the slot */
.past-events > .fold-body, .past > .fold-body { padding: 0.75rem 0 0; }
@media (prefers-reduced-motion: reduce) { .fold-chevron::before { transition: none; } }


/* The statement of purpose: nine lines, each set to the same width by its
   size, weight and style (Ed, 2026-11-30, question 60 c): the name bold, the
   three actions in serif italic, the opening and closing clauses regular.
   js/site.js sizes each line to fit and spaces the lines so no letters
   touch; without it, the lines show at a fixed size. */
.purpose { margin: 0; }
.lockup { margin: 0; max-width: 32rem; font-size: clamp(1.5rem, 1rem + 2.2vw, 2.4rem); }
.lockup .ln { display: block; width: max-content; max-width: 100%; white-space: nowrap; }
.lockup .ln-base { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.ln-bold { font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.ln-regular { font-weight: 400; letter-spacing: -0.02em; line-height: 1; }
.ln-italic { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; line-height: 1; }

/* Events ---------------------------------------------------------------- */

.event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: 1fr; } /* one column: dates run in order (Ed, 2026-12-04) */
.event-about { margin: 0.35rem 0 0; font-weight: 400; font-size: 1rem; line-height: 1.45; color: var(--text); max-width: 42rem; }
.event { --icon: 48px; display: grid; grid-template-columns: var(--icon) minmax(0, 1fr); align-items: center; column-gap: 1rem; padding: 0.8rem 1rem 0.8rem var(--box-x); background: var(--raised); border-radius: var(--radius); }
.event-icon { width: var(--icon); height: var(--icon); }
.event-icon img { display: block; width: var(--icon); height: var(--icon); }
.event-text { display: grid; grid-template-columns: 1fr; gap: 0.2rem; min-width: 0; }
@media (max-width: 40rem) { .event { --icon: 40px; column-gap: 0.85rem; } }
.event-upcoming { box-shadow: inset 6px 0 0 var(--yellow); } /* inside the box, so the text edge stays put */
.event-upcoming .event-date { color: var(--yellow); }
.event-date { font-weight: 700; }
.event-title { margin: 0; font-size: 1.05rem; }

/* Join ------------------------------------------------------------------ */

.apply { margin: 0; } /* no panel; the full column (Ed, 2026-11-30) */
.apply h3 { margin-top: 0; }
.field { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 700; padding: 0; }
.hint { display: block; color: var(--text-soft); font-size: 0.95rem; }
.apply input[type="text"], .apply input[type="email"], .apply textarea { /* the postcode is a text input too */
  width: 100%; margin-top: 0.35rem; padding: 0.6rem 0.7rem;
  font: inherit; color: var(--text); background: var(--sunken);
  border: 2px solid var(--text-soft); border-radius: 6px;
}
.apply textarea { display: block; resize: vertical; min-height: 5.5rem; line-height: 1.5; }
.apply input::placeholder, .apply textarea::placeholder { color: var(--text-soft); opacity: 1; }
.apply [aria-invalid="true"] { border-color: var(--yellow); border-style: dashed; }
.field-error { display: block; font-weight: 700; margin-top: 0.25rem; color: var(--yellow); }
.field-error::before { content: "! "; }
.field-check { display: flex; align-items: center; gap: 0.6rem; }
.field-check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--green); flex: none; }
.field-check label { font-weight: 700; }
.join-part > p { margin-top: 0; }


.button-primary, .button-secondary {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 6px; padding: 0.6rem 1.1rem;
}
.button-primary { background: var(--yellow); color: var(--ink); border: 2px solid var(--yellow); }
.button-secondary { background: transparent; color: var(--text); border: 2px solid var(--text-soft); }
.button-primary:hover, .button-secondary:hover { text-decoration: underline; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-status:empty { display: none; }
.form-status { margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: 6px; background: var(--sunken); border: 1px solid var(--line); }
.form-status p { margin: 0 0 0.5rem; }
.form-status p:last-child { margin-bottom: 0; }
.form-status.is-error { border-left: 8px solid var(--pink); }
.form-status.is-success { border-left: 8px solid var(--green); }

/* Directory ------------------------------------------------------------- */

.directory-layout { position: relative; display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 52rem) {
  .directory-layout { grid-template-columns: minmax(20rem, 28rem) 1fr; gap: 3rem; } /* map and list fill the column; a wider map makes leader lines cross (tested) */
}

/* The map: mark I8's low-poly UK, drawn large. */
.map { position: relative; max-width: 28rem; width: 100%; margin: 0 auto; }
.map-drawing { display: block; width: 100%; height: auto; }

/* A community: a black circle with a thin light edge, so it shows on any facet. */
.pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  background: var(--circle); border: 0;
  box-shadow: 0 0 0 2px var(--circle-edge);
  cursor: pointer; z-index: 1;
}
.pin:hover, .pin[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--circle-edge), 0 0 0 5px var(--yellow); }


/* Leader lines from each circle to its entry: desktop only, drawn by site.js. */
.leader-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; display: none; }
@media (min-width: 52rem) { .leader-lines { display: block; } }
.leader-lines line { stroke: var(--text-soft); stroke-width: 1.25; stroke-opacity: 0.7; }
.leader-lines line.is-open { stroke: var(--yellow); stroke-width: 2; stroke-opacity: 1; }
.leader-lines circle { fill: var(--text-soft); }
.leader-lines circle.is-open { fill: var(--yellow); }


.community-list, .past-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.community { background: var(--raised); border-radius: var(--radius); scroll-margin-top: 1rem; }
.community.is-open { box-shadow: inset 0 0 0 1px var(--yellow); }
.community .fold-heading { font-size: 1.1rem; }
.community .fold-toggle { padding: 0.7rem 0.9rem 0.7rem var(--box-x); justify-content: flex-start; gap: 0; }
.community .fold-toggle::after { content: none; } /* the chevron on the left replaces the + */
.community .fold-body { padding: 0 0.9rem 0.9rem calc(var(--box-x) + var(--chev-w)); }
.entry-facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; }
.entry-facts dt { font-weight: 700; }
.entry-facts dd { margin: 0; overflow-wrap: anywhere; }

.past { margin-top: 0.75rem; }
.past-item { padding: 0.8rem 1rem 0.8rem calc(var(--box-x) + var(--chev-w)); background: var(--raised); border-radius: var(--radius); }
.past-item h4 { margin: 0; font-size: 1.05rem; }
.past-item p { margin: 0.2rem 0 0; }
.past-meta { color: var(--text-soft); }


/* Footer: the mark and the name (Ed, 2026-11-30) */
.site-footer { display: flex; align-items: center; gap: 0.9rem; padding-top: 2.5rem; padding-bottom: 3rem; margin-top: 1rem; }
.site-footer::before { content: none; }
.footer-mark { width: 36px; height: auto; flex: none; }
.footer-name { font-weight: 700; font-size: 1.1rem; }
.footer-source { margin-left: auto; } /* the repository, quietly at the right (Ed, 2026-12-04) */
@media (max-width: 40rem) {
  /* on a phone, below the name, on its left edge */
  .site-footer { display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; row-gap: 0.3rem; align-items: center; }
  .footer-mark { grid-row: 1 / span 2; }
  .footer-name { align-self: end; }
  .footer-source { margin-left: 0; justify-self: start; align-self: start; }
}

/* Inactive communities: a full-width grid of compact cards (Ed, 2026-11-30) */
.past-body { padding: 1rem 0 0; }
.past-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; align-items: stretch; }
@media (max-width: 52rem) { .past-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .past-list { grid-template-columns: 1fr; } }
.past-list .past-item { padding: 0.8rem 1rem; }
.past-list .past-item h4 { font-size: 1rem; }
.past-list .past-item p { font-size: 0.92rem; overflow-wrap: anywhere; }
