/* ═══════════════════════════════════════════════════════════════════
   coree_du_sud.css — Thème : Taegeuk moderne, néon K-pop, hanbok et tech
   Couleurs drapeau : rouge taegeuk + bleu taegeuk + noir trigrammes sur blanc
   + accents rose corail tech (soft tech aesthetic)
   Polices : Noto Serif KR + Pretendard-like (IBM Plex Sans KR) + Roboto Mono
   ═══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@300;400;600;700;900&family=IBM+Plex+Sans+KR:wght@300;400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

:root {
  --sb:     #0a0c18;                 /* nuit de Séoul bleutée */
  --sb2:    #10132a;
  --surf:   #151a38;
  --surf2:  #1c2346;

  --rouge:      #C60C30;              /* rouge taegeuk */
  --rouge-2:    #ff3a5c;
  --rouge-p:    rgba(198,12,48,.12);
  --rouge-d:    rgba(198,12,48,.50);
  --bleu:       #003478;              /* bleu taegeuk */
  --bleu-2:     #4a78d6;
  --bleu-p:     rgba(0,52,120,.18);
  --bleu-d:     rgba(0,52,120,.60);
  --corail:     #f7a3b1;              /* rose K-pop */
  --lavande:    #9b8cf0;              /* néon Séoul */
  --neon:       #00e0b8;              /* accent néon */

  --ink:    #eaecf5;
  --ink2:   rgba(234,236,245,.66);
  --ink3:   rgba(234,236,245,.30);

  --brd:    rgba(155,140,240,.20);
  --brdh:   rgba(155,140,240,.55);

  --fd: 'Noto Serif KR', Georgia, serif;
  --fb: 'IBM Plex Sans KR', sans-serif;
  --fm: 'Roboto Mono', monospace;

  --sw: 272px;
  --r: 10px;                          /* angles doux modernes */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--fb);
  background: var(--sb);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.78;
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(198,12,48,.14) 0, transparent 38%),
    radial-gradient(ellipse at 85% 90%, rgba(0,52,120,.25) 0, transparent 42%),
    radial-gradient(ellipse at 50% 50%, rgba(155,140,240,.08) 0, transparent 55%);
  background-attachment: fixed;
}

/* Taegeuk stylisé en fond */
body::before {
  content: ''; position: fixed; top: 20%; right: -10%; width: 500px; height: 500px;
  border-radius: 50%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg,
    rgba(198,12,48,.04) 0deg, rgba(198,12,48,.04) 180deg,
    rgba(0,52,120,.04) 180deg, rgba(0,52,120,.04) 360deg);
  filter: blur(40px);
}

.progress-bar {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: linear-gradient(90deg, var(--rouge), var(--corail), var(--lavande), var(--bleu-2), var(--bleu));
  z-index: 200; transition: width .08s linear;
  box-shadow: 0 1px 12px rgba(155,140,240,.45);
}

.page-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sw); flex-shrink: 0;
  background: linear-gradient(180deg, var(--sb2) 0%, var(--sb) 100%);
  border-right: 1px solid var(--brd);
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--surf2) transparent;
}
.sidebar-header {
  padding: 30px 22px 22px;
  border-bottom: 1px solid var(--brd);
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(198,12,48,.15) 0%, rgba(0,52,120,.15) 100%);
}
.sidebar-header::after {
  /* taegeuk miniature */
  content: ''; position: absolute; right: 14px; bottom: 10px; width: 48px; height: 48px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 50%, var(--bleu) 50%),
    linear-gradient(180deg, var(--rouge) 50%, var(--bleu) 50%);
  background-blend-mode: multiply;
  opacity: .4;
  border: 2px solid rgba(255,255,255,.1);
}
.sidebar-back {
  font-family: var(--fm); font-size: .6rem; letter-spacing: .14em;
  color: var(--ink3); text-decoration: none; display: block; margin-bottom: 12px;
}
.sidebar-back:hover { color: var(--corail); }
.sidebar-title {
  font-family: var(--fd); font-size: 2rem; font-weight: 700;
  color: var(--corail); line-height: 1.0; letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--corail) 0%, var(--lavande) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.toc-nav { padding: 10px 0 14px; flex: 1; }
.toc-section-label {
  font-family: var(--fm); font-size: .58rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink3); padding: 8px 22px 4px;
}
.toc-link {
  display: block; padding: 5px 22px 5px 26px;
  font-family: var(--fb); font-size: .83rem; font-weight: 400;
  color: var(--ink2); text-decoration: none;
  border-left: 2px solid transparent; transition: all .15s;
}
.toc-link:hover, .toc-link.active {
  color: var(--corail); border-left-color: var(--lavande); background: rgba(155,140,240,.08);
}
.sidebar-nav { padding: 12px 22px; border-top: 1px solid var(--brd); }
.sidebar-nav p {
  font-family: var(--fm); font-size: .56rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink3); margin-bottom: 7px;
}
.sidebar-nav a {
  display: block; font-family: var(--fb); font-size: .8rem;
  color: var(--ink3); text-decoration: none; padding: 2px 0;
}
.sidebar-nav a:hover, .sidebar-nav a.current { color: var(--corail); }
.sidebar-nav a.current { font-weight: 700; }

.main { flex: 1; min-width: 0; padding: 0 58px 100px; max-width: 840px; }

.page-header {
  padding: 54px 0 36px; margin-bottom: 50px;
  border-bottom: 1px solid var(--brd);
  position: relative;
}
.page-header::before {
  /* taegeuk décoratif stylisé */
  content: ''; position: absolute; top: 16px; right: 0; width: 72px; height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, var(--rouge) 0%, var(--rouge) 40%, transparent 40%),
    radial-gradient(circle at 70% 70%, var(--bleu) 0%, var(--bleu) 40%, transparent 40%);
  border: 2px solid rgba(255,255,255,.2);
  opacity: .72;
}
.page-header::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 180px; height: 2px;
  background: linear-gradient(90deg, var(--corail), var(--lavande), transparent);
  box-shadow: 0 0 14px rgba(155,140,240,.5);
}
.subject-tag {
  font-family: var(--fm); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--corail); margin-bottom: 12px;
}
h1.page-title {
  font-family: var(--fd); font-size: 3.6rem; font-weight: 900;
  color: var(--ink); line-height: .95; letter-spacing: -.015em;
}
h1.page-title .sub {
  color: var(--lavande); font-size: 1.05rem;
  display: block; margin-top: 10px;
  font-family: var(--fd); letter-spacing: .01em; font-weight: 400;
}
.page-intro { margin-top: 18px; font-size: 1rem; color: var(--ink2); max-width: 570px; }

.section { margin-bottom: 60px; scroll-margin-top: 26px; }
h2.section-title {
  font-family: var(--fd); font-size: 2rem; font-weight: 700;
  color: var(--ink); margin-bottom: 20px; padding-bottom: 8px;
  border-bottom: 1px solid var(--brd);
  display: flex; align-items: baseline; gap: 14px;
  letter-spacing: -.01em;
}
h2.section-title .num {
  font-family: var(--fm); font-size: .7rem;
  color: #fff; background: linear-gradient(135deg, var(--rouge) 0%, var(--lavande) 100%);
  padding: 3px 11px; border-radius: 4px; font-weight: 500;
  box-shadow: 0 0 10px rgba(155,140,240,.4);
}
h3.sub-title {
  font-family: var(--fd); font-size: 1.25rem; font-weight: 700;
  color: var(--corail); margin: 26px 0 11px;
}
p { margin-bottom: .9em; } ul, ol { padding-left: 1.4em; margin-bottom: .9em; } li { margin-bottom: .3em; }

.box { padding: 15px 18px 13px; margin: 16px 0; border-radius: var(--r); border: 1px solid var(--brd); background: rgba(255,255,255,.03); }
.box-label { font-family: var(--fm); font-size: .62rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 8px; }
.box.def       { background: rgba(155,140,240,.08); border-color: var(--brdh); } .box.def .box-label { color: var(--lavande); }
.box.histoire  { background: var(--rouge-p); border-left: 4px solid var(--rouge); } .box.histoire .box-label { color: var(--rouge-2); }
.box.technique { background: var(--bleu-p); border-left: 4px solid var(--bleu-2); } .box.technique .box-label { color: var(--bleu-2); }
.box.conseil   { background: rgba(0,224,184,.08); border-left: 4px solid var(--neon); } .box.conseil .box-label { color: var(--neon); }
.box.attention { background: var(--rouge-p); border-left: 4px solid var(--rouge-2); } .box.attention .box-label { color: var(--rouge-2); }
.box.chiffres  { background: rgba(0,0,0,.44); border-color: var(--brdh); } .box.chiffres .box-label { color: var(--lavande); }
.box.remark    { background: transparent; border-left: 3px solid var(--brd); padding-left: 20px; } .box.remark .box-label { color: var(--ink3); }

.detail-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fb); font-weight: 600; font-size: .88rem;
  color: var(--lavande); border: 1px solid var(--lavande);
  padding: 4px 14px; border-radius: 20px; cursor: pointer;
  background: transparent; margin-top: 8px; transition: all .18s; user-select: none;
}
.detail-toggle:hover { background: var(--lavande); color: var(--sb); }
.detail-toggle .arrow { transition: transform .2s; }
.detail-toggle.open .arrow { transform: rotate(90deg); }
.detail-content { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.detail-content.open { max-height: 900px; }
.detail-inner { margin-top: 10px; padding: 13px 18px; background: rgba(0,0,0,.38); border: 1px dashed var(--brd); border-radius: var(--r); color: var(--ink2); font-size: .93rem; }

.data-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .89rem; border-radius: var(--r); overflow: hidden; border: 1px solid var(--brd); }
.data-table th { background: linear-gradient(90deg, rgba(198,12,48,.3) 0%, rgba(0,52,120,.3) 100%); color: var(--corail); padding: 9px 14px; text-align: left; font-family: var(--fm); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid var(--brdh); }
.data-table td { padding: 8px 14px; border-bottom: 1px solid var(--brd); vertical-align: top; }
.data-table tr:hover td { background: rgba(155,140,240,.06); }
.data-table td:first-child { font-family: var(--fm); font-size: .8rem; color: var(--lavande); }

code { font-family: var(--fm); font-size: .82em; background: rgba(0,0,0,.38); color: var(--corail); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--brd); }
em { color: var(--corail); font-style: italic; }
strong { color: #fff; font-weight: 700; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; } .two-col .box { margin: 0; }

.mobile-header { display: none; position: sticky; top: 0; z-index: 50; background: var(--sb2); border-bottom: 2px solid var(--lavande); padding: 12px 18px; align-items: center; justify-content: space-between; }
.mobile-menu-btn { background: none; border: none; color: var(--corail); font-size: 1.3rem; cursor: pointer; }
.mobile-title { font-family: var(--fd); font-size: 1.1rem; color: var(--corail); font-weight: 700; }
.mobile-drawer { display: none; position: fixed; inset: 0; z-index: 100; } .mobile-drawer.open { display: flex; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.8); }
.drawer-panel { position: relative; z-index: 1; width: 272px; background: var(--sb2); height: 100%; overflow-y: auto; padding: 14px 0; border-right: 1px solid var(--brd); }

@media (max-width: 960px) {
  .sidebar { display: none; }
  body::before { display: none; }
  .mobile-header { display: flex; }
  .main { padding: 0 20px 70px; }
  h1.page-title { font-size: 2.5rem; }
  .page-header::before { display: none; }
  .two-col { grid-template-columns: 1fr; }
}
