/*
Theme Name: Elevating Voices
Theme URI: https://elevatingvoicescic.org.uk
Author: Elevating Voices CIC
Description: A lightweight, accessibility-first theme for Elevating Voices CIC. Layout structure follows a full-bleed hero, statement band, about, work grid and contact footer pattern.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: elevating-voices
*/

/* ---------------------------------------------------------
   1. Fonts
   Drop the .woff2 files into /fonts/ and these will load.
   If the files are missing, the fallback stack takes over.
   Atkinson Hyperlegible: designed by the Braille Institute
   for maximum character distinction. Bricolage Grotesque:
   variable display face.
   --------------------------------------------------------- */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/BricolageGrotesque-Variable.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------
   2. Design tokens
   --------------------------------------------------------- */
:root {
  --ink:        #14232b;   /* deep slate — body text, dark sections */
  --ink-soft:   #3d5460;   /* secondary text */
  --sea:        #1f6f6a;   /* petrol green — primary brand */
  --sea-deep:   #14504c;   /* hover state */
  --gold:       #e8b33c;   /* signal colour — CTAs, voice bars */
  --paper:      #f4f6f5;   /* cool off-white page background */
  --mist:       #dce5e2;   /* card + divider tone */
  --white:      #ffffff;

  --font-display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body:    "Atkinson Hyperlegible", "Verdana", "Segoe UI", sans-serif;

  --measure: 62ch;         /* max line length for readability */
  --wrap: 1180px;
  --gap: clamp(1.5rem, 4vw, 3.5rem);
  --section-y: clamp(3.5rem, 9vw, 7rem);
  --radius: 4px;
}

/* ---------------------------------------------------------
   3. Base
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.7;          /* generous leading aids tracking */
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1.25em; max-width: var(--measure); }

a { color: var(--sea-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* Visible keyboard focus everywhere — non-negotiable */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--white);
  padding: 0.75rem 1.25rem; z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section--dark { background: var(--ink); color: var(--paper); }
.section--dark a { color: var(--gold); }
.section--sea { background: var(--sea); color: var(--white); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sea);
  margin: 0 0 1rem;
}
.section--dark .eyebrow, .section--sea .eyebrow { color: var(--gold); }

/* ---------------------------------------------------------
   4. Signature: the voice bars
   Five rising bars — the name made literal. Static by
   default, they lift on hover, and stay still if the
   visitor has asked for reduced motion.
   --------------------------------------------------------- */
.voicebars { display: flex; align-items: flex-end; gap: 4px; height: 26px; margin-bottom: 1.25rem; }
.voicebars span {
  display: block; width: 6px; background: var(--gold);
  transition: height 240ms ease;
}
.voicebars span:nth-child(1) { height: 40%; }
.voicebars span:nth-child(2) { height: 70%; }
.voicebars span:nth-child(3) { height: 100%; }
.voicebars span:nth-child(4) { height: 60%; }
.voicebars span:nth-child(5) { height: 85%; }
.voicebars--sea span { background: var(--sea); }
.card:hover .voicebars span:nth-child(1),
.section:hover > .wrap > .voicebars span:nth-child(1) { height: 70%; }
.card:hover .voicebars span:nth-child(4) { height: 100%; }

/* ---------------------------------------------------------
   5. Header + navigation
   --------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 35, 43, 0.96);
  backdrop-filter: blur(6px);
  color: var(--white);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.9rem;
}
.site-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--white); text-decoration: none; letter-spacing: -0.01em; }
.site-brand img { max-height: 52px; width: auto; }

.nav-toggle {
  display: none; background: none; border: 2px solid rgba(255,255,255,0.35);
  color: var(--white); font-family: var(--font-body); font-size: 0.95rem;
  padding: 0.5rem 0.9rem; border-radius: var(--radius); cursor: pointer;
}

.main-nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a {
  color: var(--white); text-decoration: none; font-size: 0.95rem;
  padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav .current-menu-item > a { border-bottom-color: var(--gold); color: var(--white); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.is-open { display: block; }
  .site-header__inner { flex-wrap: wrap; }
  .main-nav ul { flex-direction: column; gap: 0; padding-bottom: 0.75rem; }
  .main-nav li { border-top: 1px solid rgba(255,255,255,0.15); }
  .main-nav a { display: block; padding: 0.85rem 0; }
}

/* ---------------------------------------------------------
   6. Hero
   No autoplay, no carousel. One still statement.
   --------------------------------------------------------- */
.hero {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.32; }
.hero__inner {
  position: relative;
  padding-block: clamp(4.5rem, 13vw, 9rem);
}
.hero h1 { max-width: 20ch; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero__sub { max-width: 56ch; font-size: clamp(1.05rem, 1.1vw + 0.8rem, 1.3rem); color: #dbe4e2; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.btn {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 1rem; padding: 0.9rem 1.6rem; border-radius: var(--radius);
  text-decoration: none; border: 2px solid transparent; transition: background 160ms ease, color 160ms ease;
}
.btn--primary { background: var(--gold); color: var(--ink); }
.btn--primary:hover { background: var(--white); color: var(--ink); }
.btn--ghost { border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--ink); }
.btn--sea { background: var(--sea); color: var(--white); }
.btn--sea:hover { background: var(--sea-deep); color: var(--white); }

/* ---------------------------------------------------------
   7. Statement band
   --------------------------------------------------------- */
.statement p {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.25; max-width: 30ch; margin: 0;
}
.statement__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 800px) { .statement__grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------
   8. Cards + grids
   --------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; font-size: 1rem; color: var(--ink-soft); }
.section--dark .card { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.16); }
.section--dark .card p { color: #c9d5d2; }

/* Film / work tiles */
.tile { display: block; text-decoration: none; color: inherit; }
.tile__thumb {
  aspect-ratio: 16 / 9; background: var(--mist);
  overflow: hidden; border-radius: var(--radius); margin-bottom: 0.9rem;
}
.tile__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.tile:hover .tile__thumb img { transform: scale(1.04); }
.tile h3 { margin-bottom: 0.35rem; }
.tile__meta { font-size: 0.9rem; color: var(--ink-soft); }
.section--dark .tile__meta { color: #b9c7c4; }

/* ---------------------------------------------------------
   9. Content pages + posts
   --------------------------------------------------------- */
.page-hero { background: var(--sea); color: var(--white); padding-block: clamp(3rem, 7vw, 5rem); }
.page-hero h1 { margin-bottom: 0.25rem; }
.page-hero p { color: rgba(255,255,255,0.9); max-width: 55ch; margin: 0; }

.entry-content ul, .entry-content ol { max-width: var(--measure); padding-left: 1.25rem; }
.entry-content li { margin-bottom: 0.5rem; }
.entry-content blockquote {
  border-left: 4px solid var(--gold); margin: 2rem 0; padding: 0.25rem 0 0.25rem 1.5rem;
  font-family: var(--font-display); font-size: 1.25rem;
}

.post-list { display: grid; gap: var(--gap); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .post-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .post-list { grid-template-columns: 1fr; } }

.video-embed { position: relative; aspect-ratio: 16 / 9; margin-bottom: 2rem; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pagination { margin-top: 3rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: 0.5rem 0.9rem; border: 1px solid var(--mist); background: var(--white); text-decoration: none; border-radius: var(--radius); }
.pagination .current { background: var(--sea); color: var(--white); border-color: var(--sea); }

/* ---------------------------------------------------------
   10. Footer
   --------------------------------------------------------- */
.site-footer { background: var(--ink); color: #c9d5d2; padding-block: var(--section-y) 2rem; }
.site-footer h2 { color: var(--white); }
.site-footer h3 { color: var(--white); font-size: 1.05rem; margin-bottom: 0.35rem; }
.site-footer a { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.9rem; }
.footer-legal p { margin: 0; max-width: none; }

/* ---------------------------------------------------------
   11. Reduced motion
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .tile:hover .tile__thumb img { transform: none; }
}
