/* Cliparthèque — d'après le design system Amuseurs :
   papier crème, encre chaude, quatre couleurs du bonnet de bouffon,
   contours d'encre 2 px et ombres décalées « pop ». */
:root {
  --green: #609b00; --green-100: #eef6df; --green-700: #4a7800;
  --yellow: #fbaf00; --yellow-100: #fff4d9;
  --blue: #0082f4; --blue-100: #e3f1ff; --blue-700: #0064bd;
  --red: #ff1425; --red-100: #ffe7e9; --red-700: #cc0f1d;
  --ink: #221c18; --paper: #fffdf7;
  --neutral-50: #faf8f4; --neutral-100: #f2efe8; --neutral-200: #e4dfd5;
  --neutral-300: #cbc4b7; --neutral-500: #7c756a; --neutral-600: #57524a;
  --surface-card: #fff;
  --text-muted: var(--neutral-600);
  --border-soft: var(--neutral-200);
  --accent: var(--green-700);
  --focus-ring: var(--blue);
  --stroke: 2px;
  --shadow-pop: 3px 3px 0 var(--ink);
  --shadow-pop-lg: 5px 5px 0 var(--ink);
  --shadow-soft: 0 2px 8px rgba(34, 28, 24, .10);
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 22px; --radius-pill: 999px;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 120ms; --dur-med: 220ms;
  --display: 'Kalam', 'Comic Sans MS', cursive;
  --body: 'Karla', 'Helvetica Neue', Arial, sans-serif;
  --tile: 148px;
  --gap: 14px;
  --side-w: 264px;
  --top-h: 76px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--body);
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; }
a { color: var(--blue-700); }
a:hover { color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.small { font-size: 14px; }
.muted { color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-pill); background: var(--surface-card); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-pop);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-700); color: #fff; }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn.ghost:hover { border-color: var(--ink); box-shadow: var(--shadow-pop); background: var(--surface-card); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; box-shadow: 2px 2px 0 var(--ink); }
.btn.icon { width: 40px; padding: 0; }
.btn.toggle[aria-pressed="true"] { background: var(--red-100); }
.btn.toggle[aria-pressed="true"] .ic, .btn.fav[aria-pressed="true"] .ic { fill: var(--red); stroke: var(--red-700); }

/* En-tête */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--paper);
  border-bottom: var(--stroke) solid var(--ink);
}
.top-in { height: var(--top-h); display: flex; align-items: center; gap: 24px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -.01em; }
.bells { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-8deg); }
.bells i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); }
.bells i:nth-child(1) { background: var(--blue); }
.bells i:nth-child(2) { background: var(--yellow); }
.bells i:nth-child(3) { background: var(--green); }
.bells i:nth-child(4) { background: var(--red); }
.search {
  flex: 1; min-width: 0; max-width: 680px; display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px 0 16px; background: var(--surface-card);
  border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); box-shadow: var(--shadow-pop);
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.search:focus-within { box-shadow: var(--shadow-pop-lg); transform: translate(-1px, -1px); }
.search-btn { display: none; }  /* la loupe seule, sur mobile */
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; height: 100%; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search kbd {
  font: 700 12px var(--body); color: var(--text-muted); border: 1.5px solid var(--neutral-300);
  border-radius: 6px; padding: 1px 7px;
}
.search:focus-within kbd { display: none; }
#journal-btn { margin-left: auto; }

/* Mise en page */
.layout { display: flex; align-items: flex-start; }
.side {
  position: sticky; top: var(--top-h); flex: none; width: var(--side-w);
  height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h));
  display: flex; flex-direction: column; padding: 20px 16px 0 24px; gap: 10px;
  border-right: var(--stroke) solid var(--ink); background: var(--paper);
}
.side h2 { font-size: 20px; }
.side-head { display: flex; align-items: center; justify-content: space-between; }
.close-side { display: none; }
.colls {
  display: flex; flex-direction: column; gap: 6px; margin: 0 -8px 12px -4px; padding: 2px 8px 4px 2px;
  flex: 0 1 auto; min-height: 120px; max-height: 45%; overflow-y: auto; scrollbar-width: thin;
}
.colls .coll { flex: none; }
.coll {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 12px; border: var(--stroke) solid transparent; border-radius: var(--radius-sm);
  background: none; cursor: pointer; font-weight: 500;
}
.coll:hover { background: var(--neutral-100); }
.coll[aria-checked="true"] { border-color: var(--ink); background: var(--surface-card); box-shadow: 2px 2px 0 var(--ink); font-weight: 700; }
.coll .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.coll .n { margin-left: auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.coll small { display: block; font-size: 12px; color: var(--text-muted); font-weight: 400; line-height: 1.3; }
.theme-filter {
  height: 36px; padding: 0 12px; border: 1.5px solid var(--neutral-300); border-radius: var(--radius-sm);
  background: var(--surface-card); font-size: 14px;
}
.theme-filter:focus { border-color: var(--ink); outline: 0; }
.themes { list-style: none; margin: 0 -8px 0 -4px; padding: 0 8px 24px 0; overflow-y: auto; flex: 1 1 0; min-height: 160px; scrollbar-width: thin; }
.themes button {
  display: flex; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 6px;
  background: none; text-align: left; font-size: 14px; cursor: pointer; line-height: 1.35;
}
.themes button:hover { background: var(--neutral-100); }
.themes small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); line-height: 1.3; }
.menu-switch { display: flex; flex: none; margin-bottom: 8px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; }
.menu-switch button { flex: 1; padding: 7px 4px; border: 0; background: var(--surface-card); font-size: 13px; font-weight: 500; cursor: pointer; }
.menu-switch button + button { border-left: 1.5px solid var(--ink); }
.menu-switch button[aria-checked="true"] { background: var(--yellow); font-weight: 700; }
.menu-note { flex: none; margin: 0 0 8px; font-size: 12px; line-height: 1.35; color: var(--text-muted); }
.themes button[aria-pressed="true"] { background: var(--yellow-100); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--ink); }
.themes .n { margin-left: auto; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.themes .grp { font: 700 11px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 14px 8px 4px; }

.main { flex: 1; min-width: 0; padding: 18px 24px 64px; }
.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 18px; min-height: 40px; }
.count { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.count span { font-weight: 400; color: var(--text-muted); }
.show-side { display: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 12px;
  border: 1.5px solid var(--ink); border-radius: var(--radius-pill); background: var(--yellow-100);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.chip:hover { background: var(--yellow); }
.chip .ic { width: 14px; height: 14px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.seg { display: flex; border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; height: 34px; box-shadow: 2px 2px 0 var(--ink); }
.seg button { width: 34px; border: 0; cursor: pointer; position: relative; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-checked="true"]::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2.5px solid var(--green); background: transparent; }
.seg [data-bg="white"] { background: #fff; }
.seg [data-bg="check"] { background: repeating-conic-gradient(#e4dfd5 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.seg [data-bg="dark"] { background: #2c2520; }
.size { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.size input { width: 96px; accent-color: var(--green-700); }

/* Grille virtualisée */
.grid { position: relative; }
.tile {
  position: absolute; top: 0; left: 0; display: flex; flex-direction: column; padding: 0; margin: 0;
  border: 0; background: none; cursor: pointer; text-align: left;
}
.tile .pic {
  position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 14%;
  background: var(--surface-card); border: 1.5px solid var(--border-soft); border-radius: var(--radius-md);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
}
.tile img { position: absolute; inset: 13%; width: 74%; height: 74%; object-fit: contain; display: block; }
.tile:hover .pic, .tile:focus-visible .pic { border: var(--stroke) solid var(--ink); box-shadow: var(--shadow-pop); transform: translate(-1px, -1px); }
.tile:focus-visible { outline: 0; }
.tile:focus-visible .pic { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.tile .lbl { height: 34px; padding: 6px 2px 0; font-size: 13px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--neutral-600); }
.tile.fav .pic::after { content: ""; position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 1.5px solid var(--ink); }
.no-lbl .tile .lbl { display: none; }
body[data-bg="check"] .tile .pic, body[data-bg="check"] .stage, body[data-bg="check"] .related-grid button { background: repeating-conic-gradient(#efeae1 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
body[data-bg="dark"] .tile .pic, body[data-bg="dark"] .stage, body[data-bg="dark"] .related-grid button { background: #2c2520; border-color: #2c2520; }

.empty { text-align: center; padding: 72px 16px; }
.empty-title { font: 700 32px var(--display); margin: 0 0 4px; }
.empty .btn { margin-top: 12px; }

/* Fiche détaillée */
.sheet {
  border: var(--stroke) solid var(--ink); border-radius: var(--radius-lg); padding: 0;
  background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--ink);
  width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
}
.sheet::backdrop { background: rgba(34, 28, 24, .55); }
.sheet[open] { animation: pop var(--dur-med) var(--ease-bounce); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.sheet-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); }
.stage {
  position: relative; display: grid; place-items: center; min-height: 460px; padding: 48px;
  background: #fff; border-right: var(--stroke) solid var(--ink);
}
.stage img { max-width: 100%; max-height: min(62vh, 560px); width: 100%; height: 100%; object-fit: contain; }
.nav { position: absolute; top: 50%; translate: 0 -50%; }
.nav.prev { left: 14px; } .nav.next { right: 14px; }
.info { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0; font: 700 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.info h2 { font-size: 34px; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink); background: var(--surface-card); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink);
}
.tag:hover { background: var(--green-100); color: var(--ink); }
.tag.file { cursor: default; font-weight: 500; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; border-color: var(--neutral-300); }
.tag.file:hover { background: var(--surface-card); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.png { display: flex; align-items: center; }
.png .btn { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.png select {
  height: 40px; border: var(--stroke) solid var(--ink); border-left: 0; border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--neutral-50); padding: 0 10px; font-size: 14px; font-weight: 700; box-shadow: var(--shadow-pop); cursor: pointer;
}
.related h3 { font-size: 18px; margin-bottom: 8px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.related-grid button {
  aspect-ratio: 1; padding: 8px; border: 1.5px solid var(--border-soft); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer;
}
.related-grid button:hover { border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.related-grid button[aria-current="true"] { border: var(--stroke) solid var(--green); }
.related-grid img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hint { margin: auto 0 0; font-size: 12px; color: var(--text-muted); }

.about { width: min(820px, calc(100vw - 32px)); }
.about-in { padding: 22px 28px 26px; }
.about h2 { font-size: 34px; margin: 6px 0 12px; }
.about h3 { font-size: 21px; margin-bottom: 6px; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.about-cols section { background: var(--surface-card); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow-pop); }
.about-cols section:nth-child(1) { border-top: 8px solid var(--blue); }
.about-cols section:nth-child(2) { border-top: 8px solid var(--red); }
.about-cols section:nth-child(3) { border-top: 8px solid var(--yellow); }
.about-cols section:nth-child(4) { border-top: 8px solid var(--neutral-500); }
.about-cols p { margin: 0 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; pointer-events: none; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: var(--radius-pill); font-weight: 700; font-size: 14px;
  transition: opacity var(--dur-med), translate var(--dur-med) var(--ease-bounce);
}
.toast.on { opacity: 1; translate: -50% 0; }

/* Écrans étroits */
@media (max-width: 900px) {
  :root { --top-h: 64px; --gap: 10px; }
  .top-in { gap: 12px; padding: 0 16px; }
  .brand-name { display: none; }
  .search { height: 44px; }
  .search kbd { display: none; }
  #about-btn { padding: 0 10px; }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(320px, 86vw); height: 100dvh;
    border-right: var(--stroke) solid var(--ink); box-shadow: 8px 0 0 rgba(34, 28, 24, .2);
    translate: -105% 0; transition: translate var(--dur-med) var(--ease-out); padding-top: 16px;
  }
  .side.open { translate: 0 0; }
  .close-side, .show-side { display: inline-flex; }
  .main { padding: 14px 16px 48px; }
  .tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .size input { width: 72px; }
  .sheet-in { grid-template-columns: 1fr; }
  /* Une seule case de grille bornée à la hauteur du cadre : sinon l'image le déborde */
  .stage { min-height: 0; aspect-ratio: 4 / 3; padding: 24px 56px; border-right: 0; border-bottom: var(--stroke) solid var(--ink); grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
  .stage img { max-height: 100%; min-height: 0; }
  .info h2 { font-size: 28px; }
  .hint { display: none; }
  .about-cols { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  #fav-only span, #shuffle span { display: none; }
  #fav-only, #shuffle { width: 34px; padding: 0; }
  #about-btn { font-size: 0; width: 40px; padding: 0; }
  #about-btn::before { content: "?"; font-size: 18px; }
  /* Recherche repliée en loupe ; ouverte, elle prend toute la largeur de l'en-tête */
  .search { display: none; }
  .search-btn { display: inline-flex; margin-left: auto; }
  .top.searching .search { display: flex; }
  .top.searching :is(.brand, .search-btn, #journal-btn, #about-btn) { display: none; }
  #journal-btn { margin-left: 0; }
  .sheet { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); box-shadow: 4px 4px 0 var(--ink); }
}

/* Photos et images web */
[hidden] { display: none !important; }
.tile.k-photos .pic, .tile.k-mphotos .pic, .tile.k-paphotos .pic { padding: 0; }
.tile.k-photos img, .tile.k-mphotos img, .tile.k-paphotos img { inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius-md) - 2px); }
.tile.k-web .lbl { visibility: hidden; }
.k-web img, .k-anim img { image-rendering: pixelated; }
.stage.k-photos, .stage.k-mphotos, .stage.k-paphotos { padding: 24px; }
.stage.k-web img, .stage.k-anim img { width: auto; height: auto; max-height: none; }
.related-grid.k-photos button, .related-grid.k-mphotos button, .related-grid.k-paphotos button { padding: 0; overflow: hidden; }
.related-grid.k-photos img, .related-grid.k-mphotos img, .related-grid.k-paphotos img { object-fit: cover; }

/* Szene-Cliparts : pixel art */
.tile.k-szene .pic { padding: 6%; }
.tile.k-szene img { inset: 6%; width: 88%; height: 88%; }
.stage.k-szene img { image-rendering: pixelated; }
.about-cols section:nth-child(5) { border-top: 8px solid var(--ink); }
.about-cols section:nth-child(6) { border-top: 8px solid var(--green-700); }
.about-cols section:nth-child(7) { border-top: 8px solid var(--red-700); }
.about-cols section:nth-child(8) { border-top: 8px solid var(--blue-700); }
.about-cols section:nth-child(9) { border-top: 8px solid var(--neutral-600); }
.about-cols section:nth-child(10) { border-top: 8px solid var(--neutral-300); }
/* Étapes du site, dans les crédits */
.histo { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: var(--stroke) solid var(--ink); }
.histo li { position: relative; margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.histo li::before { content: ''; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--green-700); border: 1.5px solid var(--ink); }
.histo time { display: block; font-weight: 700; }

/* Interrupteur +18 ans */
.switch { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0 4px; padding: 12px 14px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); background: var(--surface-card); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 46px; height: 26px; margin-top: 2px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); background: var(--neutral-200); position: relative; transition: background var(--dur-fast); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: var(--stroke) solid var(--ink); transition: translate var(--dur-med) var(--ease-bounce); }
.switch input:checked + .track { background: var(--red); }
.switch input:checked + .track::after { translate: 20px 0; }
.switch input:focus-visible + .track { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.switch small { display: block; font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* Éditorial : galerie du jour, sélections, journal */
.edito { margin-bottom: 8px; }
.edito-h { font-size: 26px; margin: 28px 0 12px; scroll-margin-top: calc(var(--top-h) + 12px); }
.today {
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr); gap: 20px; align-items: center;
  padding: 20px 22px; background: var(--yellow-100); border: var(--stroke) solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop-lg);
}
/* Galerie du jour et journal côte à côte */
.une { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(260px, 1fr); gap: 20px; align-items: stretch; }
.une.seul { grid-template-columns: 1fr; }
.une-journal { display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 14px; background: var(--surface-card); border: var(--stroke) solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop-lg); }
.une-journal .eyebrow { margin-bottom: 6px; }
.art-row { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px; margin: 0 -6px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.art-row:hover { background: var(--blue-100); color: var(--ink); }
.art-row .cover { aspect-ratio: 1; }
.art-row strong { display: block; font: 700 17px/1.2 var(--display); }
.art-row small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; color: var(--text-muted); font-size: 13px; line-height: 1.35; }
.une-journal .more { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 15px; }
.une.seul .une-journal { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 18px; }
.une.seul .une-journal .eyebrow, .une.seul .une-journal .more { grid-column: 1 / -1; }
.today h2 { font-size: 40px; margin: 4px 0 6px; }
.today-txt p:not(.eyebrow) { margin: 0 0 14px; }
.today-txt .eyebrow::first-letter { text-transform: uppercase; }
.today-pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.th {
  position: relative; display: block; aspect-ratio: 1; background: #fff; border: 1.5px solid var(--border-soft); border-radius: var(--radius-md);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.th:hover { border: var(--stroke) solid var(--ink); box-shadow: var(--shadow-pop); transform: translate(-1px, -1px); }
.th img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; }
.th.k-photos img, .th.k-mphotos img, .th.k-paphotos img { inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius-md) - 2px); }
.th.k-web img, .th.k-anim img, .th.k-szene img { image-rendering: pixelated; }
.th.k-szene img { inset: 5%; width: 90%; height: 90%; }
.fetes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; }
.fetes .eyebrow { margin-right: 6px; }
.fetes .chip { padding: 0 12px; text-decoration: none; color: var(--ink); background: var(--surface-card); }
.fetes .chip:hover { background: var(--yellow-100); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 12px; color: var(--ink); text-decoration: none;
  background: var(--surface-card); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-pop-lg); color: var(--ink); }
.card strong { font: 700 19px/1.2 var(--display); margin-top: 6px; }
.card small { color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; aspect-ratio: 1; background: var(--neutral-50); border-radius: var(--radius-sm); padding: 4px; }
.mosaic img { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #fff; border-radius: 6px; padding: 8%; }
.mosaic img.k-photos, .mosaic img.k-mphotos, .mosaic img.k-paphotos { object-fit: cover; padding: 0; }
.mosaic img.k-web, .mosaic img.k-anim, .mosaic img.k-szene { image-rendering: pixelated; }
.mosaic img.k-szene { padding: 2%; }
.cards.arts { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cover { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--blue-100); border-radius: var(--radius-sm); overflow: hidden; }
.cover img { width: 70%; height: 80%; object-fit: contain; }
.cover.k-photos img, .cover.k-mphotos img, .cover.k-paphotos img { width: 100%; height: 100%; object-fit: cover; }
.cover.k-szene img, .cover.k-anim img { image-rendering: pixelated; }
.sel-head { margin: 4px 0 18px; max-width: 760px; }
.sel-head h1 { font-size: 40px; margin: 4px 0 6px; }
.sel-head p:not(.eyebrow) { margin: 0; color: var(--neutral-600); }

/* Articles du journal */
.article { width: min(760px, calc(100vw - 32px)); }
.art-close { position: sticky; top: 0; z-index: 2; background: var(--paper); margin: -22px -28px 0; padding: 14px 20px 10px 28px; border-bottom: 1.5px solid var(--border-soft); }
#art-body { padding-top: 18px; font-size: 17px; line-height: 1.65; }
#art-body h2 { font-size: 38px; margin: 6px 0 10px; }
#art-body h3 { font-size: 25px; margin: 28px 0 8px; }
#art-body .chapo { font-size: 19px; color: var(--neutral-600); margin: 0 0 18px; }
#art-body p { margin: 0 0 14px; }
#art-body blockquote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 6px solid var(--yellow); font-style: italic; }
#art-body .cards { margin: 12px 0; }
.planche { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 16px 0 20px; }
.planche .more { grid-column: 1 / -1; font-weight: 700; font-size: 15px; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 18px 0; border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); overflow: hidden; background: var(--ink); box-shadow: var(--shadow-pop); }
.video button { all: unset; cursor: pointer; position: absolute; inset: 0; display: grid; place-items: center; }
.video button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video .play { position: relative; width: 76px; height: 54px; border-radius: 16px; background: var(--red); border: var(--stroke) solid var(--ink); box-shadow: var(--shadow-pop); }
.video .play::after { content: ""; position: absolute; left: 30px; top: 14px; border: 13px solid transparent; border-left: 21px solid #fff; border-right: 0; }
.video button:hover .play { background: var(--red-700); }
.video button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -6px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sources { font-size: 14px; color: var(--neutral-600); border-top: 1.5px solid var(--border-soft); padding-top: 12px; margin-top: 24px; }
.sources li { margin-bottom: 4px; }
@media (max-width: 1180px) {
  .une { grid-template-columns: 1fr; }
  .une-journal { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 18px; }
  .une-journal .eyebrow, .une-journal .more { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .today { grid-template-columns: 1fr; padding: 16px; }
  .today h2, .sel-head h1 { font-size: 32px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card strong { font-size: 17px; }
  .art-close { margin: -22px -18px 0; padding: 12px 16px 10px; }
  .article .about-in { padding: 22px 18px 24px; }
  #art-body h2 { font-size: 30px; }
}
@media (max-width: 520px) {
  /* « Autour des cliparts » sur deux lignes, pour laisser la place aux Crédits */
  #journal-btn { padding: 0 6px; width: 78px; white-space: normal; line-height: 1.1; font-size: 13px; text-align: center; }
  .today-pics { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .fetes { flex-wrap: nowrap; overflow-x: auto; margin: 14px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
  .fetes .chip, .fetes .eyebrow { flex: none; }
  .planche { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
}

/* Collections repliables */
.fold { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; }
.fold .ic { transition: rotate var(--dur-med) var(--ease-out); }
.fold[aria-expanded="false"] .ic { rotate: -90deg; }
.fold:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.colls.folded { min-height: 0; margin-bottom: 4px; }
.colls.folded .coll:not([aria-checked="true"]) { display: none; }

/* Tous les thèmes */
.themes-dlg { width: min(1400px, calc(100vw - 32px)); height: calc(100dvh - 32px); max-width: none; overflow: hidden; }
.themes-dlg[open] { display: flex; flex-direction: column; }
.tv-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 18px; padding: 16px 20px 12px; border-bottom: var(--stroke) solid var(--ink); }
.tv-head h2 { font-size: 30px; }
.tv-head .theme-filter { max-width: 420px; width: 100%; }
.tv-colls { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.tv-colls .chip { flex: none; padding: 0 12px; background: var(--surface-card); }
.tv-colls .chip[aria-checked="true"] { background: var(--yellow); }
/* Mots-clés d'un dessin Openclipart, dans la fiche */
.kw-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; margin-top: 4px; }
.kw-list .eyebrow { width: 100%; margin: 0; }
.tag.kw { height: 24px; padding: 0 9px; font-size: 12px; font-weight: 500; border-color: var(--neutral-300); }
/* Sous-thèmes d'une rubrique */
.subs { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 18px; }
.subs .chip { padding: 0 12px; background: var(--surface-card); }
.subs .chip small { font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.subs .chip[aria-pressed="true"] { background: var(--yellow); }
@media (max-width: 520px) {
  .subs { flex-wrap: nowrap; overflow-x: auto; margin: -6px -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
  .subs .chip { flex: none; }
}
.tv-wrap { flex: 1; min-height: 0; display: flex; position: relative; }
.tv-body { flex: 1; min-width: 0; overflow-y: auto; padding: 8px 20px 32px; }
.tv-body h3 { display: flex; align-items: center; gap: 8px; font-size: 22px; margin: 18px 0 10px; }
.tv-body h3 small { font: 400 13px var(--body); color: var(--text-muted); }
.tv-body .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.tv-card { display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.tv-card strong { font-size: 14px; line-height: 1.3; margin-top: 6px; }
.tv-card small { font-size: 12px; color: var(--text-muted); }
.tv-card:hover .th { border: var(--stroke) solid var(--ink); box-shadow: var(--shadow-pop); transform: translate(-1px, -1px); }
.tv-card[aria-pressed="true"] .th { border: 3px solid var(--green); box-shadow: var(--shadow-pop); }
.tv-panel {
  flex: none; width: min(440px, 42%); overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 14px;
  border-left: var(--stroke) solid var(--ink); background: var(--neutral-50); animation: slide var(--dur-med) var(--ease-out);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.tp-head { display: flex; justify-content: space-between; gap: 12px; }
.tp-head h3 { font-size: 26px; margin-top: 2px; }
.tp-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
#tp-more { align-self: center; }
@media (max-width: 900px) {
  .themes-dlg { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .tv-head { grid-template-columns: 1fr auto; padding: 12px 14px 10px; }
  .tv-head h2 { font-size: 24px; }
  .tv-head .theme-filter { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .tv-body { padding: 4px 14px 24px; }
  .tv-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
  .tv-panel { position: absolute; inset: 0; width: auto; border-left: 0; }
}

/* Rotation dans la fiche */
.rotate summary { cursor: pointer; font-size: 13px; color: var(--text-muted); width: max-content; }
.rotate summary:hover { color: var(--ink); }
.rotate-in { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.seg.rot button { width: auto; padding: 0 11px; background: var(--surface-card); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg.rot button[aria-pressed="true"] { background: var(--yellow); }
.seg.rot button:hover { background: var(--yellow-100); }
.seg.rot button[aria-pressed="true"]:hover { background: var(--yellow); }
#d-img { transition: transform var(--dur-med) var(--ease-out); }

/* Bouton Photos (enfoncé = photos affichées) et dossiers d'une rubrique */
.btn.toggle-on[aria-pressed="false"] { background: var(--neutral-100); color: var(--text-muted); border-style: dashed; }
.btn.toggle-on[aria-pressed="false"] .ic { opacity: .5; }
.tag.sub { font-weight: 500; border-style: dashed; }
.tp-folders { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tp-folders .eyebrow { width: 100%; }
.tp-folders .chip { padding: 0 10px; background: var(--surface-card); font-weight: 500; }
.tp-folders .chip small { color: var(--text-muted); margin-left: 2px; }
.tp-grid button.k-photos, .tp-grid button.k-mphotos, .tp-grid button.k-paphotos { padding: 0; overflow: hidden; }
.tp-grid button.k-photos img, .tp-grid button.k-mphotos img, .tp-grid button.k-paphotos img { object-fit: cover; }
.tp-grid button.k-web img, .tp-grid button.k-anim img, .tp-grid button.k-szene img { image-rendering: pixelated; }
@media (max-width: 520px) { #photos-btn span { display: none; } #photos-btn { width: 34px; padding: 0; } }

/* Menu d'origine d'une collection : les lettres au-dessus de la grille et la fenêtre du logiciel */
.letters { position: sticky; top: var(--top-h); z-index: 3; display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; padding: 6px 0; background: var(--paper); }
.letters button { min-width: 26px; height: 26px; border: 0; border-radius: var(--radius-sm); background: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.letters button:hover:not(:disabled) { background: var(--yellow-100); }
.letters button:disabled { color: var(--neutral-300); cursor: default; }
.grabber { width: min(980px, calc(100vw - 32px)); max-width: none; padding: 20px; }
.gg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.gg-head h2 { margin: 0; }
.gg-head p { margin: 2px 0 0; color: var(--text-muted); }
.gg-body { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; height: min(480px, calc(100dvh - 150px)); }
.gg-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.gg-col label { font-size: 13px; font-weight: 700; }
.gg-col label span { font-weight: 400; color: var(--text-muted); }
.gg-col select { flex: 1; width: 100%; min-height: 0; padding: 2px; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); background: var(--surface-card); color: var(--ink); font-size: 14px; }
.gg-img { flex: 1; min-height: 120px; display: flex; align-items: center; justify-content: center; padding: 10px; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.gg-img img { max-width: 100%; max-height: 100%; }
.gg-prev p { margin: 0; color: var(--text-muted); max-height: 5.5em; overflow-y: auto; }
@media (max-width: 720px) {
  .gg-body { grid-template-columns: 1fr; height: auto; }
  .gg-col select { flex: none; height: 150px; }
  .gg-img { flex: none; height: 200px; }
}
