/* news.julian-corporation.com — thème clair/sombre automatique */

:root {
  --bg: #f4f4f0;
  --surface: #ffffff;
  --border: #e2e2da;
  --text: #1c1c1a;
  --muted: #6b6b64;
  --faint: #8f8f86;
  --accent: #b3541e;
  --hot-bg: #b3541e0d;
  --warn: #b45309;
  --star: #e0a020;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  --pop-shadow: 0 10px 40px rgb(0 0 0 / 0.18);
  --scrim: rgb(28 28 26 / 0.45);
  --badge-text: #fff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1d2026;
    --border: #2b2f37;
    --text: #e7e7e2;
    --muted: #9a9a92;
    --faint: #73736c;
    --accent: #e8834a;
    --hot-bg: #e8834a14;
    --star: #f0c04a;
    --shadow: none;
    --pop-shadow: 0 10px 40px rgb(0 0 0 / 0.6);
    --scrim: rgb(0 0 0 / 0.6);
    --badge-text: #14161a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

a { color: inherit; }

/* Pleine largeur : plus de conteneur bridé, on ajoute des colonnes quand l'écran grandit. */
.topbar, main, footer { padding-left: 20px; padding-right: 20px; }
main { padding-bottom: 40px; }

.soft { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.error { color: #c0392b; font-size: 0.85rem; min-height: 1.2em; margin: 6px 0 0; }

/* ---- boutons ---- */
button { font: inherit; }

.ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  padding: 2px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.ghost:hover { color: var(--accent); border-color: var(--accent); }

.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
}
.primary:hover { filter: brightness(1.08); }

/* ---- barre haute et onglets ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 14px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.brand { font-size: 1.2rem; font-weight: 700; text-decoration: none; }

.tabs { display: flex; gap: 4px; }
.tabs a {
  padding: 5px 14px;
  border-radius: 99px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.tabs a:hover { color: var(--accent); background: var(--hot-bg); }
.tabs a.on { background: var(--accent); color: #fff; }

.updated { margin-left: auto; color: var(--faint); font-size: 0.8rem; }

/* ---- barre de filtres ---- */
.filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 0 14px;
}
.filter-label { color: var(--muted); font-size: 0.82rem; margin-right: 2px; }

.filter-tag {
  background: none;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.filter-tag:hover { border-color: var(--c); color: var(--text); }
.filter-tag[aria-pressed="true"] {
  background: var(--c);
  border-color: var(--c);
  color: var(--badge-text);
}
.filter-count { margin-left: auto; font-size: 0.8rem; }

/* ---- panneaux (digest, sélection, favoris) ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 18px 24px;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.panel-head h1, .panel-head h2 { font-size: 1.15rem; margin: 0; }

.digest-body { font-size: 0.92rem; }
.digest-body h2 { font-size: 0.98rem; margin: 18px 0 6px; color: var(--accent); break-after: avoid; }
.digest-body ul { margin: 0; padding-left: 18px; }
.digest-body li { margin: 5px 0; break-inside: avoid; }
.digest-body a { color: var(--accent); text-decoration: none; }
.digest-body a:hover { text-decoration: underline; }

.digest-page { max-width: 900px; margin-left: auto; margin-right: auto; }

.archive-list { padding-left: 18px; margin: 6px 0 0; }
.archive-list li { margin: 8px 0; }
.archive-list a { color: var(--accent); text-decoration: none; }
.archive-list a:hover { text-decoration: underline; }

.selection-items { margin-top: 6px; }
@media (min-width: 900px) {
  .selection-items { columns: 2; column-gap: 44px; }
  .selection-items .item { break-inside: avoid; }
}
@media (min-width: 1900px) {
  .selection-items { columns: 3; }
}

/* ---- grille des sources : pleine largeur, colonnes ajoutées avec la place ---- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
@media (min-width: 860px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 2500px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 3200px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px 10px;
  box-shadow: var(--shadow);
}
.card[hidden] { display: none; }

.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.card-head h2 { font-size: 1rem; margin: 0; }
.card-head h2 a { text-decoration: none; }
.card-head h2 a:hover { color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #888); flex: none; }
.warn { color: var(--warn); cursor: help; margin-left: auto; }

/* ---- articles ---- */
.items { list-style: none; margin: 0; padding: 0; }
.items .item {
  position: relative;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}
.items .item:first-child { border-top: none; }
.items .item[hidden] { display: none; }

/* Article jugé « à ne pas manquer » */
.items .item.hot {
  background: var(--hot-bg);
  border-left: 3px solid var(--accent);
  margin-left: -18px;
  padding-left: 15px;
  padding-right: 8px;
  border-radius: 0 4px 4px 0;
}

.items .title {
  display: block;
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.35;
  text-decoration: none;
}
.items .title:hover { color: var(--accent); }
.items .title:visited { color: var(--muted); }
.lock { font-size: 0.8em; }

.meta { color: var(--faint); font-size: 0.78rem; }
.meta a { color: var(--faint); }
.meta a:hover { color: var(--accent); }

.src { color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--c, #888); }

.badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--c, #888);
  color: var(--badge-text);
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: 1px;
}

.pop-btn {
  margin-left: 6px;
  padding: 0 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}
.pop-btn:hover { color: var(--accent); border-color: var(--accent); }

.actions { float: right; display: inline-flex; gap: 2px; }
.react {
  background: none;
  border: none;
  padding: 0 4px;
  color: var(--border);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.react:hover { color: var(--muted); }
.react.on { color: var(--star); }
.react-no.on { color: var(--warn); }

.excerpt {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.items .empty { color: var(--faint); font-style: italic; padding: 8px 0; }

/* ---- overlay (résumé, connexion) ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay[hidden] { display: none; }

.overlay-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--pop-shadow);
  width: 100%;
  max-width: 720px;          /* assez large pour que le résumé ne s'étire pas en colonne */
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.overlay-panel.narrow { max-width: 420px; }

.overlay-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--border);
}
.overlay-head h2 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.overlay-head p { margin: 4px 0 0; }
.overlay-head .ghost { margin-left: auto; flex: none; }

.overlay-content {
  padding: 16px 22px;
  overflow-y: auto;          /* le défilement reste dans le panneau */
  font-size: 0.92rem;
  line-height: 1.6;
}
.overlay-content p { margin: 0 0 12px; }
.overlay-content p:last-child { margin-bottom: 0; }
.overlay-content label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 4px; }
.overlay-content input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.overlay-content input[type="password"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.overlay-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border);
}
.overlay-foot a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.overlay-foot a:hover { text-decoration: underline; }
.overlay-foot .soft { margin-left: auto; font-size: 0.75rem; }

/* ---- pied de page ---- */
footer {
  padding-top: 10px;
  padding-bottom: 30px;
  color: var(--faint);
  font-size: 0.8rem;
}

@media (max-width: 560px) {
  .topbar { gap: 10px; }
  .updated { width: 100%; margin-left: 0; }
  .panel { padding: 14px 16px; }
  .items .item.hot { margin-left: -16px; padding-left: 13px; }
  .overlay { padding: 10px; align-items: flex-end; }
  .overlay-panel { max-height: 90vh; }
}
