/* ============================================================
   EduLibre — Plataforma de Recursos Educativos Gratuitos
   CSS Principal · Servicio Social CEFODEH · UVM 2026
   ============================================================ */

/* ── Variables y Temas ──────────────────────────────────────── */
:root {
  --primary:        #123C69;
  --primary-light:  #1a4f8a;
  --primary-dark:   #0c2847;
  --secondary:      #2E8B57;
  --secondary-light:#38a569;
  --accent:         #1ECBE1;
  --accent-light:   #4ed8e8;
  --accent-warm:    #06b6d4;

  --bg:             #ffffff;
  --bg-alt:         #f4f8fc;
  --bg-card:        rgba(255,255,255,0.97);
  --glass:          rgba(255,255,255,0.12);
  --glass-border:   rgba(255,255,255,0.22);

  --text:           #0f1c2e;
  --text-2:         #4a5568;
  --text-3:         #8a9ab0;

  --border:         #e2eaf3;
  --border-2:       #c8d8ec;

  --sh-sm:  0 2px 8px  rgba(18,60,105,.08);
  --sh-md:  0 4px 20px rgba(18,60,105,.12);
  --sh-lg:  0 8px 40px rgba(18,60,105,.16);
  --sh-xl:  0 16px 64px rgba(18,60,105,.2);

  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 9999px;

  --ease:   cubic-bezier(0.4,0,0.2,1);
  --t:      0.3s;
  --t-fast: 0.15s;
  --t-slow: 0.6s;

  --nav-h:  70px;
  --max-w:  1200px;

  --grad-hero:    linear-gradient(135deg,#0c1f3a 0%,#123C69 45%,#0d3d2e 100%);
  --grad-primary: linear-gradient(135deg,#123C69,#1a5a94);
  --grad-accent:  linear-gradient(135deg,#1ECBE1,#2E8B57);
  --grad-card:    linear-gradient(145deg,rgba(18,60,105,.06),rgba(30,203,225,.04));
}

[data-theme="dark"] {
  --bg:        #0d1117;
  --bg-alt:    #161b22;
  --bg-card:   rgba(22,27,34,.97);
  --glass:     rgba(255,255,255,.05);
  --glass-border: rgba(255,255,255,.1);
  --text:      #e6edf3;
  --text-2:    #8b949e;
  --text-3:    #6e7681;
  --border:    #30363d;
  --border-2:  #484f58;
  --sh-sm:     0 2px 8px  rgba(0,0,0,.35);
  --sh-md:     0 4px 20px rgba(0,0,0,.45);
  --sh-lg:     0 8px 40px rgba(0,0,0,.55);
  --sh-xl:     0 16px 64px rgba(0,0,0,.65);
  --grad-hero: linear-gradient(135deg,#080e18 0%,#0d1f3c 45%,#071813 100%);
  --grad-card: linear-gradient(145deg,rgba(18,60,105,.15),rgba(30,203,225,.08));
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Poppins', 'Inter', 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ── Scroll Progress Bar ────────────────────────────────────── */
#scroll-progress {
  position: fixed; top: 0; left: 0; width: 0%; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

/* ── Loading Screen ─────────────────────────────────────────── */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--grad-hero);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 10000;
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo {
  font-size: 2.5rem; font-weight: 700; color: #fff;
  letter-spacing: -0.02em; margin-bottom: 2rem;
}
.loader-logo span { color: var(--accent); }
.loader-bar-wrap {
  width: 200px; height: 3px;
  background: rgba(255,255,255,.2); border-radius: var(--r-full); overflow: hidden;
}
.loader-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  border-radius: var(--r-full);
  animation: loadBar 2s var(--ease) forwards;
}
@keyframes loadBar { to { width: 100%; } }
.loader-text {
  margin-top: 1rem; color: rgba(255,255,255,.6);
  font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── Navigation ─────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  z-index: 1000;
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--sh-md);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--max-w); width: 100%; margin: 0 auto;
  display: flex; align-items: center; gap: 2rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.3rem; color: white;
  flex-shrink: 0;
}
#navbar.scrolled .nav-logo { color: var(--primary); }
.nav-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: white; font-weight: 800;
  overflow: hidden; flex-shrink: 0;
}
.nav-logo-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-logo span { color: var(--accent); }
#navbar.scrolled .nav-logo span { color: var(--accent-warm); }

.nav-links {
  display: flex; gap: 0.25rem; margin-left: auto; align-items: center;
}
.nav-links a {
  padding: 0.45rem 0.85rem;
  border-radius: var(--r-sm);
  font-size: 0.88rem; font-weight: 500;
  color: rgba(255,255,255,.85);
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}
#navbar.scrolled .nav-links a { color: var(--text-2); }
.nav-links a:hover, .nav-links a.active {
  background: rgba(30,203,225,.18); color: var(--accent);
}
#navbar.scrolled .nav-links a:hover,
#navbar.scrolled .nav-links a.active {
  background: rgba(18,60,105,.1); color: var(--primary);
}

.nav-actions {
  display: flex; align-items: center; gap: 0.75rem; margin-left: 1rem;
}
.btn-darkmode {
  width: 40px; height: 40px; border-radius: var(--r-full);
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem;
  transition: all var(--t-fast) var(--ease);
}
#navbar.scrolled .btn-darkmode { background: var(--bg-alt); color: var(--text); }
.btn-darkmode:hover { background: rgba(30,203,225,.3); }

.btn-hamburger {
  display: none; width: 40px; height: 40px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.15);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
#navbar.scrolled .btn-hamburger { background: var(--bg-alt); }
.btn-hamburger span {
  display: block; width: 22px; height: 2px;
  background: white; border-radius: var(--r-full);
  transition: all var(--t-fast) var(--ease);
}
#navbar.scrolled .btn-hamburger span { background: var(--text); }
.btn-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-hamburger.open span:nth-child(2) { opacity: 0; }
.btn-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
  box-shadow: var(--sh-lg);
  z-index: 999;
  flex-direction: column; gap: 0.25rem;
  transform: translateY(-10px); opacity: 0;
  transition: all var(--t) var(--ease);
}
.nav-mobile.open {
  display: flex; transform: translateY(0); opacity: 1;
}
.nav-mobile a {
  padding: 0.75rem 1rem; border-radius: var(--r-sm);
  color: var(--text); font-size: 0.95rem; font-weight: 500;
  transition: all var(--t-fast) var(--ease);
  display: flex; align-items: center; gap: 0.6rem;
}
.nav-mobile a:hover { background: var(--bg-alt); color: var(--primary); }
.nav-mobile a.active { background: rgba(18,60,105,.1); color: var(--primary); font-weight: 600; }

/* ── Back to Top ────────────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 48px; height: 48px; border-radius: var(--r-full);
  background: var(--grad-primary);
  color: white; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-lg);
  transform: translateY(80px); opacity: 0;
  transition: all var(--t) var(--ease);
  z-index: 800;
}
#back-to-top.visible { transform: translateY(0); opacity: 1; }
#back-to-top:hover { transform: translateY(-4px); box-shadow: var(--sh-xl); }

/* ── Hero Sections ──────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  background: var(--grad-hero);
  overflow: hidden;
}
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--bg) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  max-width: var(--max-w); margin: 0 auto;
  padding: calc(var(--nav-h) + 3rem) clamp(1rem,5vw,2.5rem) 5rem;
  width: 100%;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(30,203,225,.15);
  border: 1px solid rgba(30,203,225,.3);
  color: var(--accent-light); border-radius: var(--r-full);
  padding: 0.4rem 1rem; font-size: 0.82rem; font-weight: 500;
  margin-bottom: 1.5rem; backdrop-filter: blur(8px);
  animation: fadeInUp 0.6s var(--ease) 0.2s both;
}
.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.1;
  color: white; letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s var(--ease) 0.4s both;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.75); max-width: 600px;
  margin-bottom: 2.5rem; font-weight: 400;
  animation: fadeInUp 0.6s var(--ease) 0.6s both;
}
.hero-actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
  animation: fadeInUp 0.6s var(--ease) 0.8s both;
}
.hero-stats {
  display: flex; gap: 2.5rem; margin-top: 4rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s var(--ease) 1s both;
}
.hero-stat { color: white; }
.hero-stat strong { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); }
.hero-stat span { font-size: 0.85rem; color: rgba(255,255,255,.65); }

.hero-scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.5); display: flex; flex-direction: column;
  align-items: center; gap: 0.5rem; font-size: 0.8rem; z-index: 2;
  animation: fadeInUp 1s var(--ease) 1.2s both;
}
.scroll-dot {
  width: 28px; height: 44px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: var(--r-full); position: relative;
}
.scroll-dot::after {
  content: ''; position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px;
  background: rgba(255,255,255,.6); border-radius: 50%;
  animation: scrollBounce 2s infinite;
}
@keyframes scrollBounce {
  0%,100% { top: 6px; opacity: 1; }
  80%      { top: 22px; opacity: 0; }
}

/* ── Page Headers (subpages) ────────────────────────────────── */
.page-header {
  position: relative; padding: calc(var(--nav-h) + 4rem) 1.5rem 4rem;
  background: var(--grad-hero); overflow: hidden; text-align: center;
}
.page-header::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(30,203,225,.15), transparent);
}
.page-header-content { position: relative; z-index: 2; }
.page-header-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(30,203,225,.15); border: 1px solid rgba(30,203,225,.3);
  color: var(--accent-light); border-radius: var(--r-full);
  padding: 0.4rem 1rem; font-size: 0.82rem; font-weight: 500; margin-bottom: 1rem;
}
.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; color: white;
  margin-bottom: 1rem; letter-spacing: -0.03em;
}
.page-header p {
  font-size: 1.1rem; color: rgba(255,255,255,.7); max-width: 600px; margin: 0 auto;
}

/* ── Sections ───────────────────────────────────────────────── */
section { padding: 5rem clamp(1rem,4vw,2.5rem); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--accent-warm); font-size: 0.82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
}
.section-label::before {
  content: ''; display: block; width: 20px; height: 2px;
  background: var(--accent-warm); border-radius: var(--r-full);
}
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -0.025em;
  color: var(--text); margin-bottom: 1rem;
}
.section-title span { color: var(--primary); }
[data-theme="dark"] .section-title span { color: var(--accent); }
.section-desc {
  font-size: 1.05rem; color: var(--text-2); max-width: 600px; line-height: 1.7;
}
.section-header-center { text-align: center; }
.section-header-center .section-label { justify-content: center; }
.section-header-center .section-desc { margin: 0 auto; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--r-full);
  font-size: 0.93rem; font-weight: 600; font-family: inherit;
  transition: all var(--t) var(--ease); cursor: pointer;
  white-space: nowrap; border: 2px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 16px rgba(18,60,105,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(18,60,105,.45);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: white;
  box-shadow: 0 4px 16px rgba(30,203,225,.35);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(30,203,225,.45); }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.4); color: white;
}
.btn-outline:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.7); }
.btn-outline-dark {
  background: transparent; border-color: var(--border-2); color: var(--text);
}
.btn-outline-dark:hover { border-color: var(--primary); color: var(--primary); background: rgba(18,60,105,.06); }
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.82rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: all var(--t) var(--ease);
}
.card:hover {
  transform: translateY(-4px); box-shadow: var(--sh-lg);
  border-color: var(--border-2);
}
.card-body { padding: 1.75rem; }
.card-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: linear-gradient(135deg, var(--bg-alt), var(--border));
}
.card-img-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: var(--grad-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--text-3);
}

/* Category cards */
.cat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2rem 1.5rem;
  text-align: center; cursor: pointer;
  transition: all var(--t) var(--ease);
  position: relative; overflow: hidden;
}
.cat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-accent); transform: scaleX(0);
  transition: transform var(--t) var(--ease);
}
.cat-card:hover::before { transform: scaleX(1); }
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); border-color: var(--accent); }
.cat-icon {
  width: 64px; height: 64px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto 1rem;
}

/* Resource cards */
.resource-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  display: flex; flex-direction: column;
  transition: all var(--t) var(--ease);
  box-shadow: var(--sh-sm);
}
.resource-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--border-2); }
.resource-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; color: var(--text); }
.resource-desc { font-size: 0.87rem; color: var(--text-2); flex-grow: 1; margin-bottom: 1rem; line-height: 1.6; }
.resource-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.resource-tag {
  font-size: 0.73rem; font-weight: 600; padding: 0.25rem 0.6rem;
  border-radius: var(--r-full); background: var(--bg-alt); color: var(--text-2);
  border: 1px solid var(--border);
}
.resource-tag.lang { background: rgba(30,203,225,.1); color: var(--accent-warm); border-color: rgba(30,203,225,.25); }
.resource-tag.level { background: rgba(46,139,87,.1); color: var(--secondary); border-color: rgba(46,139,87,.25); }
.resource-tag.type { background: rgba(18,60,105,.1); color: var(--primary-light); border-color: rgba(18,60,105,.2); }

/* ── Stats ──────────────────────────────────────────────────── */
.stats-section { background: var(--bg-alt); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 2rem;
}
.stat-card {
  text-align: center; padding: 2.5rem 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  transition: all var(--t) var(--ease);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.stat-icon {
  font-size: 2.2rem; margin-bottom: 1rem; display: block;
}
.stat-num {
  font-size: 2.75rem; font-weight: 800; line-height: 1;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}
.stat-label { font-size: 0.9rem; color: var(--text-2); font-weight: 500; }

/* ── Tags / Badges ──────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.75rem; border-radius: var(--r-full);
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.tag-primary   { background: rgba(18,60,105,.1); color: var(--primary); }
.tag-accent    { background: rgba(30,203,225,.12); color: var(--accent-warm); }
.tag-secondary { background: rgba(46,139,87,.1); color: var(--secondary); }
.tag-neutral   { background: var(--bg-alt); color: var(--text-2); border: 1px solid var(--border); }
[data-theme="dark"] .tag-primary { background: rgba(26,79,138,.25); color: #60a5fa; }

/* ── Post Cards ─────────────────────────────────────────────── */
.post-card { cursor: pointer; }
.post-card .card-img-placeholder {
  font-size: 4rem; transition: transform var(--t) var(--ease);
}
.post-card:hover .card-img-placeholder { transform: scale(1.05); }
.post-meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.post-meta .dot { width: 3px; height: 3px; background: var(--text-3); border-radius: 50%; }
.post-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.6rem; color: var(--text); }
.post-excerpt { font-size: 0.88rem; color: var(--text-2); line-height: 1.6; margin-bottom: 1rem; }
.post-read-more {
  font-size: 0.85rem; font-weight: 600; color: var(--accent-warm);
  display: flex; align-items: center; gap: 0.3rem;
  transition: gap var(--t-fast) var(--ease);
}
.post-card:hover .post-read-more { gap: 0.6rem; }

/* ── Gallery ────────────────────────────────────────────────── */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.25rem;
}
.gallery-item {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  aspect-ratio: 4/3; cursor: pointer;
  background: var(--grad-card); border: 1px solid var(--border);
}
.gallery-item-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; color: var(--text-3);
  transition: transform var(--t-slow) var(--ease);
}
.gallery-item:hover .gallery-item-inner { transform: scale(1.08); }
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,31,58,.85), transparent 50%);
  opacity: 0; transition: opacity var(--t) var(--ease);
  display: flex; align-items: flex-end; padding: 1.25rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay p { color: white; font-size: 0.9rem; font-weight: 500; }

/* Lightbox */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t) var(--ease);
}
#lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-content {
  max-width: 90vw; max-height: 85vh;
  position: relative; text-align: center;
}
.lightbox-close {
  position: absolute; top: -3rem; right: 0;
  color: white; font-size: 1.75rem; cursor: pointer;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.1);
  transition: background var(--t-fast) var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* ── Timeline ───────────────────────────────────────────────── */
.timeline { position: relative; padding: 2rem 0; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; background: var(--border-2); transform: translateX(-50%);
}
.timeline-item {
  display: flex; gap: 3rem; margin-bottom: 3rem; align-items: flex-start;
}
.timeline-item:nth-child(even) { flex-direction: row-reverse; }
.timeline-dot {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--grad-accent); border: 3px solid var(--bg);
  box-shadow: 0 0 0 4px rgba(30,203,225,.2);
  margin-top: 1.5rem; flex-shrink: 0; z-index: 1;
}
.timeline-content {
  flex: 1; max-width: calc(50% - 3rem);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  box-shadow: var(--sh-sm);
  transition: all var(--t) var(--ease);
}
.timeline-content:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.timeline-num {
  font-size: 0.78rem; font-weight: 700; color: var(--accent-warm);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem;
}
.timeline-content h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.timeline-content p { font-size: 0.88rem; color: var(--text-2); line-height: 1.6; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block; font-size: 0.88rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 0.5rem;
}
.form-input, .form-textarea {
  width: 100%; padding: 0.85rem 1.1rem;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--bg); color: var(--text); font-size: 0.93rem;
  transition: all var(--t-fast) var(--ease);
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(18,60,105,.1);
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(30,203,225,.1);
}
.form-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }

/* ── ODS Cards ──────────────────────────────────────────────── */
.ods-card {
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--sh-lg);
}
.ods-card-header {
  padding: 2.5rem; color: white; position: relative; overflow: hidden;
}
.ods-card-header::before {
  content: ''; position: absolute; right: -2rem; top: -2rem;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.ods-card-body { padding: 2rem; background: var(--bg-card); }
.ods-num {
  font-size: 4rem; font-weight: 900; opacity: 0.35;
  position: absolute; right: 1.5rem; top: 1rem; line-height: 1;
}
.ods-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.ods-card-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.ods-card-header p { font-size: 0.9rem; opacity: 0.85; }

/* ── Info Grid ──────────────────────────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 1.5rem;
}
.info-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.75rem;
  transition: all var(--t) var(--ease); box-shadow: var(--sh-sm);
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.info-card-icon {
  width: 52px; height: 52px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 1rem;
}
.info-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.info-card p { font-size: 0.88rem; color: var(--text-2); line-height: 1.6; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: #070f1d; color: rgba(255,255,255,.75);
  padding: 4rem clamp(1rem,4vw,2.5rem) 2rem;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 3rem;
  margin-bottom: 3rem;
}
.footer-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.3rem; font-weight: 700; color: white; margin-bottom: 1rem;
}
.footer-logo-icon {
  width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent), var(--secondary));
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: white; font-weight: 800;
  overflow: hidden; flex-shrink: 0;
}
.footer-logo-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.footer-logo span { color: var(--accent); }
.footer-desc { font-size: 0.88rem; line-height: 1.7; margin-bottom: 1.5rem; max-width: 280px; }
.footer-social { display: flex; gap: 0.75rem; }
.social-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; color: rgba(255,255,255,.7);
  transition: all var(--t-fast) var(--ease); border: 1px solid rgba(255,255,255,.1);
}
.social-btn:hover { background: var(--primary-light); color: white; transform: translateY(-2px); }
.footer-col h4 {
  font-size: 0.88rem; font-weight: 700; color: white;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.25rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a {
  font-size: 0.88rem; color: rgba(255,255,255,.6);
  transition: all var(--t-fast) var(--ease);
  display: flex; align-items: center; gap: 0.4rem;
}
.footer-links a:hover { color: var(--accent); padding-left: 4px; }
.footer-divider {
  border: none; border-top: 1px solid rgba(255,255,255,.08);
  margin-bottom: 2rem;
}
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem; font-size: 0.82rem; color: rgba(255,255,255,.4);
}
.footer-bottom a { color: var(--accent); }
.footer-bottom a:hover { color: var(--accent-light); }
.footer-credits {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-md); padding: 1.25rem 1.5rem; margin-top: 2rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.footer-credits p { font-size: 0.82rem; color: rgba(255,255,255,.5); line-height: 1.6; }
.footer-credits strong { color: rgba(255,255,255,.8); }

/* ── Utility classes ────────────────────────────────────────── */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-secondary-color { color: var(--secondary); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Scroll Reveal ──────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left  { opacity: 0; transform: translateX(-28px); transition: opacity 0.65s var(--ease), transform 0.65s var(--ease); }
.reveal-right { opacity: 0; transform: translateX(28px);  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease); }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ── Keyframe Animations ────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}

/* ── Article (posts) ────────────────────────────────────────── */
.article-layout {
  max-width: 820px; margin: 0 auto;
  padding: 3rem clamp(1rem,4vw,2.5rem);
}
.article-meta {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text-2); margin-bottom: 2rem;
}
.article-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.2;
  letter-spacing: -0.025em; color: var(--text); margin-bottom: 1.25rem;
}
.article-lead {
  font-size: 1.15rem; color: var(--text-2); line-height: 1.75;
  border-left: 4px solid var(--accent); padding-left: 1.25rem;
  margin-bottom: 2.5rem;
}
.article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 2.5rem 0 1rem; color: var(--text); }
.article-body h3 { font-size: 1.1rem; font-weight: 700; margin: 2rem 0 0.75rem; color: var(--text); }
.article-body p  { margin-bottom: 1.25rem; color: var(--text-2); line-height: 1.8; }
.article-body ul, .article-body ol { margin: 1rem 0 1.5rem 1.5rem; }
.article-body li { margin-bottom: 0.6rem; color: var(--text-2); line-height: 1.7; }
.article-body ul li { list-style: disc; }
.article-body ol li { list-style: decimal; }
.article-img-placeholder {
  width: 100%; aspect-ratio: 2/1; background: var(--grad-card);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; color: var(--text-3); margin-bottom: 2.5rem;
}
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4rem;
  padding-top: 2.5rem; border-top: 1px solid var(--border);
}
.article-nav-btn {
  padding: 1rem 1.25rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: all var(--t) var(--ease);
}
.article-nav-btn:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--sh-md); }
.article-nav-btn span { display: block; font-size: 0.75rem; color: var(--text-3); margin-bottom: 0.3rem; }
.article-nav-btn strong { font-size: 0.9rem; color: var(--text); line-height: 1.4; display: block; }
.article-nav-btn.next { text-align: right; }

/* ── Team ───────────────────────────────────────────────────── */
.team-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-lg);
}
.team-card-header {
  background: var(--grad-hero); padding: 3rem 2.5rem;
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.team-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 4px solid rgba(30,203,225,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--accent-light); flex-shrink: 0;
  overflow: hidden;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-info { color: white; }
.team-info h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.3rem; }
.team-info p  { opacity: 0.75; font-size: 0.95rem; }
.team-card-body { padding: 2.5rem; }

/* ── Search / Filter ────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.filter-btn {
  padding: 0.55rem 1.2rem; border-radius: var(--r-full);
  font-size: 0.85rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text-2);
  transition: all var(--t-fast) var(--ease); cursor: pointer;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary); color: white; border-color: var(--primary);
}
.search-bar {
  position: relative; margin-bottom: 2rem;
}
.search-bar input {
  width: 100%; padding: 0.9rem 1.25rem 0.9rem 3rem;
  border: 1.5px solid var(--border); border-radius: var(--r-full);
  background: var(--bg-card); color: var(--text); font-size: 0.95rem;
  transition: border-color var(--t-fast) var(--ease); outline: none;
}
.search-bar input:focus { border-color: var(--primary); }
.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}

/* ── Alerts / Banners ───────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem; border-radius: var(--r-md);
  display: flex; align-items: flex-start; gap: 0.75rem;
  font-size: 0.9rem; line-height: 1.5; margin-bottom: 1.5rem;
}
.alert-success { background: rgba(46,139,87,.1); border: 1px solid rgba(46,139,87,.25); color: var(--secondary); }
.alert-info    { background: rgba(30,203,225,.1); border: 1px solid rgba(30,203,225,.25); color: var(--accent-warm); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .timeline::before { left: 20px; }
  .timeline-item, .timeline-item:nth-child(even) { flex-direction: column; padding-left: 50px; }
  .timeline-dot { left: 20px; }
  .timeline-content { max-width: 100%; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .btn-hamburger { display: flex; }
  section { padding: 3.5rem 1.25rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .article-nav { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { justify-content: center; }
  .filter-bar { gap: 0.5rem; }
  .filter-btn { font-size: 0.78rem; padding: 0.45rem 0.9rem; }
  .team-card-header { flex-direction: column; text-align: center; }
  #back-to-top { bottom: 1.25rem; right: 1.25rem; width: 42px; height: 42px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(1.8rem, 8vw, 3rem); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive inline grids ────────────────────────────────── */
/* Collapse two-column inline-style grids to one column on mobile */
@media (max-width: 768px) {
  /* Match elements using inline display:grid with explicit columns */
  .section-inner > div[style*="display:grid"],
  .section-inner > div[style*="display: grid"],
  main [style*="display:grid"],
  main [style*="display: grid"],
  .team-card-body > div[style*="display:grid"],
  .team-card-body > div[style*="display: grid"],
  section [style*="grid-template-columns:1fr 1fr"],
  section [style*="grid-template-columns:1.2fr 1fr"],
  section [style*="grid-template-columns:1fr 1.2fr"],
  section [style*="grid-template-columns:1fr 1.4fr"],
  section [style*="grid-template-columns:1fr 1.5fr"],
  section [style*="grid-template-columns:2fr 1fr"],
  section [style*="grid-template-columns:1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Two-column ODS mini grid — keep 2 cols on mobile */
  .ods-mini-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Article inner two-column in team.html */
  .team-card-body > div { grid-template-columns: 1fr !important; }

  /* Contact form two-column name+email row */
  .form-group + .form-group,
  .contact-form-inner > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Print styles ───────────────────────────────────────────── */
@media print {
  #navbar, #nav-mobile, #loading-screen, #back-to-top, #scroll-progress { display: none !important; }
  .hero { min-height: auto; }
  body { font-size: 12pt; }
}
