/* demerion.net — site public. Palette : nuit violette, or du titre du jeu. */
:root {
  --bg: #0d0714;
  --bg-alt: #150c22;
  --panel: #1c1129;
  --panel-2: #24173a;
  --line: rgba(232, 196, 92, 0.22);
  --text: #ece6f3;
  --muted: #b3a8c2;
  --gold: #e8c45c;
  --gold-2: #ffd970;
  --gold-dark: #8a6420;
  --violet: #9a5cff;
  --radius: 10px;
  --wrap: 1160px;
  --serif: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
a:hover { color: var(--gold-2); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: .02em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--gold); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }

/* ── En-tête ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 7, 20, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-family: var(--serif); font-size: 1.3rem; font-weight: 700; letter-spacing: .06em; }
.brand img { border-radius: 8px; }
.site-nav { margin-left: auto; display: flex; gap: 6px; }
.site-nav a { color: var(--text); text-decoration: none; white-space: nowrap; padding: 8px 14px; border-radius: 6px; font-weight: 500; }
.site-nav a:hover { background: var(--panel-2); color: var(--gold-2); }
.site-nav a[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 1060px) {
  .nav-burger { display: block; margin-left: auto; width: 44px; height: 44px; cursor: pointer; position: relative; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    position: absolute; left: 10px; width: 24px; height: 2px; background: var(--gold); content: ""; border-radius: 2px;
  }
  .nav-burger span { top: 21px; }
  .nav-burger span::before { top: -7px; left: 0; }
  .nav-burger span::after { top: 7px; left: 0; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .site-nav a { padding: 12px; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
}

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 8px; font-weight: 700;
  text-decoration: none; border: 1px solid transparent; letter-spacing: .02em; transition: transform .15s, box-shadow .15s;
}
.btn-gold { background: linear-gradient(180deg, #ffe08a, #d9a83c); color: #2a1606; border-color: #f7d77c; box-shadow: 0 6px 20px rgba(232, 196, 92, .25); }
.btn-gold:hover { color: #2a1606; transform: translateY(-1px); box-shadow: 0 8px 26px rgba(232, 196, 92, .4); }
.btn-ghost { color: var(--gold); border-color: var(--gold); background: rgba(13, 7, 20, .55); }
.btn-ghost:hover { background: rgba(232, 196, 92, .12); }
.btn-disabled { opacity: .82; cursor: default; }
.btn-disabled:hover { transform: none; }

/* ── Accueil ───────────────────────────────────────────────────────────── */
.hero { position: relative; background: #000; }
.hero-art { width: 100%; max-height: 78vh; object-fit: cover; object-position: center 40%; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero-text { position: absolute; left: 0; right: 0; bottom: clamp(16px, 4vw, 48px); z-index: 1; text-align: center; }
.hero-tagline { font-family: var(--serif); font-size: clamp(1.05rem, 2.4vw, 1.6rem); color: #fff; text-shadow: 0 2px 10px #000, 0 0 2px #000; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .hero-text { position: static; padding: 8px 0 24px; }
  .hero::after { display: none; }
}

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); border-block: 1px solid rgba(255, 255, 255, .04); }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; color: var(--violet); font-weight: 700; margin-bottom: .4em; }
.two-cols { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .two-cols { grid-template-columns: 1fr; } }
.framed { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.framed figcaption { padding: 10px 14px; color: var(--muted); font-size: .9rem; }
.framed.wide { margin-top: 24px; }
.facts { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.facts li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.facts strong { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--gold); }
.facts span { color: var(--muted); font-size: .85rem; }
@media (max-width: 480px) { .facts { grid-template-columns: repeat(2, 1fr); } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 28px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 24px; text-align: center; }
.feature img { width: 160px; margin: 0 auto 6px; }
.feature h3 { color: var(--gold); }
.feature p { color: var(--muted); margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.gallery figcaption { padding: 8px 12px; font-size: .9rem; color: var(--muted); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.link-more { text-decoration: none; font-weight: 600; }

/* ── Actualités ────────────────────────────────────────────────────────── */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.news-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s, border-color .15s; }
.news-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.news-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.news-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.news-card-media img { width: 100%; height: 100%; object-fit: cover; }
.news-card-media img.is-placeholder { opacity: .55; }
/* Image verticale (portrait de héros…) : montrée en entier, sur un halo, au lieu d'être rognée au milieu. */
.news-card-media.is-portrait, .article-cover.is-portrait { background: radial-gradient(ellipse at center, rgba(154, 92, 255, .30), #0b0612 70%); }
.news-card-media.is-portrait img { object-fit: contain; padding-top: 6px; }
.article-cover.is-portrait { text-align: center; }
.article-cover.is-portrait img { width: auto; max-width: 100%; max-height: 520px; margin: 0 auto; display: block; }
.news-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.news-card-body time { color: var(--violet); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.news-card-body h3 { margin: 6px 0 8px; color: var(--text); }
.news-card-body p { color: var(--muted); font-size: .95rem; flex: 1; }
.read-more { color: var(--gold); font-weight: 600; font-size: .92rem; }

.page-banner { padding: 56px 0 28px; background: radial-gradient(ellipse at top, rgba(154, 92, 255, .22), transparent 60%), var(--bg-alt); border-bottom: 1px solid var(--line); }
.page-banner h1 { margin: 0; }
.back-link { display: inline-block; margin-bottom: 14px; text-decoration: none; font-weight: 600; }
.article-meta { color: var(--muted); margin: 10px 0 0; }
.article-cover { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.article-lead { font-size: 1.15rem; color: #fff; }
.article-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-nav a { text-decoration: none; max-width: 48%; color: var(--text); font-weight: 600; }
.article-nav a span { display: block; color: var(--gold); font-size: .85rem; font-weight: 500; }
.article-nav .next { text-align: right; margin-left: auto; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; padding: 8px 12px; border-radius: 6px; text-align: center; border: 1px solid var(--line); text-decoration: none; }
.pagination [aria-current] { background: var(--gold); color: #2a1606; font-weight: 700; }
.pagination .gap { border: 0; }

/* ── Texte riche (Markdown) ───────────────────────────────────────────── */
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.4em; color: var(--gold); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.4em 0; padding: 12px 20px; border-left: 3px solid var(--gold); background: var(--panel); font-family: var(--serif); font-style: italic; color: #fff; }
.prose code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.prose pre { background: var(--panel); padding: 14px; border-radius: 8px; overflow-x: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose .md-figure { margin: 1.6em 0; }
.prose .md-figure img { border-radius: 8px; border: 1px solid var(--line); }
.prose .md-figure figcaption { color: var(--muted); font-size: .9rem; margin-top: 6px; text-align: center; }
.md-table-wrap { overflow-x: auto; }
.md-table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 8px 10px; }
.md-table th { background: var(--panel-2); }

.not-found { min-height: 50vh; display: grid; place-items: center; }

/* ── Pied de page ──────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: #08040d; padding: 32px 0; color: var(--muted); font-size: .92rem; }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 16px; justify-items: center; text-align: center; }
.footer-brand { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.footer-brand img { border-radius: 8px; }
.footer-brand strong { display: block; color: var(--text); font-family: var(--serif); }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; row-gap: 6px; justify-content: center; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--gold); }
.footer-copy { grid-column: 1 / -1; margin: 0; font-size: .85rem; }
.footer-nav { padding-top: 14px; border-top: 1px solid var(--line); justify-self: stretch; }

/* Aperçu d'une actualité depuis l'administration */
.preview-banner { background: #e0a440; color: #1a0f00; text-align: center; font-weight: 700; padding: 8px 16px; }

/* ── Devenir testeur, contact (lot « testeurs », 2026-10-28) ─────────── */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 28px 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { counter-increment: step; position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 44px 18px 18px; }
.steps li::before { content: counter(step); position: absolute; top: 12px; left: 18px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #2a1606; font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.steps h3 { color: var(--gold); margin-bottom: .4em; }
.steps p { color: var(--muted); margin: 0; font-size: .95rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.small-note { font-size: .88rem; }

.notice { border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; border: 1px solid; }
.notice h2 { font-size: 1.3rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { background: rgba(80, 180, 110, .10); border-color: rgba(110, 210, 140, .45); }
.notice-error { background: rgba(220, 70, 70, .10); border-color: rgba(240, 110, 110, .5); }

.site-form { display: grid; gap: 16px; }
.site-form label { display: block; font-weight: 600; }
.site-form label > input:not([type="checkbox"]):not([type="radio"]), .site-form label > textarea { display: block; margin-top: 6px; }
.site-form input[type="text"], .site-form input[type="email"], .site-form textarea {
  width: 100%; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit; font-weight: 400;
}
.site-form textarea { resize: vertical; min-height: 140px; }
.site-form input:focus, .site-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.site-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; margin: 0; display: grid; gap: 8px; }
.site-form legend { padding: 0 6px; font-weight: 600; }
.site-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.site-form .check input { margin-top: .35em; width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.site-form button { justify-self: start; cursor: pointer; font: inherit; font-weight: 700; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.site-form .choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-weight: 500; }
.choice input:checked + span { background: var(--gold); color: #2a1606; border-color: var(--gold); font-weight: 700; }
.choice input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.site-nav a.nav-cta { color: var(--gold); border: 1px solid var(--gold); }
.site-nav a.nav-cta:hover { background: rgba(232, 196, 92, .12); }

/* Catégories des actualités (lot 3) */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.cat-tabs a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.cat-tabs a:hover { border-color: var(--gold); color: var(--text); }
.cat-tabs a[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: #1a1208; font-weight: 700; }
.cat-badge { display: inline-block; align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.08); color: var(--muted); margin-bottom: 6px; }
.cat-badge.cat-version { background: rgba(214,170,80,.18); color: var(--gold); }
.cat-badge.cat-coulisses { background: rgba(150,110,230,.18); color: var(--violet); }
.article-meta .cat-badge { margin: 0 8px 0 0; vertical-align: middle; }

/* Galerie */
.tab-count { opacity: .65; font-size: .8em; margin-left: 2px; }
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gallery-item { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.04); }
.gallery-item:hover, .gallery-item:focus-visible { border-color: var(--gold); }
.gallery-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 9px; background: linear-gradient(transparent, rgba(0,0,0,.82)); color: #fff; font-size: .92rem; font-weight: 600; }
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6,3,12,.94); color: var(--text); }
.lightbox::backdrop { background: rgba(0,0,0,.6); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; max-width: calc(100vw - 120px); text-align: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; display: block; margin: 0 auto; }
.lightbox figcaption { padding-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.lightbox figcaption .lb-caption { color: var(--muted); }
.lightbox figcaption .lb-meta { color: var(--violet); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .75rem; }
.lb-close, .lb-nav { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; line-height: 1; }
.lb-close { top: 14px; right: 14px; width: 42px; height: 42px; font-size: 1.6rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 2rem; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-close:hover, .lb-nav:hover { border-color: var(--gold); color: var(--gold); }
.lightbox.single .lb-nav { display: none; }
@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery-title { font-size: .8rem; padding: 16px 8px 6px; }
  .lightbox figure { max-width: 100vw; }
  .lb-nav { top: auto; bottom: 14px; transform: none; }
}

/* ── Bandeau cookies (consent.js) ─────────────────────────────────────── */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 920px; margin-inline: auto; display: flex; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--gold-dark); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); font-size: .92rem; line-height: 1.5;
}
.cookie-banner[hidden] { display: none; }
.cookie-text > strong { color: var(--gold); font-family: var(--serif); }
.cookie-text p { margin: 4px 0 0; color: var(--muted); }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-actions .btn { min-width: 110px; font: inherit; font-weight: 700; cursor: pointer; }
.footer-cookies { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.footer-cookies:hover { color: var(--gold); }
@media (max-width: 700px) {
  .cookie-banner { flex-direction: column; align-items: stretch; left: 8px; right: 8px; bottom: 8px; padding: 14px; }
  .cookie-actions .btn { flex: 1; }
}
