/* ==========================================================================
   ImpactBRG / 豐盛社企學會 FSES HK — Base Design Tokens & System
   Style: Uniqlo (clean grid, generous whitespace, typography-led, minimal
   shadows, thin borders) × TEDx (bold uppercase, high contrast, 3-colour
   discipline) × ESG 2026 (teal-green anchors, warm off-white, earth tones)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */

:root {
  /* Brand Colors — ImpactBridge emerald-teal (2026 refresh) */
  --primary:       #0F8A6A;   /* ImpactBridge emerald-teal */
  --primary-dark:  #0A5C46;
  --primary-light: #E3F3EE;
  --accent:        #E62B1E;   /* award red (TEDx bold) */
  --accent-light:  #FDECEA;
  --black:         #111111;
  --white:         #FFFFFF;
  --warm-white:    #F5F0EB;   /* Pantone 2026 Cloud Dancer — warm off-white */

  /* Grey Scale (10 stops) */
  --grey-50:  #FAFAFA;
  --grey-100: #F5F5F5;
  --grey-200: #EBEBEB;
  --grey-300: #D4D4D4;
  --grey-400: #A3A3A3;
  --grey-500: #737373;
  --grey-600: #525252;
  --grey-700: #404040;
  --grey-800: #262626;
  --grey-900: #1A1A1A;

  /* ESG 2026 Sustainability Palette (research-backed) */
  --teal:         #2C5C54;   /* transformative teal — dominant ESG 2026 mood */
  --teal-mid:     #4EB08F;   /* medium teal green for charts/accents */
  --teal-light:   #D4ECE4;   /* pale aqua wash background */
  --earth:        #7B5E3A;   /* earth/nature brown */
  --earth-light:  #F5EDE3;
  --sage:         #8BA955;   /* sage green for positive metrics */
  --sky:          #099EC8;   /* clean water bright teal-blue */
  --sky-light:    #E3EEF8;
  --amber:        #C27B1A;   /* energy/warmth amber */
  --amber-light:  #FDF3E3;
  --lime:         #84BC41;   /* sustainability data positive */

  /* SDG Official UN Colors (goals 1–17) */
  --sdg-1:  #E5243B; /* No Poverty */
  --sdg-2:  #DDA63A; /* Zero Hunger */
  --sdg-3:  #4C9F38; /* Good Health & Well-Being */
  --sdg-4:  #C5192D; /* Quality Education */
  --sdg-5:  #FF3A21; /* Gender Equality */
  --sdg-6:  #26BDE2; /* Clean Water & Sanitation */
  --sdg-7:  #FCC30B; /* Affordable & Clean Energy */
  --sdg-8:  #A21942; /* Decent Work & Economic Growth */
  --sdg-9:  #FD6925; /* Industry, Innovation & Infrastructure */
  --sdg-10: #DD1367; /* Reduced Inequalities */
  --sdg-11: #FD9D24; /* Sustainable Cities & Communities */
  --sdg-12: #BF8B2E; /* Responsible Consumption & Production */
  --sdg-13: #3F7E44; /* Climate Action */
  --sdg-14: #0A97D9; /* Life Below Water */
  --sdg-15: #56C02B; /* Life on Land */
  --sdg-16: #00689D; /* Peace, Justice & Strong Institutions */
  --sdg-17: #19486A; /* Partnerships for Goals */

  /* ── Typography ─────────────────────────────────────────────────────────
     Two roles:
       --font         Body / UI — system-ui (SF Pro/Segoe UI) → Noto Sans HK → Inter
       --font-display Headlines — system-ui (SF Pro) → Inter 800 → Noto Sans HK
       --font-mono    Code — JetBrains Mono
     system-ui gives SF Pro on Apple, Segoe UI on Windows.
     Inter (w800) is the web fallback. Noto Sans HK covers all CJK glyphs.
  ── */
  --font:         system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans HK', 'Inter', sans-serif;
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Noto Sans HK', sans-serif;
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Noto Sans HK', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* ── Type Scale ─────────────────────────────────────────────────────────
     Token          rem      px    Role
     --text-2xs     0.625    10    micro labels (SDG tile numbers, tiny tags)
     --text-xs      0.75     12    timestamps, captions, eyebrow labels
     --text-sm      0.875    14    secondary body, form help, chips
     --text-base    1        16    primary body                     ← root
     --text-lg      1.125    18    lead paragraphs, nav items, btn-xl
     --text-xl      1.25     20    card titles, panel headers
     --text-2xl     1.5      24    sub-headings, drawer titles
     --text-3xl     1.875    30    section headings (smaller pages)
     --text-4xl     2.25     36    h3 / stat display
     --text-5xl     3        48    h2 / page hero headings
     --text-6xl     3.75     60    h1 / marketing display
     --text-7xl     4.5      72    billboard max

     Note: existing code uses xs→5xl unchanged; 6xl + 7xl are additive.
     --text-md is an alias for --text-lg (18px), for semantic clarity in
     new code that wants to distinguish "medium" from "large".
  ── */
  --text-2xs:  0.625rem;   /*  10px */
  --text-xs:   0.75rem;    /*  12px */
  --text-sm:   0.875rem;   /*  14px */
  --text-base: 1rem;       /*  16px */
  --text-md:   1.125rem;   /*  18px — alias for --text-lg */
  --text-lg:   1.125rem;   /*  18px */
  --text-xl:   1.25rem;    /*  20px */
  --text-2xl:  1.5rem;     /*  24px */
  --text-3xl:  1.875rem;   /*  30px */
  --text-4xl:  2.25rem;    /*  36px */
  --text-5xl:  3rem;       /*  48px */
  --text-6xl:  3.75rem;    /*  60px */
  --text-7xl:  4.5rem;     /*  72px */

  /* ── Line Heights ────────────────────────────────────────────────────── */
  --lh-none:    1;      /* single-line display numbers */
  --lh-tight:   1.15;   /* editorial headlines */
  --lh-snug:    1.35;   /* card headings, compact UI */
  --lh-normal:  1.5;    /* nav, buttons, labels */
  --lh-relaxed: 1.7;    /* body prose (good for CJK + Latin mix) */
  --lh-loose:   1.9;    /* small text blocks, max readability */

  /* ── Letter Spacing ──────────────────────────────────────────────────── */
  --tracking-tighter: -0.025em; /* display Latin headlines (system-ui / SF Pro) */
  --tracking-tight:   -0.01em;  /* sub-headings */
  --tracking-normal:   0em;     /* body, CJK (never apply negative to CJK) */
  --tracking-wide:     0.05em;  /* small labels */
  --tracking-wider:    0.12em;  /* uppercase eyebrow captions */
  --tracking-widest:   0.2em;   /* ultra-condensed tags */

  /* ── Font Weights ────────────────────────────────────────────────────── */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    800;

  /* Spacing — 8-point grid */
  --s1:  8px;
  --s2:  16px;
  --s3:  24px;
  --s4:  32px;
  --s5:  40px;
  --s6:  48px;
  --s7:  56px;
  --s8:  64px;
  --s9:  72px;
  --s10: 80px;
  --s11: 88px;
  --s12: 96px;

  /* Layout */
  --gutter:      24px;
  --margin:      40px;
  --content-max: 1200px;
  --sidebar-w:   240px;
  --topnav-h:    64px;

  /* Border Radius — Uniqlo: almost no radius */
  --r-sm:   2px;
  --r-md:   4px;
  --r-lg:   8px;
  --r-xl:   12px;
  --r-full: 9999px;

  /* Shadows — very subtle, Uniqlo-style (no heavy elevation) */
  --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card:  0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.14);

  /* Motion */
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
}


/* --------------------------------------------------------------------------
   2. CSS RESET
   -------------------------------------------------------------------------- */

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

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

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--black);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  max-width: 100%;
  display: block;
}

input,
button,
textarea,
select {
  font: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: none;
  border-top: 1px solid var(--grey-200);
  margin: var(--s4) 0;
}

p {
  margin-bottom: 1em;
}

p:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   3. TYPOGRAPHY SYSTEM
   -------------------------------------------------------------------------- */

/* ── Heading scale ────────────────────────────────────────────────────────
   All headings use --font-display (Manrope → Noto Sans HK).
   Sizes use clamp(min, fluid, max) so they scale smoothly with the viewport.
   letter-spacing uses --tracking-tight (not negative) because CJK glyphs
   should not be tracked negatively — only Latin display text benefits.
   ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--black);
}

/* headings inside dark/coloured containers inherit the container's colour */
.page-header h1, .page-header h2, .page-header h3,
.page-hero h1, .page-hero h2, .page-hero h3,
.dir-hero h1, .dir-hero h2, .dir-hero h3,
[style*="background:var(--primary"] h1,
[style*="background: var(--primary"] h1 { color: inherit; }

/* clamp(mobile-min, fluid-vw, desktop-max) */
h1 { font-size: clamp(2.25rem,  5vw,   var(--text-6xl)); }  /* 36 → 60 px */
h2 { font-size: clamp(1.75rem,  3.5vw, var(--text-5xl)); }  /* 28 → 48 px */
h3 { font-size: clamp(1.375rem, 2.5vw, var(--text-4xl)); }  /* 22 → 36 px */
h4 { font-size: clamp(1.125rem, 2vw,   var(--text-3xl)); }  /* 18 → 30 px */
h5 { font-size: var(--text-xl);  }                          /* 20 px fixed */
h6 { font-size: var(--text-lg);  }                          /* 18 px fixed */

strong { font-weight: var(--weight-bold); }
em     { font-style: italic; }

/* ── Section label — TEDx discipline: uppercase eyebrow ── */
.section-label {
  display: block;
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--grey-500);
  margin-bottom: var(--s1);
}

.section-label.label-primary { color: var(--primary); }
.section-label.label-accent  { color: var(--accent); }
.section-label.label-white   { color: rgba(255, 255, 255, 0.65); }

/* ── Display text — hero billboard, large editorial numbers ── */
.display {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, var(--text-7xl));
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--lh-none);
}

/* ── Lead paragraph ── */
.lead {
  font-size: var(--text-xl);
  line-height: var(--lh-relaxed);
  color: var(--grey-600);
}

/* ── Monospace ── */
code, kbd, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

pre {
  background: var(--grey-100);
  border-radius: var(--r-md);
  padding: var(--s3);
  overflow-x: auto;
}

/* ── Prose content ── */
.prose {
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--grey-700);
}
.prose h2 { margin-top: var(--s6); margin-bottom: var(--s2); }
.prose h3 { margin-top: var(--s5); margin-bottom: var(--s2); }
.prose p  { margin-bottom: var(--s3); }
.prose ul,
.prose ol {
  list-style: disc;
  padding-left: var(--s4);
  margin-bottom: var(--s3);
}
.prose li { margin-bottom: var(--s1); }


/* --------------------------------------------------------------------------
   4. GRID SYSTEM — 12 COLUMNS
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.grid-8 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--gutter);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}

/* Column spans */
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Column offsets */
.col-offset-1 { grid-column-start: 2; }
.col-offset-2 { grid-column-start: 3; }
.col-offset-3 { grid-column-start: 4; }
.col-offset-4 { grid-column-start: 5; }
.col-offset-5 { grid-column-start: 6; }
.col-offset-6 { grid-column-start: 7; }

/* Tablet: 768px — 8 columns */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .col-1,
  .col-2  { grid-column: span 2; }
  .col-3,
  .col-4  { grid-column: span 4; }
  .col-5,
  .col-6  { grid-column: span 4; }
  .col-7,
  .col-8  { grid-column: span 6; }
  .col-9,
  .col-10 { grid-column: span 8; }
  .col-11,
  .col-12 { grid-column: span 8; }

  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .col-offset-1,
  .col-offset-2,
  .col-offset-3,
  .col-offset-4,
  .col-offset-5,
  .col-offset-6 { grid-column-start: auto; }
}

/* Mobile: 480px — single column */
@media (max-width: 480px) {
  .grid,
  .grid-8,
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--s2);
  }

  .col-1,
  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9,
  .col-10,
  .col-11,
  .col-12 {
    grid-column: span 1;
  }
}

/* Container */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--margin);
}

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

@media (max-width: 480px) {
  .container { padding: 0 var(--s2); }
}


/* --------------------------------------------------------------------------
   5. PUBLIC LAYOUT (.layout-public)
   -------------------------------------------------------------------------- */

.layout-public {
  min-height: 100vh;
  background: var(--white);
}

/* Sticky topnav — NO shadow, thin border only (Uniqlo) */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-h);
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
  z-index: 900;
  display: flex;
  align-items: center;
  padding: 0 var(--margin);
}

.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: var(--s1);
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.topnav-brand:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

.topnav-brand img {
  height: 32px;
  width: auto;
}

.topnav-brand-name {
  color: var(--primary);
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: var(--s5);
}

.topnav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--grey-700);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 99px;
}
.topnav-links a svg { width: 15px; height: 15px; flex: none; opacity: 0.9; }

.topnav-links a:hover {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

.topnav-links a.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
}

/* ── Topnav dropdowns (multi-level sitemap menu) ── */
.topnav-links { gap: var(--s4); margin: 0 var(--s5); }
.topnav-links > li { position: relative; }
.topnav-links .has-sub > a::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.55;
}
.topnav-sub {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 210px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.10);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
  z-index: 950;
}
.topnav-links .has-sub:hover .topnav-sub,
.topnav-links .has-sub:focus-within .topnav-sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.topnav-sub a {
  display: block;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 5px;
  border-bottom: none;
  font-size: var(--text-sm);
  color: var(--grey-700);
}
.topnav-sub a:hover { background: var(--grey-50); color: var(--primary); }
.topnav-sub a.active { color: var(--primary); font-weight: 600; }

/* ── Mobile hamburger + slide-in drawer ── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px; height: 40px;
  padding: 9px;
  background: none;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  cursor: pointer;
}
.nav-burger span {
  display: block; height: 2px; width: 100%;
  background: var(--grey-800); border-radius: 2px;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mnav-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease); z-index: 998;
}
.mnav-scrim.open { opacity: 1; visibility: visible; }
.mnav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(82vw, 340px);
  background: var(--white);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  z-index: 999;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.mnav-drawer.open { transform: translateX(0); }
.mnav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--grey-200);
  font-weight: 700; color: var(--grey-800);
}
.mnav-close { background: none; border: none; font-size: 20px; color: var(--grey-500); cursor: pointer; line-height: 1; }
.mnav-list { display: flex; flex-direction: column; padding: var(--s2); }
.mnav-item {
  display: block; padding: 12px 14px; border-radius: 8px;
  font-size: var(--text-base); font-weight: 600; color: var(--grey-800); text-decoration: none;
}
.mnav-item:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.mnav-sub {
  display: block; padding: 9px 14px 9px 28px; border-radius: 8px;
  font-size: var(--text-sm); color: var(--grey-600); text-decoration: none;
}
.mnav-sub:hover { background: var(--grey-50); color: var(--primary); text-decoration: none; }
.mnav-login { margin-top: var(--s2); background: var(--primary); color: #fff; text-align: center; }
.mnav-login:hover { background: var(--primary-dark); color: #fff; }

@media (max-width: 1080px) {
  .topnav-links { display: none; }
  .nav-burger { display: flex; }
}

/* Push content below fixed topnav */
.layout-public > main,
.layout-public-content {
  padding-top: var(--topnav-h);
}

/* Sections — Uniqlo breathing room: 96px vertical padding */
.section {
  padding: var(--s12) 0;
}

.section.section-sm { padding: var(--s8) 0; }
.section.section-lg { padding: calc(var(--s12) * 1.5) 0; }

/* Alternating background pattern */
.section.bg-white { background: var(--white); }
.section.bg-grey  { background: var(--grey-50); }

/* Full-bleed dark section */
.section.bg-dark {
  background: var(--black);
  color: var(--white);
}

.section.bg-dark h1,
.section.bg-dark h2,
.section.bg-dark h3,
.section.bg-dark h4,
.section.bg-dark h5,
.section.bg-dark h6 { color: var(--white); }

.section.bg-dark .section-label { color: var(--grey-400); }
.section.bg-dark p              { color: var(--grey-300); }

/* Full-bleed green section */
.section.bg-green {
  background: var(--primary);
  color: var(--white);
}

.section.bg-green h1,
.section.bg-green h2,
.section.bg-green h3,
.section.bg-green h4,
.section.bg-green h5,
.section.bg-green h6 { color: var(--white); }

.section.bg-green .section-label { color: rgba(255, 255, 255, 0.7); }
.section.bg-green p              { color: rgba(255, 255, 255, 0.85); }

/* Accent (red) CTA section — TEDx award banner */
.section.bg-accent {
  background: var(--accent);
  color: var(--white);
}

.section.bg-accent h1,
.section.bg-accent h2,
.section.bg-accent h3,
.section.bg-accent h4,
.section.bg-accent h5,
.section.bg-accent h6 { color: var(--white); }

.section.bg-accent .section-label { color: rgba(255, 255, 255, 0.7); }
.section.bg-accent p               { color: rgba(255, 255, 255, 0.9); }

/* Hero */
.hero {
  padding: var(--s12) 0;
  min-height: 480px;
  display: flex;
  align-items: center;
}

/* Mobile topnav */
@media (max-width: 768px) {
  .topnav {
    padding: 0 var(--s3);
  }

  .topnav-links {
    display: none;
    position: absolute;
    top: var(--topnav-h);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--grey-200);
    padding: var(--s1) 0;
    box-shadow: var(--shadow-sm);
  }

  .topnav-links.open {
    display: flex;
  }

  .topnav-links a {
    padding: 12px var(--s3);
    border-bottom: none;
    width: 100%;
  }
}


/* --------------------------------------------------------------------------
   6. PANEL LAYOUT (.layout-panel)
   -------------------------------------------------------------------------- */

.layout-panel {
  display: flex;
  min-height: 100vh;
  background: var(--grey-50);
}

/* Fixed sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #1C2B22;
  display: flex;
  flex-direction: column;
  z-index: 800;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: var(--s3) var(--s2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: var(--s1);
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

.sidebar-logo a:hover { text-decoration: none; }

/* ImpactBridge leaf mark in panel sidebar */
.sidebar-logo .ib-mark {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Role badge under the sidebar logo */
.sidebar-role {
  display: flex; align-items: center; gap: 8px;
  padding: var(--s2) var(--s2) var(--s1);
  flex-shrink: 0;
}
.sidebar-role-badge {
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: 99px;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85);
}
.sidebar-role-badge.sidebar-role-fses { background: var(--primary); color: #fff; }
.sidebar-role-label { font-size: 0.75rem; color: rgba(255,255,255,0.55); }

.sidebar-logo img {
  height: 28px;
  width: auto;
}

.sidebar-logo-name {
  color: var(--white);
  font-weight: 700;
  font-size: var(--text-sm);
  line-height: 1.3;
}

.sidebar-logo-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--grey-500);
  font-weight: 400;
}

.sidebar-section-label {
  padding: var(--s3) var(--s2) var(--s1);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--grey-500);
}

.sidebar-nav {
  flex: 1;
  padding: var(--s1) 0;
}

.sidebar-nav ul { list-style: none; }

.sidebar-nav li { margin: 2px var(--s1); }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--grey-300);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  border-radius: var(--r-md);
  transition: background-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-decoration: none;
}

.sidebar-nav a.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.sidebar-nav a .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  font-size: 16px;
  text-align: center;
}

.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: var(--s1) var(--s2);
}

.sidebar-user {
  padding: var(--s2) var(--s2) var(--s1);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--grey-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - var(--s2) * 2);
  margin: 0 var(--s1) var(--s2);
  padding: 8px 12px;
  color: var(--grey-300);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--r-md);
  transition: color var(--duration) var(--ease),
              background-color var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
  text-align: left;
}

.sidebar-logout:hover {
  color: var(--white);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Panel main content */
.panel-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--grey-50);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Panel page header */
.panel-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
  padding: var(--s2) var(--s4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
  flex-shrink: 0;
  min-height: 52px;
}

.panel-header-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.panel-header-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.01em;
}

.panel-header-sub {
  font-size: var(--text-xs);
  color: var(--grey-500);
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

/* Panel content area */
.panel-content {
  padding: var(--s4);
  flex: 1;
}

/* Tighter line-height for admin panel UI */
.layout-panel {
  line-height: var(--lh-normal);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--text-sm);
  color: var(--grey-500);
  margin-bottom: var(--s3);
}

.breadcrumb a {
  color: var(--grey-500);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb-sep     { color: var(--grey-300); }
.breadcrumb-current { color: var(--grey-700); font-weight: 500; }

/* Breadcrumbs on dark/coloured headers */
.page-header .breadcrumb,
.page-hero .breadcrumb,
.dir-hero .breadcrumb,
.award-hero .breadcrumb {
  color: rgba(255,255,255,.75);
}
.page-header .breadcrumb a,
.page-hero .breadcrumb a,
.dir-hero .breadcrumb a,
.award-hero .breadcrumb a { color: rgba(255,255,255,.75); }
.page-header .breadcrumb a:hover,
.page-hero .breadcrumb a:hover { color: var(--white); }
.page-header .breadcrumb-sep,
.page-hero .breadcrumb-sep,
.dir-hero .breadcrumb-sep { color: rgba(255,255,255,.4); }

/* Sidebar mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 700;
}

.sidebar-overlay.active { display: block; }

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration) var(--ease);
  }

  .sidebar.open { transform: translateX(0); }

  .panel-main  { margin-left: 0; }

  .panel-content { padding: var(--s3); }

  .panel-header  { padding: var(--s3); }
}


/* --------------------------------------------------------------------------
   7. UTILITY CLASSES
   -------------------------------------------------------------------------- */

/* Text alignment */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Font weight */
.font-light    { font-weight: var(--weight-light); }
.font-normal   { font-weight: var(--weight-regular); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }
.font-black    { font-weight: var(--weight-black); }

/* Font family */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font); }
.font-mono    { font-family: var(--font-mono); }

/* Font size — all scale steps available as utility classes */
.text-2xs  { font-size: var(--text-2xs); }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }
.text-5xl  { font-size: var(--text-5xl); }
.text-6xl  { font-size: var(--text-6xl); }

/* Letter spacing */
.tracking-tight    { letter-spacing: var(--tracking-tight); }
.tracking-normal   { letter-spacing: var(--tracking-normal); }
.tracking-wide     { letter-spacing: var(--tracking-wide); }
.tracking-wider    { letter-spacing: var(--tracking-wider); }
.tracking-widest   { letter-spacing: var(--tracking-widest); }

/* Line height */
.leading-none    { line-height: var(--lh-none); }
.leading-tight   { line-height: var(--lh-tight); }
.leading-snug    { line-height: var(--lh-snug); }
.leading-normal  { line-height: var(--lh-normal); }
.leading-relaxed { line-height: var(--lh-relaxed); }
.leading-loose   { line-height: var(--lh-loose); }

/* Color utilities */
.text-muted   { color: var(--grey-500); }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-white   { color: var(--white); }
.text-black   { color: var(--black); }
.text-dark    { color: var(--grey-700); }

/* Margin-top */
.mt-1 { margin-top: var(--s1); }
.mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); }
.mt-6 { margin-top: var(--s6); }
.mt-7 { margin-top: var(--s7); }
.mt-8 { margin-top: var(--s8); }

/* Margin-bottom */
.mb-1 { margin-bottom: var(--s1); }
.mb-2 { margin-bottom: var(--s2); }
.mb-3 { margin-bottom: var(--s3); }
.mb-4 { margin-bottom: var(--s4); }
.mb-5 { margin-bottom: var(--s5); }
.mb-6 { margin-bottom: var(--s6); }
.mb-7 { margin-bottom: var(--s7); }
.mb-8 { margin-bottom: var(--s8); }

/* Flex */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.flex-start   { display: flex; align-items: flex-start; }
.flex-end     { display: flex; align-items: flex-end; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-end  { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

/* Gap */
.gap-1 { gap: var(--s1); }
.gap-2 { gap: var(--s2); }
.gap-3 { gap: var(--s3); }
.gap-4 { gap: var(--s4); }

/* Width / height */
.w-full  { width: 100%; }
.w-auto  { width: auto; }
.h-full  { height: 100%; }
.flex-1  { flex: 1; }
.flex-none { flex: none; }

/* Display */
.block        { display: block; }
.inline       { display: inline; }
.inline-block { display: inline-block; }
.inline-flex  { display: inline-flex; }
.hidden       { display: none !important; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--s1); }
.p-2 { padding: var(--s2); }
.p-3 { padding: var(--s3); }
.p-4 { padding: var(--s4); }

/* Line clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Screen-reader only */
.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;
}

/* Dividers */
.divider {
  height: 1px;
  background: var(--grey-200);
  margin: var(--s4) 0;
}

.divider-sm {
  height: 1px;
  background: var(--grey-200);
  margin: var(--s2) 0;
}

/* Focus ring — accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print */
@media print {
  .sidebar,
  .topnav,
  .panel-header { display: none; }
  .panel-main   { margin-left: 0; }
}
