/* ============================================================
   DGSSI · Publications — Bibliothèque officielle de consultation
   Design : tech sombre & cyan électrique (tokens inspirés de DESIGN.md)
   surface.base #000 · surface.raised #111 · accent #00e5ff · DM Sans
   ============================================================ */
:root {
  --bg: #000000;
  --bg-soft: #0a0b0c;
  --bg-card: #111111;
  --bg-raised: #191a1c;
  --line: rgba(255, 255, 255, 0.10);
  --line-accent: rgba(0, 229, 255, 0.38);
  --accent: #00e5ff;
  --accent-soft: #7df0ff;
  --ink: #ffffff;
  --ink-dim: #9aa4a8;
  --accent-2: #f0f0f0;
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: rgb(14, 16, 18) 0px 0px 100px 50px;
  --shadow-accent: rgba(0, 229, 255, 0.3) 0px 0px 8px 0px, rgba(0, 229, 255, 0.08) 0px 18px 50px 0px;
  --glow-inset: rgba(0, 229, 255, 0.05) 0px 0px 60px 0px inset;
  --font-display: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wrap: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1400px 600px at 80% -200px, rgba(0, 229, 255, 0.07), transparent 60%),
    radial-gradient(1200px 700px at -10% 40%, rgba(240, 240, 240, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #001417; }

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Accessibilité ---------- */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: #001417; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(0, 0, 0, 0.82);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  max-width: var(--wrap); margin: 0 auto; padding: 15px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand .seal {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, #0090a8 100%);
  color: #001417; box-shadow: 0 8px 24px rgba(0, 229, 255, 0.35);
}
.brand .seal svg { width: 24px; height: 24px; }
.brand .name { line-height: 1.25; }
.brand .name strong { display: block; font-size: 15px; letter-spacing: 0.4px; }
.brand .name span { font-size: 11px; color: var(--ink-dim); letter-spacing: 1.8px; text-transform: uppercase; }
.header-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-dim); text-decoration: none;
  border: 1px solid var(--line); padding: 9px 18px; border-radius: 999px;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}
.header-link:hover { color: var(--accent-soft); border-color: var(--accent); background: rgba(0, 229, 255, 0.06); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 92px 28px 70px; text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(1100px 480px at 50% -140px, rgba(0, 229, 255, 0.18), transparent 62%),
    radial-gradient(900px 420px at 88% 115%, rgba(240, 240, 240, 0.10), transparent 60%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(760px 340px at 50% 0%, black, transparent 78%);
  -webkit-mask-image: radial-gradient(760px 340px at 50% 0%, black, transparent 78%);
  opacity: 0.32;
}
.hero > * { position: relative; }
.hero .ornament {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--accent); margin-bottom: 26px;
}
.hero .ornament::before, .hero .ornament::after {
  content: ""; width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-accent));
}
.hero .ornament::after { transform: scaleX(-1); }
.hero .kicker {
  display: inline-block; font-size: 12px; letter-spacing: 3.5px;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--line-accent); border-radius: 999px;
  padding: 8px 22px; margin-bottom: 28px;
  background: rgba(0, 229, 255, 0.06);
}
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(38px, 6vw, 66px); line-height: 1.08;
  letter-spacing: 0.5px;
}
.hero h1 em { font-style: italic; color: var(--accent-soft); }
.hero p {
  max-width: 660px; margin: 22px auto 0; color: var(--ink-dim); font-size: 16px;
}
.hero p b { color: var(--ink); font-weight: 600; }
.hero .stats {
  display: flex; gap: 18px; justify-content: center; margin-top: 46px; flex-wrap: wrap;
}
.hero .stat {
  min-width: 132px; padding: 18px 26px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(17, 17, 17, 0.65);
  backdrop-filter: blur(6px);
}
.hero .stat b { display: block; font-family: var(--font-display); font-size: 32px; color: var(--accent-soft); line-height: 1.15; }
.hero .stat span { font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink-dim); }

/* ---------- À la une ---------- */
.featured {
  max-width: var(--wrap); margin: 6px auto 0; padding: 0 28px;
}
.featured .featured-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px;
  background: linear-gradient(150deg, var(--bg-raised), var(--bg-card) 65%);
  border: 1px solid var(--line-accent); border-radius: var(--radius);
  padding: 44px 48px; box-shadow: var(--shadow-accent);
}
.featured .featured-card::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.14), transparent 65%);
  pointer-events: none;
}
.featured .label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent);
  margin-bottom: 16px;
}
.featured h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; margin-bottom: 14px;
}
.featured h2 a { color: var(--ink); text-decoration: none; }
.featured h2 a:hover { color: var(--accent-soft); }
.featured .excerpt { color: var(--ink-dim); font-size: 14.5px; max-width: 56ch; }
.featured .side {
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  border-left: 1px solid var(--line); padding-left: 40px;
}
.featured .side .row { display: flex; flex-direction: column; gap: 4px; }
.featured .side .k { font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink-dim); }
.featured .side .v { font-size: 15px; color: var(--ink); }
.featured .cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 10px; padding: 13px 24px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #00b8cc);
  color: #001417; font-weight: 600; font-size: 14px; text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.featured .cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 229, 255, 0.3); }

/* ---------- Toolbar ---------- */
.toolbar {
  max-width: var(--wrap); margin: 0 auto; padding: 44px 28px 6px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.search {
  flex: 1 1 300px; display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 13px 22px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.12); }
.search svg { flex: none; opacity: 0.55; }
.search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--ink); font-size: 15px; font-family: inherit;
}
.search input::placeholder { color: var(--ink-dim); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  cursor: pointer; border: 1px solid var(--line); background: var(--bg-card);
  color: var(--ink-dim); font-size: 13px; font-family: inherit;
  padding: 11px 20px; border-radius: 999px; transition: all 0.25s ease;
}
.chip:hover { color: var(--ink); border-color: var(--line-accent); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), #00b8cc);
  color: #001417; border-color: transparent; font-weight: 600;
}
.select-wrap { position: relative; }
.select-wrap svg {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  pointer-events: none; opacity: 0.55;
}
.sort-select, .theme-select {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-card); border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 999px; padding: 11px 44px 11px 18px; font-size: 13px; font-family: inherit;
  cursor: pointer; outline: none; max-width: 240px;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.sort-select:hover, .theme-select:hover { border-color: var(--line-accent); color: var(--ink); }
.sort-select:focus-visible, .theme-select:focus-visible { border-color: var(--accent); }
.sort-select option, .theme-select option { background: var(--bg-card); color: var(--ink); }

.count {
  max-width: var(--wrap); margin: 0 auto; padding: 14px 28px 0;
  font-size: 12.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-dim);
}
.count b { color: var(--accent-soft); }

/* ---------- Grid & cards ---------- */
.grid {
  max-width: var(--wrap); margin: 0 auto; padding: 22px 28px 96px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px;
}
.card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(165deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 28px 24px; overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.card:hover { transform: translateY(-6px); border-color: var(--line-accent); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card .topline {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px;
}
.tag svg { width: 13px; height: 13px; }
.tag.documents { color: var(--accent-soft); background: rgba(0, 229, 255, 0.12); border: 1px solid var(--line-accent); }
.tag.guides { color: var(--accent-2); background: rgba(240, 240, 240, 0.1); border: 1px solid rgba(240, 240, 240, 0.35); }
.year {
  font-family: var(--font-display); font-size: 17px; color: var(--ink-dim);
  letter-spacing: 1px;
}
.card h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 22px; line-height: 1.25; margin-bottom: 12px;
}
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { color: var(--accent-soft); }
.card .excerpt {
  color: var(--ink-dim); font-size: 13.5px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .themes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.card .themes span {
  font-size: 11px; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
  background: rgba(255, 255, 255, 0.02);
}
.card .meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-dim);
}
.card .meta .read {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); text-decoration: none; font-weight: 600;
  letter-spacing: 0.6px; font-size: 13px;
  transition: gap 0.25s ease, color 0.25s ease;
}
.card .meta .read:hover { color: var(--accent-soft); gap: 10px; }
.empty {
  grid-column: 1 / -1; text-align: center; color: var(--ink-dim);
  padding: 70px 20px; font-size: 15px;
}
.empty .reset {
  display: inline-block; margin-top: 16px; cursor: pointer;
  border: 1px solid var(--line-accent); background: none; color: var(--accent-soft);
  font-size: 13px; font-family: inherit; padding: 10px 22px; border-radius: 999px;
  transition: background 0.25s ease;
}
.empty .reset:hover { background: rgba(0, 229, 255, 0.1); }

/* ---------- Detail page ---------- */
.detail { max-width: 880px; margin: 0 auto; padding: 60px 28px 100px; }
.detail .back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-dim); text-decoration: none; font-size: 13.5px;
  transition: color 0.25s ease, gap 0.25s ease;
}
.detail .back:hover { color: var(--accent-soft); gap: 12px; }
.detail h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 4.5vw, 46px); line-height: 1.15; margin: 26px 0 20px;
}
.detail .meta-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 36px; }
.detail .date {
  font-size: 12.5px; color: var(--ink-dim); letter-spacing: 0.4px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
}
.detail .theme-chip {
  font-size: 12px; color: var(--accent-soft);
  background: rgba(0, 229, 255, 0.08); border: 1px solid var(--line-accent);
  border-radius: 999px; padding: 6px 15px;
}
.detail .body {
  background: linear-gradient(165deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 42px 46px; color: #d9dcdd; font-size: 15.5px;
}
.detail .body::first-letter {
  font-family: var(--font-display); font-size: 3.1em; line-height: 0.85;
  float: left; padding: 6px 14px 0 0; color: var(--accent-soft);
}
.detail .read-more { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.detail .read-more a {
  color: var(--accent); text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
}
.detail .read-more a:hover { color: var(--accent-soft); }

.detail .sources { margin-top: 38px; }
.detail .sources h3, .detail .related h3 {
  display: flex; align-items: center; gap: 14px;
  font-size: 11.5px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 18px;
}
.detail .sources h3::after, .detail .related h3::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.source-btn {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 22px; margin-bottom: 12px;
  color: var(--ink); text-decoration: none; font-size: 14.5px;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.source-btn:hover { border-color: var(--accent); transform: translateX(4px); background: var(--bg-raised); }
.source-btn .icon {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(0, 229, 255, 0.1); border: 1px solid var(--line-accent);
  color: var(--accent-soft);
}
.source-btn .icon svg { width: 19px; height: 19px; }
.source-btn .text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.source-btn .text small { font-size: 12px; color: var(--ink-dim); }
.source-btn .arrow { color: var(--accent); flex: none; }
.source-btn.local { border-style: dashed; }
.source-btn.local .icon { background: rgba(240, 240, 240, 0.08); border-color: rgba(240, 240, 240, 0.35); color: var(--accent-2); }
.source-btn.local:hover { border-color: var(--accent-2); }
.source-btn.local .arrow { color: var(--accent-2); }

.detail .related { margin-top: 44px; }
.detail .related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px;
}
.related-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 20px 22px;
  text-decoration: none; transition: border-color 0.25s ease, transform 0.25s ease;
}
.related-card:hover { border-color: var(--line-accent); transform: translateY(-3px); }
.related-card .r-title {
  font-family: var(--font-display); font-size: 16.5px; font-weight: 600;
  line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.related-card:hover .r-title { color: var(--accent-soft); }
.related-card .r-date { font-size: 12px; color: var(--ink-dim); margin-top: auto; }

.detail .official-note {
  margin-top: 34px; font-size: 13px; color: var(--ink-dim);
  border-left: 3px solid var(--line-accent); padding: 6px 0 6px 18px;
}
.detail .official-note a { color: var(--accent); text-decoration: none; }
.detail .official-note a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-soft), #000000);
  padding: 56px 28px 40px;
}
.site-footer .cols {
  max-width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 44px;
}
.site-footer h4 {
  font-size: 11.5px; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.site-footer p, .site-footer li { font-size: 13.5px; color: var(--ink-dim); }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--ink-dim); text-decoration: none; transition: color 0.25s ease; }
.site-footer a:hover { color: var(--accent-soft); }
.site-footer .legal {
  max-width: var(--wrap); margin: 40px auto 0; padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-dim); text-align: center;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); animation: rise 0.6s ease forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured .featured-card { grid-template-columns: 1fr; gap: 26px; padding: 34px 30px; }
  .featured .side { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 640px) {
  .hero { padding: 60px 20px 48px; }
  .hero .stat { min-width: 44%; padding: 14px 16px; }
  .featured { padding: 0 20px; }
  .toolbar { padding: 32px 20px 4px; }
  .count { padding: 12px 20px 0; }
  .grid { padding: 18px 20px 72px; grid-template-columns: 1fr; }
  .detail { padding: 40px 20px 80px; }
  .detail .body { padding: 30px 24px; }
  .site-footer { padding: 44px 20px 32px; }
}

.header-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
