/* SHADOW//NEWS — UI 600×600 pour Meta Ray-Ban Display.
   Fond sombre (optimal sur waveguide), texte large, sélection ultra-contrastée. */

:root {
  --bg: #05080d;
  --panel: #0c1219;
  --panel2: #121c27;
  --line: #1b2837;
  --txt: #e9f1f8;
  --txt-dim: #c3d0dd;
  --muted: #7d8fa3;
  --c-all: #5ee6a8;
  --c-tech: #39c5f3;
  --c-ia: #b48bff;
  --c-cyber: #ff4d5e;
  --accent: #ff4d5e;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
}
body { display: flex; align-items: center; justify-content: center; }

#app {
  width: 600px; height: 600px;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ─── Barre du haut ─── */
#topbar {
  height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
#brand {
  font-family: var(--mono);
  font-size: 19px; font-weight: 700; letter-spacing: 2px;
}
#brand .slash { color: var(--accent); }
#top-right { display: flex; align-items: center; gap: 10px; }
#clock { font-family: var(--mono); font-size: 17px; color: var(--txt-dim); }
#live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2ecc71; box-shadow: 0 0 8px #2ecc71aa;
}
#live-dot.stale { background: #f5a623; box-shadow: 0 0 8px #f5a623aa; }
#live-dot.err   { background: #ff4d5e; box-shadow: 0 0 8px #ff4d5eaa; }

/* ─── Zone centrale ─── */
#screen { flex: 1 1 auto; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: none; flex-direction: column; }
.view.active { display: flex; }

/* ─── Accueil ─── */
#view-home { padding: 14px 16px 8px; gap: 10px; }
.home-card {
  flex: 1 1 0; min-height: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--cat, var(--muted));
  border-radius: 10px;
}
.home-card .bar { display: none; }
.home-card .label { font-size: 21px; font-weight: 700; flex: 1; }
.home-card .info {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  text-align: right; line-height: 1.5;
}
.home-card .info .count { font-size: 17px; color: var(--txt-dim); font-weight: 700; }
.home-card.selected {
  background: var(--panel2);
  border-color: var(--cat, var(--accent));
  box-shadow: 0 0 0 1px var(--cat, var(--accent)), 0 0 18px -6px var(--cat, var(--accent));
}
.home-card.selected .label { color: var(--cat, var(--txt)); }
.home-card.action { border-left-color: var(--muted); }
.home-card.action .label { font-size: 18px; font-weight: 600; color: var(--txt-dim); }

/* ─── Liste ─── */
#list-head {
  flex: 0 0 38px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  font-family: var(--mono); font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
#list-title { font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--cat, var(--txt-dim)); }
#list-scroll { flex: 1 1 auto; overflow-y: auto; scrollbar-width: none; }
#list-scroll::-webkit-scrollbar { display: none; }

.card {
  padding: 13px 18px 13px 14px;
  border-left: 5px solid transparent;
  border-bottom: 1px solid var(--line);
}
.card .title {
  font-size: 20px; line-height: 1.32; font-weight: 600;
  color: var(--txt-dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card .meta {
  margin-top: 7px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 15px; color: var(--muted);
}
.card .meta .src {
  color: var(--cat, var(--muted));
  font-weight: 700;
}
.card .meta .new-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ecc71;
}
.card.read .title { color: var(--muted); font-weight: 500; }
.card.selected {
  background: var(--panel2);
  border-left-color: var(--cat, var(--accent));
}
/* clamp constant (2 lignes) : la géométrie de la liste ne bouge pas quand la
   sélection se déplace — le titre complet est de toute façon dans le lecteur */
.card.selected .title {
  color: var(--txt);
}

.empty-state {
  margin: auto; text-align: center; color: var(--muted);
  font-size: 18px; line-height: 1.6; padding: 0 40px;
}
.empty-state .big { font-size: 34px; display: block; margin-bottom: 10px; }

/* ─── Lecture ─── */
#read-progress {
  flex: 0 0 4px; background: var(--line);
}
#read-progress-bar {
  height: 100%; width: 0%;
  background: var(--cat, var(--accent));
  transition: width .15s linear;
}
#reader-scroll {
  flex: 1 1 auto; overflow-y: auto; scrollbar-width: none;
  padding: 16px 22px 10px;
  scroll-behavior: smooth;
}
#reader-scroll::-webkit-scrollbar { display: none; }

.read-cat {
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--cat, var(--accent));
}
.read-title {
  font-size: 23px; line-height: 1.28; font-weight: 700;
  margin: 8px 0 10px;
  overflow-wrap: anywhere;
}
.read-meta {
  font-family: var(--mono); font-size: 15px; color: var(--muted);
  overflow-wrap: anywhere;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.read-meta .src { color: var(--txt-dim); font-weight: 700; }
.read-img {
  width: 100%; max-height: 200px; object-fit: cover;
  border-radius: 8px; margin: 0 0 14px;
  border: 1px solid var(--line);
}
.read-para {
  font-size: 19px; line-height: 1.58;
  color: var(--txt-dim);
  margin: 0 0 16px;
  overflow-wrap: anywhere; /* URLs et mots longs ne sortent jamais des 600px */
}
.read-end {
  margin: 26px 0 40px;
  padding: 14px;
  text-align: center;
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 8px;
}
.read-end b { color: var(--txt-dim); }

/* ─── Toast ─── */
#toast {
  position: absolute;
  left: 50%; bottom: 56px;
  transform: translateX(-50%) translateY(16px);
  background: #0f1822ee;
  border: 1px solid var(--accent);
  color: var(--txt);
  font-size: 16px; font-weight: 600;
  padding: 10px 20px; border-radius: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
  z-index: 10;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Aide commandes (bas) ─── */
#hints {
  height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 15.5px; color: var(--muted);
  white-space: nowrap;
}
.hint { display: flex; align-items: center; gap: 7px; }
.hint .key {
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  color: var(--txt-dim);
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 8px;
  min-width: 26px; text-align: center;
}
