/* ===========================================================
   Mur de la Presse 974 — Style "lemurdelapresse"
   Layout : masonry CSS columns sur fond gris clair
   Cartes : blanches, légères, hauteurs variables
   =========================================================== */
:root {
  --bg: #e9eaec;
  --bg-soft: #d9dadc;
  --paper: #ffffff;
  --ink: #161616;
  --ink-soft: #4a4a4a;
  --muted: #8a8a8a;
  --line: #e0e1e3;
  --pill: #d8d9db;
  --pill-ink: #2a2a2a;
  --accent: #c8392c;
  --accent-2: #e8a73a;
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.06);
  --radius: 10px;
}

* { box-sizing: border-box; }
/* Défense : l'attribut [hidden] doit toujours masquer, même si une règle
   CSS spécifique pose un display: flex/grid/etc. */
[hidden] { display: none !important; }
/* Couleur de sélection cohérente avec le branding (rouge volcan) au lieu
   du bleu système qui peut faire croire à un bug visuel. */
::selection      { background: rgba(200,57,44,.20); color: inherit; }
::-moz-selection { background: rgba(200,57,44,.20); color: inherit; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ============ TOPBAR ============ */
.topbar {
  background: var(--ink);
  color: #fff;
  padding: 6px 16px;
  font-size: 11px;
  letter-spacing: .04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
}
.topbar .date { color: #c8b894; }
.topbar .live { display: inline-flex; align-items: center; gap: 6px; }
.topbar .live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff4040; animation: pulse 1.5s infinite;
}
.topbar .edition { opacity: .6; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ============ MASTHEAD ============ */
.masthead {
  background: linear-gradient(to bottom, #fff, #f7f7f8);
  border-bottom: 1px solid var(--line);
  padding: 22px 16px 18px;
  text-align: center;
}
.masthead .logo {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
}
/* ".re" simple : juste le texte dans la couleur d'accent, sans pillule */
.masthead .logo .dot-re {
  color: var(--accent);
  font-weight: 900;
}
.masthead .tagline-baseline {
  margin: 8px 0 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .25em;
  color: var(--muted);
}
.masthead .tagline-explain {
  margin: 14px auto 0;
  max-width: 640px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ============ FILTRES ============ */
.filters {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(233,234,236,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-search > svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.filter-search input {
  flex: 1;
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.filter-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,57,44,.15);
}
.btn-reset {
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all .15s;
  white-space: nowrap;
}
.btn-reset:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-refresh:hover { background: #a52d22; border-color: #a52d22; }
.btn-refresh:active { transform: scale(.97); }
.btn-refresh.refreshing svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-label {
  flex: 0 0 auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 600;
  width: 60px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}
.chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  transition: all .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 600;
}
.chip .count {
  font-size: 10px;
  background: rgba(0,0,0,.08);
  padding: 1px 5px;
  border-radius: 999px;
}
.chip.active .count { background: rgba(255,255,255,.2); color: #fff; }

/* ============ STATUS LINE ============ */
.status-line {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 16px 4px;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.status-line b { color: var(--ink); font-weight: 600; }
.status-line .dot-sep { color: var(--muted); }

/* ============ ABOUT ============ */
.about {
  max-width: 760px;
  margin: 32px auto 0;
  padding: 24px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.about h2 {
  margin: 0 0 12px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.about p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.about p:last-child { margin-bottom: 0; }
.about strong { color: var(--ink); font-weight: 600; }

/* ============ TOOLBAR ============ */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(233,234,236,.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.search {
  flex: 1 1 220px;
  min-width: 200px;
  position: relative;
}
.search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,57,44,.15);
}
.search svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip:hover { border-color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 600;
}
.chip .count {
  font-size: 10px;
  background: rgba(0,0,0,.08);
  padding: 1px 5px;
  border-radius: 999px;
}
.chip.active .count { background: rgba(255,255,255,.2); }

.btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  font-weight: 500;
  color: var(--ink);
}
.btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #a52d22; border-color: #a52d22; }
.btn svg { flex: 0 0 auto; }
.btn.refreshing svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ STATUS ============ */
.status {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1500px;
  margin: 0 auto;
}
.status .meta b { color: var(--ink); }

.error-banner {
  margin: 0 16px 12px;
  padding: 10px 14px;
  background: #fef3e2;
  border: 1px solid #f5cf95;
  color: #6b4a13;
  border-radius: 8px;
  font-size: 12px;
}

/* ============ MASONRY GRID ============ */
.grid {
  /* CSS multi-column = masonry naturel */
  column-count: 1;
  column-gap: 12px;
  padding: 0 12px 24px;
  max-width: 1700px;
  margin: 0 auto;
}
@media (min-width: 540px)  { .grid { column-count: 2; } }
@media (min-width: 760px)  { .grid { column-count: 3; } }
@media (min-width: 1000px) { .grid { column-count: 4; } }
@media (min-width: 1280px) { .grid { column-count: 5; } }
@media (min-width: 1560px) { .grid { column-count: 6; } }

/* ============ CARD ============ */
.card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  background: var(--paper);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-card);
  display: block;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
  color: inherit;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.brand .favicon {
  width: 18px; height: 18px;
  border-radius: 3px;
  flex: 0 0 18px;
  background: #f1f1f3;
  object-fit: contain;
}
.brand .brandname {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.brand .brandname .tld {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 1px;
  vertical-align: 1px;
}
.cat-icon {
  width: 22px; height: 22px;
  flex: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  opacity: .7;
}

.rubrique {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: .02em;
}

.time-pill {
  display: inline-block;
  background: var(--pill);
  color: var(--pill-ink);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 8px;
}

.card h2 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.22;
  color: var(--ink);
  word-wrap: break-word;
  hyphens: auto;
}

.card .desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.card .img-wrap {
  width: calc(100% + 28px);
  margin: 8px -14px;
  background: #f1f1f3;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
}
.card .img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.card .img-wrap.broken { display: none; }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.card-footer .read {
  font-weight: 600;
  color: var(--accent);
}

/* Skeleton */
.skel {
  background: var(--paper);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 14px;
  break-inside: avoid;
}
.skel-line {
  background: linear-gradient(90deg, #ececee 0%, #f6f6f8 50%, #ececee 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  height: 12px;
  margin-bottom: 8px;
}
.skel-line.short { width: 50%; }
.skel-img {
  background: linear-gradient(90deg, #ececee 0%, #f6f6f8 50%, #ececee 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  height: 130px;
  margin: 8px 0;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 14px;
  column-span: all;
}

/* ============ FOOTER ============ */
.foot {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.foot .signature {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .03em;
}
.foot .signature strong {
  color: var(--ink);
  font-weight: 700;
}
