/* =========================================
   BRIEFING BELGE — esthétique journal/presse
   Inspiration : édition imprimée + ticker TV
   ========================================= */

:root {
  --paper: #f4f0e8;
  --paper-dark: #ebe5d4;
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --ink-mute: #6b6b6b;
  --ink-faint: #999893;
  --rule: rgba(26, 26, 26, 0.12);
  --rule-strong: rgba(26, 26, 26, 0.25);
  --accent: #c8312b;
  --accent-soft: #e85d57;
  --gold: #b8893a;
  --bg-card: rgba(255, 252, 245, 0.6);
  --bg-hover: rgba(255, 252, 245, 0.95);

  /* Couleurs par journal */
  --c-lesoir: #c8312b;
  --c-lalibre: #003c71;
  --c-lecho: #b8893a;
  --c-trends: #1a1a1a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Geist', -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  /* Texture papier subtile */
  background-image:
    radial-gradient(ellipse 800px 400px at 80% 0%, rgba(200, 49, 43, 0.04), transparent 70%),
    radial-gradient(ellipse 600px 300px at 0% 100%, rgba(0, 60, 113, 0.03), transparent 70%);
  background-attachment: fixed;
  padding-top: 56px;  /* place pour le ticker */
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.05  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =========================================
   TICKER (fixé en haut)
   ========================================= */
.ticker-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  z-index: 100;
  border-bottom: 3px solid var(--accent);
  overflow: hidden;
}

.ticker-label {
  flex: 0 0 auto;
  background: var(--accent);
  color: white;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 18px;
  text-transform: uppercase;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-content {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-scroll 480s linear infinite;
  padding-left: 100%;
  align-items: center;
  height: 100%;
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 400;
  font-size: 1rem;
}

.ticker-content:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  margin-right: 48px;
  cursor: pointer;
  transition: color 0.2s;
}
.ticker-item:hover { color: var(--accent-soft); }

.ticker-item .src {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-soft);
  margin-right: 10px;
  padding: 2px 8px;
  border: 1px solid var(--accent-soft);
  border-radius: 3px;
}

.ticker-item .sep {
  color: var(--ink-faint);
  margin: 0 18px;
}

.ticker-loading {
  color: var(--ink-faint);
  font-style: italic;
  padding-left: 24px;
}

/* =========================================
   PAGE
   ========================================= */
.page {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 32px 60px;
}

/* MASTHEAD */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 24px;
  border-bottom: 4px double var(--rule-strong);
  margin-bottom: 40px;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
}
.brand-dot { color: var(--accent); }
.brand-be {
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 400;
  color: var(--ink-mute);
}

.tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-mute);
  margin-top: 8px;
  font-variation-settings: "opsz" 144, "wght" 400;
}

.masthead-right {
  text-align: right;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-mute);
  line-height: 1.7;
}
.masthead-right .date {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.masthead-right .time {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 72, "wght" 500;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: 0.05em;
  margin: 4px 0;
}
.masthead-right .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
}
.status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse 2s ease-out infinite;
}
.status.error .dot { background: var(--accent); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* =========================================
   BRIEF IA
   ========================================= */
.brief-section {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 36px 44px;
  margin-bottom: 56px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 20px rgba(0,0,0,0.04);
}
.brief-section::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--c-lalibre));
  border-radius: 6px 6px 0 0;
}

.brief-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.brief-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.brief-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 500;
  font-style: italic;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.brief-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-mute);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

.brief-actions { display: flex; gap: 10px; flex-shrink: 0; }
.btn-primary, .btn-secondary {
  font-family: 'Geist Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: all 0.2s;
  font-weight: 500;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-primary:disabled, .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Contenu Markdown du brief */
.brief-content {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 14, "wght" 400;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink);
  column-count: 2;
  column-gap: 48px;
  column-rule: 1px solid var(--rule);
}
@media (max-width: 880px) {
  .brief-content { column-count: 1; }
}

.brief-content h2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 600;
  font-size: 1.3rem;
  margin: 28px 0 12px;
  color: var(--ink);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  break-after: avoid;
}
.brief-content h2:first-child { margin-top: 0; }
.brief-content h3 {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 600;
  font-size: 1.1rem;
  margin: 20px 0 8px;
  break-after: avoid;
}
.brief-content p { margin-bottom: 14px; text-align: justify; hyphens: auto; }
.brief-content ul, .brief-content ol { margin: 10px 0 16px 22px; }
.brief-content li { margin-bottom: 8px; }
.brief-content em {
  color: var(--ink-mute);
  font-style: italic;
}
.brief-content strong {
  font-weight: 600;
  color: var(--ink);
}
.brief-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.brief-content a:hover { background: rgba(200, 49, 43, 0.08); }

.brief-content .placeholder {
  font-style: italic;
  color: var(--ink-mute);
  text-align: center;
  padding: 40px;
}

/* =========================================
   COLONNES PAR JOURNAL
   ========================================= */
.section-h {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 500;
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--ink);
}

.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.paper-col {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--paper-color, var(--ink));
  border-radius: 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  overflow: hidden;
}

.paper-col-header {
  padding: 16px 20px;
  border-bottom: 2px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.paper-col-name {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--paper-color, var(--ink));
}
.paper-col-count {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.paper-col-body {
  flex: 1;
  overflow-y: auto;
  max-height: 700px;
  padding: 6px 0;
}
.paper-col-body::-webkit-scrollbar { width: 6px; }
.paper-col-body::-webkit-scrollbar-track { background: transparent; }
.paper-col-body::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 3px; }

.article-item {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.article-item:hover { background: var(--bg-hover); }
.article-item:last-child { border-bottom: none; }

.article-thumb {
  flex: 0 0 80px;
  width: 80px; height: 80px;
  background: var(--paper-dark);
  border-radius: 3px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.article-thumb.no-image {
  background: linear-gradient(135deg, var(--paper-dark) 0%, var(--rule) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.article-body { flex: 1; min-width: 0; }
.article-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 18, "wght" 500;
  font-size: 0.98rem;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}
.article-meta .cat {
  color: var(--paper-color, var(--accent));
  text-transform: uppercase;
  font-weight: 500;
}

/* Carte Trends Tendance — pas d'articles, juste un lien */
.trends-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-decoration: none;
  transition: all 0.3s;
  min-height: 400px;
  position: relative;
  overflow: hidden;
}
.trends-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, var(--gold), transparent 50%);
  opacity: 0.2;
}
.trends-card > * { position: relative; z-index: 1; }
.trends-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.2); }
.trends-card .eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.trends-card .name {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 500;
  font-size: 2.2rem;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 16px;
}
.trends-card .desc {
  color: rgba(244, 240, 232, 0.7);
  font-size: 0.92rem;
  margin-bottom: 24px;
  line-height: 1.5;
}
.trends-card .arrow {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: auto;
}

/* =========================================
   FOOTER
   ========================================= */
.page-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.8;
}

/* =========================================
   MODAL HISTORIQUE
   ========================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--paper);
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--rule);
}
.modal-header h3 {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 500;
  font-size: 1.4rem;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--ink-mute);
  line-height: 1;
}
.modal-close:hover { color: var(--accent); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 28px 28px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding 0.2s;
}
.history-item:hover { padding-left: 8px; }
.history-item:last-child { border-bottom: none; }
.history-date {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 500;
  font-size: 1rem;
}
.history-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}
.history-slot {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  margin-left: 12px;
}
.history-slot.morning { color: var(--gold); border-color: var(--gold); }
.history-slot.evening { color: var(--c-lalibre); border-color: var(--c-lalibre); }
.history-slot.manual { color: var(--ink-mute); }

/* Loading state */
.loading-pulse {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-loading 1.4s infinite ease-in-out;
}
@keyframes pulse-loading {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.placeholder {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink-mute);
  padding: 24px;
  text-align: center;
}

/* === V2 : tag langue (EN) sur les sources internationales === */
.lang-tag {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  font-weight: 600;
  padding: 2px 6px;
  margin-left: 8px;
  border: 1px solid var(--paper-color, var(--ink));
  border-radius: 3px;
  vertical-align: middle;
  color: var(--paper-color, var(--ink));
}

/* === V2 : drapeau dans les titres de section === */
.section-h .flag {
  display: inline-block;
  margin-right: 8px;
  font-size: 0.85em;
  vertical-align: baseline;
}

/* Espacement entre les 2 sections */
#section-international {
  margin-top: 60px;
}
