/* competitions.css - The One Academy TH Competitions Design System & Theme Engine */

:root {
  --page-bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --heading: #0f172a;
  --border: #dbe3ef;
  --card-bg: #ffffff;
  --callout-bg: #eff6ff;
  --callout-text: #1e40af;
  --link: #1d4ed8;
  --nav-bg: #12184a;
}

:root[data-theme="dark"] {
  --page-bg: #0a0912;
  --surface: #18152e;
  --surface-alt: #110e24;
  --text: #eceaf8;
  --text-muted: #94a3b8;
  --heading: #f8fafc;
  --border: rgba(184, 176, 255, 0.15);
  --card-bg: #18152e;
  --callout-bg: #1e1b4b;
  --callout-text: #93c5fd;
  --link: #818cf8;
  --nav-bg: rgba(10, 9, 18, 0.90);
}

/* Global Body & Layout Integration */
body {
  background: var(--page-bg);
  color: var(--text);
}

:root[data-theme="dark"] body {
  background: var(--page-bg) !important;
  color: var(--text) !important;
}

.competition-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 64px;
}

/* --- Multi-Column Grid Layout for Competitions Hub --- */
.competition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

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

/* Breadcrumb */
.competition-main .nm-breadcrumb,
.competition-main .nm-breadcrumb a,
.competition-main .nm-breadcrumb span,
.breadcrumb,
.breadcrumb a,
.breadcrumb span {
  color: var(--text-muted);
  text-decoration: none;
}

.competition-main .nm-breadcrumb a:hover,
.breadcrumb a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Competition Detail Hero */
.competition-detail-hero,
.competition-hero,
.knowledge-hero {
  padding: 34px clamp(20px, 4vw, 44px);
  border: 1px solid var(--border);
  border-top: 5px solid #2563eb;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  margin-bottom: 24px;
}

:root[data-theme="light"] .knowledge-hero .page-panel,
:root[data-theme="light"] .article-main,
:root[data-theme="light"] .article-aside,
:root[data-theme="light"] .article-box {
  background: #ffffff !important;
  color: #1e293b !important;
  border-color: #dbe3ef !important;
}

:root[data-theme="dark"] .knowledge-hero .page-panel,
:root[data-theme="dark"] .article-main,
:root[data-theme="dark"] .article-aside,
:root[data-theme="dark"] .article-box {
  background: #18152e !important;
  color: #eceaf8 !important;
  border-color: rgba(184, 176, 255, 0.15) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

.competition-detail-hero h1,
.competition-hero h1,
.knowledge-hero h1,
.article-main h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.15;
  color: var(--heading);
  margin: 0 0 14px 0;
}

:root[data-theme="dark"] .knowledge-hero .page-panel h1,
:root[data-theme="dark"] .article-main h1,
:root[data-theme="dark"] .article-main h2,
:root[data-theme="dark"] .article-aside h2,
:root[data-theme="dark"] .article-section h2,
:root[data-theme="dark"] .article-section h3 {
  color: #f8fafc !important;
}

.competition-detail-hero > p,
.competition-hero p,
.knowledge-hero p,
.article-section p,
.article-section li {
  color: var(--text);
  line-height: 1.7;
}

:root[data-theme="dark"] .knowledge-hero .page-panel p,
:root[data-theme="dark"] .article-section p,
:root[data-theme="dark"] .article-section li,
:root[data-theme="dark"] .toc-list a,
:root[data-theme="dark"] .toc-list {
  color: #cbd5e1 !important;
}

.eyebrow {
  color: #2563eb;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

:root[data-theme="dark"] .eyebrow {
  color: #93c5fd;
}

/* Competition Sticky TOC Subnav */
.competition-toc,
.lesson-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: static;
  margin: 18px 0 28px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.competition-toc a,
.lesson-toc a {
  padding: 7px 12px;
  color: var(--link);
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  background: var(--surface-alt);
  transition: all 0.2s ease;
}

.competition-toc a:hover,
.lesson-toc a:hover {
  background: #2563eb;
  color: #ffffff;
}

/* Article Lesson Sections */
.competition-article .lesson-section,
.lesson-section {
  margin: 0 0 24px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.competition-article h2,
.lesson-section h2,
.section-heading h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--heading);
  margin-top: 0;
}

.competition-article h3,
.lesson-section h3 {
  font-size: 1.15rem;
  color: var(--heading);
  margin-top: 20px;
}

/* Quick Facts & Info Grids */
.quick-facts,
.two-column-facts,
.center-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  background: transparent;
  border: none;
}

.quick-facts > div,
.two-column-facts > div,
.center-split > div,
.subject-matrix > div,
.round-flow > div {
  padding: 16px 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.quick-facts dt,
.two-column-facts h3,
.subject-matrix strong {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--link);
  margin-bottom: 6px;
}

.quick-facts dd {
  margin: 0;
  color: var(--heading);
  font-weight: 700;
}

/* Feature & Evidence Cards */
.evidence-split,
.decision-grid,
.exam-library-grid,
.transfer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.evidence-card,
.decision-card,
.library-card,
.transfer-card,
.history-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-alt);
}

.evidence-card h3,
.decision-card h3,
.library-card h3,
.transfer-card h3,
.history-card h3 {
  margin-top: 0;
  color: var(--heading);
}

.evidence-card.is-partial { border-top: 4px solid #f59e0b; }
.evidence-card.is-official { border-top: 4px solid #2563eb; }

/* Callouts & Notes */
.source-note,
.fee-callout,
.caution-section,
.warning-box,
.transfer-panel,
.comparison-note,
.report-panel {
  padding: 20px;
  border-radius: 14px;
  margin: 20px 0;
  border-left: 5px solid #2563eb;
  background: var(--callout-bg);
  color: var(--text);
}

.warning-box { border: 2px solid #f59e0b; background: rgba(245, 158, 11, 0.1); }
.warning-box strong { color: #d97706; }
.transfer-panel { border-left-color: #0f766e; background: rgba(15, 118, 110, 0.1); }
.transfer-panel h2, .transfer-panel h3 { color: #0d9488; }
.report-panel { border-color: #10b981; background: rgba(16, 185, 129, 0.1); }

/* Tables */
.competition-table-wrap,
table {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  margin: 18px 0;
}

.competition-table,
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

.competition-table th,
.competition-table td,
table th,
table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  color: var(--text);
}

.competition-table th,
table th {
  background: var(--surface-alt);
  color: var(--heading);
  font-weight: 800;
}

:root[data-theme="dark"] table th,
:root[data-theme="dark"] .competition-table th {
  background: #110e24 !important;
  color: #f8fafc !important;
}

:root[data-theme="dark"] table td,
:root[data-theme="dark"] .competition-table td {
  background: #18152e !important;
  color: #eceaf8 !important;
  border-color: rgba(184, 176, 255, 0.1) !important;
}

/* FAQ Details */
.faq-list details {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.faq-list summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 800;
  color: var(--heading);
}

.faq-list p {
  padding: 0 0 12px;
  color: var(--text-muted);
}

/* Source Lists */
.source-list {
  padding-left: 1.35rem;
}

.source-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.source-list a {
  font-weight: 800;
  color: var(--link);
}

.source-list span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Article Footer Review */
.article-review {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 18px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-review strong {
  color: var(--heading);
}

/* Status Badges */
.hub-status,
.competition-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-verified_current { color: #14532d; background: #dcfce7; border: 1px solid #86efac; }
.status-needs_current_year_update { color: #854d0e; background: #fef9c3; border: 1px solid #fde047; }
.status-partial_verified { color: #9a3412; background: #ffedd5; border: 1px solid #fdba74; }

/* Filter Chips (Hub page) */
.filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 32px 0;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--link);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.is-active,
.filter-chip.active,
.filter-chip:hover {
  background: #2563eb;
  color: #ffffff !important;
  border-color: #2563eb;
}

/* Hub Cards Grid */
.hub-section .competition-card {
  border: 1px solid var(--border);
  border-top: 4px solid #2563eb;
  border-radius: 16px;
  background: var(--surface);
  padding: 22px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.hub-section .competition-card h3 {
  color: var(--heading);
  font-size: 1.3rem;
  margin: 10px 0 6px 0;
}

.hub-section .competition-card__full {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.hub-section .competition-card dl {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.hub-section .competition-card .text-link {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff !important;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

/* Responsive Rules */
@media(max-width:760px) {
  .quick-facts, .two-column-facts, .evidence-split, .decision-grid, .exam-library-grid, .transfer-grid, .center-split {
    grid-template-columns: 1fr;
  }
}
