/* ============================================================
   DESK39 — Système éditorial « rédaction de nuit »
   Encre chaude · Papier crème · Rouge de presse
   ============================================================ */

:root {
  /* — Encre (fonds sombres, chauds) — */
  --bg:        #141310;
  --bg-2:      #1a1813;
  --bg-3:      #221f18;
  --bg-inset:  #100f0c;
  --bg-rise:   #26221b;

  /* — Lignes — */
  --line:        #322e26;
  --line-2:      #423d33;
  --line-strong: #564f42;

  /* — Papier (texte crème) — */
  --paper:   #f2ede2;
  --paper-2: #c4bcad;
  --paper-3: #8e8779;
  --paper-4: #645e53;

  /* — Rouge de presse (accent unique) — */
  --red:      #c63d33;
  --red-2:    #db5a50;
  --red-deep: #9c2c25;
  --red-wash: rgba(198, 61, 51, 0.13);
  --red-line: rgba(198, 61, 51, 0.40);

  /* — Typo — */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Libre Franklin', system-ui, -apple-system, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* — Mesures — */
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius: 3px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--red); color: #fff; }

/* Subtle paper grain on the page */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typographic primitives ---------- */
.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-3);
  font-weight: 500;
}
.kicker--red { color: var(--red-2); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-3);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--red);
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; color: var(--paper); }
.serif { font-family: var(--serif); }
.mono  { font-family: var(--mono); }
.italic { font-style: italic; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ============================================================
   HEADER / MASTHEAD
   ============================================================ */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.masthead__bar {
  display: flex; align-items: center; gap: 28px;
  height: 70px;
}
.masthead__nav {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
}
.navlink {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-2);
  padding: 9px 14px;
  border-radius: var(--radius);
  transition: color .18s, background .18s;
}
.navlink:hover { color: var(--paper); background: var(--bg-3); }
.navlink--active { color: var(--paper); }
.navlink--active::after {
  content: ""; display: block; height: 2px; margin-top: 5px;
  background: var(--red);
}
.masthead__tools { display: flex; align-items: center; gap: 14px; }
.clock {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.iconbtn {
  width: 38px; height: 38px; border-radius: var(--radius);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--paper-2);
  transition: border-color .18s, color .18s;
}
.iconbtn:hover { border-color: var(--line-strong); color: var(--paper); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: baseline; gap: 1px; user-select: none; }
.logo__word {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 25px;
  letter-spacing: -0.015em;
  color: var(--paper);
}
.logo__num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--red);
  padding: 2px 6px 1px;
  border-radius: 2px;
  margin-left: 4px;
  transform: translateY(-1px);
}

/* ---------- Dateline strip ---------- */
.dateline {
  border-bottom: 1px solid var(--line);
  background: var(--bg-inset);
}
.dateline__row {
  display: flex; align-items: center; gap: 18px;
  height: 38px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--paper-3);
  overflow: hidden;
}
.dateline__row > span { white-space: nowrap; }
.dateline .sep { color: var(--line-strong); }
.dateline .live { color: var(--red-2); display: inline-flex; align-items: center; gap: 7px; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); display: inline-block;
  box-shadow: 0 0 0 0 var(--red-line);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--red-line); }
  70% { box-shadow: 0 0 0 7px rgba(198,61,51,0); }
  100% { box-shadow: 0 0 0 0 rgba(198,61,51,0); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .18s, border-color .18s, color .18s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-2); }
.btn--ghost { border-color: var(--line-strong); color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper-3); background: var(--bg-3); }
.btn--mini { padding: 8px 13px; font-size: 11.5px; }
.btn svg { width: 14px; height: 14px; }

/* ============================================================
   MEDIA TAG (chaîne / antenne)
   ============================================================ */
.media {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--paper-2);
}
.media__mono {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--paper);
  background: var(--bg-3);
}
.media__mono[data-accent] { border-color: var(--red-line); color: var(--red-2); }

/* Frequency / type tag */
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 2px;
  border: 1px solid var(--line-2);
  color: var(--paper-3);
}
.tag--red { color: var(--red-2); border-color: var(--red-line); background: var(--red-wash); }

.timeslot {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--paper);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.section-head__title { font-size: clamp(26px, 3vw, 34px); }
.section-head__title em { font-style: italic; color: var(--paper-2); font-weight: 500; }
.section-head__meta { font-family: var(--mono); font-size: 12px; color: var(--paper-3); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.linkmore {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--paper-2);
  display: inline-flex; align-items: center; gap: 8px;
  transition: gap .18s, color .18s;
}
.linkmore:hover { color: var(--red-2); gap: 12px; }

/* ============================================================
   PROGRAMME CARD (émission)
   ============================================================ */
.pcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  transition: border-color .2s, background .2s, transform .2s;
  min-height: 100%;
}
.pcard:hover { border-color: var(--line-strong); background: var(--bg-3); transform: translateY(-2px); }
.pcard__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pcard__time { display: flex; align-items: center; gap: 9px; }
.pcard__title { font-size: 23px; line-height: 1.12; margin-bottom: 8px; }
.pcard__title a { transition: color .18s; }
.pcard:hover .pcard__title a { color: var(--paper); }
.pcard__host { font-size: 14px; color: var(--paper-2); margin-bottom: 16px; }
.pcard__host b { font-weight: 600; color: var(--paper); }
.pcard__desc { font-size: 14.5px; color: var(--paper-2); line-height: 1.55; margin-bottom: 20px; }
.pcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.pcard__num {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--mono); font-size: 11px; color: var(--paper-4); letter-spacing: 0.05em;
}

/* play affordance */
.play {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--paper);
}
.play__disc {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--red-line); background: var(--red-wash);
  display: grid; place-items: center; color: var(--red-2);
  transition: background .18s, color .18s;
}
.play:hover .play__disc { background: var(--red); color: #fff; border-color: var(--red); }
.play svg { width: 11px; height: 11px; }

/* ============================================================
   EPISODE CARD — radio · émission · titre · durée · player · badge
   ============================================================ */
.ecard {
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  transition: border-color .2s, background .2s;
}
.ecard:hover { border-color: var(--line-strong); background: var(--bg-3); }
.ecard__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ecard__badges { display: flex; align-items: center; gap: 8px; }
.ecard__show { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-3); margin-bottom: 6px; }
.ecard__title { font-family: var(--serif); font-size: 21px; line-height: 1.14; letter-spacing: -0.01em; margin-bottom: 7px; }
.ecard__host { font-size: 13.5px; color: var(--paper-2); margin-bottom: 18px; }
.ecard__host b { color: var(--paper); font-weight: 600; }

/* player */
.player { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.player__btn {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  border: 1px solid var(--red-line); background: var(--red-wash);
  display: grid; place-items: center; color: var(--red-2);
  transition: background .16s, color .16s, border-color .16s;
}
.player__btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.player__btn svg { width: 13px; height: 13px; }
.player__bar { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.player__track { height: 3px; border-radius: 3px; background: var(--line-2); position: relative; overflow: hidden; }
.player__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); border-radius: 3px; }
.player__time { display: flex; justify-content: space-between; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--paper-3); letter-spacing: 0.03em; }
.player__time .total { color: var(--paper-4); }

/* duration pill */
.dur { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--paper-3); }
.dur svg { width: 12px; height: 12px; opacity: 0.8; }

/* ============================================================
   SUB-GROUP HEADER (sous-groupe)
   ============================================================ */
.subhead { display: flex; align-items: baseline; gap: 14px; padding-block: 26px 16px; }
.subhead__n { font-family: var(--mono); font-size: 12px; color: var(--red-2); letter-spacing: 0.06em; }
.subhead__t { font-family: var(--serif); font-size: 21px; color: var(--paper); }
.subhead__hr { flex: 1; height: 1px; background: var(--line); align-self: center; }
.subhead__meta { font-family: var(--mono); font-size: 11px; color: var(--paper-4); letter-spacing: 0.06em; text-transform: uppercase; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-inset);
  padding: clamp(40px, 6vw, 72px) 30px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.empty__mark {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--paper-3);
  position: relative;
}
.empty__mark::after { content: ""; position: absolute; left: 11px; right: 11px; top: 50%; height: 1px; background: var(--line-strong); transform: rotate(-32deg); }
.empty__mark svg { width: 22px; height: 22px; }
.empty__title { font-family: var(--serif); font-size: 23px; color: var(--paper); }
.empty__text { font-size: 14.5px; color: var(--paper-3); max-width: 40ch; line-height: 1.55; }
.empty__cta { margin-top: 8px; }

/* ============================================================
   GRIDS
   ============================================================ */
.grid { display: grid; gap: 1px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: var(--bg-inset); padding-block: 64px 40px; margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 56px; }
.footer__lede { font-family: var(--serif); font-size: 18px; line-height: 1.5; color: var(--paper-2); max-width: 34ch; margin-top: 18px; }
.footer__col h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-4); margin-bottom: 16px; font-weight: 500; }
.footer__col a { display: block; font-size: 14px; color: var(--paper-2); padding: 5px 0; transition: color .15s; }
.footer__col a:hover { color: var(--red-2); }
.footer__base { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 28px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--paper-4); text-transform: uppercase; }

/* ============================================================
   UTIL
   ============================================================ */
.hr { height: 1px; background: var(--line); border: 0; }
.muted { color: var(--paper-3); }
.center { text-align: center; }

@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .masthead__nav .navlink { padding: 8px 10px; }
  .clock { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
