/* ==========================================================================
   Base neutre — reset, accessibilité, formulaires. Le style vient de stijl-a/b.css
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
p, h1, h2, h3, h4, li, dd, dt, figcaption, blockquote { overflow-wrap: break-word; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
figure { margin: 0; }
dd { margin: 0; }
[hidden] { display: none !important; }

/* Accessibilité */
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; top: 1rem; left: 1rem; z-index: 1000;
    padding: .75rem 1.25rem; background: #fff; color: #111; font-weight: 600;
    border-radius: 999px; transform: translateY(-200%); transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 3px; }
main:focus { outline: none; }

/* Mise en page */
.container { width: 100%; max-width: var(--container, 1240px); margin-inline: auto; padding-inline: var(--gutter, 20px); }
.icon { width: 1.5rem; height: 1.5rem; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* Formulaires — base */
.form { display: grid; gap: 1.25rem; }
.form__row { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: .4rem; align-content: start; }
.field label { font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; padding: .85rem 1rem; line-height: 1.4; min-height: 3rem; }
.field textarea { resize: vertical; min-height: 9rem; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.25rem) 50%, calc(100% - .9rem) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }
.field--check { grid-template-columns: auto 1fr; column-gap: .75rem; align-items: start; }
.field--check input { width: 1.25rem; height: 1.25rem; min-height: 0; margin-top: .2rem; padding: 0; }
.field--check label { font-weight: 400; font-size: .925rem; }
.field--check .field__error { grid-column: 1 / -1; }
.field__req { color: var(--error, #B42318); }
.field__opt, .field__hint { font-size: .875rem; opacity: .8; font-weight: 400; }
.field__error { color: var(--error, #B42318); font-size: .9rem; font-weight: 500; }
.field [aria-invalid="true"] { border-color: var(--error, #B42318) !important; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__legend { font-size: .875rem; opacity: .8; }
.form-alert { padding: 1rem 1.25rem; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid var(--error, #B42318); background: #FEF3F2; color: #7A271A; }
.form-alert ul { margin-top: .5rem; padding-left: 1.25rem; }
.form-alert a { color: inherit; font-weight: 500; }

/* Galerie : mosaïque d'affiches et de photos (couleurs et arrondis dans stijl-a/b.css) */
.gallery { column-count: 2; column-gap: 1rem; }
.gallery__item { break-inside: avoid; margin-bottom: 1.5rem; }
.gallery__link { display: block; overflow: hidden; border-radius: 8px; background: rgba(127, 127, 127, .12); }
.gallery__link img { width: 100%; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.gallery__link:hover img { transform: scale(1.03); }
.gallery__caption { margin-top: .6rem; font-size: .9rem; line-height: 1.4; }
.gallery--grid { column-count: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; align-items: start; }
.gallery--grid .gallery__item { margin-bottom: 0; }
.gallery__more { margin-top: 2.5rem; }
@media (max-width: 639px) { .gallery__caption { font-size: .8rem; } }
@media (min-width: 768px) { .gallery { column-count: 3; } .gallery--grid { column-count: auto; } }
@media (min-width: 1100px) { .gallery { column-count: 4; } .gallery--photos { column-count: 3; } .gallery--grid { column-count: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Agrandissement d'une image de la galerie (créé par main.js) */
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8, 8, 10, .95); color: #fff; --focus: #fff; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox__figure { display: grid; justify-items: center; gap: .75rem; padding: 72px 16px 24px; }
.lightbox__img { width: auto; max-width: min(92vw, 1100px); max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); object-fit: contain; border-radius: 6px; }
.lightbox__caption { max-width: 60ch; text-align: center; font-size: .95rem; line-height: 1.45; }
.lightbox__count { display: block; margin-top: .25rem; font-size: .8rem; color: rgba(255, 255, 255, .75); }
.lightbox__btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.35rem; line-height: 1; transition: background-color .2s; }
.lightbox__btn:hover { background: rgba(255, 255, 255, .25); }
.lightbox__close { top: 14px; right: 14px; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 14px; }
.lightbox__next { right: 14px; }
@media (max-width: 767px) {
    .lightbox__figure { padding-bottom: 84px; }
    .lightbox__prev, .lightbox__next { top: auto; bottom: 16px; transform: none; }
}
body.lightbox-open { overflow: hidden; }

/* Bouton de changement de style (usage interne) */
.theme-switch {
    position: fixed; left: 1rem; bottom: 1rem; z-index: 90;
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .55rem 1rem .55rem .6rem; border-radius: 999px;
    background: #fff; color: #111; font: 500 .8rem/1.2 system-ui, sans-serif; text-decoration: none;
    border: 1px solid rgba(0,0,0,.15);
}
.theme-switch__label { padding: .25rem .5rem; border-radius: 999px; background: #111; color: #fff; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }

/* Révélation au défilement (activée par JS) */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
    .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}
