@font-face {
  font-family: "Atkinson";
  src: url("fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Les couleurs, polices et arrondis sont définis par le thème actif (dossier themes/). */
:root {
  /* 1rem = 20px sur un écran 1080×1920, proportionnel sur tout autre écran portrait */
  font-size: min(calc(100vw / 54), calc(100vh / 96));
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  cursor: none;
  user-select: none;
}

body { transition: background 1s ease, color 1s ease; }

.screen {
  height: 100vh;
  padding: 3.2rem 3rem 1.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 1.6rem;
  transition: transform 2s ease;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

/* ---------- En-tête ---------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 1.6rem;
  border-bottom: 2px solid var(--ink);
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 3.4rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144;
}
.brand-address {
  margin-top: 0.5rem;
  font-size: 1.6rem;
  color: var(--muted);
}
.clock { text-align: right; flex-shrink: 0; }
.clock-time {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.clock-date {
  margin-top: 0.4rem;
  font-size: 1.6rem;
  color: var(--muted);
}
.clock-date::first-letter { text-transform: uppercase; }

/* ---------- Météo ---------- */
.weather {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 1.6rem 2.2rem;
}
.weather-now { display: flex; align-items: center; gap: 1.8rem; }
.weather-icon { width: 6.4rem; height: 6.4rem; color: var(--accent); flex-shrink: 0; }
.weather-icon svg { width: 100%; height: 100%; stroke-width: 1.3; }
.weather-temp {
  font-size: 5.2rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.weather-desc { font-size: 1.8rem; margin-top: 0.4rem; }
.weather-extra { font-size: 1.4rem; color: var(--muted); margin-top: 0.3rem; }
.weather-extra span { display: block; }

.weather-days {
  list-style: none;
  display: flex;
  gap: 0.6rem;
}
.weather-day {
  width: 7.6rem;
  text-align: center;
  padding: 0.8rem 0.4rem;
  border-left: 1px solid var(--line);
}
.weather-day:first-child { border-left: none; }
.weather-day-name { font-size: 1.5rem; font-weight: 700; }
.weather-day-name::first-letter { text-transform: uppercase; }
.weather-day-icon { width: 3.2rem; height: 3.2rem; margin: 0.4rem auto; color: var(--ink); }
.weather-day-icon svg { width: 100%; height: 100%; }
.weather-day-temp { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.weather-day-temp .min { color: var(--muted); }
.weather-day-rain { font-size: 1.3rem; color: var(--muted); margin-top: 0.2rem; }
.weather-day-min { display: none; }

/* ---------- Actualités ---------- */
.news { display: flex; flex-direction: column; min-height: 0; }
.news-counter {
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.news-stage { position: relative; flex: 1; min-height: 0; }

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.slide.active { opacity: 1; transform: none; }

.slide-image {
  flex: 0 0 40%;
  background: var(--accent-soft) center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.slide-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 2rem 2.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.slide.no-image .slide-body { justify-content: center; padding: 3.2rem 3rem; }

.slide-meta {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  font-size: 1.5rem;
  color: var(--muted);
}
.slide-tag {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  padding: 0.3rem 1rem;
  border-radius: 99rem;
  letter-spacing: 0.04em;
}
/* Actu importante : liseré rouge et étiquette rouge */
.slide.important { border: 0.25rem solid var(--danger); }
.slide.important .slide-tag {
  background: var(--danger);
  color: var(--surface);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.slide-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.9rem;
  line-height: 1.12;
  font-variation-settings: "opsz" 96;
}
.slide.no-image .slide-title { font-size: 3.5rem; }
.slide-text {
  font-size: 1.7rem;
  line-height: 1.45;
  white-space: pre-line;
}
.slide.no-image .slide-text { font-size: 1.95rem; }

.news-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
}

.news-steps { display: none; }  /* segments de progression, utilisés par certains thèmes */

.news-progress {
  height: 0.3rem;
  margin-top: 1rem;
  background: var(--line);
  border-radius: 1rem;
  overflow: hidden;
}
.news-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
}

/* ---------- Infos pratiques ---------- */
.infos-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.info {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  padding: 1.1rem 1.3rem;
  min-width: 0;
}
.info.wide { grid-column: 1 / -1; }
.info-icon {
  width: 3.4rem;
  height: 3.4rem;
  flex-shrink: 0;
  padding: 0.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.info-icon svg { width: 100%; height: 100%; }
.info-text { min-width: 0; }
.info-title { font-size: 1.4rem; color: var(--muted); }
.info-detail {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0.15rem;
}

/* ---------- Pied de page ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  color: var(--muted);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  gap: 2rem;
  white-space: nowrap;
}
.footer > span { overflow: hidden; text-overflow: ellipsis; }
.footer > #status { flex-shrink: 0; }
.footer .offline { color: var(--danger); font-weight: 700; }
