/* ============================================================
   GROG Design System — Le Guide du Rôliste Galactique
   Single CSS file replacing Grog.css + space.css + grog-menus.css
   ============================================================ */

/* ── 1. CSS Variables ─────────────────────────────────────── */

:root {
  /* Colors */
  --color-blue: #243654;
  --color-blue-light: #2e4a6e;
  --color-blue-dark: #1a2840;
  --color-red: #892e35;
  --color-red-light: #a3434b;
  --color-parchment: #ebddb5;
  --color-parchment-light: #f3edd5;
  --color-parchment-dark: #e0cc96;
  --color-dark-parchment: #D7BC6C;
  --color-dark-gold: #B8860B;
  --color-dark-silver: #696969;
  --color-text: #333;
  --color-text-light: #666;
  --color-text-muted: #999;
  --color-link: #892e35;
  --color-link-hover: #5e1a22;
  --color-white: #fff;
  --color-black: #1a1a1a;
  --color-border: #d4c4a0;
  --color-border-light: #e8dcc0;
  --color-success: #497744;
  --color-warning: #b45309;
  --color-error: #892e35;

  /* Typography */
  --font-heading: 'Titillium Web', sans-serif;
  --font-body: 'Bitter', serif;
  --font-nav: 'Panton', 'Titillium Web', sans-serif;
  --font-condensed: 'Open Sans Condensed', sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Layout */
  --container-max: clamp(1200px, 90vw, 1800px);
  --sidebar-width: clamp(260px, 22vw, 380px);
  --gap: clamp(16px, 1.5vw, 28px);
  --gap-sm: clamp(8px, 0.8vw, 16px);
  --gap-xs: 8px;
  --nav-padding: clamp(24px, 3vw, 60px);
  --radius: 4px;
  --radius-lg: 8px;

  /* Header */
  --header-height: 104px;
  --nav-height: 44px;
  --gold-band-height: 6px;

  /* Typographic scale */
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-md:   1.125rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  1.875rem;
  --fs-3xl:  2.25rem;

  /* Line heights */
  --lh-tight:   1.25;
  --lh-snug:    1.4;
  --lh-normal:  1.65;
  --lh-relaxed: 1.8;

  /* Spacing scale (composants ; --gap*, fluide, reste pour le layout macro) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-8:  48px;
  --space-10: 64px;

  /* Shadow scale (teintées bleu marine pour rester dans la palette) */
  --shadow-sm: 0 1px 2px rgba(26, 40, 64, 0.06),
               0 1px 3px rgba(26, 40, 64, 0.08);
  --shadow-md: 0 2px 4px rgba(26, 40, 64, 0.08),
               0 4px 12px rgba(26, 40, 64, 0.12);
  --shadow-lg: 0 4px 8px rgba(26, 40, 64, 0.10),
               0 12px 24px rgba(26, 40, 64, 0.16);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Z-index scale */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-modal:    1000;
  --z-toast:    1100;
}

/* ── 2. Reset / Base ──────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-white);
}

img { max-width: 100%; height: auto; border: 0; }
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

/* Global keyboard focus ring (WCAG 2.4.7) — form fields keep their box-shadow ring */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.btn-action:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Gold ring on dark blue surfaces where the blue ring would be invisible */
.header a:focus-visible, .header button:focus-visible,
.navHaut a:focus-visible, .navHaut button:focus-visible,
.navBas a:focus-visible, .navBas button:focus-visible {
  outline-color: var(--color-dark-gold);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-blue);
  margin: 0 0 0.5em 0;
  line-height: 1.25;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; border-bottom: 2px solid var(--color-dark-gold); padding-bottom: 0.3em; margin-bottom: 0.8em; }
h3 { font-size: 1.2rem; color: var(--color-blue); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em 0; }
ul, ol { margin: 0 0 1em 0; padding-left: 1.5em; }
li { margin-bottom: 0.25em; }

strong { font-weight: 700; }
em { font-style: italic; }
small, .small { font-size: 0.85em; color: var(--color-text-light); }

hr { border: none; border-top: 1px solid var(--color-border); margin: 1.5em 0; }
blockquote { border-left: 3px solid var(--color-dark-gold); margin: 1em 0; padding: 0.5em 1em; background: var(--color-parchment-light); }

/* ── 3. Layout ────────────────────────────────────────────── */

/* Container — replaces old Blueprint .container (950px fixed) */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* The main wrapper — replaces .span-24.first.last.home */
.span-24.first.last.home,
.span-24.first.last {
  width: 100%;
  float: none;
  margin: 0;
  padding: 0;
}

/* 2-column layout via CSS Grid on the common parent.
   Structure in main.html:
     .span-24.first.last.home
       > .header (full width)
       > .navHaut (full width)
       > a#main
       > .span-16.colTexte  ← main content
       > .span-8.colDroite  ← sidebar
       > .navBas (full width)
*/
.span-24.first.last.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: 0;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Full-width rows: header, nav, footer */
.span-24.first.last.header,
.span-24.first.last.navHaut,
.span-24.first.last.navBas {
  grid-column: 1 / -1;
}

/* Main content column */
.span-16.first.colonne.colTexte {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  min-width: 0; /* prevent grid blowout */
}

/* Sidebar column */
.span-8.last.colonne.colDroite {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* ── Gold decorative band ──────────────────────────────── */
body::before {
  content: '';
  display: block;
  height: var(--gold-band-height);
  background: linear-gradient(90deg, var(--color-dark-gold), var(--color-dark-parchment), var(--color-dark-gold));
}

/* ── 4. Header ────────────────────────────────────────────── */

.header {
  background-color: var(--color-blue);
  color: var(--color-white);
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

.header .span-10,
.header .span-14 {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

.header .span-10.first {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

#h1Logo {
  margin: 0 0 0 var(--space-5);
  padding: 0;
}

#h1Logo a {
  display: block;
}

/* Logo — GROG d10 white logo on blue header (cropped SVG, ~2.18:1) */
#logo {
  width: 183px;
  height: 84px;
  background-image: url('/img/logo-grog-d10-blanc.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#claim {
  color: var(--color-dark-parchment);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.85rem;
  margin: 0;
}

/* Banner pub (header right) */
.header__banner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  padding: 0 var(--space-4) var(--space-3) 0;
}
.header__banner-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-decoration: none;
  transition: transform var(--transition-base);
  max-width: 100%;
}
.header__banner-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.header__banner-link:focus-visible {
  outline: 2px solid var(--color-dark-gold);
  outline-offset: 4px;
  border-radius: var(--radius);
}
.header__banner-eyebrow {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-dark-parchment);
  opacity: 0.75;
  line-height: 1;
  letter-spacing: 0.02em;
}
.header__banner-img {
  display: block;
  max-height: 56px;
  width: auto;
  max-width: 100%;
}

/* Skip links */
#prelude {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
#prelude:focus-within {
  position: static;
  width: auto;
  height: auto;
}
#prelude a {
  color: var(--color-parchment);
}

/* ── 5. Navigation ────────────────────────────────────────── */

.navHaut {
  background-color: var(--color-blue-dark);
  border-bottom: 3px solid var(--color-dark-gold);
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.rich-toolbar {
  display: flex !important;
  align-items: center;
  padding: 0 var(--nav-padding) !important;
  height: var(--nav-height) !important;
  max-width: var(--container-max);
  margin: 0 auto;
}

.toolbar-menus {
  display: flex;
  gap: 0;
  flex: 1;
  align-items: center;
}

/* Dropdown menus */
.dd-menu {
  position: relative;
}

/* Triggers are <button>s (keyboard-operable) — reset UA button chrome */
.dd-menu > .dr-menu-label,
.dd-menu > .rich-ddmenu-label {
  display: inline-block;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-parchment);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.dd-menu:hover > .dr-menu-label,
.dd-menu:hover > .rich-ddmenu-label {
  color: var(--color-dark-gold);
  background-color: rgba(255,255,255,0.08);
}

.dd-menu-content,
.dd-menu-content.rich-menu-list-bg {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 220px;
  max-width: calc(100vw - 2 * var(--gap));
  padding: 8px 0;
  background-color: var(--color-blue);
  border: 1px solid var(--color-blue-light);
  border-top: 3px solid var(--color-dark-gold);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  background-image: none;
}

/* Canonical open state driven by nav.js; hover stays a desktop enhancement */
.dd-menu.is-open > .dd-menu-content,
.dd-menu:hover > .dd-menu-content {
  display: block;
}

/* No-JS keyboard fallback (nav.js tags <html> with .has-nav-js) */
html:not(.has-nav-js) .dd-menu:focus-within > .dd-menu-content {
  display: block;
}

.dd-menu-content a {
  display: block;
  padding: 8px 20px;
  color: var(--color-parchment);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.dd-menu-content a:hover {
  background-color: var(--color-blue-light);
  color: var(--color-dark-gold);
  text-decoration: none;
}

.dd-menu-content .rich-menu-separator {
  height: 0;
  margin: 4px 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* Anonymous "Contribuer" menu: login hint + disabled previews of member actions */
.dd-menu-content a.dd-menu-login-hint {
  font-style: italic;
  color: var(--color-dark-parchment);
}
.dd-menu-item-disabled {
  display: block;
  padding: 8px 20px;
  color: rgba(255,255,255,0.65);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: default;
}

/* Login area (right side of nav, slides into the drawer on mobile) */
.toolbar-account {
  margin-left: auto;
  white-space: nowrap;
  color: var(--color-parchment);
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.toolbar-account a,
.toolbar-account .logout-link {
  color: var(--color-dark-gold);
  font-weight: 600;
  margin-left: 8px;
}
.toolbar-account a:hover,
.toolbar-account .logout-link:hover {
  color: var(--color-white);
  text-decoration: none;
}
.toolbar-account .logout-form {
  display: inline;
  margin: 0;
  padding: 0;
}
.toolbar-account .logout-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* Mobile drawer overlay + scroll lock (driven by nav.js) */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 40, 64, 0.5);
  z-index: 999;
}
.nav-overlay[hidden] { display: none; }
body.nav-locked { overflow: hidden; }

a.login {
  color: var(--color-dark-gold) !important;
  font-weight: 600;
  background: none !important;
  border: 1px solid var(--color-dark-gold) !important;
  padding: 4px 12px !important;
  border-radius: var(--radius);
  transition: background-color 0.2s;
}
a.login:hover {
  background-color: var(--color-dark-gold) !important;
  color: var(--color-blue) !important;
}

/* Burger menu button (hidden on desktop, shown on mobile) */
.burger-menu {
  display: none;
  background: none;
  border: none;
  color: var(--color-parchment);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  order: 99; /* push to right end */
}

/* ── 6. Content area ──────────────────────────────────────── */

.colonne {
  background: none;
  background-image: none !important;
}

.colTexte {
  background-color: var(--color-white);
  border-top: none;
  border-bottom: none;
}

.colDroite {
  background-color: var(--color-parchment);
  border-top: none;
  border-bottom: none;
  border-left: 1px solid var(--color-border);
}

.colPave {
  padding: var(--gap);
}

/* Tighten the gap between the nav bar and the first content block (hero) */
.colTexte > .colPave { padding-top: var(--gap-sm); }

/* ── 7. Sidebar ───────────────────────────────────────────── */

.colDroite .colPave {
  padding: var(--gap) var(--gap-sm);
}

/* The search box sits flush with the top of the sidebar, level with the hero */
.colDroite > .colPave:first-of-type { padding-top: var(--gap-sm); }

.colDroite h3 {
  font-size: 1.2rem;
  color: var(--color-blue);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3em;
  margin-bottom: 0.5em;
}

/* Search form — pill design used in layout navbar, search page and listing sidebars.
   Structure: <form class="recherche"><span class="recherche__icon">🔍</span>
   <input type="search"/><button class="recherche__clear">×</button></form>
   Submit happens on Enter; no visible submit button (the .recherche--with-submit
   modifier opts back into a visible button for the dedicated search page). */
.recherche {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.recherche:focus-within {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(36, 54, 84, 0.18);
}
.recherche.search-page-form {
  max-width: 500px;
  margin: 0 0 1.5em 0;
}

.recherche__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--color-text-light);
  pointer-events: none;
}
.recherche__icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.recherche input[type="search"],
.recherche input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 4px 8px 0;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  outline: none;
}
.recherche input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.recherche input::placeholder {
  color: var(--color-text-light);
  opacity: 1;
}

.recherche__clear {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--color-text-light);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.recherche.is-filled .recherche__clear { display: inline-flex; }
.recherche__clear:hover {
  background: var(--color-parchment-light);
  color: var(--color-text);
}
.recherche__clear svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Variant with a visible submit button (page /recherche, listes admin) —
   the button hugs the right edge of the pill, full height, no inner gap. */
.recherche--with-submit .recherche__submit {
  flex: 0 0 auto;
  align-self: stretch;
  padding: 6px 18px;
  background: var(--color-blue);
  color: var(--color-white);
  border: none;
  border-radius: 0 9999px 9999px 0;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.recherche--with-submit .recherche__submit:hover { background: var(--color-blue-light); }

/* Separators — replace spacer GIF images with CSS borders */
img.sepTexte,
img.sepColonne {
  display: block;
  width: 100%;
  height: 0 !important;
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1em 0;
  background: none !important;
  background-image: none !important;
}

.hr, .hrCol {
  border-top: 1px solid var(--color-border);
  margin: 1em 0;
  background: none;
}

/* Larger <hr> separator between major sections (e.g. wizard preview, end of form) */
hr.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Planning — 2-column calendar grid grouped by period */
.planning-grid {
  display: flex;
  flex-wrap: wrap;
}
.planning-period {
  width: 50%;
  box-sizing: border-box;
  padding-right: 1em;
  margin-bottom: 1em;
}
.planning-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.planning-list li {
  margin: 0.4em 0;
  line-height: 1.5;
}
.planning-list li img {
  vertical-align: middle;
  margin-right: 0.3em;
}

/* ── 8. Footer ────────────────────────────────────────────── */

.span-24.first.last.navBas,
.navBas {
  background-color: var(--color-blue);
  color: var(--color-parchment);
  padding: var(--gap) var(--nav-padding);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  border-top: 3px solid var(--color-dark-gold);
  min-height: auto;
  background-image: none !important;
  position: relative;
  overflow: hidden;
}

/* Logo géant incliné, débordant et passant sous les colonnes de liens */
.navBas-logo-fou {
  position: absolute;
  left: 30%;
  bottom: -8%;
  width: clamp(300px, 42vw, 600px);
  height: auto;
  transform: translateX(-50%) rotate(11deg);
  transform-origin: bottom center;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.5));
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

.navBas:hover .navBas-logo-fou {
  transform: translateX(-50%) translateY(-18%) rotate(0deg);
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .navBas-logo-fou { transition: none; }
}

.blocNavBas {
  float: none;
  width: auto;
  padding: 0 var(--gap-sm);
  margin: 0;
  position: relative;
  z-index: 1;
}

.blocNavBas h4 {
  color: var(--color-dark-gold);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.navBas ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.navBas li {
  margin-bottom: 0.3em;
}

.navBas a {
  color: var(--color-parchment) !important;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  transition: color 0.15s;
}

.navBas a:hover {
  color: var(--color-dark-gold) !important;
  text-decoration: none !important;
  border: 0 !important;
}

/* ── 9. Components ────────────────────────────────────────── */

/* --- Tables (results, data tables) --- */
table.results, table.gamme, table.calendrier, table.invisible, table.invisibleDroite {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  font-size: 0.9rem;
  margin-bottom: 1em;
}

table.results thead th, table.gamme thead th {
  background-color: var(--color-blue);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 12px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
table.results thead th.taCenter, table.gamme thead th.taCenter { text-align: center; }

table.results td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

tr.altRow td {
  background-color: #f5f2ec;
}

tr.altRichRow td {
  background-color: transparent;
}

table.results a { color: var(--color-link); }
table.results a:hover { color: var(--color-link-hover); }

/* Sortable column headers (table.results.sortable) */
table.results.sortable thead th:has(.th-sort) { padding: 0; }
table.results.sortable thead th .th-sort {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
table.results.sortable thead th.taCenter .th-sort { text-align: center; }
table.results.sortable thead th .th-sort:hover { background-color: rgba(255, 255, 255, 0.12); }
table.results.sortable thead th .th-sort:focus-visible { outline: 2px solid var(--color-white); outline-offset: -2px; }
table.results.sortable thead th.sort-asc  .th-sort::after { content: ' \25B2'; font-size: 0.75em; }
table.results.sortable thead th.sort-desc .th-sort::after { content: ' \25BC'; font-size: 0.75em; }

table.invisible, table.invisibleDroite {
  background: transparent;
  border: 0;
}

/* Width helpers for table columns */
.half { width: 50%; }
.third { width: 33.33%; }
.quarter { width: 25%; }
.full { width: 100%; }

/* --- Gameline detail page --- */
.gameline-col-narrow  { width: 10%; }
.gameline-col-tiny    { width: 6%;  }
.gameline-col-medium  { width: 18%; }
.gameline-col-action  { width: 1%; white-space: nowrap; }

table.results td .login-input {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-size: var(--fs-sm);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
table.results td .login-input:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(36, 54, 84, 0.2);
  outline: none;
}

/* --- Statistics page (/grog/statistiques) --- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 767px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.stats-breakdown {
  border-collapse: collapse;
  margin: 0 0 var(--gap-sm) 1em;
  font-size: var(--fs-sm);
}
.stats-breakdown td { padding: 2px 8px 2px 0; }
.stats-breakdown__label { width: 200px; }

.stats-rank { width: 95%; }
.stats-rank__value { width: 60px; }

.stats-mascot { text-align: right; }

/* Larger variant of .btn-action for in-page primary CTAs (edit fiche, export, etc.) */
.btn-action.btn-action-large,
a.btn-action.btn-action-large {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* --- Book/cover grid used on public-profile (critics, collection) --- */
.book-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  clear: both;
}
.book-grid__item {
  flex: 0 0 160px;
  text-align: center;
}
.book-grid__cover {
  max-width: 100px;
  height: auto;
}

/* --- ISBN scan page (/deleg/user/scan) --- */
.scan-panel { max-width: 600px; }
.scan-controls { margin-bottom: 1rem; }
.scan-reader { width: 100%; max-width: 500px; position: relative; }
.scan-video { width: 100%; max-width: 500px; display: block; border-radius: var(--radius); background: #000; }

.scan-viewfinder {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.scan-viewfinder__frame {
  width: 80%; height: 35%;
  border: 3px solid var(--color-dark-gold);
  border-radius: var(--radius);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
}
.scan-live {
  margin: 0.5rem 0 0; padding: 0.4rem 0.75rem;
  font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem;
  border-radius: var(--radius); background: var(--color-parchment-light);
}
.scan-live--ok    { background: #e8f5e9; }
.scan-live--warn  { background: #fff8e1; }
.scan-live--found { background: #e8f5e9; color: #2e7d32; }
.scan-manual { margin-top: 1.5rem; }
.scan-manual__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.scan-manual__input { flex: 1; }
.scan-result-slot { margin-top: 1.5rem; }

.scan-result {
  padding: 1rem;
  border-left: 4px solid var(--color-border);
  background: var(--color-parchment-light);
}
.scan-result--ok   { background: #e8f5e9; border-left-color: #4caf50; }
.scan-result--warn { background: #fff8e1; border-left-color: #ffa000; }
.scan-result--err  { background: #ffebee; border-left-color: #c62828; }
.scan-result__line { margin: 0 0 0.5rem; }
.scan-result__line:last-child { margin-bottom: 0; }
.scan-result__meta { color: var(--color-text-light); }
.scan-error { color: #c62828; }

.scan-cards { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.scan-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; }
.scan-card__cover { width: 80px; height: auto; flex: 0 0 auto; border-radius: var(--radius); }
.scan-card__body { flex: 1; min-width: 0; }
.scan-card__title { font-family: var(--font-heading); font-weight: 700; margin: 0 0 0.25rem; }
.scan-card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

@media (max-width: 767px) {
  .scan-panel { max-width: none; }
  .scan-reader, .scan-video { max-width: none; }
}

/* --- Edito month cards (/editorial/jeux-du-mois) --- */
.edito-card-list { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-3); }
.edito-card-list .card + .card { margin-top: 0; }
.edito-card { display: flex; gap: var(--space-4); align-items: flex-start; }
.edito-card__main { flex: 1 1 auto; min-width: 0; }
.edito-card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--color-blue);
  margin: 0 0 var(--space-2) 0;
  line-height: var(--lh-snug);
  border: none;
  padding: 0;
}
.edito-card__title a { color: inherit; }
.edito-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.edito-card__head .card__eyebrow { margin-bottom: var(--space-2); }
.edito-card__more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-link);
  cursor: pointer;
}
.edito-card__more:hover { text-decoration: underline; }
.edito-card__toggle:focus-visible ~ .edito-card__head .edito-card__more {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
  border-radius: 2px;
}
.edito-card__more svg.icon { width: 14px; height: 14px; }
.edito-card__toggle:checked ~ .edito-card__head .edito-card__more svg.icon { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) {
  .edito-card__more svg.icon { transition: transform var(--transition-base); }
}
.edito-card__more-close { display: none; }
.edito-card__toggle:checked ~ .edito-card__head .edito-card__more-open { display: none; }
.edito-card__toggle:checked ~ .edito-card__head .edito-card__more-close { display: inline; }
.edito-card__text {
  margin-top: var(--space-2);
  line-height: var(--lh-normal);
  color: var(--color-text);
  text-align: justify;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.edito-card__text :last-child { margin-bottom: 0; }
.edito-card__toggle:checked ~ .edito-card__text {
  display: block;
  -webkit-line-clamp: none;
  line-clamp: none;
  overflow: visible;
}
.edito-card__media { flex: 0 0 auto; display: block; }
.edito-card__image {
  display: block;
  width: 150px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 767px) {
  .edito-card { flex-direction: column-reverse; }
  .edito-card__media { align-self: center; }
}

/* Inline-block list — used to center a <ul> whose items stay left-aligned. */
ul.list-inline-block,
ol.list-inline-block {
  display: inline-block;
  text-align: left;
}
.gameline-meta { margin-top: var(--space-4); color: var(--color-text-light); }
.sidebar-partners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.sidebar-partners li { padding: 0; border-bottom: none; }
.sidebar-partners a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-partners img { max-width: 90px; height: auto; display: block; }
.page-stack > section,
.page-stack > .card { margin-bottom: var(--space-5); }

/* --- Bookdetails detail page --- */
.contributor-bio-flag {
  font-size: 0.65em;
  color: var(--color-blue);
  margin-left: 1px;
}
.critiques-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.critiques-header h3 { margin: 0; }
.critique-edit { margin: var(--space-1) 0 var(--space-2); }
.author-word-name { margin: var(--space-3) 0 var(--space-1); }
.other-edition img,
.sidebar-list--stats img[width="32"] { vertical-align: middle; margin-right: var(--space-1); }
.sidebar-list--stats li {
  border-bottom: none;
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}
.sidebar-list--stats li > a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
  width: 100%;
}
.sidebar-list--stats .fRight { float: none; flex-shrink: 0; order: 2; align-self: center; }
.sidebar-list--stats li > a > span:not(.fRight),
.sidebar-list--stats li > .fRight ~ span {
  order: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* --- Reference lists (ficheJeu) --- */
ul.ficheJeu, .ficheJeu {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
}

ul.ficheJeu li, .ficheJeu li {
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-light);
}

ul.ficheJeu li:last-child, .ficheJeu li:last-child {
  border-bottom: none;
}

ul.ficheJeu.statsList li, .ficheJeu.statsList li {
  border-bottom: none;
  padding: 2px 0;
}

/* --- Collapsible groups on user profile (critiques, collection) --- */
.userProfileGroup {
  background: var(--color-parchment-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin: 0 0 var(--gap-sm) 0;
  overflow: hidden;
}

.userProfileGroup > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-parchment);
  border-bottom: 1px solid transparent;
  user-select: none;
  position: relative;
  padding-left: 32px;
}

.userProfileGroup > summary::-webkit-details-marker { display: none; }

.userProfileGroup > summary::before {
  content: "▸";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-dark-gold);
  transition: transform 0.15s ease;
}

.userProfileGroup[open] > summary {
  border-bottom-color: var(--color-border);
}

.userProfileGroup[open] > summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.userProfileGroup > summary:hover {
  background: var(--color-parchment-dark);
}

.userProfileGroup > *:not(summary) {
  padding: 12px 14px;
}

/* --- Alphabet navigation --- */
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 1em;
}

.alpha-nav a {
  display: inline-block;
  padding: 4px 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-blue);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: background-color 0.15s, color 0.15s;
}

.alpha-nav a:hover, .alpha-nav a.active {
  background-color: var(--color-blue);
  color: var(--color-white);
  text-decoration: none;
  border-color: var(--color-blue);
}

/* --- Entity lists (3-column) --- */
ul.entity-list {
  list-style: none;
  padding: 0;
  columns: 3;
  column-gap: var(--gap);
}

ul.entity-list li {
  break-inside: avoid;
  padding: 4px 0;
  border-bottom: 1px dotted var(--color-border-light);
}

/* --- Theme grid (themes list page) --- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin: var(--gap) 0;
}

.theme-cell {
  text-align: center;
  padding: var(--gap-sm);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: var(--color-parchment-light);
}

.theme-cell h4 {
  margin: var(--gap-xs) 0 0 0;
}

.theme-cell p.small {
  margin: 4px 0 0 0;
}

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

@media (max-width: 500px) {
  .theme-grid { grid-template-columns: 1fr; }
}

/* --- Generic card component (DS) --- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: var(--space-4); }

.card--interactive {
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}
.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card__eyebrow {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2) 0;
}
.card__eyebrow svg.icon {
  width: 14px; height: 14px;
  stroke: var(--color-dark-gold);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}
.card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-blue);
  margin: 0 0 var(--space-2) 0;
  line-height: var(--lh-snug);
  border: none;
  padding: 0;
}
.card__body {
  font-size: var(--fs-sm);
  color: var(--color-text);
  line-height: var(--lh-normal);
}
.card__body :last-child { margin-bottom: 0; }

/* --- Hub contributeur (deleg/user/manage) --- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); margin: var(--space-3) 0 0 0; }
.hub-grid .card + .card { margin-top: 0; }
.hub-tile { height: 100%; text-decoration: none; display: flex; flex-direction: column; gap: var(--space-2); }
.hub-tile:hover, .hub-tile:hover .card__title { text-decoration: none; }
.hub-tile:hover { background: var(--color-parchment-light); }
.hub-tile .card__eyebrow { margin: 0; min-height: 1.4em; }
.hub-tile .card__title { margin: 0; min-height: 2.8em; }
.hub-tile .card__body { margin: 0 0 0 0; color: var(--color-text-light); }
.hub-tile .card__eyebrow svg.icon { stroke: var(--color-dark-gold); }
.hub-badge { display: inline-block; min-width: 1.4em; padding: 0 var(--space-1); border-radius: var(--radius); background: var(--color-dark-gold); color: var(--color-white); font-size: var(--fs-xs); font-weight: 700; text-align: center; line-height: 1.5; }
@media (max-width: 767px) { .hub-grid { grid-template-columns: 1fr; } .hub-tile { min-height: 44px; } }

/* --- Homepage pavés (cards) --- */
div.pave {
  background-color: var(--color-blue);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  /* Override old Blueprint span-4 fixed width */
  width: auto !important;
  float: none !important;
  margin: 0 !important;
}

div.pave:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

div.pave a {
  text-decoration: none;
  display: block;
}

div.pave a h4.lnk {
  color: var(--color-dark-gold);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 10px 4px;
  margin: 0;
  background-color: var(--color-blue-dark);
}

div.pave img {
  opacity: 0.85;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

div.pave:hover img { opacity: 1; }

div.pave a p {
  padding: 6px 10px;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-white);
}

div.pave a p span {
  display: block;
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 0.7rem;
  margin-bottom: 2px;
}

/* Pave type colors */
div.pave a p.as { background-color: var(--color-success); }
div.pave a p.new { background-color: #204884; }
div.pave a p.art { background-color: var(--color-red); }
div.pave a p.conv { background-color: #5C8D87; }
div.pave a p.actu { background-color: #7A4B7E; }
div.pave a p.mag { background-color: #8E4D24; }
div.pave a p.anno { background-color: var(--color-dark-silver); }
div.pave a p.oldie { background-color: #4E5761; }
div.pave a p.bio { background-color: #694329; }
div.pave a p.histo { background-color: #682443; }

/* Vignettes grid container */
#vignettes .bloc {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-sm);
  margin-bottom: var(--gap);
}

/* Override old span-4 inside vignettes */
#vignettes .span-4 { width: auto !important; float: none !important; margin: 0 !important; }

/* --- Vignette cards (new) --- */
.vignette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--gap);
}

.vignette {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
  display: flex;
}
.vignette:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.vignette:focus-within {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.vignette__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  width: 100%;
}
.vignette__link:hover { text-decoration: none; }

.vignette__image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-parchment-light);
}
.vignette__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}
.vignette:hover .vignette__image { transform: scale(1.03); }

.vignette__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.vignette__category {
  align-self: flex-start;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-white);
  background: var(--color-dark-silver);
  line-height: 1.5;
}
.vignette__category--as    { background: var(--color-success); }
.vignette__category--new   { background: #204884; }
.vignette__category--art   { background: var(--color-red); }
.vignette__category--conv  { background: #5C8D87; }
.vignette__category--actu  { background: #7A4B7E; }
.vignette__category--mag   { background: #8E4D24; }
.vignette__category--anno  { background: var(--color-dark-silver); }
.vignette__category--oldie { background: #4E5761; }
.vignette__category--bio   { background: #694329; }
.vignette__category--histo { background: #682443; }

.vignette__title {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--color-blue);
  margin: 0;
  line-height: var(--lh-snug);
  border: none;
  padding: 0;
}
.vignette:hover .vignette__title { color: var(--color-link); }

.vignette__excerpt {
  font-size: var(--fs-sm);
  color: var(--color-text);
  line-height: var(--lh-normal);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

/* --- Vignette overlay variant (legacy "pave": text over image) --- */
.vignette-grid--overlay {
  grid-template-columns: repeat(5, 1fr);
}

.vignette--overlay { display: block; }
.vignette--overlay .vignette__link {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
}
.vignette--overlay .vignette__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vignette__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-1);
  padding: var(--space-3);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.55) 38%, rgba(0, 0, 0, 0) 72%);
  transition: background var(--transition-base);
}
.vignette--overlay:hover .vignette__overlay,
.vignette--overlay:focus-within .vignette__overlay {
  justify-content: flex-start;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.82) 100%);
}

.vignette--overlay .vignette__title {
  color: var(--color-white);
  font-size: var(--fs-sm);
}
.vignette--overlay:hover .vignette__title { color: var(--color-white); }

.vignette--overlay .vignette__excerpt {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--fs-xs);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.vignette--overlay:hover .vignette__excerpt,
.vignette--overlay:focus-within .vignette__excerpt {
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

@media (prefers-reduced-motion: reduce) {
  .vignette__overlay { transition: none; }
}

@media (max-width: 1023px) {
  .vignette-grid--overlay { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .vignette-grid--overlay { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .vignette-grid--overlay { grid-template-columns: 1fr; }
}

/* --- book-preview (hover/focus card on gameline book list) --- */
.book-preview {
  position: fixed;
  display: none;
  width: 280px;
  max-width: calc(100vw - var(--space-4) * 2);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  padding: var(--space-4);
  transition: opacity var(--transition-base);
}
.book-preview--visible { display: block; }
.book-preview__cover {
  display: block;
  width: 120px;
  max-width: 100%;
  border-radius: var(--radius);
  margin: 0 auto var(--space-2);
}
.book-preview__title {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--color-blue);
  line-height: var(--lh-snug);
  margin: 0 0 var(--space-2);
}
.book-preview__excerpt {
  font-size: var(--fs-sm);
  color: var(--color-text);
  line-height: var(--lh-normal);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  line-clamp: 6;
  overflow: hidden;
}

/* --- Edito hero (jeu du mois) --- */
.edito-hero {
  background-color: var(--color-parchment-light);
  border: 1px solid var(--color-border-light);
  border-top: 4px solid var(--color-dark-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5) var(--space-4);
  margin-bottom: var(--gap);
  box-shadow: var(--shadow-sm);
}

.edito-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-dark-gold);
  margin: 0 0 var(--space-4) 0;
}
.edito-hero__eyebrow .icon {
  width: 14px; height: 14px;
  stroke: var(--color-dark-gold);
  stroke-width: 2;
  fill: none;
}

.edito-hero__inner {
  display: grid;
  grid-template-columns: clamp(140px, 18%, 200px) 1fr;
  gap: var(--space-5);
  align-items: start;
}

.edito-hero__media {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 1 / 1;
  background: var(--color-parchment);
}
.edito-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.edito-hero__title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: var(--lh-snug);
  margin: 0 0 var(--space-3) 0;
  border: none;
  padding: 0;
}
.edito-hero__title a { color: var(--color-blue); }
.edito-hero__title a:hover { color: var(--color-link); text-decoration: none; }

.edito-hero__details {
  margin-bottom: 0;
}

.edito-hero__text {
  font-size: var(--fs-base);
  color: var(--color-text);
  line-height: var(--lh-normal);
  text-align: justify;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-clamp: 4;
  overflow: hidden;
}
.edito-hero__text p:last-child { margin-bottom: 0; }

.edito-hero__checkbox:checked ~ .edito-hero__text {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.edito-hero__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
}

.edito-hero__links {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}
.edito-hero__link {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-link);
}
.edito-hero__link:hover { color: var(--color-blue); }

.edito-hero__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-blue);
  background: transparent;
  border: none;
  user-select: none;
}
.edito-hero__toggle:hover { color: var(--color-link); text-decoration: underline; }
.edito-hero__checkbox:focus-visible ~ .edito-hero__toggle {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.edito-hero__toggle::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition-base);
  margin-left: var(--space-1);
}
.edito-hero__checkbox:checked ~ .edito-hero__toggle::after {
  transform: rotate(-135deg);
}

.edito-hero__toggle-hide { display: none; }
.edito-hero__checkbox:checked ~ .edito-hero__toggle .edito-hero__toggle-show { display: none; }
.edito-hero__checkbox:checked ~ .edito-hero__toggle .edito-hero__toggle-hide { display: inline; }

@media (max-width: 599px) {
  .edito-hero { padding: var(--space-4); }
  .edito-hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .edito-hero__media {
    max-width: 200px;
    margin: 0 auto;
  }
}

/* --- Homepage sidebar cards --- */
.sidebar-card { padding: var(--space-4) var(--space-4) var(--space-3); }
.sidebar-card + .sidebar-card { margin-top: var(--space-4); }

.card__eyebrow--inner {
  margin-top: var(--space-3);
  color: var(--color-blue);
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2) 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.sidebar-list li { margin: 0; padding: 2px 0; }
.sidebar-list a { color: var(--color-link); }
.sidebar-list a:hover { color: var(--color-link-hover); }

.sidebar-foot {
  font-style: italic;
  color: var(--color-text-light);
  font-size: var(--fs-xs);
  text-align: right;
  margin: 0;
}

.sidebar-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: var(--space-1);
}
.sidebar-filter { margin: 0 0 var(--space-2) 0; }
.sidebar-filter .select-pill { width: 100%; }

.sidebar-help {
  font-size: var(--fs-xs);
  color: var(--color-text-light);
  line-height: var(--lh-snug);
  margin: var(--space-2) 0 0 0;
}

.sidebar-lede {
  font-size: var(--fs-sm);
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.sidebar-actions .btn-action,
.sidebar-actions .inline-form {
  justify-content: center;
  width: 100%;
}
.sidebar-actions a.btn-action:not(.btn-action-icon),
.sidebar-actions button.btn-action:not(.btn-action-icon) {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.sidebar-sep {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: var(--space-4) 0 var(--space-3);
}

.sidebar-rss {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-blue);
}
.sidebar-rss .icon {
  width: 16px; height: 16px;
  stroke: var(--color-dark-gold);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}
.sidebar-rss:hover { color: var(--color-link); text-decoration: none; }
.sidebar-rss:hover .icon { stroke: var(--color-link); }

/* --- Critics --- */
h4.divCritique {
  border-top: 2px solid var(--color-dark-gold);
  padding-top: 12px;
  margin-top: 1em;
  margin-bottom: 0.5em;
  color: var(--color-blue);
}

ul.listeCritique {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.listeCritique li {
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-light);
}

/* Rating dice display */
.d4, .d20 {
  display: inline-block;
  background: url('/images/structure/d4.png') left center repeat-x;
  height: 16px;
  vertical-align: middle;
}

.d4 img, .d20 img {
  display: block;
  height: 16px;
}

/* Cover images */
img.couv, .fRight.couv {
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

img.logo {
  width: clamp(200px, 22vw, 300px);
  max-height: 220px;
  height: auto;
  object-fit: contain;
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: var(--space-3);
}

/* --- Empty state --- */
.empty-list {
  color: var(--color-text-light);
  font-style: italic;
  padding: 1em 0;
}

/* --- Error pages (404 / 500) --- */
.error-page {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-5) 0;
}
.error-page h2 { border: none; }
.error-page p { margin: var(--space-4) 0; }
.error-page__art {
  display: block;
  height: auto;
  max-width: 100%;
  margin: var(--space-5) auto;
}

/* ── 10. Forms & Buttons ──────────────────────────────────── */

.btn, input.btn, button[type="submit"] {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--color-blue);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn:hover, input.btn:hover, button[type="submit"]:hover {
  background-color: var(--color-blue-light);
  color: var(--color-white);
}

.btn-primary {
  background-color: var(--color-blue);
  color: var(--color-white);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}

.btn-danger-sm {
  background-color: var(--color-red);
  color: var(--color-white);
  font-size: 0.8rem;
  padding: 4px 10px;
}

input.field, select.field, textarea.field, input.req, input.champ {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
}

input.field:focus, select.field:focus, textarea.field:focus, input.req:focus, input.champ:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(36,54,84,0.2);
}

input.lanceReq {
  background-color: var(--color-blue);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
}

/* User form styling */
.user-form { max-width: 100%; width: 100%; }
.form-group { margin-bottom: 1em; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3em; font-family: var(--font-heading); color: var(--color-text); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="search"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background-color: #fafafa;
  color: var(--color-text);
  transition: border-color 0.2s, background-color 0.2s;
}
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="file"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="search"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-blue);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(36, 54, 84, 0.1);
}
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  margin-right: 0.5em;
  vertical-align: middle;
  cursor: pointer;
  width: auto;
  accent-color: var(--color-blue);
}
.form-group label:has(> input[type="checkbox"]),
.form-group label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  margin-bottom: 0.5em;
  font-weight: 400;
  margin-right: 1em;
  flex-wrap: wrap;
}
/* Checkbox group containers — row (inline) or stack (one per line) */
.form-group--checkbox-row { display: flex; align-items: center; gap: var(--space-2); }
.form-group--checkbox-stack { display: flex; flex-direction: column; gap: var(--space-2); }
.form-group--checkbox-row > label:has(> input[type="checkbox"]),
.form-group--checkbox-row > label:has(> input[type="radio"]),
.form-group--checkbox-stack > label:has(> input[type="checkbox"]),
.form-group--checkbox-stack > label:has(> input[type="radio"]) {
  margin-bottom: 0;
  margin-right: 0;
}
.form-group input:disabled,
.form-group input[readonly],
.form-group select:disabled,
.form-group textarea:disabled {
  background-color: #f0f0f0;
  color: var(--color-text-light);
  cursor: not-allowed;
}
/* Grouped fieldset (e.g. legacy free-text fields on bookdetails) */
.form-fieldset {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  background: #fafafa;
}
.form-fieldset legend { padding: 0 var(--space-2); font-size: var(--fs-sm); color: var(--color-text-light); }
.form-hint { font-size: var(--fs-sm); font-weight: 400; color: var(--color-text-light); }
.form-group--narrow { max-width: 400px; }
.form-actions { margin-top: 1.5em; display: flex; gap: 8px; flex-wrap: wrap; }

/* Form grids — defined once here; mobile/tablet collapse lives in §12/§13 */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.info-message { background-color: #dff0d8; color: #3c763d; padding: 12px; border-radius: var(--radius); margin-bottom: 1em; }
.error-message { background-color: #f2dede; color: #a94442; padding: 12px; border-radius: var(--radius); margin-bottom: 1em; }

/* ── 11. Utilities ────────────────────────────────────────── */

.taCenter { text-align: center; }
.taLeft { text-align: left; }
.taRight { text-align: right; }
.taJustify, .taJustify p { text-align: justify; }
.grog-prose p:not([align]) { text-align: justify; }
.taTop { vertical-align: top; }
.is-hidden { display: none !important; }
.clear-both { clear: both; }
.list-plain { list-style: none; padding-left: 0; margin: 0; }
.list-compact { margin: 0; padding-left: 1.2em; }
.img-fluid { max-width: 100%; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.fRight { float: right; margin-left: var(--gap-sm); margin-bottom: var(--gap-sm); }
.fLeft { float: left; margin-right: var(--gap-sm); margin-bottom: var(--gap-sm); }
.large { font-size: 1.2em; }

/* Admin components */
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1em; flex-wrap: wrap; gap: 8px; }
/* Scrollable table regions — carry role="region" aria-label tabindex="0" in markup */
.admin-table-wrap, .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background-color: var(--color-blue); color: var(--color-white); padding: 8px 12px; text-align: left; font-family: var(--font-heading); }
.admin-table td { padding: 8px 12px; border-bottom: 1px solid var(--color-border-light); }
.admin-table tr:hover td { background-color: var(--color-parchment-dark); }
.admin-nav { margin-bottom: 1em; }
.admin-section { margin-top: 2em; margin-bottom: 2em; }
.btn-admin {
  display: inline-flex; align-items: center; gap: 10px;
  background-color: var(--color-blue); color: var(--color-white);
  padding: 6px 14px; border-radius: var(--radius); border: none;
  cursor: pointer; font-family: var(--font-heading);
  text-decoration: none; font-size: 0.9rem; font-weight: 600;
  transition: background-color 0.15s;
}
.btn-admin:hover { background-color: var(--color-blue-light); color: var(--color-white); text-decoration: none; }
.btn-admin-sec {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; color: var(--color-blue);
  border: 1px solid var(--color-blue);
  padding: 6px 14px; border-radius: var(--radius);
  cursor: pointer; font-family: var(--font-heading);
  text-decoration: none; font-size: 0.9rem;
  transition: background-color 0.15s, color 0.15s;
}
.btn-admin-sec:hover { background-color: var(--color-blue); color: var(--color-white); text-decoration: none; }
.btn-admin svg.icon, .btn-admin-sec svg.icon, .btn-primary svg.icon, button svg.icon {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2; fill: none;
  flex-shrink: 0;
  margin-right: 4px;
}

/* Admin row action buttons (icon-only). Two action columns:
   - .actions      : leading column (Edit / Unlock), no header label
   - .actions-end  : trailing column (Delete)
*/
.admin-table th.actions-col,
.admin-table th.actions-end-col,
.admin-table td.actions,
.admin-table td.actions-end {
  width: 1%;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}
.admin-table td.actions > .btn-action,
.admin-table td.actions > .inline-form,
.admin-table td.actions-end > .btn-action,
.admin-table td.actions-end > .inline-form {
  vertical-align: middle;
}
.inline-form { display: inline-flex; margin: 0; padding: 0; }

/* Image preview thumbnails on admin forms */
.admin-img-preview { max-width: 200px; border: 1px solid var(--color-border-light); }
.admin-img-preview--sm { max-width: 150px; }

/* Side-by-side image previews (large illustration + thumbnail) on the cover section */
.img-preview-grid { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; margin-bottom: var(--space-4); }
.img-preview-cell { margin: 0; text-align: center; }
.img-preview-cell img { display: block; max-width: 200px; height: auto; border: 1px solid var(--color-border-light); }
.img-preview-cell figcaption { margin-top: var(--space-1); }

/* Cover section cards — equal height, submit button pinned to the bottom */
.form-grid-2 > .cover-card { display: flex; flex-direction: column; height: 100%; }
/* Cancel the vertical .card + .card stacking margin inside the horizontal grid */
.form-grid-2 > .cover-card + .cover-card { margin-top: 0; }
.cover-card + .form-grid-2 { margin-top: var(--space-4); }
.cover-card__intro { margin-bottom: var(--space-3); }
.cover-card__form { display: flex; flex-direction: column; flex: 1; }
.cover-card__form > .btn-action { margin-top: auto; align-self: flex-start; }

/* Styled native file picker button (replaces the OS-default "Parcourir") */
.form-group input[type="file"] { padding: 6px; cursor: pointer; }
.form-group input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--color-blue);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}
.form-group input[type="file"]::file-selector-button:hover { background: var(--color-blue-light); }

/* Status indicators — dots (users list) and text (maintenance, questionnaire results) */
.status-dot { font-size: 1.2em; }
.status-dot--ok,  .status-ok  { color: var(--color-success); }
.status-dot--warn, .status-warn { color: var(--color-warning); }
.status-dot--err, .status-err { color: var(--color-error); }

/* Admin edit forms — fiche status badge, meta line, moderation panel, foldable notice */
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-family: var(--font-heading); font-size: var(--fs-xs); font-weight: 700; color: var(--color-white); vertical-align: middle; text-decoration: none; }
.status-badge--pending { background: var(--color-warning); }
.status-badge--published { background: var(--color-success); }
a.status-badge--pending:hover { background: var(--color-error); color: var(--color-white); }

.fiche-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); font-size: var(--fs-sm); }
.fiche-meta a { display: inline-flex; align-items: center; gap: 4px; }
.fiche-meta svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

.moderation-panel { background: var(--color-parchment-light); border-left: 4px solid var(--color-warning); border-radius: var(--radius); padding: var(--space-4); }
.moderation-panel h3 { margin-top: 0; }

.form-details { margin-bottom: 1em; }
.form-details summary { cursor: pointer; font-weight: 600; color: var(--color-blue); }

/* Picklist (dual listbox) — admin gamesystems */
.picklist { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-3); align-items: center; }
.picklist-col { display: flex; flex-direction: column; }
.picklist-col h4 { margin: 0 0 var(--space-1) 0; font-size: var(--fs-sm); color: var(--color-text-light); }
.picklist-col select { width: 100%; height: 320px; }
.picklist-col select option:checked {
  background: var(--color-dark-gold) linear-gradient(0deg, var(--color-dark-gold), var(--color-dark-gold));
  color: var(--color-white);
}
.picklist-buttons { display: flex; flex-direction: column; gap: var(--space-2); }
.picklist-buttons button {
  padding: 6px 10px;
  border: 1px solid #d0d0d0;
  background: #fafafa;
  border-radius: var(--radius);
  cursor: pointer;
}
.picklist-buttons button:hover { background: var(--color-white); border-color: var(--color-blue-light); }
@media (max-width: 767px) {
  .picklist { grid-template-columns: 1fr; }
  .picklist-buttons { flex-direction: row; justify-content: center; }
}

/* Floating image preview for the storage browser — display toggled by JS */
.storage-preview {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: var(--z-modal);
  max-width: 320px;
  max-height: 420px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
}
.storage-preview img { display: block; max-width: 100%; max-height: 410px; object-fit: contain; }

/* Selectors are written as `a.btn-action, button.btn-action` (specificity 0,1,1)
   to override the global `button[type="submit"]` rule (also 0,1,1) by source order. */
a.btn-action, button.btn-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius);
  font-family: var(--font-heading); font-size: 0.85rem; font-weight: 600;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; background: transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
a.btn-action svg.icon, button.btn-action svg.icon {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2; fill: none;
  flex-shrink: 0;
}

/* Icon-only square variant — used in admin row actions for compactness.
   Centering relies on flex; the !important padding overrides UA button styles. */
a.btn-action.btn-action-icon, button.btn-action.btn-action-icon {
  width: 28px; height: 28px;
  padding: 0 !important; gap: 0; line-height: 0;
  font-size: 0;
  vertical-align: middle;
}
a.btn-action.btn-action-icon svg.icon, button.btn-action.btn-action-icon svg.icon {
  width: 16px; height: 16px;
  display: block;
  margin: auto;
}

/* Variants below also use `button.btn-action.btn-action-X` so they keep the same
   specificity (0,2,1) and beat the global `button[type="submit"]` background rule. */

/* Edit — gold outline, matches the .login (Profil) button in the navbar.
   Hover flips to a solid gold fill with white icon for contrast. */
a.btn-action.btn-action-edit, button.btn-action.btn-action-edit {
  color: var(--color-dark-gold);
  border-color: var(--color-dark-gold);
  background: var(--color-white);
}
a.btn-action.btn-action-edit:hover, button.btn-action.btn-action-edit:hover {
  background-color: var(--color-dark-gold);
  color: var(--color-white);
}

/* Unlock — blue outline, distinct from Edit so the locked state is obvious */
a.btn-action.btn-action-warn, button.btn-action.btn-action-warn {
  color: var(--color-blue);
  border-color: var(--color-blue);
  background: var(--color-white);
}
a.btn-action.btn-action-warn:hover, button.btn-action.btn-action-warn:hover {
  background-color: var(--color-blue);
  color: var(--color-white);
}

/* View / info kept blue for callouts elsewhere */
a.btn-action.btn-action-view, a.btn-action.btn-action-info,
button.btn-action.btn-action-view, button.btn-action.btn-action-info {
  color: var(--color-blue);
  border-color: var(--color-blue);
  background: var(--color-white);
}
a.btn-action.btn-action-view:hover, a.btn-action.btn-action-info:hover,
button.btn-action.btn-action-view:hover, button.btn-action.btn-action-info:hover {
  background-color: var(--color-blue);
  color: var(--color-white);
}

/* Success — solid blue, used on the BookDetails validation form */
a.btn-action.btn-action-success, button.btn-action.btn-action-success {
  color: var(--color-white);
  background-color: var(--color-blue);
  border-color: var(--color-blue);
}
a.btn-action.btn-action-success:hover, button.btn-action.btn-action-success:hover {
  background-color: var(--color-blue-light);
  color: var(--color-white);
}

/* Danger — bordeaux outline, same shade as link color (#892e35) */
a.btn-action.btn-action-danger, button.btn-action.btn-action-danger {
  color: var(--color-link);
  border-color: var(--color-link);
  background: var(--color-white);
}
a.btn-action.btn-action-danger:hover, button.btn-action.btn-action-danger:hover {
  background-color: var(--color-link);
  color: var(--color-white);
}

/* Ask — green outline, signals "en attente de précisions" (BookDetails newStatus=2) */
a.btn-action.btn-action-ask, button.btn-action.btn-action-ask {
  color: var(--color-success);
  border-color: var(--color-success);
  background: var(--color-white);
}
a.btn-action.btn-action-ask:hover, button.btn-action.btn-action-ask:hover {
  background-color: var(--color-success);
  color: var(--color-white);
}

/* Visible/Sorti boolean column icon */
.icon-flag {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 2; fill: none;
  vertical-align: middle;
}
.icon-flag-on  { color: var(--color-blue); }
.icon-flag-off { color: var(--color-text-light); }

/* Admin table — sort indicators on column headers */
.admin-table th.taRight { text-align: right; }
.admin-table th a { color: var(--color-white); text-decoration: none; display: block; }
.admin-table th a:hover { text-decoration: underline; }
.admin-table th.sort-asc a::after  { content: ' ▲'; font-size: 0.75em; }
.admin-table th.sort-desc a::after { content: ' ▼'; font-size: 0.75em; }

/* Bio superscript */
sup[title="Biographie disponible"] {
  color: var(--color-dark-gold);
}

/* Icon sprites — keep working */
.icEdit, .icDel, .icHelp, .icAddC, .icDelC, .icNew, .icLeft, .icRight, .icUnlock, .icUnwait {
  display: inline-block;
  width: 17px;
  height: 17px;
  background-image: url('/images/structure/icones.png');
  background-repeat: no-repeat;
  vertical-align: middle;
}
.icEdit { background-position: 0 0; }
.icDel { background-position: -17px 0; }
.icHelp { background-position: -34px 0; }
.icAddC { background-position: -51px 0; }
.icDelC { background-position: -68px 0; }
.icNew { background-position: -85px 0; }
.icLeft { background-position: -102px 0; }
.icRight { background-position: -119px 0; }

/* ── 11b. Single-column reorder (≤1023px) ─────────────────── */
/* When the layout collapses to one column (mobile + tablet), promote the
   sidebar's children into the .home grid (display:contents) and order them so
   the site search box sits right under the nav, above the page content, while
   the rest of the sidebar (admin menu, mascot) stays below the content. */
@media (max-width: 1023px) {
  .span-24.first.last.header { order: -3; }
  .span-24.first.last.navHaut { order: -2; }
  .span-8.last.colonne.colDroite { display: contents; }
  .colDroite > .colPave:first-of-type {
    order: -1;
    background-color: var(--color-parchment);
    border-bottom: 1px solid var(--color-border);
  }
  .span-16.first.colonne.colTexte { order: 0; }
  .colDroite > .colPave:not(:first-of-type),
  .colDroite > .sepColonne {
    order: 1;
    background-color: var(--color-parchment);
    border-top: 1px solid var(--color-border);
  }
  .span-24.first.last.navBas { order: 2; }
}

/* ── 12. Responsive — Mobile (<768px) ─────────────────────── */

@media (max-width: 767px) {

  :root {
    --header-height: 76px;
  }

  /* No hover preview on touch/mobile (JS also gates on pointer:fine) */
  .book-preview { display: none !important; }

  /* Header: stack logo and claim */
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--gap-sm) var(--gap);
    min-height: auto;
  }

  .header .span-14.last { display: none; }

  #logo { width: 122px; height: 56px; }

  /* Navigation: burger-driven drawer (nav.js toggles .is-open) */
  .burger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: var(--gap);
    top: 0;
    z-index: 1001;
    min-width: 44px;
    min-height: var(--nav-height);
  }

  .navHaut {
    position: relative;
  }

  .navHaut .toolbar-menus {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    background-color: var(--color-blue-dark);
    z-index: 1000;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }

  .toolbar-menus.is-open { display: flex; }

  /* No-JS fallback: menu opens while burger or panel is hovered/focused */
  html:not(.has-nav-js) .burger-menu:hover ~ .toolbar-menus,
  html:not(.has-nav-js) .burger-menu:focus ~ .toolbar-menus,
  html:not(.has-nav-js) .toolbar-menus:hover {
    display: flex;
  }

  .dd-menu {
    width: 100%;
  }

  .dd-menu > .dr-menu-label,
  .dd-menu > .rich-ddmenu-label {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    text-align: left;
  }

  .dd-menu-content, .dd-menu-content.rich-menu-list-bg {
    position: static;
    box-shadow: none;
    border: none;
    border-top: none;
    padding-left: 16px;
    max-width: none;
  }

  .dd-menu-content a,
  .dd-menu-item-disabled {
    display: flex;
    align-items: center;
    min-height: 44px;
    white-space: normal;
  }

  /* Account block lives at the bottom of the drawer */
  .toolbar-account {
    margin: 8px 0 0;
    padding: 10px 16px 4px;
    border-top: 1px solid rgba(255,255,255,0.15);
    white-space: normal;
  }
  .toolbar-account a,
  .toolbar-account .logout-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* Touch targets ≥ 44px (WCAG 2.5.5 / project rule 6) */
  .btn, input.btn, button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }
  a.btn-action, button.btn-action { min-height: 44px; }
  a.btn-action.btn-action-icon, button.btn-action.btn-action-icon {
    min-width: 44px;
    min-height: 44px;
  }
  .alpha-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .recherche__clear { min-width: 44px; min-height: 44px; }

  /* Form grids collapse to 1 column — DS safety net over page-scoped <style> */
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr !important; }

  /* Content: single column — sidebar below content */
  .span-24.first.last.home {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .span-8.last.colonne.colDroite {
    border-left: none;
  }

  .colPave { padding: var(--gap-sm); }

  /* Tables: horizontal scroll (fallback for tables not yet wrapped in .table-scroll) */
  table.results, table.gamme, table.calendrier { display: block; overflow-x: auto; }
  table.results thead, table.results tbody { min-width: 600px; }

  /* Wrapped tables keep their table semantics; the region wrapper scrolls instead */
  .table-scroll > table, .admin-table-wrap > table { display: table; overflow-x: visible; }
  .table-scroll > table.results thead, .table-scroll > table.results tbody { min-width: 0; }

  /* Entity lists: single column */
  ul.entity-list { columns: 1; }

  /* Vignettes: 2 columns */
  #vignettes .bloc { grid-template-columns: repeat(2, 1fr); }

  /* Footer: 2 columns then 1 — full selector to outweigh the (0,4,0) base rule */
  .span-24.first.last.navBas, .navBas { grid-template-columns: repeat(2, 1fr); }

  /* Half/third/quarter: auto on mobile */
  .half, .third, .quarter { width: auto; }
}

@media (max-width: 480px) {
  #vignettes .bloc { grid-template-columns: 1fr; }
  .span-24.first.last.navBas, .navBas { grid-template-columns: 1fr; }
}

/* ── 13. Responsive — Tablet portrait (768px–1023px) ─────── */

@media (min-width: 768px) and (max-width: 1023px) {
  /* Single column; sidebar children are reordered by the ≤1023px block above */
  .span-24.first.last.home {
    grid-template-columns: 1fr;
  }
  .span-24.first.last.navBas, .navBas { grid-template-columns: repeat(3, 1fr); }
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  ul.entity-list { columns: 2; }
  .form-grid-3 { grid-template-columns: 1fr 1fr !important; }
}

/* ── 14. Responsive — Grand desktop FHD (≥1600px) ───────── */

@media (min-width: 1600px) {
  html { font-size: 17px; }
  #logo { width: 200px; height: 92px; }
  .dd-menu > .dr-menu-label,
  .dd-menu > .rich-ddmenu-label {
    padding: 10px 20px;
    font-size: 0.95rem;
  }
}

/* ── 15. Responsive — Ultra-large QHD+ (≥1920px) ───────── */

@media (min-width: 1920px) {
  html { font-size: 18px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.65rem; }
  h3 { font-size: 1.3rem; }
  #vignettes .bloc { grid-template-columns: repeat(5, 1fr); }
  .theme-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── 15b. Login page ─────────────────────────────────────── */

/* Inputs reuse the search-bar visual language; actions row keeps the
   primary submit + two secondary outline links inline. Also reused on
   admin edit forms where we want the lighter, white-backed look instead
   of the default #fafafa admin input style. */
.form-group input.login-input,
.form-group select.login-input,
.form-group textarea.login-input {
  background: var(--color-white);
  border-color: var(--color-border);
}
.form-group input.login-input:focus,
.form-group select.login-input:focus,
.form-group textarea.login-input:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(36, 54, 84, 0.2);
}
/* Suppress browser autofill yellow background (Chromium/WebKit). */
.form-group input.login-input:-webkit-autofill,
.form-group input.login-input:-webkit-autofill:hover,
.form-group input.login-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--color-white) inset;
  -webkit-text-fill-color: var(--color-text);
  caret-color: var(--color-text);
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
/* Match the secondary action links' height to the primary submit button
   (8px/16px padding, 0.9rem) — overrides .btn-action's compact 4px/10px.
   Applies to both .login-actions (login page) and .form-actions (register,
   forgot-password) to keep the auth flow visually consistent. */
.login-actions a.btn-action,
.form-actions a.btn-action {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Full-width workflow action buttons (Valider / Rejeter / Demander précisions)
   live outside .form-actions, so their default 4px/10px compact padding makes
   them look smaller than Enregistrer/Annuler. Re-align to the same height as
   the primary submit button. The :not(.btn-action-icon) guard keeps icon-only
   admin row buttons (28x28 squares) at their compact size. */
button.btn-action.btn-action-success:not(.btn-action-icon),
button.btn-action.btn-action-danger:not(.btn-action-icon),
button.btn-action.btn-action-info:not(.btn-action-icon),
button.btn-action.btn-action-ask:not(.btn-action-icon),
a.btn-action.btn-action-success:not(.btn-action-icon),
a.btn-action.btn-action-danger:not(.btn-action-icon),
a.btn-action.btn-action-info:not(.btn-action-icon),
a.btn-action.btn-action-ask:not(.btn-action-icon) {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* ── 16. Pill select (sidebar widgets) ───────────────────── */

select.select-pill {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: inline-block;
  padding: 6px 32px 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background-color: var(--color-white);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23243654' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select.select-pill:hover {
  border-color: var(--color-blue);
}

select.select-pill:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(36, 54, 84, 0.2);
}

/* ── 18. Chip search (multi-select avec recherche serveur) ──── */

.chip-search-section { margin-bottom: 1.5em; }
.chip-search-section h4 { margin: 0 0 0.5rem 0; }

.chip-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.chip-search-chips:has(.chip-search-chip) { padding: 0.3rem 0; }

.chip-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  background: var(--color-dark-gold);
  color: #fff;
  border: 1px solid var(--color-dark-gold);
  border-radius: 999px;
  font-size: 0.9em;
  transition: background-color 0.15s, border-color 0.15s;
}
.chip-search-chip:hover {
  background: #8B6508;
  border-color: #8B6508;
}

.chip-search-chip-remove {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
  padding: 0 0.2rem;
  color: #fff;
}
.chip-search-chip-remove:hover { color: #ffe9b3; }

.chip-search-wrap { position: relative; width: 100%; }
.chip-search-input {
  width: 100%;
  padding: 0.5rem;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-family: inherit;
  font-size: inherit;
}
.chip-search-input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(36, 54, 84, 0.2);
}

.chip-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 250px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-top: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.chip-search-suggestions li {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.chip-search-suggestions li:hover,
.chip-search-suggestions li.active {
  background: #f0f0f0;
}
.chip-search-suggestions li.empty {
  color: #888;
  font-style: italic;
  cursor: default;
}

/* ── 18b. Search autocomplete ─────────────────────────────── */

.search-suggest-wrap { position: relative; }
.search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d6d3cd;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: min(320px, calc(100vw - 2 * var(--gap)));
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--color-dark-gold) transparent;
}
/* WebKit / Chromium / Edge / Safari */
.search-suggest::-webkit-scrollbar {
  width: 8px;
}
.search-suggest::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.search-suggest::-webkit-scrollbar-thumb {
  background: var(--color-dark-parchment);
  border-radius: 9999px;
  border: 2px solid #fff;
  background-clip: padding-box;
  transition: background-color 0.15s ease;
}
.search-suggest::-webkit-scrollbar-thumb:hover {
  background: var(--color-dark-gold);
  background-clip: padding-box;
}
.search-suggest li { margin: 0; padding: 0; }
.search-suggest li + li { border-top: 1px solid #f0ede7; }
.search-suggest li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
  color: #2d2a26;
  transition: background-color 0.12s ease;
}
.search-suggest li a:hover,
.search-suggest li.active a {
  background: #f5f0e6;
  color: #1a1a1a;
}

.search-suggest-thumb {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  line-height: 1;
}
.search-suggest-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.search-suggest-thumb--book { background: #8b5a3c; }
.search-suggest-thumb--game { background: #4a7ba6; }
.search-suggest-thumb--indie { background: #6b8e4e; }
.search-suggest-thumb--author { background: #a64a7b; border-radius: 50%; }
.search-suggest-thumb--publisher { background: #c08040; }

.search-suggest-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.search-suggest-label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-suggest-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  font-weight: 500;
}

.search-suggest-empty {
  padding: 12px 14px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--color-text-light);
  text-align: center;
  cursor: default;
}

.search-empty {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  background: #fafafa;
  border-left: 3px solid #c0392b;
}
.search-empty h3 { margin-top: 0; }
.search-empty ul { margin: 0.5em 0; }

/* Search results grid (page /recherche) */
.search-section { margin: 0 0 1.5em 0; }
.search-section h3 {
  margin: 0 0 0.6em 0;
  padding-bottom: 0.3em;
  border-bottom: 1px solid #e8e3da;
}
.search-results-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
}
@media (max-width: 700px) {
  .search-results-grid { grid-template-columns: 1fr; }
}
.search-results-grid li { margin: 0; }
.search-results-grid li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  text-decoration: none;
  color: #2d2a26;
  border-radius: 4px;
  transition: background-color 0.12s ease;
}
.search-results-grid li a:hover { background: #f5f0e6; }

.search-result-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  border-radius: 4px;
  overflow: hidden;
  line-height: 1;
}
.search-result-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.search-result-letter { position: relative; z-index: 0; }
.search-result-thumb--book { background: #8b5a3c; }
.search-result-thumb--game { background: #4a7ba6; }
.search-result-thumb--indie { background: #6b8e4e; }
.search-result-thumb--author { background: #a64a7b; border-radius: 50%; }
.search-result-thumb--publisher { background: #c08040; }

.search-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.search-result-label {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 0.8rem;
  color: #8a8074;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 19. Print ────────────────────────────────────────────── */

@media print {
  body { background: white; color: black; font-size: 10pt; }
  .header, .navHaut, .navBas, .colDroite, .burger-menu { display: none !important; }
  .colTexte { width: 100% !important; }
  a::after { content: " (" attr(href) ")"; font-size: 0.8em; }
  .pave { break-inside: avoid; }
}
