/*
Theme Name:  Valueplacement
Theme URI:   https://valueplacement.co.uk
Description: Accessible, WCAG 2.1 AA compliant platform connecting FE students with employers in Berkshire.
Author:      Valueplacement
Version:     1.0.0
License:     GNU General Public License v2 or later
Text Domain: valueplacement
*/

/* ================================================================
   ACCESSIBILITY-FIRST DESIGN TOKENS
   All colour combinations meet WCAG 2.1 AA (4.5:1 minimum ratio)
   ================================================================ */
:root {
  /* Brand */
  --green:           #0a7d30; /* darkened for 4.5:1 on white */
  --green-hover:     #086527;
  --green-light:     #e6f4eb;
  --green-mid:       #c3e6cc;
  --green-on-dark:   #5dce7d; /* lighter shade for use on dark bg */

  /* Text — all pass AA on white */
  --text-primary:    #1a1a1a; /* 16:1 on white */
  --text-secondary:  #4a4a4a; /* 9.7:1 on white */
  --text-muted:      #5f5f5f; /* 7.2:1 on white */
  --text-on-green:   #ffffff;

  /* Surfaces */
  --white:           #ffffff;
  --bg-page:         #f8f9fa;
  --bg-card:         #ffffff;
  --bg-dark:         #1a2e1f;

  /* Borders */
  --border:          #c8ccd0;
  --border-focus:    #0a7d30;

  /* Status — all AA compliant */
  --status-work-exp: #7b3f00;   /* brown */
  --status-work-exp-bg: #fff3e0;
  --status-placement:#0047ab;   /* dark blue */
  --status-placement-bg:#e8f0fe;
  --status-part-time:#5b0080;   /* purple */
  --status-part-time-bg:#f3e5ff;
  --status-volunteer:#0a7d30;   /* green */
  --status-volunteer-bg:#e6f4eb;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Typography */
  --font-body:    'Atkinson Hyperlegible', 'Verdana', sans-serif;
  --font-heading: 'DM Sans', 'Trebuchet MS', sans-serif;
  --font-mono:    'Courier New', monospace;

  /* Font sizes — minimum 16px body per WCAG */
  --text-xs:   14px;
  --text-sm:   16px;
  --text-base: 18px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  30px;
  --text-3xl:  38px;
  --text-4xl:  48px;

  /* Line heights — generous for readability */
  --leading-tight:  1.25;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Shadows — minimal, not distracting */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.10);
  --shadow-md:   0 3px 12px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 30px rgba(0,0,0,0.12);

  /* Transitions */
  --transition: 200ms ease;

  /* Layout */
  --max-width:  1160px;
  --header-h:   72px;
}

/* ================================================================
   HIGH CONTRAST MODE SUPPORT
   ================================================================ */
@media (forced-colors: active) {
  :root {
    --border-focus: Highlight;
    --green: ButtonText;
  }
  .btn { border: 2px solid ButtonText !important; }
  .opportunity-card { border: 2px solid ButtonText !important; }
}

/* ================================================================
   REDUCED MOTION SUPPORT
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* ================================================================
   SKIP LINK — must be first focusable element
   ================================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 99999;
  padding: var(--space-3) var(--space-5);
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: var(--space-4);
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

/* ================================================================
   FOCUS STYLES — highly visible, WCAG 2.1 AA
   Never remove outlines. Keyboard users depend on these.
   ================================================================ */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Remove focus outline for mouse users only */
:focus:not(:focus-visible) { outline: none; }

/* ================================================================
   SCREEN READER UTILITIES
   ================================================================ */
.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;
}

.sr-only-focusable:focus { 
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ================================================================
   TYPOGRAPHY — dyslexia-friendly
   ================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  /* Slightly increased letter-spacing for headings helps readability */
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl)); }
h2 { font-size: clamp(var(--text-xl), 4vw, var(--text-3xl)); }
h3 { font-size: clamp(var(--text-lg), 3vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  font-size: var(--text-base);
  line-height: var(--leading-loose); /* extra generous for SEND learners */
  color: var(--text-secondary);
  max-width: 70ch; /* optimal reading line length */
}

/* ================================================================
   LINKS — underlined by default for accessibility
   Never remove underlines from body text links
   ================================================================ */
a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition), background-color var(--transition);
}
a:hover {
  color: var(--green-hover);
  text-decoration-thickness: 2px;
}

/* Navigation links — underline not needed in nav context */
nav a { text-decoration: none; }

/* ================================================================
   LAYOUT UTILITIES
   ================================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }
}

.section { padding: var(--space-9) 0; }
.section-sm { padding: var(--space-7) 0; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ================================================================
   BUTTONS — large tap targets (min 44x44px per WCAG)
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px; /* exceeds 44px minimum */
  padding: 0 var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition), 
              color var(--transition), 
              border-color var(--transition),
              transform var(--transition);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background-color: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.btn-primary:hover {
  background-color: var(--green-hover);
  border-color: var(--green-hover);
  color: var(--white);
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover {
  background-color: var(--green);
  color: var(--white);
  text-decoration: none;
}

.btn-white {
  background-color: var(--white);
  color: var(--green);
  border-color: var(--white);
}
.btn-white:hover {
  background-color: var(--green-light);
  color: var(--green-hover);
  text-decoration: none;
}

/* Large variant for hero CTAs */
.btn-lg {
  min-height: 56px;
  padding: 0 var(--space-7);
  font-size: var(--text-lg);
}

/* ================================================================
   HEADER
   ================================================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  height: var(--header-h);
  background-color: var(--white);
  border-bottom: 2px solid var(--border);
  transition: box-shadow var(--transition);
}
#site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-5);
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo img { height: 42px; width: auto; }
.site-logo:hover { opacity: 0.85; }

/* Primary navigation */
.primary-nav { display: flex; align-items: center; }

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.primary-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--green);
  background-color: var(--green-light);
}
.primary-nav a[aria-current="page"] {
  font-weight: 700;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
}
.nav-toggle:hover { border-color: var(--green); color: var(--green); }

/* Accessibility toolbar in header */
.a11y-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.a11y-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  transition: background-color var(--transition), border-color var(--transition);
}
.a11y-btn:hover { border-color: var(--green); color: var(--green); }
.a11y-btn[aria-pressed="true"] { background-color: var(--green-light); border-color: var(--green); color: var(--green); }

/* ================================================================
   DYSLEXIA MODE (toggled via JS)
   ================================================================ */
body.dyslexia-mode {
  font-family: 'OpenDyslexic', 'Atkinson Hyperlegible', sans-serif;
  word-spacing: 0.15em;
  letter-spacing: 0.05em;
}

/* ================================================================
   LARGE TEXT MODE
   ================================================================ */
body.large-text {
  font-size: 20px;
}
body.large-text h1 { font-size: clamp(36px, 6vw, 56px); }
body.large-text h2 { font-size: clamp(28px, 5vw, 44px); }
body.large-text h3 { font-size: clamp(24px, 4vw, 34px); }
body.large-text p  { font-size: 20px; }
body.large-text .btn { font-size: 20px; min-height: 56px; }

/* ================================================================
   MOBILE NAVIGATION
   ================================================================ */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0; bottom: 0;
    background-color: var(--white);
    padding: var(--space-6) var(--space-5);
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--transition);
    border-top: 2px solid var(--border);
    z-index: 8999;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; align-items: stretch; width: 100%; gap: 0; }
  .primary-nav a {
    font-size: var(--text-base);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    min-height: 56px;
  }
  .header-actions .btn { display: none; }
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
  padding-top: calc(var(--header-h) + var(--space-9));
  padding-bottom: var(--space-9);
  background-color: var(--bg-dark);
  background-image: linear-gradient(160deg, #1a2e1f 0%, #0f1f13 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

/* Subtle decorative pattern — non-meaningful, so hidden from AT */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(93,206,125,0.08) 0%, transparent 60%),
                    radial-gradient(circle at 80% 20%, rgba(93,206,125,0.05) 0%, transparent 50%);
  pointer-events: none;
  aria-hidden: true;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--space-6); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background-color: rgba(93,206,125,0.15);
  border: 1px solid rgba(93,206,125,0.3);
  color: var(--green-on-dark);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
}

.hero-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 800;
  color: var(--white);
  margin-bottom: var(--space-5);
  line-height: 1.1;
}
.hero-title .accent { color: var(--green-on-dark); }

.hero-desc {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: rgba(255,255,255,0.85);
  max-width: 52ch;
  margin-bottom: var(--space-7);
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Split card for student/employer */
.hero-split {
  display: grid;
  gap: var(--space-4);
}

.hero-card {
  background-color: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: background-color var(--transition), border-color var(--transition);
}
.hero-card:hover { 
  background-color: rgba(255,255,255,0.12);
  border-color: rgba(93,206,125,0.4);
}
.hero-card-icon {
  font-size: 32px;
  margin-bottom: var(--space-3);
  display: block;
  /* Decorative icons get role="img" with aria-label in the HTML */
}
.hero-card h3 {
  color: var(--white);
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}
.hero-card p {
  color: rgba(255,255,255,0.75);
  font-size: var(--text-sm);
  max-width: none;
  margin-bottom: var(--space-4);
}

/* ================================================================
   SEARCH BAR
   ================================================================ */
.search-section {
  background-color: var(--white);
  padding: var(--space-7) 0;
  border-bottom: 2px solid var(--border);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

/* Form group — label always visible */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-width: 160px;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

/* Required indicator */
.form-label .required {
  color: #b91c1c; /* red, 4.5:1 on white */
  margin-left: 2px;
}
.form-label .required::after { content: ' (required)'; }
.form-label .required { 
  font-size: 0; /* visually show asterisk only */
}
.form-label .required::before {
  content: '*';
  font-size: var(--text-sm);
  font-weight: 700;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:hover,
.form-select:hover { border-color: var(--text-secondary); }

.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10,125,48,0.2);
}

/* Error state */
.form-input[aria-invalid="true"],
.form-select[aria-invalid="true"] { border-color: #b91c1c; }

.form-error {
  font-size: var(--text-xs);
  color: #b91c1c;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Custom select arrow */
.form-select-wrap { position: relative; }
.form-select-wrap::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 6px;
  background-color: var(--text-secondary);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

/* ================================================================
   OPPORTUNITY TYPE FILTER PILLS
   ================================================================ */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background-color: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition), 
              border-color var(--transition), 
              color var(--transition);
}
.filter-pill:hover {
  border-color: var(--green);
  color: var(--green);
  background-color: var(--green-light);
}
.filter-pill[aria-pressed="true"] {
  background-color: var(--green);
  border-color: var(--green);
  color: var(--white);
}
/* Colour indicators per type — not sole means of identification (text also present) */
.filter-pill[data-type="work-experience"] .pill-dot { background-color: var(--status-work-exp); }
.filter-pill[data-type="placement"] .pill-dot       { background-color: var(--status-placement); }
.filter-pill[data-type="part-time"] .pill-dot        { background-color: var(--status-part-time); }
.filter-pill[data-type="volunteering"] .pill-dot     { background-color: var(--status-volunteer); }

.pill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ================================================================
   OPPORTUNITY CARDS
   Large click targets, clear hierarchy
   ================================================================ */
.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

.opportunity-card {
  background-color: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
}

.opportunity-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
}

/* Card is entirely clickable via stretched link */
.opportunity-card .card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-logo {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  object-fit: contain;
  padding: var(--space-1);
  background-color: var(--white);
  flex-shrink: 0;
}
.card-logo-placeholder {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background-color: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--green);
  flex-shrink: 0;
}

.card-type-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.card-type-badge.work-experience {
  background-color: var(--status-work-exp-bg);
  color: var(--status-work-exp);
}
.card-type-badge.placement {
  background-color: var(--status-placement-bg);
  color: var(--status-placement);
}
.card-type-badge.part-time {
  background-color: var(--status-part-time-bg);
  color: var(--status-part-time);
}
.card-type-badge.volunteering {
  background-color: var(--status-volunteer-bg);
  color: var(--status-volunteer);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--leading-tight);
  text-decoration: none;
}
.card-title:hover { color: var(--green); text-decoration: underline; }

.card-company {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
/* Icons use text symbols so they work without icon fonts */
.card-meta-item::before { font-size: 14px; }

.card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: none;
}

.card-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-deadline {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ================================================================
   HOW IT WORKS SECTION
   ================================================================ */
.how-it-works { background-color: var(--white); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  counter-reset: step-counter;
}
@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; }
}

.step {
  text-align: center;
  padding: var(--space-6);
  position: relative;
  counter-increment: step-counter;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  background-color: var(--green);
  color: var(--white);
  font-size: var(--text-xl);
  font-weight: 800;
  border-radius: 50%;
  margin: 0 auto var(--space-4);
}

.step h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}
.step p { font-size: var(--text-base); margin: 0 auto; text-align: center; }

/* ================================================================
   SECTION HEADING PATTERN
   ================================================================ */
.section-header { margin-bottom: var(--space-7); }
.section-header.centered { text-align: center; }
.section-header.centered p { margin-left: auto; margin-right: auto; }

.section-label {
  display: inline-block;
  background-color: var(--green-light);
  color: var(--green);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: clamp(var(--text-xl), 4vw, var(--text-3xl));
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 60ch;
  line-height: var(--leading-loose);
}

/* ================================================================
   EMPLOYER CTA BANNER
   ================================================================ */
.employer-cta {
  background-color: var(--bg-dark);
  color: var(--white);
  padding: var(--space-8) 0;
}

.employer-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.employer-cta h2 { color: var(--white); margin-bottom: var(--space-3); }
.employer-cta p { color: rgba(255,255,255,0.8); max-width: 55ch; }

/* ================================================================
   FOOTER
   ================================================================ */
#site-footer {
  background-color: var(--bg-dark);
  color: rgba(255,255,255,0.85);
  padding: var(--space-9) 0 var(--space-6);
  border-top: 3px solid var(--green);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-7);
  margin-bottom: var(--space-8);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
  max-width: 40ch;
}

.footer-col h3 {
  color: var(--white);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}
.social-link:hover { border-color: var(--green-on-dark); color: var(--white); }

/* ================================================================
   EMPLOYER DASHBOARD
   ================================================================ */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-6);
  min-height: 100vh;
  padding-top: var(--header-h);
}

@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}

.dashboard-sidebar {
  background-color: var(--white);
  border-right: 2px solid var(--border);
  padding: var(--space-6);
}

.dashboard-nav ul { display: flex; flex-direction: column; gap: var(--space-1); }
.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.dashboard-nav a:hover,
.dashboard-nav a[aria-current="page"] {
  background-color: var(--green-light);
  color: var(--green);
}

.dashboard-main { padding: var(--space-6); }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}

.stat-card {
  background-color: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.stat-card .stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--green);
  display: block;
  margin-bottom: var(--space-1);
}
.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 600;
}

/* ================================================================
   SINGLE OPPORTUNITY PAGE
   ================================================================ */
.opportunity-detail {
  padding-top: calc(var(--header-h) + var(--space-8));
}

.opportunity-detail-header {
  background-color: var(--white);
  border-bottom: 2px solid var(--border);
  padding: var(--space-7) 0;
}

.opportunity-detail-header-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.opportunity-detail-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-7);
  padding: var(--space-8) 0;
}
@media (max-width: 900px) {
  .opportunity-detail-body { grid-template-columns: 1fr; }
}

/* Apply box */
.apply-box {
  background-color: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: sticky;
  top: calc(var(--header-h) + var(--space-5));
  height: fit-content;
}
.apply-box h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}
.apply-box .btn { width: 100%; justify-content: center; }

/* ================================================================
   NOTICES & ALERTS — accessible with role="alert"
   ================================================================ */
.notice {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: var(--text-base);
  font-weight: 600;
}
.notice-info    { background-color: #e8f0fe; border-color: #0047ab; color: #00307a; }
.notice-success { background-color: var(--green-light); border-color: var(--green); color: var(--green-hover); }
.notice-warning { background-color: #fff3e0; border-color: #7b3f00; color: #5a2d00; }
.notice-error   { background-color: #fee2e2; border-color: #b91c1c; color: #7f1d1d; }

/* ================================================================
   LOADING STATES — accessible spinners
   ================================================================ */
.spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--green); }
}

/* ================================================================
   PAGINATION — large targets
   ================================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-3);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.page-link:hover { border-color: var(--green); color: var(--green); background-color: var(--green-light); }
.page-link[aria-current="page"] { 
  background-color: var(--green); 
  border-color: var(--green); 
  color: var(--white);
  text-decoration: none;
}

/* ================================================================
   UTILITY — padding for fixed header
   ================================================================ */
.has-header-offset { padding-top: calc(var(--header-h) + var(--space-7)); }

/* ================================================================
   PRINT STYLES
   ================================================================ */
@media print {
  #site-header, .a11y-toolbar, .filter-pills, .pagination { display: none; }
  body { font-size: 12pt; color: #000; }
  a::after { content: ' (' attr(href) ')'; font-size: 10pt; }
  .opportunity-card { border: 1pt solid #000; page-break-inside: avoid; }
}
