/* ==========================================================================
   Thesaurus Patrimoine — Thème Joornal
   Architecture  : utility-first écrit à la main (classes courtes atomiques)
   Grille        : CSS Grid 3 colonnes → 2 → 1
   Carte (card)  : image en haut avec overlay catégorie, texte dessous
   Palette       : Bleu nuit · Blanc · Or champagne · Ardoise
   Typographie   : DM Serif Display (titres) + Inter (corps)
   ========================================================================== */

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --night:      #0B1829;
  --night-mid:  #162338;
  --night-soft: #1E3050;
  --white:      #FFFFFF;
  --off:        #F5F6F8;
  --off-dark:   #EAECF0;
  --gold:       #C9A84C;
  --gold-lt:    #E0C07A;
  --slate:      #64748B;
  --slate-lt:   #94A3B8;
  --ink:        #0F172A;
  --ink-soft:   #334155;
  --border:     #CBD5E1;

  --serif:  'DM Serif Display', Georgia, serif;
  --sans:   'Inter', system-ui, sans-serif;

  /* Fluid type scale */
  --t-xs:  0.6875rem;
  --t-sm:  0.8125rem;
  --t-md:  1rem;
  --t-lg:  1.1875rem;
  --t-xl:  1.5rem;
  --t-2xl: 2rem;
  --t-3xl: 2.75rem;
  --t-4xl: 3.5rem;

  --ease: 200ms ease;
  --ease-slow: 400ms ease;
  --wrap: 1200px;
  --gap:  2rem;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.7;
  background: var(--off);
  color: var(--ink);
}

/* ── Rail (conteneur centré) ─────────────────────────────────────────────── */
.rail {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ==========================================================================
   HEADER — SLAB
   ========================================================================== */
.slab {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--night);
  border-bottom: 1px solid var(--night-soft);
}

.slab__rail {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
  display: flex;
  align-items: center;
  height: 3.75rem;
  gap: 2.5rem;
}

.slab__logotype {
  height: 1.875rem;
  width: auto;
  flex-shrink: 0;
}

/* Cipher nav */
.cipher {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
}

.cipher__path {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-lt);
  border-radius: 3px;
  transition: color var(--ease), background var(--ease);
  white-space: nowrap;
}

.cipher__path:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

/* Mobile burger */
.slab__burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.slab__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

@media (max-width: 720px) {
  .slab__burger { display: flex; }

  .slab__nav {
    position: fixed;
    top: 3.75rem;
    inset-inline: 0;
    background: var(--night);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem 1.5rem 2rem;
    transform: translateY(-105%);
    opacity: 0;
    transition: transform 0.26s ease, opacity 0.26s ease;
    pointer-events: none;
  }

  .slab__nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .cipher { flex-direction: column; align-items: flex-start; gap: 0; }
  .cipher__path { font-size: var(--t-sm); padding: 0.65rem 0; }
}

/* ==========================================================================
   HOMEPAGE — HERALD (hero)
   ========================================================================== */
.herald {
  background: var(--night);
  color: var(--white);
  padding: 5rem 1.5rem 4.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle diagonal texture */
.herald::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -60deg,
    rgba(201, 168, 76, 0.03) 0px,
    rgba(201, 168, 76, 0.03) 1px,
    transparent 1px,
    transparent 48px
  );
  pointer-events: none;
}

.herald__rail {
  position: relative;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
  max-width: 760px;
  margin-inline: 0;
}

.herald__kicker {
  display: inline-block;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
  margin-bottom: 1.5rem;
}

.herald__display {
  font-family: var(--serif);
  font-size: clamp(var(--t-3xl), 6vw, var(--t-4xl));
  line-height: 1.1;
  font-style: italic;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.herald__deck {
  font-size: var(--t-lg);
  color: var(--slate-lt);
  line-height: 1.65;
  margin-bottom: 2.5rem;
  max-width: 540px;
  font-weight: 300;
}

.herald__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.875rem;
  background: var(--gold);
  color: var(--night);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background var(--ease), transform var(--ease);
}

.herald__btn:hover {
  background: var(--gold-lt);
  transform: translateY(-1px);
}

/* ==========================================================================
   SECTION LABELS — GLYPH
   ========================================================================== */
.glyph {
  padding-block: 4rem 2rem;
}

.glyph--alt {
  background: var(--off-dark);
  padding-block: 4rem 3rem;
  margin-top: 3rem;
}

.glyph__rail {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.glyph__hed {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.glyph__hed--lg .glyph__label {
  font-size: clamp(var(--t-xl), 3vw, var(--t-3xl));
}

.glyph__label {
  font-family: var(--serif);
  font-size: var(--t-2xl);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  white-space: nowrap;
}

.glyph__rule {
  display: block;
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ==========================================================================
   GRILLE D'ARTICLES — PANEL
   ========================================================================== */

/* 3 colonnes → 2 → 1 */
.panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* 2 colonnes */
.panel--duo {
  grid-template-columns: repeat(2, 1fr);
}

/* Colonne unique (articles liés) */
.panel--col {
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
}

@media (max-width: 992px) {
  .panel { grid-template-columns: repeat(2, 1fr); }
  .panel--duo { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .panel,
  .panel--duo { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CARTE D'ARTICLE — CARD (image en haut, overlay catégorie)
   ========================================================================== */
.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
  transition: box-shadow var(--ease-slow);
}

.card:hover {
  box-shadow: 0 8px 32px rgba(11, 24, 41, 0.12);
}

/* Bloc image avec overlay */
.card__visual {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--off-dark);
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--ease-slow);
}

.card:hover .card__img { transform: scale(1.04); }

/* Badge catégorie en overlay (coin supérieur gauche) */
.card__badge {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  background: var(--gold);
  color: var(--night);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.625rem;
  pointer-events: none;
}

/* Corps de la carte */
.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.375rem 1.25rem 1.5rem;
  border-top: 3px solid transparent;
  transition: border-color var(--ease);
}

.card:hover .card__body { border-top-color: var(--night); }

.card__info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.card__time {
  font-size: var(--t-xs);
  color: var(--slate);
  font-weight: 400;
}

.card__dot { color: var(--border); }

.card__read {
  font-size: var(--t-xs);
  color: var(--slate);
}

.card__title {
  font-family: var(--serif);
  font-size: var(--t-xl);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  flex: 1;
}

.card__title a {
  color: var(--ink);
  transition: color var(--ease);
}

.card__title a:hover { color: var(--night-soft); }

.card__excerpt {
  font-size: var(--t-sm);
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__cta {
  margin-top: auto;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color var(--ease);
}

.card__cta:hover { color: var(--night); }

/* Variante dans panel--col (articles liés) */
.panel--col .card {
  flex-direction: row;
  aspect-ratio: auto;
  background: var(--white);
}

.panel--col .card__visual {
  flex: 0 0 160px;
  aspect-ratio: auto;
  align-self: stretch;
}

.panel--col .card__body { padding: 1.25rem 1.5rem; }

@media (max-width: 480px) {
  .panel--col .card { flex-direction: column; }
  .panel--col .card__visual { flex: none; aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   PAGE ARTICLE — DATUM
   ========================================================================== */
.datum__rail {
  max-width: 800px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-top: 1.75rem;
}

/* Breadcrumb */
.datum__crumb ol,
.datum__crumb ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  font-size: var(--t-xs);
  color: var(--slate);
  padding: 0;
}

.datum__crumb li + li::before {
  content: '›';
  margin-right: 0.25rem;
  color: var(--border);
}

.datum__crumb a:hover { color: var(--gold); }

/* Article */
.datum__body {
  padding-block: 2.5rem 4rem;
}

.datum__hdr { margin-bottom: 2rem; }

.datum__cat {
  display: inline-block;
  background: var(--night);
  color: var(--gold);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1.25rem;
}

.datum__h1 {
  font-family: var(--serif);
  font-size: clamp(var(--t-2xl), 5vw, var(--t-3xl));
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.datum__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--t-xs);
  color: var(--slate);
  padding-block: 0.875rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.datum__sep { color: var(--border); }

/* Cover */
.datum__cover {
  margin-bottom: 2.5rem;
  overflow: hidden;
  aspect-ratio: 16 / 8;
  background: var(--off-dark);
}

.datum__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Table of contents */
.datum__toc {
  background: var(--night);
  color: var(--slate-lt);
  padding: 1.375rem 1.75rem;
  margin-bottom: 3rem;
  font-size: var(--t-sm);
  border-left: 4px solid var(--gold);
}

.datum__toc ol,
.datum__toc ul {
  padding-left: 1.25rem;
  line-height: 2;
  list-style: decimal;
}

.datum__toc a { color: var(--slate-lt); transition: color var(--ease); }
.datum__toc a:hover { color: var(--gold-lt); }

/* Article prose */
.datum__prose {
  font-size: var(--t-lg);
  line-height: 1.85;
  color: var(--ink-soft);
}

.datum__prose > * + * { margin-top: 1.625rem; }

.datum__prose h2 {
  font-family: var(--serif);
  font-size: var(--t-2xl);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin-top: 3.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.625rem;
}

.datum__prose h3 {
  font-family: var(--serif);
  font-size: var(--t-xl);
  font-weight: 400;
  color: var(--ink);
  margin-top: 2.5rem;
}

.datum__prose a {
  color: var(--night-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.datum__prose a:hover { color: var(--gold); }

.datum__prose strong { font-weight: 600; color: var(--ink); }

.datum__prose ul,
.datum__prose ol { padding-left: 1.5rem; }

.datum__prose ul { list-style: disc; }
.datum__prose ol { list-style: decimal; }

.datum__prose blockquote {
  border-left: 4px solid var(--gold);
  padding: 1.25rem 1.5rem;
  background: var(--off);
  color: var(--ink);
  font-style: italic;
  font-family: var(--serif);
  font-size: var(--t-xl);
}

.datum__prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  font-family: var(--sans);
  margin-block: 2rem;
}

.datum__prose th {
  background: var(--night);
  color: var(--white);
  padding: 0.625rem 1rem;
  text-align: left;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.datum__prose td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
}

.datum__prose tr:nth-child(even) td { background: var(--off); }

/* Author block */
.datum__author {
  margin-top: 3.5rem;
  padding: 1.5rem;
  background: var(--off);
  border-left: 4px solid var(--night);
  font-size: var(--t-sm);
}

/* ==========================================================================
   ARTICLES LIÉS — INDEX-REL
   ========================================================================== */
.index-rel {
  background: var(--night);
  padding-block: 4rem;
  margin-top: 2rem;
}

.index-rel__rail {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.index-rel__hed {
  font-family: var(--serif);
  font-size: var(--t-2xl);
  font-weight: 400;
  font-style: italic;
  color: var(--white);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Override card dans index-rel pour fond sombre */
.index-rel .card { background: var(--night-mid); }
.index-rel .card__title a { color: var(--off); }
.index-rel .card__excerpt { color: var(--slate-lt); }
.index-rel .card:hover { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); }
.index-rel .card__body { border-top-color: transparent; }
.index-rel .card:hover .card__body { border-top-color: var(--gold); }

/* ==========================================================================
   PAGINATION — PAGINATE
   ========================================================================== */
.paginate {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  padding-block: 3rem 4.5rem;
}

.paginate .paginate__num a,
.paginate .paginate__num span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--slate);
  border: 1px solid var(--border);
  background: var(--white);
  transition: all var(--ease);
}

.paginate .paginate__num a:hover {
  border-color: var(--night);
  color: var(--night);
  background: var(--off);
}

.paginate .paginate__num--on a,
.paginate .paginate__num--on span {
  background: var(--night);
  border-color: var(--night);
  color: var(--white);
  font-weight: 600;
}

/* ==========================================================================
   FOOTER — LEDGE
   ========================================================================== */
.ledge {
  background: var(--night);
  color: var(--slate-lt);
  border-top: 3px solid var(--gold);
  padding: 3.5rem 1.5rem;
  margin-top: 5rem;
}

.ledge__rail {
  max-width: var(--wrap);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2.5rem;
}

@media (max-width: 720px) {
  .ledge__rail { grid-template-columns: 1fr; text-align: center; }
}

.ledge__logotype { height: 1.75rem; width: auto; opacity: 0.6; }

.ledge__sub {
  font-size: var(--t-xs);
  color: var(--slate);
  margin-top: 0.5rem;
  font-style: italic;
  font-family: var(--serif);
}

.ledge__links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  justify-content: center;
  flex-wrap: wrap;
}

.ledge__path {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 0.35rem 0.75rem;
  transition: color var(--ease);
}

.ledge__path:hover { color: var(--gold-lt); }

.ledge__copy {
  font-size: var(--t-xs);
  color: var(--slate);
  text-align: right;
}

@media (max-width: 720px) { .ledge__copy { text-align: center; } }
