/* ============================================================
   SADC Youth Network — style.css
   Red colour scheme, light mode, mobile-first, accessible
   ============================================================ */

/* === CSS Variables — Light Mode (FORCED) ================= */
:root {
  /* Red palette derived from brand colour swatch */
  --brand-900: #3D0000;   /* deepest crimson - hero banners */
  --brand-700: #7A0A0A;   /* dark crimson - headings, hover */
  --brand-500: #C41010;   /* primary red - buttons, links   */
  --brand-300: #E85050;   /* medium red - accents           */
  --brand-100: #FFF0F0;   /* light pink tint - subtle bg    */
  --accent-crimson: #8B1A1A; /* deep red secondary accent   */
  --accent-warm:    #CC4400;  /* warm red-brown highlight    */

  /* Text — stays dark for readability on light bg */
  --text-900: #0a0a0a;
  --text-700: #2f2f2f;
  --text-500: #5b5b5b;

  /* Backgrounds — ALWAYS light (forced light mode) */
  --bg:         #ffffff;
  --bg-soft:    #fdf5f5;   /* very subtle warm white */
  --card-bg:    #ffffff;
  --border:     #f0d4d4;   /* warm pinkish border     */
  --header-bg:  rgba(255,255,255,0.95);

  --shadow:       0 8px 28px rgba(100,0,0,.07), 0 2px 8px rgba(100,0,0,.05);
  --shadow-hover: 0 14px 40px rgba(100,0,0,.13), 0 4px 12px rgba(100,0,0,.08);

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --nav-height: 66px;
}

/* Force light mode — ignore OS dark mode preference */
@media (prefers-color-scheme: dark) {
  :root {
    --brand-900: #3D0000;
    --brand-700: #7A0A0A;
    --brand-500: #C41010;
    --brand-300: #E85050;
    --brand-100: #FFF0F0;
    --accent-crimson: #8B1A1A;
    --accent-warm:    #CC4400;

    --text-900: #0a0a0a;
    --text-700: #2f2f2f;
    --text-500: #5b5b5b;

    /* Still light — this forces light mode even on dark OS */
    --bg:         #ffffff;
    --bg-soft:    #fdf5f5;
    --card-bg:    #ffffff;
    --border:     #f0d4d4;
    --header-bg:  rgba(255,255,255,0.95);

    --shadow:       0 8px 28px rgba(100,0,0,.07), 0 2px 8px rgba(100,0,0,.05);
    --shadow-hover: 0 14px 40px rgba(100,0,0,.13), 0 4px 12px rgba(100,0,0,.08);
  }
}

/* === Reset ================================================ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-900);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 {
  font-family: Poppins, Inter, sans-serif;
  margin: 0 0 .5rem;
  color: var(--text-900);
  line-height: 1.2;
}

h1 { font-size: clamp(1.6rem, 1.1rem + 2.5vw, 3rem); }
h2 { font-size: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
h3 { font-size: clamp(1.05rem, .9rem + .8vw, 1.4rem); }

p  { margin: .25rem 0 .75rem; color: var(--text-700); }
a  { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { color: var(--text-700); }

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

/* === Header & Navigation ================================= */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .18s;
}

.brand:hover { opacity: .85; }

.brand-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-900));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .15px;
  color: var(--text-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: .2rem;
  flex: 1;
  justify-content: center;
}

.nav-item { position: relative; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .55rem .8rem;
  border-radius: 999px;
  color: var(--text-700);
  border: 1px solid transparent;
  background: transparent;
  font-size: .85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  white-space: nowrap;
  line-height: 1.4;
  min-height: 44px;
}

.nav-btn:hover {
  background: var(--brand-100);
  color: var(--brand-700);
  border-color: var(--border);
}

/* === Desktop Dropdown ==================================== */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: .4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  pointer-events: none;
  z-index: 200;
}

.dropdown a {
  display: flex;
  align-items: center;
  padding: .6rem .75rem;
  border-radius: 10px;
  color: var(--text-700);
  font-size: .875rem;
  transition: background .12s, color .12s;
  min-height: 44px;
}

.dropdown a:hover {
  background: var(--bg-soft);
  color: var(--brand-700);
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear;
  }
}

.dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear;
}

.nav-cta { flex-shrink: 0; }

/* === Hamburger =========================================== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  cursor: pointer;
  padding: 10px;
  transition: background .18s;
  flex-shrink: 0;
}

.hamburger:hover { background: var(--bg-soft); }

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-900);
  border-radius: 2px;
  transition: transform .24s ease, opacity .24s ease;
  transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === Mobile Menu ========================================= */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  transition: max-height .32s cubic-bezier(.4,0,.2,1);
}

.mobile-menu.is-open {
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu .container {
  padding-top: .5rem;
  padding-bottom: 1.2rem;
}

.mobile-menu .nav-item { border-bottom: 1px solid var(--border); }
.mobile-menu .nav-item:last-child { border-bottom: none; }

.mobile-menu .nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  padding: .85rem .75rem;
  font-size: .95rem;
  min-height: 52px;
  color: var(--text-900);
}

.mobile-menu .nav-btn:hover {
  background: var(--bg-soft);
  border-color: transparent;
}

/* Mobile sub-dropdown */
.mobile-menu .dropdown {
  position: static !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  pointer-events: auto !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 .5rem .25rem 1.1rem !important;
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s cubic-bezier(.4,0,.2,1) !important;
}

.mobile-menu .dropdown.is-open { max-height: 400px; }

.mobile-menu .dropdown a {
  padding: .7rem .5rem;
  font-size: .9rem;
  color: var(--text-500);
  min-height: 48px;
  border-radius: 8px;
}

.mobile-menu .dropdown a:hover {
  color: var(--brand-500);
  background: var(--bg-soft);
}

/* === Responsive Breakpoints ============================== */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-cta   { display: none; }
  .hamburger { display: flex; }
}

@media (min-width: 961px) {
  .mobile-menu { display: none !important; }
}

/* === Buttons ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--brand-500);
  background: var(--brand-500);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(196,16,16,.22);
  transition: background .18s, transform .18s, box-shadow .18s, border-color .18s;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
}

.btn:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(196,16,16,.3);
}

.btn:active { transform: translateY(0); }

.btn.secondary {
  background: transparent;
  color: var(--brand-500);
  border-color: var(--brand-300);
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--brand-100);
  border-color: var(--brand-500);
  color: var(--brand-700);
}

/* === Utility ============================================= */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .22rem .7rem;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .3px;
}

.section { padding: clamp(2rem, 5vw, 4.5rem) 0; }

/* === Grid System ========================================= */
.grid { display: grid; gap: 1.2rem; }
.two   { grid-template-columns: repeat(2, minmax(0,1fr)); }
.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.four  { grid-template-columns: repeat(4, minmax(0,1fr)); }

@media (max-width: 960px) {
  .three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .four  { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 600px) {
  .two   { grid-template-columns: 1fr; }
  .three { grid-template-columns: 1fr; }
  .four  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .four  { grid-template-columns: 1fr; }
}

/* === Cards =============================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: clamp(.95rem, 1.2rem + .5vw, 1.6rem);
  transition: transform .2s ease, box-shadow .2s ease;
  color: var(--text-900);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card h1, .card h2, .card h3, .card h4 { color: var(--text-900); }
.card p   { color: var(--text-700); }
.card li  { color: var(--text-700); }
.card label { color: var(--text-700); }
.card ul  { padding-left: 1.3rem; }
.card ul li { margin-bottom: .35rem; }
.card small { color: var(--text-500); }

/* Resources gallery image sizing (single control point) */
.gallery-image {
  width: 150%;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* === Hero ================================================ */
.hero { padding: clamp(2rem, 5vw, 4rem) 0; }

.hero-wrap {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 1.8rem;
  align-items: center;
}

.hero-art {
  aspect-ratio: 4/3;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, var(--brand-100), var(--bg));
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

@media (max-width: 700px) {
  .hero-wrap { grid-template-columns: 1fr; }
  .hero-art  { display: none; }
}

/* === Pills =============================================== */
.pill {
  display: inline-flex;
  align-items: center;
  padding: .28rem .75rem;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
  font-size: .82rem;
}

/* === Network Members ===================================== */
.grid.four { overflow: visible; }

.country-card {
  position: relative;
  z-index: 0;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
  transition: transform .18s, box-shadow .18s;
  cursor: pointer;
}

.country-card:hover,
.country-card:focus-within {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  z-index: 10;
}

.country-name { font-weight: 700; color: var(--text-900); }
.country-card small { color: var(--text-500); font-size: .8rem; }

.org-dropdown {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 6px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: .6rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .16s, transform .16s, visibility 0s linear .16s;
  z-index: 100;
}

.org-dropdown a {
  display: flex;
  align-items: center;
  padding: .45rem .55rem;
  border-radius: 8px;
  color: var(--text-700);
  font-size: .875rem;
  min-height: 40px;
  transition: background .12s;
}

.org-dropdown a:hover {
  background: var(--bg-soft);
  color: var(--brand-700);
}

@media (hover: hover) and (pointer: fine) {
  .country-card:hover > .org-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .16s, transform .16s, visibility 0s linear;
  }
}

.org-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .16s, transform .16s, visibility 0s linear;
}

@media (max-width: 600px) {
  .org-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: .4rem 0 0;
    margin-top: .5rem;
    display: none;
    transition: none;
  }
  .org-dropdown.is-open { display: block; }
}

/* === Forms =============================================== */
.input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: .7rem .95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: .95rem;
  background: var(--bg);
  color: var(--text-900);
  box-sizing: border-box;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(196,16,16,.12);
}

::placeholder { color: var(--text-500); opacity: 1; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--text-700);
  font-size: .9rem;
}

textarea { resize: vertical; min-height: 100px; }

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--brand-500);
  cursor: pointer;
  flex-shrink: 0;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b5b5b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

option { background: var(--card-bg); color: var(--text-900); }

/* === Stats Strip ========================================= */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin: 1.5rem 0;
  justify-content: center;
}

.stat-item { text-align: center; }

.stat-num {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem);
  font-weight: 700;
  color: var(--brand-700);
  font-family: Poppins, sans-serif;
  line-height: 1;
}

.stat-label {
  font-size: .8rem;
  color: var(--text-500);
  margin-top: .25rem;
}

/* === Footer ============================================== */
footer {
  background: var(--brand-900);
  border-top: none;
  padding: clamp(2rem, 4vw, 3rem) 0 0;
  font-size: .9rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .foot-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

.footer-blurb { max-width: 44ch; color: rgba(255,255,255,.75); }

.foot-links {
  list-style: none;
  padding: 0;
  margin: .4rem 0 0;
  display: grid;
  gap: .4rem;
}

.foot-links a {
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  transition: color .15s;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.foot-links a:hover { color: #fff; }

.brand-name-footer {
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  white-space: nowrap;
}

footer h3 {
  font-size: 1rem;
  margin-bottom: .6rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: .78rem;
}

.social-icons {
  display: flex;
  gap: .65rem;
  margin-top: .75rem;
}

.social-link {
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .875rem;
  transition: background .18s, transform .18s;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.2);
}

.social-link:hover {
  background: var(--brand-500);
  transform: translateY(-2px);
  border-color: var(--brand-500);
}

.footer-contacts { margin-top: .75rem; }
.footer-contacts p { margin: .25rem 0; color: rgba(255,255,255,.75); font-size: .875rem; }
.footer-contacts a { color: rgba(255,255,255,.9); font-weight: 500; }
.footer-contacts a:hover { color: #fff; }

.footer-email {
  margin-top: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.75);
  font-size: .875rem;
}

.footer-email a {
  color: rgba(255,255,255,.9);
  font-weight: 500;
  transition: color .15s;
}

.footer-email a:hover { color: #fff; text-decoration: underline; }

.copyright {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  margin-top: .5rem;
}

.copyright a { color: rgba(255,255,255,.7); }
.copyright a:hover { color: #fff; }

/* === Thematic Area Pages ================================= */
.thematic-header {
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #fff;
  padding: clamp(2rem, 5vw, 3.5rem) 1rem;
  text-align: center;
}

.thematic-title {
  font-family: Poppins, sans-serif;
  font-size: clamp(1.4rem, 2vw + .8rem, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: .4rem;
}

.thematic-sub {
  font-size: .975rem;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.65;
  opacity: .9;
  color: rgba(255,255,255,.9);
}

.thematic-banner { width: 100%; max-height: 1000px; overflow: hidden; }
.banner-img { width: 100%; height: 100%; display: block; object-fit: cover; }

.thematic-content {
  padding: clamp(1.5rem, 4vw, 2.5rem) 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.thematic-content h2  { color: var(--brand-700); margin-bottom: .75rem; }
.thematic-content p   { line-height: 1.75; color: var(--text-700); margin-bottom: 1rem; }

/* === Focus States ======================================== */
:where(a, button, [role="button"], .nav-btn, .btn):focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* === Notification Boxes ================================== */
.form-success {
  background: #fff0f0;
  border: 1px solid var(--brand-500);
  color: var(--brand-700);
  padding: .8rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.form-error {
  background: #ffeaea;
  border: 1px solid #e05a5a;
  color: #8b1a1a;
  padding: .8rem 1rem;
  border-radius: var(--radius-md);
}

/* === Mobile global tweaks ================================ */
@media (max-width: 600px) {
  .section { padding: 1.8rem 0; }
  .card { padding: 1rem 1.1rem; border-radius: var(--radius-lg); }
  .btn  { padding: .72rem 1rem; font-size: .875rem; }

  .hero-wrap > div > div,
  [style*="display:flex"][style*="gap"] { flex-wrap: wrap; }

  .stats-strip { gap: 1rem 2rem; }
  .stats-strip .stat-item { flex: 1 1 calc(50% - 1rem); }

  .card .grid.two { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .brand-name { font-size: .82rem; }
  h1 { font-size: 1.45rem; }
  .stats-strip .stat-item { flex: 1 1 100%; }
}
