/* Styles propres à la page d'aperçu (pas à recopier dans un site final) */

#topbar-root { position: sticky; top: 0; z-index: 50; }
.gallery-topbar {
  position: relative;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .gallery-topbar { background: rgba(16,14,23,.75); }

.gallery-topbar__logo {
  font-family: var(--ff-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}


.subnav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 1 1 auto;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink-faint);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.subnav a:hover { color: var(--ink); }
.subnav a.is-active { background: var(--accent-soft); color: var(--accent); }

.gallery-topbar__tools {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .gallery-topbar {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 12px 16px;
  }
  .gallery-topbar__logo { flex: 0 0 auto; }
  .gallery-topbar__tools { margin-left: auto; gap: 10px; }
  .subnav { order: 3; flex-basis: 100%; }
  .swatch { width: 16px; height: 16px; }
  [data-theme-toggle] { padding: 6px 10px; font-size: .72rem; }
}
.swatches { display: flex; gap: 6px; }
.swatch {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch.is-active { border-color: var(--ink); }
[data-theme-toggle] {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--ff-body);
}

/* Discret : juste une icône, pas de libellé — pour ne pas attirer l'attention
   d'un visiteur qui ne cherche pas à l'utiliser. */
.admin-lock {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: .85rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  opacity: .5;
  transition: opacity .3s var(--ease), background .3s var(--ease);
}
.admin-lock:hover { opacity: 1; background: var(--paper-alt); }
.admin-lock.is-active { opacity: 1; background: var(--accent-soft); }

.intro {
  padding: 80px 0 50px;
}
.intro h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 16px 0 18px; max-width: 780px; }
.intro p { font-size: 1.05rem; max-width: 640px; }

.section-head {
  padding: 64px 0 30px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-top: 10px; }
.section-head p { max-width: 480px; font-size: .96rem; }

.demo-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.showcase-block {
  padding-bottom: 70px;
}

.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.palette-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.palette-chip {
  width: 92px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: .72rem;
}
.palette-chip__color { height: 64px; }
.palette-chip span { display: block; padding: 6px 8px; font-weight: 600; }

.type-row { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.type-row b { font-family: var(--ff-heading); }

footer.site-footer { margin-top: 40px; }

@media (max-width: 640px) {
  .intro { padding: 50px 0 34px; }
  .section-head { padding: 44px 0 22px; }
  .showcase-block { padding-bottom: 50px; }
  .palette-chip { width: 78px; }
  .type-row b:first-child { font-size: 1.9rem !important; }
}

/* ============================================================
   FAVORIS — étoiles sur chaque modèle
   ============================================================ */

.model { position: relative; }
.model__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.model__head .demo-tag,
.model__head .eyebrow { margin: 0; }

/* Étoile et archivage : outils d'admin, invisibles pour un visiteur normal.
   Le cadenas de la barre du haut bascule l'attribut data-admin sur <html>. */
.star-btn, .archive-btn { display: none; }
html[data-admin="1"] .star-btn, html[data-admin="1"] .archive-btn { display: flex; }

.star-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-faint);
  font-size: 15px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.star-btn:hover { transform: scale(1.12); border-color: var(--accent); color: var(--accent); }
.star-btn.is-active { color: #F5A623; border-color: #F5A623; background: rgba(245,166,35,.14); }

.archive-btn {
  position: absolute;
  top: 12px;
  right: 50px;
  z-index: 20;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  color: #E11D48;
  font-size: 18px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.archive-btn::before { content: "−"; }
.archive-btn:hover { transform: scale(1.12); background: #E11D48; color: #fff; }
.archive-btn.is-active { background: #E11D48; color: #fff; }

/* Modèle archivé, visible seulement en admin : grisé et encadré en rouge
   pour qu'il ne se confonde pas avec un modèle normal. */
html[data-admin="1"] .is-archived-model {
  opacity: .5;
  outline: 2px dashed #E11D48;
  outline-offset: 6px;
  border-radius: var(--radius-md);
}

.model.is-highlighted { animation: modelPulse 1.8s ease; border-radius: var(--radius-md); }
@keyframes modelPulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  20% { box-shadow: 0 0 0 8px var(--accent-soft); }
}

.favorites-section {
  padding: 50px 0 70px;
  border-top: 1px solid var(--border);
}
.archive-section { display: none; }
html[data-admin="1"] .archive-section { display: block; }
.archive-section .demo-tag { color: #E11D48; }
.favorites-empty {
  font-size: .95rem;
  color: var(--ink-faint);
  padding: 30px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 24px;
}

/* --- Sections repliables par catégorie, avec aperçu visuel des modèles --- */
.fav-category {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--paper-soft);
  margin-top: 16px;
  overflow: hidden;
}
.fav-category summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--ff-heading);
  font-weight: 600;
  font-size: 1.02rem;
  user-select: none;
}
.fav-category summary::-webkit-details-marker { display: none; }
.fav-category__count { font-weight: 400; color: var(--ink-faint); font-size: .85rem; }
.fav-category__chevron {
  font-size: 1.2rem;
  color: var(--ink-faint);
  transition: transform .25s var(--ease);
}
.fav-category[open] summary .fav-category__chevron { transform: rotate(90deg); }
.fav-category__body {
  padding: 4px 22px 26px;
  border-top: 1px solid var(--border);
}
.fav-visual-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 22px;
}
.fav-visual-item {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.fav-visual-item .model { margin-bottom: 0 !important; }
.fav-visual-item__admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.fav-visual-item__badge {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.fav-archive-btn {
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.fav-archive-btn:hover { border-color: var(--accent); color: var(--accent); }
.fav-visual-item__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: .82rem;
  color: var(--ink-faint);
  text-decoration: none;
}
.fav-visual-item__link:hover { color: var(--accent); }

@media (max-width: 640px) {
  .fav-category summary { padding: 14px 16px; }
  .fav-category__body { padding: 4px 16px 20px; }
  .fav-visual-item { padding: 16px; }
}

/* ============================================================
   PAGE D'ACCUEIL (hub) — grille de catégories
   ============================================================ */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 980px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
  display: block;
  padding: 26px;
  border-radius: var(--radius-md);
  background: var(--paper-soft);
  border: 1px solid var(--border);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.cat-card__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 30px;
}
.cat-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.cat-card p { font-size: .86rem; }
.cat-card__count { font-size: .78rem; color: var(--ink-faint); margin-top: 14px; display: block; }

/* ============================================================
   PAGES CATÉGORIE — en-tête + fil d'ariane
   ============================================================ */

.page-header { padding: 56px 0 20px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin-bottom: 18px;
}
.back-link:hover { color: var(--accent); }
.page-header h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 14px 0 12px; }
.page-header p { max-width: 620px; font-size: 1rem; }

.preview-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--paper-soft);
  padding: 36px 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--paper-soft);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 190px;
}
.model-box__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ============================================================
   COMPOSEUR DE PAGE — panneau de choix + aperçu en direct
   ============================================================ */

.builder {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
  padding-bottom: 70px;
}
@media (max-width: 900px) {
  .builder { grid-template-columns: 1fr; }
}

.builder__panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--paper-soft);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@media (max-width: 900px) { .builder__panel { position: static; max-height: none; } }

.builder__group h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.builder__options { display: flex; flex-wrap: wrap; gap: 8px; }
.builder__options button {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .82rem;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease);
}
.builder__options button:hover { border-color: var(--accent); color: var(--ink); }
.builder__options button.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}
.builder__options--swatches button {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}
.builder__options--swatches button.is-active { border-color: var(--ink); }

.builder__hint {
  font-size: .78rem;
  color: var(--ink-faint);
  line-height: 1.5;
  background: var(--paper);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.builder__actions { display: flex; flex-direction: column; gap: 8px; }
.builder__actions .btn { width: 100%; }
.builder__actions .btn-ghost { border: 1px solid var(--border) !important; }
.builder__copied {
  font-size: .78rem;
  color: #16A34A;
  min-height: 16px;
  text-align: center;
}

.builder__summary {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.builder__summary h4 { font-size: .85rem; margin-bottom: 10px; }
.builder__summary ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.builder__summary li { font-size: .82rem; color: var(--ink-soft); }
.builder__summary li b { color: var(--ink); font-weight: 600; }

.builder__preview-wrap { position: relative; }

.builder__preview-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.builder__preview {
  height: 640px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--paper);
}

.builder__fullscreen-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.builder__fullscreen-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.builder__fullscreen-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.builder-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  margin-bottom: 60px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.builder-cta:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.builder-cta h2 { color: #fff; margin: 10px 0 10px; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.builder-cta p { color: rgba(255,255,255,.85); max-width: 560px; font-size: .95rem; }
.builder-cta__arrow { font-size: 1.6rem; flex-shrink: 0; }
@media (max-width: 640px) {
  .builder-cta { flex-direction: column; align-items: flex-start; padding: 28px; }
}

/* ============================================================
   APERÇU PLEIN ÉCRAN — voir un cadre de navigation en grand pour bien
   observer un effet lié au scroll (barre qui se cache, etc.)
   ============================================================ */

.fullscreen-preview {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11,11,15,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.fullscreen-preview.is-open { opacity: 1; pointer-events: auto; }
.fullscreen-preview__panel {
  width: min(560px, 100%);
  height: min(820px, 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-soft);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.5);
  transform: scale(.96);
  transition: transform .25s var(--ease);
}
.fullscreen-preview.is-open .fullscreen-preview__panel { transform: scale(1); }
.fullscreen-preview.is-wide .fullscreen-preview__panel {
  width: min(1400px, 96vw);
  height: 92vh;
  background: var(--paper);
}
.fullscreen-preview__scroll { height: 100%; overflow-y: auto; overflow-x: hidden; }
.fullscreen-preview__scroll .device-frame__scroll,
.fullscreen-preview__scroll .builder__preview {
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.fullscreen-preview__close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.fullscreen-preview__close:hover { background: rgba(255,255,255,.28); transform: scale(1.06); }
body.has-fullscreen-preview { overflow: hidden; }
@media (max-width: 640px) {
  .fullscreen-preview { padding: 0; }
  .fullscreen-preview__panel { border-radius: 0; }
}

/* ============================================================
   MENU MOBILE — barre fine collée en haut + feuille du bas (pouce)
   ============================================================ */
.gallery-topbar__menu, .gallery-topbar__theme { display: none; }
.mnav { display: none; }
@media (max-width: 680px) {
  .gallery-topbar { flex-wrap: nowrap; row-gap: 0; gap: 8px; padding: 8px 12px; min-height: 58px; }
  .gallery-topbar__logo { font-size: .98rem; flex: 0 0 auto; }
  .subnav, .gallery-topbar__tools .swatches, .gallery-topbar__tools [data-theme-toggle] { display: none; }
  .gallery-topbar__menu {
    display: inline-flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; height: 42px; padding: 0 16px 0 14px;
    border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--paper); color: var(--ink);
    font: 700 .86rem var(--ff-body); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .15s ease, border-color .25s ease;
  }
  .gallery-topbar__menu:active { transform: scale(.96); }
  .gallery-topbar__menu span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
  .gallery-topbar__menu .burger { display: grid; gap: 4px; width: 16px; }
  .gallery-topbar__menu .burger b { display: block; height: 2px; border-radius: 2px; background: var(--accent); }
  .gallery-topbar__menu .burger b:nth-child(2) { width: 70%; }
  .gallery-topbar__tools { margin-left: 0; gap: 4px; }
  .gallery-topbar__theme, .gallery-topbar .admin-lock { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; font-size: 1.05rem; cursor: pointer; opacity: 1; }
  .gallery-topbar__theme:active, .gallery-topbar .admin-lock:active { background: var(--paper-alt); }
  .gallery-topbar .admin-lock { opacity: .55; width: 36px; }
  .gallery-topbar .admin-lock.is-active { opacity: 1; }

  .mnav { display: block; position: fixed; inset: 0; z-index: 100; visibility: hidden; pointer-events: none; }
  .mnav.is-open { visibility: visible; pointer-events: auto; }
  .mnav__backdrop { position: absolute; inset: 0; background: rgba(10, 8, 22, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s ease; }
  .mnav.is-open .mnav__backdrop { opacity: 1; }
  .mnav__panel {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--paper); border-radius: 26px 26px 0 0; box-shadow: 0 -20px 60px -20px rgba(10, 8, 30, .5);
    padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateY(102%); transition: transform .42s var(--ease);
  }
  .mnav.is-open .mnav__panel { transform: translateY(0); }
  .mnav__grip { display: grid; place-items: center; height: 26px; margin: 0 -16px; cursor: grab; touch-action: none; }
  .mnav__grip i { width: 40px; height: 5px; border-radius: 5px; background: var(--border); }
  .mnav__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; touch-action: none; }
  .mnav__head b { font: 700 1.1rem var(--ff-heading); }
  .mnav__close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper-alt); color: var(--ink); font-size: 1rem; cursor: pointer; }
  .mnav__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mnav__tile {
    display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; border-radius: 18px;
    background: var(--paper-soft); border: 1px solid var(--border); color: var(--ink); text-decoration: none;
    font: 600 .92rem var(--ff-body); -webkit-tap-highlight-color: transparent; transition: transform .15s ease, background .25s ease, border-color .25s ease;
  }
  .mnav__tile:active { transform: scale(.96); }
  .mnav__tile.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--accent); }
  .mnav__ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--paper); font-size: 1.2rem; flex: 0 0 auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
  .mnav__opts { display: grid; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
  .mnav__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mnav__row > span { font: 600 .84rem var(--ff-body); color: var(--ink-soft); }
  .mnav__seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper-alt); }
  .mnav__seg button { border: 0; background: none; padding: 9px 14px; border-radius: 999px; font: 600 .84rem var(--ff-body); color: var(--ink-soft); cursor: pointer; }
  .mnav__seg button.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
  .mnav .swatches { gap: 10px; }
  .mnav .swatch { width: 30px; height: 30px; }
  body.has-mnav { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .mnav__panel, .mnav__backdrop { transition-duration: .01s; } }

/* ============================================================
   MENU MOBILE — chorégraphie d'ouverture / fermeture
   ouverture : bouton → croix · fond qui se floute · feuille à ressort · tuiles en cascade · options qui « popent »
   fermeture : tuiles qui sortent en cascade inversée → feuille qui redescend → fond qui s'efface
   ============================================================ */
@media (max-width: 680px) {
  :root { --mnav-spring: cubic-bezier(.2, 1.12, .3, 1); }
  @supports (transition-timing-function: linear(0, 1)) {
    :root { --mnav-spring: linear(0, .12 6%, .46 14%, .78 23%, .98 32%, 1.07 41%, 1.08 48%, 1.04 58%, 1.01 70%, 1 85%, 1); }
  }

  /* la barre reste visible et cliquable : le bouton devient la croix de fermeture */
  .mnav { inset: 59px 0 0 0; visibility: hidden; transition: visibility 0s linear .6s; }
  .mnav.is-open, .mnav.is-closing { visibility: visible; transition-delay: 0s; }
  .mnav:not(.is-open) { pointer-events: none; }

  .mnav__backdrop { background: rgba(12, 8, 30, .5); opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
    transition: opacity .4s ease .08s, backdrop-filter .5s ease .08s, -webkit-backdrop-filter .5s ease .08s; }
  .mnav.is-open .mnav__backdrop { opacity: calc(1 - var(--drag, 0)); backdrop-filter: blur(7px) saturate(1.2); -webkit-backdrop-filter: blur(7px) saturate(1.2); transition-delay: 0s; transition-duration: .35s, .5s, .5s; }

  .mnav__panel { transform: translateY(105%) scale(.98); transform-origin: 50% 100%;
    transition: transform .36s cubic-bezier(.5, 0, .75, 0) .12s; }
  .mnav.is-open .mnav__panel { transform: translateY(0) scale(1); transition: transform .75s var(--mnav-spring); }
  .mnav__panel[style*="translateY"] { transition: none !important; }   /* pendant le glisser : colle au doigt */

  /* tuiles : cascade à l'ouverture, cascade inversée à la fermeture */
  .mnav.is-open .mnav__tile { animation: mnavTileIn .6s var(--mnav-spring) both; animation-delay: calc(.16s + var(--i) * 48ms); }
  .mnav.is-closing .mnav__tile { animation: mnavTileOut .24s cubic-bezier(.5, 0, .75, 0) both; animation-delay: calc((9 - var(--i)) * 16ms); }
  .mnav.is-open .mnav__head, .mnav.is-open .mnav__opts { animation: mnavFade .5s ease both; animation-delay: .1s; }
  .mnav.is-open .mnav__opts { animation-delay: .62s; }
  .mnav.is-closing .mnav__head, .mnav.is-closing .mnav__opts { animation: mnavFadeOut .2s ease both; }
  .mnav.is-open .mnav__seg { animation: mnavPop .5s var(--mnav-spring) both .68s; }
  .mnav.is-open .mnav .swatch, .mnav.is-open .swatch { animation: mnavPop .45s var(--mnav-spring) both; }
  .mnav.is-open .swatch:nth-child(1) { animation-delay: .72s; } .mnav.is-open .swatch:nth-child(2) { animation-delay: .78s; }
  .mnav.is-open .swatch:nth-child(3) { animation-delay: .84s; } .mnav.is-open .swatch:nth-child(4) { animation-delay: .9s; } .mnav.is-open .swatch:nth-child(5) { animation-delay: .96s; }
  /* la page courante « respire » une fois arrivée */
  .mnav.is-open .mnav__tile.is-active { animation: mnavTileIn .6s var(--mnav-spring) both, mnavGlow 1.6s ease-out 1s 1; animation-delay: calc(.16s + var(--i) * 48ms), 1s; }

  @keyframes mnavTileIn { from { opacity: 0; transform: translateY(34px) scale(.86) rotate(-2deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
  @keyframes mnavTileOut { to { opacity: 0; transform: translateY(14px) scale(.94); filter: blur(3px); } }
  @keyframes mnavFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes mnavFadeOut { to { opacity: 0; } }
  @keyframes mnavPop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
  @keyframes mnavGlow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }

  /* bouton : burger → croix, libellé → « Fermer » */
  .gallery-topbar__menu .burger b { transition: transform .45s var(--mnav-spring), opacity .25s ease, width .3s ease; transform-origin: 50% 50%; }
  .gallery-topbar__menu[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .gallery-topbar__menu[aria-expanded="true"] .burger b:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .gallery-topbar__menu[aria-expanded="true"] .burger b:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .gallery-topbar__menu[aria-expanded="true"] .burger b:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .gallery-topbar__menu .lbl { position: relative; display: grid; overflow: hidden; height: 1.3em; line-height: 1.3em; }
  .gallery-topbar__menu .lbl em { grid-area: 1 / 1; font-style: normal; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .45s var(--mnav-spring), opacity .3s ease; }
  .gallery-topbar__menu .lbl em:last-child { transform: translateY(120%); opacity: 0; }
  .gallery-topbar__menu[aria-expanded="true"] .lbl em:first-child { transform: translateY(-120%); opacity: 0; }
  .gallery-topbar__menu[aria-expanded="true"] .lbl em:last-child { transform: none; opacity: 1; }
  .gallery-topbar__menu span.lbl { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mnav .mnav__tile, .mnav .mnav__head, .mnav .mnav__opts, .mnav .mnav__seg, .mnav .swatch { animation: none !important; }
  .mnav__panel, .mnav__backdrop, .gallery-topbar__menu .burger b, .gallery-topbar__menu .lbl em { transition-duration: .01s !important; }
}

/* ============================================================
   DESIGN « MIEL » — celui de la page abeille, appliqué à toute la bibliothèque
   (les couleurs viennent des variables de style.css ; ici : fond, barre, cartes)
   ============================================================ */

/* Fond : le même que lucasriche.com (papier chaud, grain léger, halos violet / rose) pour ne pas dépayser un client qui passe d'un site à l'autre */
html:not([data-theme="dark"]) body { background: #eceae7; }
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(46% 40% at 96% -6%, rgba(124, 92, 219, .2), transparent 70%),
    radial-gradient(38% 34% at 4% 98%, rgba(201, 79, 130, .16), transparent 70%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

[data-theme-toggle] { background: var(--paper); }

.intro h1, .page-header h1 { letter-spacing: -.03em; }

/* ============================================================
   BARRE DU HAUT façon lucasriche.com : même composition (logo animé, texte, liens en pastilles
   avec pastille qui glisse, bouton Contact), mêmes tons papier / encre / violet.
   ============================================================ */
.gallery-topbar {
  --lr-bg: #eceae7; --lr-surface-2: #e7e2ee; --lr-ink: #211c30; --lr-dim: #6b6480; --lr-line: rgba(33, 28, 48, .10); --lr-accent: #7c5cdb;
  height: 62px; padding: 0 clamp(14px, 2.6vw, 34px); gap: 14px;
  background: color-mix(in srgb, var(--lr-bg) 96%, transparent);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom: 1px solid var(--lr-line);
}
html[data-theme="dark"] .gallery-topbar { --lr-bg: #17100a; --lr-surface-2: #2a1e10; --lr-ink: #fff1d2; --lr-dim: #d9c7a0; --lr-line: #3a2b16; background: color-mix(in srgb, var(--lr-bg) 96%, transparent); }
.gallery-topbar__logo { gap: 9px; color: var(--lr-ink); font: 700 1.1rem "Bricolage Grotesque", var(--ff-heading); letter-spacing: -.01em; }
.gt-mark { position: relative; flex: 0 0 auto; width: 30px; height: 30px; display: block; }
.gt-logo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gt-logo--cv { opacity: 0; transition: opacity .24s ease; }
.gt-logo--cv.is-ready { opacity: 1; }
.gt-logo--src { display: none; }
.gt-text { display: none; }
@media (min-width: 761px) { .gt-mark { width: 42px; height: 42px; } }
@media (min-width: 1240px) { .gt-text { display: block; } }
html[data-theme="dark"] .gt-logo { filter: invert(1); }
.subnav { position: relative; gap: 2px; }
.subnav a { color: var(--lr-dim); font-weight: 400; font-size: .88rem; padding: 8px 13px; position: relative; z-index: 1; }
.subnav a:hover { color: var(--lr-ink); }
.subnav a.is-active { background: transparent; color: var(--lr-ink); }
.subnav__ind { position: absolute; top: 50%; left: 0; height: 30px; border-radius: 999px; background: var(--lr-surface-2); transform: translateY(-50%); opacity: 0; z-index: 0; transition: left .4s cubic-bezier(.16, 1, .3, 1), width .4s cubic-bezier(.16, 1, .3, 1), opacity .25s ease; }
.gallery-topbar__cta { display: none; flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; background: var(--lr-accent); color: #fff; font-size: .88rem; font-weight: 500; transition: transform .1s ease-out, background .2s ease; }
.gallery-topbar__cta:hover { background: color-mix(in srgb, var(--lr-accent) 88%, #000); }
.gallery-topbar__cta:active { transform: scale(.96); }
@media (min-width: 681px) { .gallery-topbar__cta { display: inline-block; } }
@media (max-width: 680px) { .gallery-topbar { height: auto; min-height: 58px; } }
.subnav { padding-right: 26px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
.subnav a { padding: 8px 11px; }
@media (min-width: 1240px) { .gt-text { display: none; } }
@media (min-width: 1560px) { .gt-text { display: block; } .subnav a { padding: 8px 13px; } }
@media (min-width: 681px) { .gallery-topbar__tools { gap: 10px; } }
