/* ═══════════════════════════════════════════════════════
   EPSOready – EU Knowledge Course – Shared Stylesheet
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f8f9fa;
  color: #1a1a2e;
  line-height: 1.75;
}

/* ── Header ── */
.course-header {
  background: linear-gradient(135deg, #0f1c2e 0%, #1e2d4a 100%);
  color: white;
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.course-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(201,162,39,0.06);
  border-radius: 50%;
}
.course-header .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px;
  background: #c9a227;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #0f1c2e;
}
.logo-text { font-size: 20px; font-weight: 800; color: white; }
.logo-text span { color: #c9a227; }
.chapter-badge {
  display: inline-block;
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.4);
  color: #c9a227;
  font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 18px; border-radius: 999px; margin-bottom: 16px;
}
.course-header h1 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 900; line-height: 1.2; margin-bottom: 16px;
}
.course-header h1 span { color: #c9a227; display: block; }
.meta-row {
  display: flex; justify-content: center;
  gap: 24px; flex-wrap: wrap; margin-top: 20px;
}
.meta-pill {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
  font-size: 13px; padding: 6px 16px; border-radius: 999px;
}

/* ── Layout ── */
.container { max-width: 860px; margin: 0 auto; padding: 48px 24px 80px; }

/* ── Section headers ── */
h2 {
  font-size: 22px; font-weight: 800; color: #0f1c2e;
  margin: 48px 0 16px; padding-bottom: 10px;
  border-bottom: 3px solid #c9a227;
}
h3 { font-size: 17px; font-weight: 700; color: #0f1c2e; margin: 28px 0 10px; }
h4 { font-size: 15px; font-weight: 700; color: #374151; margin: 20px 0 8px; }

/* ── Text ── */
p { margin-bottom: 14px; color: #2d3748; font-size: 15.5px; }
strong { color: #0f1c2e; }
ul, ol { padding-left: 22px; margin-bottom: 16px; }
li { margin-bottom: 8px; color: #2d3748; font-size: 15.5px; }

/* ── Intro box ── */
.intro-box {
  background: #eef2ff; border-left: 5px solid #4f46e5;
  border-radius: 0 12px 12px 0;
  padding: 20px 24px; margin-bottom: 32px;
  font-size: 15.5px; color: #1e293b;
}

/* ── Callout ── */
.callout {
  background: #fffbeb; border: 1px solid #fcd34d;
  border-left: 5px solid #c9a227;
  border-radius: 0 12px 12px 0;
  padding: 18px 22px; margin: 24px 0;
  font-size: 14.5px; color: #1a1a2e;
}
.callout strong { color: #92650a; }
.callout-blue {
  background: #eff6ff; border-left: 5px solid #3b82f6;
  border-radius: 0 12px 12px 0;
  padding: 18px 22px; margin: 24px 0; font-size: 14.5px;
}
.callout-green {
  background: #f0fdf4; border-left: 5px solid #22c55e;
  border-radius: 0 12px 12px 0;
  padding: 18px 22px; margin: 24px 0; font-size: 14.5px;
}
.callout-red {
  background: #fef2f2; border-left: 5px solid #ef4444;
  border-radius: 0 12px 12px 0;
  padding: 18px 22px; margin: 24px 0; font-size: 14.5px;
}

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin: 20px 0;
}
.card {
  background: white; border: 2px solid #e5e7eb;
  border-radius: 14px; padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: #c9a227; box-shadow: 0 4px 16px rgba(201,162,39,0.12); }
.card .card-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.card .card-title { font-size: 15px; font-weight: 800; color: #0f1c2e; margin-bottom: 6px; }
.card .card-body { font-size: 13.5px; color: #4b5563; line-height: 1.5; }
.card .card-tag {
  display: inline-block; margin-top: 10px;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: #f1f5f9; color: #475569;
}

/* ── Two-column compare ── */
.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px; margin: 20px 0; border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.compare-col { padding: 24px; }
.compare-col.dark { background: #0f1c2e; }
.compare-col.mid { background: #1e2d4a; }
.compare-col.light { background: #f8fafc; border: 1px solid #e5e7eb; }
.compare-col h4 { font-size: 14px; font-weight: 800; margin-bottom: 14px; }
.compare-col.dark h4, .compare-col.mid h4 { color: #c9a227; }
.compare-col.light h4 { color: #0f1c2e; }
.compare-col ul { padding-left: 18px; }
.compare-col.dark li, .compare-col.mid li { color: rgba(255,255,255,0.75); font-size: 13.5px; }
.compare-col.light li { color: #374151; font-size: 13.5px; }

/* ── Pyramid / hierarchy ── */
.pyramid { margin: 24px auto; max-width: 500px; }
.pyramid-level {
  display: flex; justify-content: center; margin-bottom: 4px;
}
.pyramid-block {
  text-align: center; padding: 12px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.3;
}

/* ── Process flow ── */
.flow {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px; margin: 20px 0;
}
.flow-step {
  background: #0f1c2e; color: white;
  border-radius: 10px; padding: 12px 18px;
  font-size: 13px; font-weight: 700;
  text-align: center; flex: 1; min-width: 100px;
}
.flow-step .step-num {
  font-size: 10px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: #c9a227; display: block; margin-bottom: 4px;
}
.flow-arrow { color: #c9a227; font-size: 20px; font-weight: 900; flex-shrink: 0; }
.flow-step.highlight { background: #c9a227; color: #0f1c2e; }

/* ── Stat row ── */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 12px; margin: 20px 0;
}
.stat-box {
  background: #0f1c2e; border-radius: 14px;
  padding: 20px 16px; text-align: center;
}
.stat-box .stat-num { font-size: 28px; font-weight: 900; color: #c9a227; }
.stat-box .stat-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px; }

/* ── Facts table ── */
.facts-table {
  width: 100%; border-collapse: collapse;
  margin: 20px 0; font-size: 14px;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.facts-table thead tr { background: #0f1c2e; color: white; }
.facts-table th { padding: 12px 16px; text-align: left; font-weight: 700; font-size: 13px; }
.facts-table tbody tr:nth-child(even) { background: #f8fafc; }
.facts-table tbody tr:hover { background: #fef9ec; }
.facts-table td { padding: 11px 16px; color: #374151; border-bottom: 1px solid #e5e7eb; }
.facts-table td:first-child { font-weight: 700; color: #c9a227; white-space: nowrap; }

/* ── Key terms ── */
.terms-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 12px; margin: 16px 0;
}
.term-card {
  background: white; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 14px 16px;
}
.term-card .term { font-weight: 800; color: #0f1c2e; font-size: 14px; margin-bottom: 4px; }
.term-card .def { font-size: 13.5px; color: #4b5563; line-height: 1.5; }

/* ── Founding timeline (ch1) ── */
.founding-timeline {
  background: linear-gradient(135deg,#0f1c2e 0%,#1a2d4a 100%);
  border-radius: 20px; padding: 36px 32px 28px;
  margin: 28px 0; position: relative; overflow: hidden;
}
.founding-timeline::before {
  content:''; position: absolute;
  top:0; left:0; right:0; height:3px;
  background: linear-gradient(90deg,#c9a227,#e0b84a,#c9a227);
}
.timeline-label {
  font-size:11px; font-weight:800; letter-spacing:3px;
  text-transform:uppercase; color:#c9a227; text-align:center; margin-bottom:32px;
}
.timeline-track {
  display:flex; align-items:flex-start;
  justify-content:center; gap:0; position:relative;
}
.timeline-connector { flex:1; display:flex; align-items:center; padding-top:28px; }
.timeline-line {
  flex:1; height:2px;
  background: linear-gradient(90deg,#c9a227 0%,#e0b84a 50%,#c9a227 100%);
  position:relative;
}
.timeline-line::after {
  content:'▶'; position:absolute; right:-8px; top:-9px;
  color:#c9a227; font-size:12px;
}
.timeline-card {
  background:rgba(255,255,255,0.05); border:1px solid rgba(201,162,39,0.3);
  border-radius:16px; padding:20px 22px; width:240px; flex-shrink:0;
}
.timeline-card:hover { border-color:#c9a227; }
.timeline-card .tc-year { font-size:28px; font-weight:900; color:#c9a227; line-height:1; margin-bottom:4px; }
.timeline-card .tc-name { font-size:14px; font-weight:800; color:white; margin-bottom:6px; }
.timeline-card .tc-sub { font-size:12px; color:rgba(255,255,255,0.55); line-height:1.5; }
.timeline-card .tc-tag {
  display:inline-block; margin-top:10px;
  background:rgba(201,162,39,0.2); border:1px solid rgba(201,162,39,0.4);
  color:#c9a227; font-size:11px; font-weight:700;
  padding:3px 10px; border-radius:999px;
}
.timeline-dot {
  width:14px; height:14px; background:#c9a227; border-radius:50%;
  border:3px solid #0f1c2e; box-shadow:0 0 0 2px #c9a227; flex-shrink:0;
}
.founding-countries {
  display:flex; justify-content:center; gap:10px; flex-wrap:wrap;
  margin-top:24px; padding-top:20px; border-top:1px solid rgba(255,255,255,0.08);
}
.country-badge {
  display:flex; align-items:center; gap:6px;
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12);
  border-radius:999px; padding:5px 14px; font-size:12px; font-weight:600;
  color:rgba(255,255,255,0.8);
}
.country-badge .flag { font-size:16px; }

/* ── Temple pillars (ch1) ── */
.temple-wrap { margin:28px 0; border-radius:20px; overflow:hidden; box-shadow:0 8px 32px rgba(15,28,46,0.18); }
.temple-roof {
  background:linear-gradient(135deg,#0f1c2e 0%,#1a2d4a 100%);
  padding:20px 24px; text-align:center; position:relative;
}
.temple-roof::after {
  content:''; position:absolute; bottom:-12px; left:50%; transform:translateX(-50%);
  width:0; height:0; border-left:24px solid transparent;
  border-right:24px solid transparent; border-top:13px solid #1a2d4a; z-index:2;
}
.temple-roof .roof-title { font-size:17px; font-weight:900; color:#c9a227; letter-spacing:1px; }
.temple-roof .roof-sub { font-size:12px; color:rgba(255,255,255,0.5); margin-top:3px; }
.temple-pillars {
  display:grid; grid-template-columns:1fr 1fr 1fr;
  gap:3px; background:#e5e7eb; padding-top:16px;
}
.t-pillar { padding:28px 20px 24px; text-align:center; position:relative; }
.t-pillar-1 { background:linear-gradient(160deg,#1e3a8a 0%,#1e40af 100%); }
.t-pillar-2 { background:linear-gradient(160deg,#4338ca 0%,#4f46e5 100%); }
.t-pillar-3 { background:linear-gradient(160deg,#6d28d9 0%,#7c3aed 100%); }
.t-pillar .p-icon { font-size:28px; margin-bottom:10px; display:block; }
.t-pillar .p-num { font-size:10px; font-weight:800; letter-spacing:3px; text-transform:uppercase; color:rgba(255,255,255,0.5); margin-bottom:8px; }
.t-pillar .p-name { font-size:16px; font-weight:900; color:white; margin-bottom:8px; line-height:1.2; }
.t-pillar .p-desc { font-size:12px; color:rgba(255,255,255,0.7); line-height:1.5; margin-bottom:14px; }
.t-pillar .p-badge { display:inline-block; font-size:11px; font-weight:700; padding:4px 12px; border-radius:999px; border:1px solid rgba(255,255,255,0.3); color:white; }
.p-badge.supra { background:rgba(34,197,94,0.25); border-color:rgba(34,197,94,0.5); color:#86efac; }
.p-badge.inter { background:rgba(251,146,60,0.2); border-color:rgba(251,146,60,0.4); color:#fdba74; }
.temple-base { background:#fef2f2; border-top:3px solid #fca5a5; padding:14px 20px; text-align:center; font-size:13px; color:#991b1b; }
.temple-base strong { color:#7f1d1d; }

/* ── Enlargement cards (ch1) ── */
.enlargement-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; margin:20px 0; }
.enlargement-card { background:white; border:2px solid #e5e7eb; border-radius:12px; padding:16px; text-align:center; transition:border-color 0.2s; }
.enlargement-card:hover { border-color:#c9a227; }
.enlargement-card .year { font-size:22px; font-weight:900; color:#c9a227; }
.enlargement-card .round { font-size:11px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:1px; margin-bottom:6px; }
.enlargement-card .countries { font-size:13px; color:#374151; line-height:1.4; }
.enlargement-card .total { margin-top:8px; font-size:12px; font-weight:700; color:#0f1c2e; background:#f1f5f9; border-radius:999px; padding:3px 10px; display:inline-block; }

/* ── Practice Questions ── */
.questions-section { background:#0f1c2e; border-radius:20px; padding:36px 32px; margin-top:48px; }
.questions-section h2 { color:#c9a227; border-bottom-color:rgba(201,162,39,0.3); margin-top:0; }
.question-block { background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:12px; padding:20px 24px; margin-bottom:16px; }
.question-text { font-size:15px; font-weight:600; color:white; margin-bottom:14px; }
.question-num { color:#c9a227; font-weight:900; margin-right:6px; }
.options { list-style:none; padding:0; }
.options li { font-size:14px; color:rgba(255,255,255,0.7); padding:8px 12px; border-radius:8px; margin-bottom:4px; border:1px solid transparent; }
.options li:hover { background:rgba(255,255,255,0.07); border-color:rgba(255,255,255,0.1); }
.options li.correct { background:rgba(34,197,94,0.15); border-color:rgba(34,197,94,0.4); color:#86efac; font-weight:600; }
.options li.correct::after { content:" ✓"; font-weight:900; }

/* ── CTA ── */
.cta-box { background:linear-gradient(135deg,#c9a227 0%,#e0b84a 100%); border-radius:16px; padding:28px 32px; margin-top:24px; text-align:center; }
.cta-box p { font-size:16px; font-weight:700; color:#0f1c2e; margin-bottom:14px; }
.cta-btn { background:#0f1c2e; color:#c9a227; font-weight:800; font-size:15px; padding:12px 28px; border-radius:10px; text-decoration:none; display:inline-block; }

/* ── Navigation ── */
.nav-buttons { display:flex; justify-content:space-between; margin-top:40px; gap:12px; }
.nav-btn { background:white; border:2px solid #e5e7eb; border-radius:12px; padding:14px 24px; font-size:14px; font-weight:700; color:#0f1c2e; text-decoration:none; flex:1; text-align:center; transition:border-color 0.2s; }
.nav-btn:hover { border-color:#c9a227; }
.nav-btn.next { background:#c9a227; border-color:#c9a227; color:#0f1c2e; }

/* ── Footer ── */
.course-footer { background:#0f1c2e; color:rgba(255,255,255,0.5); text-align:center; font-size:13px; padding:24px; }

/* ── Questions section alternate format (ch13–17 use q-number/q-text/option/answer) ── */
/* .questions-section has background: #0f1c2e — all text must be light */
.q-header { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.q-icon { font-size: 32px; font-weight: 900; color: #c9a227; flex-shrink: 0; }
.q-title { font-size: 20px; font-weight: 900; color: #c9a227; }
.q-subtitle { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.q-number { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #c9a227; margin-bottom: 8px; }
.q-text { font-size: 15px; font-weight: 600; color: white; margin-bottom: 14px; }
.q-text strong { color: rgba(255,255,255,0.95) !important; }
.questions-section .options { list-style: none; padding: 0; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.questions-section .option { font-size: 14px; color: rgba(255,255,255,0.75); padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); }
.answer { font-size: 13px; color: rgba(134,239,172,0.9); padding: 10px 14px; background: rgba(34,197,94,0.1); border-radius: 8px; border-left: 3px solid #22c55e; line-height: 1.5; margin-top: 4px; }
.answer strong { color: rgba(134,239,172,1) !important; }

/* cta-box alternate classes used in some chapters */
.cta-title { font-size: 18px; font-weight: 800; color: #0f1c2e; margin-bottom: 8px; }
.cta-desc { font-size: 14px; color: rgba(15,28,46,0.8); margin-top: 10px; margin-bottom: 0; }

/* ── Global contrast fixes: strong inherits color: #0f1c2e but must be white in dark contexts ── */
.stat-box strong { color: rgba(255,255,255,0.95); }
.questions-section strong { color: rgba(255,255,255,0.95); }
.flow-step strong { color: rgba(255,255,255,0.95); }
.compare-col.dark strong, .compare-col.mid strong { color: rgba(255,255,255,0.95); }
.compare-col.dark p, .compare-col.mid p { color: rgba(255,255,255,0.8); }
.compare-col.dark li, .compare-col.mid li { color: rgba(255,255,255,0.75); }
.founding-timeline strong { color: rgba(255,255,255,0.95); }
.mff-timeline strong { color: rgba(255,255,255,0.95); }
.sgp-box strong { color: rgba(255,255,255,0.95); }
.schengen-box strong { color: rgba(255,255,255,0.95); }
.cfsp-box strong { color: rgba(255,255,255,0.95); }
.ets-box strong { color: rgba(255,255,255,0.95); }
.gd-target strong { color: rgba(255,255,255,0.95); }
.mutual-rec strong { color: rgba(255,255,255,0.95); }
.institutions-snapshot strong { color: rgba(255,255,255,0.95); }
.reform-card strong { color: rgba(255,255,255,0.95); }
.question-text strong { color: rgba(255,255,255,0.95); }
.intro-box strong { color: #1e293b; }

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Compare grids — stack vertically */
  .compare-grid { grid-template-columns: 1fr; }

  /* Temple 3-pillar — stack vertically */
  .temple-pillars { grid-template-columns: 1fr; }

  /* Timeline — vertical */
  .timeline-track { flex-direction: column; align-items: center; }
  .timeline-connector { width: 2px; height: 30px; padding-top: 0; flex-direction: column; }
  .timeline-line { width: 2px; height: 30px; }

  /* Tables — horizontal scroll instead of overflow cut */
  .facts-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .facts-table td, .facts-table th { white-space: normal; min-width: 100px; }
  .facts-table td:first-child { white-space: nowrap; }

  /* Flow steps — stack vertically */
  .flow { flex-direction: column; align-items: stretch; }
  .flow-arrow { transform: rotate(90deg); text-align: center; }
  .flow-step { min-width: unset; }

  /* Container padding */
  .container { padding: 28px 16px 60px; }

  /* Questions section */
  .questions-section { padding: 24px 16px; }
  .question-block { padding: 16px; }

  /* CTA box */
  .cta-box { padding: 24px 20px; }
}
