/* ══════════════════════════════════════════════════════════════
   EDUCATION PAGE STYLES - Standalone
   ══════════════════════════════════════════════════════════════ */

/* ── Education Hero ────────────────────────────────────────── */
.edu-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--brand) 100%);
  color: var(--white); padding: 6rem 0 4rem; text-align: center;
}
.edu-hero .eyebrow { color: var(--gold-light); }
.edu-hero .eyebrow::before { background: var(--gold-light); }
.edu-hero h1 { color: var(--white); }
.edu-hero .lead { color: rgba(255,255,255,0.9); max-width: 700px; margin: 1rem auto; }
.edu-hero-stats {
  display: flex; gap: 3rem; justify-content: center; margin-top: 3rem; flex-wrap: wrap;
}
.edu-stat { text-align: center; }
.edu-stat strong {
  display: block; font-family: var(--font-head); font-size: 2.5rem;
  font-weight: 700; color: var(--gold-light);
}
.edu-stat span { display: block; font-size: 0.85rem; opacity: 0.85; margin-top: 0.25rem; }

/* ── Filter Toggle Button ───────────────────────────────────── */
#edu-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#edu-filter-toggle:hover,
#edu-filter-toggle[aria-expanded="true"] {
  background: var(--blue);
  color: var(--white);
}

/* ── Active Filter Summary (next to toggle when closed) ─────── */
#edu-filter-summary {
  display: inline-flex;
  align-items: center;
  margin-left: 0.6rem;
  padding: 0.3rem 0.85rem;
  background: var(--blue-bg, #eef2fb);
  border: 1px solid rgba(41,82,163,0.25);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  vertical-align: middle;
}
#edu-filter-summary:empty { display: none; }

/* ── Filter Panel (collapsed by default) ────────────────────── */
#edu-filter-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#edu-filter-panel.edu-panel-open {
  max-height: 1200px;
}

/* ── Filter Sections ────────────────────────────────────────── */
.edu-filter-section { margin-bottom: 1.5rem; }
.edu-filter-section:last-of-type { margin-bottom: 0; }
.edu-filter-section h5 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  color: var(--charcoal);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Live pill showing the current selection next to section heading */
.edu-section-active {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.65rem;
  background: var(--blue-bg, #eef2fb);
  border: 1px solid rgba(41,82,163,0.22);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.edu-section-active:empty { display: none; }

.edu-filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ── Filter Chips — pill shaped, blue when active ───────────── */
.edu-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 1.05rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--body);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.edu-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.edu-chip.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

/* ── Filter Actions Row ─────────────────────────────────────── */
.edu-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.edu-filter-count { font-size: 0.85rem; color: var(--muted); margin-left: auto; }
.edu-filter-count strong { color: var(--blue); font-weight: 700; }

/* ── Resource Grid ─────────────────────────────────────────── */
.edu-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem;
}
.edu-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: var(--transition); display: flex; flex-direction: column;
}
.edu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--blue-light); }
.edu-card.hidden { display: none; }
.edu-card-icon { font-size: 2rem; margin-bottom: 1rem; }
.edu-card-body { flex: 1; }
.edu-card-title { font-size: 1rem; font-weight: 700; color: var(--charcoal); margin-bottom: 0.5rem; line-height: 1.3; }
.edu-card-desc { font-size: 0.85rem; color: var(--body); line-height: 1.6; margin-bottom: 1rem; }
.edu-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.edu-tag {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 0.25rem 0.6rem; border-radius: 4px;
  background: var(--bg2); color: var(--body); border: 1px solid var(--border);
}
.edu-tag-sport   { background: var(--blue-bg); color: var(--blue); border-color: rgba(41,82,163,0.2); }
.edu-tag-ks      { background: var(--gold-bg); color: var(--gold); border-color: rgba(200,147,58,0.2); }
.edu-tag-diff-support   { background: #e8f5e9; color: #2e7d32; border-color: rgba(46,125,50,0.2); }
.edu-tag-diff-core      { background: #fff3e0; color: #e65100; border-color: rgba(230,81,0,0.2); }
.edu-tag-diff-challenge { background: #fce4ec; color: #c2185b; border-color: rgba(194,24,91,0.2); }
.edu-card-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1rem; border-top: 1px solid var(--border); gap: 1rem;
}
.edu-checkbox { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.8rem; color: var(--body); font-weight: 500; }
.edu-checkbox input { cursor: pointer; }

/* ── Interactive Widgets ───────────────────────────────────── */
.section--bg { background: var(--bg2); }
.edu-widget { background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; max-width: 800px; margin: 0 auto; }
.edu-widget-header { text-align: center; margin-bottom: 2rem; }
.edu-widget-header h3 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.edu-widget-sub { color: var(--muted); font-size: 0.95rem; }
/* ── H2H Selectors ─────────────────────────────────────────── */
.h2h-selector { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; justify-content: center; flex-wrap: wrap; }
.h2h-select { flex: 1; min-width: 200px; max-width: 300px; padding: 0.75rem 1rem; border: 2px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; background: var(--white); }
.h2h-vs { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--gold); flex-shrink: 0; }

/* ── H2H Athlete vote buttons ──────────────────────────────── */
.h2h-display { display: flex; gap: 1.5rem; justify-content: center; margin-bottom: 0; flex-wrap: wrap; align-items: stretch; }
.h2h-athlete {
  text-align: center; flex: 1; min-width: 170px; max-width: 240px;
  padding: 1.5rem 1rem; border-radius: var(--radius);
  border: 2.5px solid var(--border); background: var(--white);
  cursor: pointer; transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.h2h-athlete:not(:disabled):hover { border-color: var(--blue); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(41,82,163,0.15); }
.h2h-athlete:not(:disabled):active { transform: translateY(0); }
.h2h-athlete:disabled { cursor: default; }

/* Initials avatar */
.h2h-initials {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--white);
  transition: background 0.3s;
}
.h2h-name { font-weight: 700; font-size: 1rem; color: var(--charcoal); line-height: 1.3; }
.h2h-tap-hint { font-size: 0.75rem; color: var(--muted); }

/* Voted states */
.h2h-voted-badge {
  display: none; font-size: 0.75rem; font-weight: 700;
  color: var(--white); background: var(--blue); padding: 0.2rem 0.6rem; border-radius: 50px;
}
.h2h-athlete.h2h-voted { border-color: var(--blue); background: var(--blue-bg, #eef2fb); }
.h2h-athlete.h2h-voted .h2h-initials { background: linear-gradient(135deg, var(--blue), #4a74c5); }
.h2h-athlete.h2h-voted .h2h-voted-badge { display: inline-flex; }
.h2h-athlete.h2h-voted .h2h-tap-hint { display: none; }
.h2h-athlete.h2h-not-voted { opacity: 0.45; border-color: var(--border); }
.h2h-athlete.h2h-not-voted .h2h-tap-hint { display: none; }

/* Middle VS / result column */
.h2h-mid {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.5rem; padding: 1rem 0.5rem; flex-shrink: 0;
}
.h2h-vs-badge {
  font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--gold);
}
.h2h-result {
  font-size: 1rem; font-weight: 700; color: var(--blue); text-align: center;
  white-space: nowrap; min-height: 1.4rem;
}

/* ── Vote bar ──────────────────────────────────────────────── */
.h2h-bar-wrap {
  display: flex; height: 10px; border-radius: 50px; overflow: hidden;
  margin: 1.25rem 0 0.4rem; background: var(--border);
}
.h2h-bar-left  { background: var(--blue); transition: width 0.5s ease; }
.h2h-bar-right { background: var(--gold); transition: width 0.5s ease; }
.h2h-bar-labels {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--muted); margin-bottom: 1.25rem;
}
.h2h-pct-left  { font-weight: 700; color: var(--blue); min-width: 2.5rem; }
.h2h-pct-right { font-weight: 700; color: var(--gold); min-width: 2.5rem; text-align: right; }
.h2h-tally { font-size: 0.78rem; text-align: center; flex: 1; }

/* Footer actions */
.h2h-footer-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ── Teacher Box ───────────────────────────────────────────── */
.edu-teacher-box { background: var(--gold-bg); border: 2px solid rgba(200,147,58,0.3); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 2rem; margin-top: 2rem; }
.edu-teacher-box h3 { margin-bottom: 1rem; color: var(--charcoal); }
.edu-list { list-style: none; padding: 0; margin: 0; }
.edu-list li { padding: 0.5rem 0; color: var(--body); line-height: 1.6; }

/* ── Classroom Mode ────────────────────────────────────────── */
body.classroom-mode .ad-wrap,
body.classroom-mode .ticker-wrap,
body.classroom-mode .header-search,
body.classroom-mode .site-footer { display: none !important; }
body.classroom-mode { font-size: 18px; }
body.classroom-mode h1 { font-size: clamp(2.8rem, 7vw, 6rem); }
body.classroom-mode h2 { font-size: clamp(2rem, 5vw, 4rem); }
body.classroom-mode p { line-height: 1.8; }
body.classroom-mode .main-nav a:not(.nav-edu-link) { opacity: 0.6; }


/* ── Resource Preview Modal ─────────────────────────────────── */
#edu-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
#edu-modal {
  background: var(--white, #fff);
  border-radius: var(--radius-lg, 12px);
  width: 100%; max-width: 760px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  overflow: hidden;
}
#edu-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
#edu-modal-title {
  font-family: var(--font-head); font-size: 1.3rem;
  font-weight: 700; color: var(--charcoal, #1a1a2e);
  margin: 0; line-height: 1.3;
}
#edu-modal-actions {
  display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0;
}
#edu-modal-close {
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 1.5px solid var(--border, #e5e7eb);
  background: transparent; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  color: var(--muted, #6b7280); transition: background 0.15s, color 0.15s;
}
#edu-modal-close:hover { background: var(--bg2, #f3f4f6); color: var(--charcoal, #1a1a2e); }
#edu-modal-body {
  overflow-y: auto; padding: 1.5rem 1.75rem;
  flex: 1;
}

/* Modal sections */
.edu-modal-section { margin-bottom: 1.75rem; }
.edu-modal-section:last-child { margin-bottom: 0; }
.edu-modal-section-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--blue, #2952a3);
  margin-bottom: 0.6rem; padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--blue-bg, #eef2fb);
}
.edu-modal-para {
  font-size: 0.95rem; line-height: 1.75; color: var(--body, #374151);
  margin: 0;
}
.edu-modal-list {
  margin: 0; padding-left: 1.25rem;
  list-style: disc;
}
.edu-modal-list li {
  font-size: 0.9rem; line-height: 1.65; color: var(--body, #374151);
  margin-bottom: 0.4rem;
}

/* Timeline */
.edu-modal-timeline { display: flex; flex-direction: column; gap: 0.5rem; }
.edu-modal-tl-item {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg2, #f9fafb);
  border-radius: 6px;
  border-left: 3px solid var(--blue, #2952a3);
}
.edu-modal-tl-year {
  font-weight: 700; font-size: 0.85rem; color: var(--blue, #2952a3);
  min-width: 3rem; flex-shrink: 0;
}
.edu-modal-tl-event { font-size: 0.9rem; color: var(--body, #374151); }

/* Comparison table */
.edu-modal-table-wrap { overflow-x: auto; margin: 0; }
.edu-modal-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
}
.edu-modal-table th {
  background: var(--blue, #2952a3); color: #fff;
  padding: 0.6rem 0.75rem; text-align: left;
  font-size: 0.8rem; font-weight: 700;
}
.edu-modal-table td {
  border: 1px solid var(--border, #e5e7eb);
  padding: 0.5rem 0.75rem; vertical-align: top;
  color: var(--body, #374151);
}
.edu-modal-table tr:nth-child(even) td { background: var(--bg2, #f9fafb); }

/* Mobile modal */
@media (max-width: 600px) {
  #edu-modal { max-height: 95vh; border-radius: 12px 12px 0 0; }
  #edu-modal-overlay { align-items: flex-end; padding: 0; }
  #edu-modal-header { padding: 1.25rem 1.25rem 1rem; }
  #edu-modal-title { font-size: 1.1rem; }
  #edu-modal-body { padding: 1.25rem; }
}

/* ── Print Styles ──────────────────────────────────────────── */
@media print {
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .site-header, .site-footer, .ticker-wrap, .ad-wrap,
  #edu-filter-toggle, #edu-filter-panel, #edu-filter-summary,
  .btn, .hamburger, .edu-preview-btn, .classroom-toggle { display: none !important; }
  .edu-card { page-break-inside: avoid; border: 1px solid #ddd; margin-bottom: 1rem; }
  .edu-card.hidden { display: none !important; }
  .edu-widget { page-break-inside: avoid; border: 2px solid #ddd; }
  h1, h2, h3 { color: #000 !important; page-break-after: avoid; }
  .edu-hero { background: none !important; color: #000 !important; padding: 2rem 0; }
  .section--bg { background: none !important; }
}

/* ── Mobile Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .edu-hero { padding: 4rem 0 3rem; }
  .edu-hero-stats { gap: 2rem; }
  .edu-grid { grid-template-columns: 1fr; }
  .edu-filter-section { margin-bottom: 1rem; }
  #edu-filter-summary { display: none; }
  .edu-section-active { display: none; }
  .edu-widget { padding: 1.5rem; }
  .h2h-display { flex-direction: column; gap: 1rem; align-items: center; }
  .h2h-athlete { max-width: 100%; width: 100%; }
  .h2h-mid { flex-direction: row; padding: 0; }
  .h2h-selector { flex-direction: column; }
  .h2h-select { max-width: 100%; }
}
