/* ── Modales & lightbox — style éditorial ── */

.tas-modal,
.lightbox,
.flipbook-modal {
    --modal-ease: cubic-bezier(0.25, 1, 0.35, 1);
    --modal-ease-in: cubic-bezier(0.4, 0, 1, 1);
    --modal-duration: 0s;
    --modal-paper: #fbfaf7;
    --modal-ink: #15243d;
    --modal-muted: #5c6d82;
    --modal-line: rgba(21, 36, 61, 0.1);
    --modal-overlay: rgba(10, 22, 40, 0.62);
    --modal-radius: 22px;
    --modal-shadow:
        0 28px 70px rgba(10, 22, 40, 0.2),
        0 2px 0 rgba(255, 255, 255, 0.65) inset;
}

@media (prefers-reduced-motion: reduce) {
    .tas-modal,
    .lightbox,
    .flipbook-modal {
        --modal-duration: 0.01s;
    }
}

.tas-modal,
.lightbox,
.flipbook-modal {
    border: none;
    padding: 0;
    background: transparent;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.tas-modal:not([open]):not(.is-visible),
.lightbox:not([open]):not(.is-visible),
.flipbook-modal:not([open]):not(.is-visible) {
    display: none !important;
}

/* Modales formulaire (div) — fiables sur iOS */
.tas-modal--form[hidden] {
    display: none !important;
}

.tas-modal--form.is-visible,
.tas-modal--form:not([hidden]) {
    display: block !important;
}

.tas-modal[open],
.tas-modal.is-visible,
.lightbox[open],
.lightbox.is-visible,
.flipbook-modal[open],
.flipbook-modal.is-visible {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    z-index: 100000 !important;
}

/* Visible dès que la dialog est ouverte (sécurité mobile / iOS) */
.tas-modal[open] .tas-modal__panel,
.tas-modal.is-visible .tas-modal__panel,
.lightbox[open] .lightbox__panel,
.lightbox.is-visible .lightbox__panel,
.flipbook-modal[open] .flipbook-modal__panel,
.flipbook-modal.is-visible .flipbook-modal__panel {
    opacity: 1 !important;
    visibility: visible !important;
}

.tas-modal::backdrop,
.lightbox::backdrop,
.flipbook-modal::backdrop {
    background: transparent;
}

.tas-modal__backdrop,
.lightbox__backdrop,
.flipbook-modal__backdrop {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    opacity: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: none;
    pointer-events: none;
}

.tas-modal.is-visible .tas-modal__backdrop,
.tas-modal.is-closing .tas-modal__backdrop,
.lightbox.is-visible .lightbox__backdrop,
.lightbox.is-closing .lightbox__backdrop,
.flipbook-modal.is-visible .flipbook-modal__backdrop,
.flipbook-modal.is-closing .flipbook-modal__backdrop {
    pointer-events: auto;
}

.tas-modal.is-visible .tas-modal__backdrop,
.lightbox.is-visible .lightbox__backdrop,
.flipbook-modal.is-visible .flipbook-modal__backdrop {
    opacity: 1;
}

.tas-modal.is-closing .tas-modal__backdrop,
.lightbox.is-closing .lightbox__backdrop,
.flipbook-modal.is-closing .flipbook-modal__backdrop {
    opacity: 0;
}

/* Bouton fermer commun */
.tas-modal__close,
.lightbox__close,
.flipbook-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--modal-muted);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--modal-line);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tas-modal__close:hover,
.lightbox__close:hover,
.flipbook-modal__close:hover {
    color: var(--modal-ink);
    background: #ffffff;
    border-color: rgba(21, 36, 61, 0.16);
    transform: scale(1.04);
}

.tas-modal__close:focus-visible,
.lightbox__close:focus-visible,
.flipbook-modal__close:focus-visible,
.lightbox__nav:focus-visible,
.flipbook-modal__nav:focus-visible,
.flipbook-modal__download:focus-visible,
.flipbook-modal__btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ── Modale contenu (TAS) ── */

.tas-modal__panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100vw - 28px));
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    color: var(--modal-ink);
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 255, 255, 0.9), transparent 55%),
        var(--modal-paper);
    border: 1px solid var(--modal-line);
    border-radius: var(--modal-radius);
    box-shadow: var(--modal-shadow);
    overflow: hidden;
    opacity: 0;
    transition: none;
}

.tas-modal.is-visible .tas-modal__panel {
    transform: translate(-50%, -50%);
    opacity: 1;
}

.tas-modal.is-closing .tas-modal__panel {
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: none;
}

.tas-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
}

.tas-modal__header {
    position: relative;
    padding: 28px 64px 20px 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, transparent 100%);
}

.tas-modal__meta {
    min-width: 0;
}

.tas-modal__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-secondary);
    margin-bottom: 8px;
}

.tas-modal__title {
    font-size: clamp(1.35rem, 3.2vw, 1.65rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: var(--modal-ink);
    margin: 0;
}

.tas-modal__date,
.tas-modal__location {
    font-size: 0.875rem;
    color: var(--modal-muted);
    line-height: 1.5;
    margin-top: 8px;
}

.tas-modal__body {
    padding: 4px 28px 28px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(21, 36, 61, 0.22) transparent;
    transition: opacity 0.18s ease;
}

.tas-modal__body.is-swapping {
    opacity: 0;
}

.tas-modal__body::-webkit-scrollbar { width: 5px; }
.tas-modal__body::-webkit-scrollbar-thumb {
    background: rgba(21, 36, 61, 0.2);
    border-radius: 999px;
}

.tas-modal__para {
    font-size: 0.96875rem;
    line-height: 1.78;
    color: var(--modal-muted);
    margin-bottom: 16px;
}

.tas-modal__para:last-child { margin-bottom: 0; }

.tas-modal__list {
    padding-left: 1.15rem;
    font-size: 0.96875rem;
    line-height: 1.72;
    color: var(--modal-muted);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tas-modal__list li::marker { color: var(--color-secondary); }

.tas-modal__figure {
    margin: 0 0 22px;
    padding: 16px;
    background: #0e1c30;
    border-radius: 14px;
    line-height: 0;
    text-align: center;
}

.tas-modal__figure-img {
    width: 100%;
    max-width: 260px;
    max-height: 260px;
    object-fit: contain;
}

.tas-modal__loading {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
    color: var(--modal-muted);
    padding: 12px 0;
}

.tas-modal__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(21, 36, 61, 0.12);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: modalSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes modalSpin {
    to { transform: rotate(360deg); }
}

.tas-modal__departure {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 18px;
    padding: 10px 14px;
    color: #0d5c45;
    background: rgba(0, 133, 63, 0.07);
    border-radius: 10px;
}

/* Hommage */
.tas-modal--hommage .tas-modal__panel {
    width: min(860px, calc(100vw - 28px));
}

.tas-modal--hommage .tas-modal__header {
    padding-bottom: 16px;
}

.tas-modal--hommage .tas-modal__body {
    padding: 0;
}

.tas-hommage-modal {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    align-items: stretch;
    min-height: 300px;
}

.tas-hommage-modal__visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: clamp(24px, 3vw, 32px) clamp(18px, 2.5vw, 24px);
    background: linear-gradient(165deg, #0c1829 0%, #152a47 100%);
    text-align: center;
}

.tas-hommage-modal__halo {
    display: none;
}

.tas-hommage-modal__photo {
    position: relative;
    z-index: 1;
    width: 100%;
    line-height: 0;
}

.tas-hommage-modal__photo img {
    width: 100%;
    max-height: clamp(240px, 36vh, 320px);
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.tas-hommage-modal__years {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(240, 192, 32, 0.92);
    letter-spacing: 0.03em;
}

.tas-hommage-modal__content {
    padding: clamp(24px, 3vw, 32px) clamp(24px, 3vw, 36px);
    overflow-y: auto;
    max-height: min(58vh, 480px);
    scrollbar-width: thin;
}

.tas-hommage-modal__lead {
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.72;
    color: var(--modal-ink);
    margin-bottom: 16px;
}

.tas-hommage-modal__text {
    font-size: 0.9375rem;
    line-height: 1.78;
    color: var(--modal-muted);
    margin-bottom: 14px;
}

.tas-hommage-modal__text:last-child {
    margin-bottom: 0;
}

/* Chronogramme */
.chrono-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--modal-line);
    border-radius: 14px;
    background: #ffffff;
}

.chrono-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.chrono-table th,
.chrono-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(21, 36, 61, 0.07);
    vertical-align: top;
    color: #334155;
}

.chrono-table th {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--modal-muted);
    background: rgba(21, 36, 61, 0.03);
    white-space: nowrap;
}

.chrono-table tbody tr:last-child td { border-bottom: none; }

.chrono-table tbody tr:nth-child(even) {
    background: rgba(21, 36, 61, 0.02);
}

.chrono-table td:first-child {
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

.chrono-table tbody tr:hover {
    background: rgba(0, 133, 63, 0.05);
}

/* ── Lightbox galerie (éditorial) ── */

.lightbox__panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(980px, calc(100vw - 28px));
    height: min(88vh, 820px);
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    color: var(--modal-ink);
    background:
        radial-gradient(ellipse 120% 70% at 50% -15%, rgba(255, 255, 255, 0.92), transparent 55%),
        var(--modal-paper);
    border: 1px solid var(--modal-line);
    border-radius: var(--modal-radius);
    box-shadow: var(--modal-shadow);
    overflow: hidden;
    opacity: 0;
    transition: none;
}

.lightbox.is-visible .lightbox__panel {
    transform: translate(-50%, -50%);
    opacity: 1;
}

.lightbox.is-closing .lightbox__panel {
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: none;
}

.lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
}

.lightbox__chrome {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 64px 12px 28px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, transparent 100%);
}

.lightbox__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-secondary);
    margin: 0;
}

.lightbox__counter {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--modal-muted);
    letter-spacing: 0.02em;
}

.lightbox__stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0 20px;
    padding: 12px 52px 16px;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(21, 36, 61, 0.05), transparent 68%),
        #f0eeea;
    border-radius: 14px;
}

.lightbox__frame {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow:
        0 12px 36px rgba(10, 22, 40, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    transition: opacity 0.22s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox__img.is-swapping {
    opacity: 0.35;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--modal-muted);
    background: #ffffff;
    border: 1px solid var(--modal-line);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.lightbox__nav:hover {
    color: var(--modal-ink);
    border-color: rgba(21, 36, 61, 0.18);
    background: #ffffff;
    transform: translateY(-50%) scale(1.04);
}

.lightbox__nav--side.lightbox__nav--prev { left: 10px; }
.lightbox__nav--side.lightbox__nav--next { right: 10px; }

.lightbox__toolbar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px 4px;
    flex-shrink: 0;
}

.lightbox__toolbar-counter {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--modal-muted);
    min-width: 64px;
    text-align: center;
}

.lightbox__caption {
    flex-shrink: 0;
    text-align: center;
    color: var(--modal-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
    padding: 14px 28px 24px;
    margin: 0;
    border-top: 1px solid var(--modal-line);
    background: rgba(255, 255, 255, 0.45);
}

.lightbox__caption:empty {
    display: none;
}

/* ── Modale flipbook ── */

.flipbook-modal__panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1180px, calc(100vw - 24px));
    height: min(900px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 255, 255, 0.75), transparent 50%),
        var(--modal-paper);
    border: 1px solid var(--modal-line);
    border-radius: var(--modal-radius);
    box-shadow: var(--modal-shadow);
    overflow: hidden;
    opacity: 0;
    transition: none;
}

.flipbook-modal.is-visible .flipbook-modal__panel {
    transform: translate(-50%, -50%);
    opacity: 1;
}

.flipbook-modal.is-closing .flipbook-modal__panel {
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: none;
}

.flipbook-modal__header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px 16px;
    flex-shrink: 0;
}

.flipbook-modal__header-copy {
    min-width: 0;
    padding-right: 48px;
}

.flipbook-modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
}

.flipbook-modal__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--modal-muted);
    margin-bottom: 4px;
}

.flipbook-modal__title {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--modal-ink);
    line-height: 1.3;
}

.flipbook-modal__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.flipbook-modal__stage {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: clamp(16px, 2.5vw, 28px);
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(21, 36, 61, 0.05), transparent 68%),
        #f0eeea;
    overflow: visible;
}

.flipbook-modal__viewer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 20px 14px;
    flex-shrink: 0;
}

.flipbook-modal__loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 0.9375rem;
    color: var(--modal-muted);
    z-index: 2;
    background: rgba(240, 238, 234, 0.92);
}

.flipbook-modal__loader[hidden] { display: none; }

.flipbook-modal__spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(21, 36, 61, 0.12);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: modalSpin 0.7s linear infinite;
}

.flipbook-modal__nav {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--modal-muted);
    background: #ffffff;
    border: 1px solid var(--modal-line);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.flipbook-modal__nav:hover {
    color: var(--modal-ink);
    border-color: rgba(21, 36, 61, 0.18);
    background: #ffffff;
    transform: scale(1.04);
}

.flipbook-modal__counter {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--modal-muted);
    min-width: 64px;
    text-align: center;
}

.flipbook-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 24px 20px;
    border-top: 1px solid var(--modal-line);
    background: rgba(255, 255, 255, 0.5);
}

.flipbook-modal__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--modal-ink);
    text-decoration: none;
    border-radius: 50%;
    border: 1px solid var(--modal-line);
    background: #ffffff;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.flipbook-modal__download:hover {
    color: var(--color-primary);
    border-color: rgba(21, 36, 61, 0.18);
    transform: scale(1.04);
}

.flipbook-modal__download svg {
    flex-shrink: 0;
}

.flipbook-modal__btn {
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--modal-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.flipbook-modal__btn:hover,
.flipbook-modal__btn:focus {
    color: var(--modal-ink);
    background: rgba(21, 36, 61, 0.05);
    outline: none;
}

body.is-modal-open,
body.is-flipbook-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.flipbook-mount {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flipbook-mount .flipbook-book,
.flipbook-mount .stf__parent,
.flipbook-mount .stf__wrapper {
    margin-left: auto;
    margin-right: auto;
}

.flipbook-modal__error {
    text-align: center;
    color: var(--modal-muted);
    padding: 40px 20px;
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .tas-modal__panel {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }

    .tas-modal__header {
        padding: 24px 56px 16px 20px;
    }

    .tas-modal__body {
        padding: 4px 20px 24px;
    }

    .lightbox__panel {
        width: calc(100vw - 20px);
        height: min(90dvh, 820px);
        max-height: calc(100dvh - 20px);
    }

    .lightbox__chrome {
        padding: 20px 56px 10px 20px;
    }

    .lightbox__stage {
        margin: 0 14px;
        padding: 10px 44px 14px;
    }

    .lightbox__caption {
        padding: 12px 20px 20px;
    }

    .flipbook-modal__panel {
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px);
        max-height: calc(100dvh - 12px);
        border-radius: 16px;
    }
}

/* ── Mobile : feuilles plein écran unifiées ── */
@media (max-width: 768px) {
    .tas-modal__backdrop,
    .lightbox__backdrop,
    .flipbook-modal__backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .tas-modal__panel,
    .lightbox__panel,
    .flipbook-modal__panel {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
        transform: none;
        -webkit-transform: translateZ(0);
        opacity: 1;
        visibility: visible;
    }

    .tas-modal[open] .tas-modal__panel,
    .lightbox[open] .lightbox__panel,
    .flipbook-modal[open] .flipbook-modal__panel,
    .tas-modal.is-visible .tas-modal__panel,
    .lightbox.is-visible .lightbox__panel,
    .flipbook-modal.is-visible .flipbook-modal__panel {
        transform: none;
        -webkit-transform: translateZ(0);
        opacity: 1;
        visibility: visible;
    }

    .tas-modal.is-closing .tas-modal__panel,
    .lightbox.is-closing .lightbox__panel,
    .flipbook-modal.is-closing .flipbook-modal__panel {
        transform: none;
    }

    .tas-modal__close,
    .lightbox__close,
    .flipbook-modal__close {
        top: max(10px, env(safe-area-inset-top, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        width: 44px;
        height: 44px;
    }

    /* Modale contenu */
    .tas-modal__header {
        flex-shrink: 0;
        padding:
            calc(max(14px, env(safe-area-inset-top, 0px)) + 6px)
            52px 12px 18px;
    }

    .tas-modal__title {
        font-size: 1.2rem;
        line-height: 1.3;
    }

    .tas-modal__body {
        padding: 0 18px calc(18px + env(safe-area-inset-bottom, 0px));
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        min-height: 0;
    }

    .tas-modal__para,
    .tas-modal__list {
        font-size: 0.9375rem;
        line-height: 1.72;
    }

    .tas-modal--hommage .tas-modal__panel {
        width: 100%;
    }

    .tas-hommage-modal {
        grid-template-columns: 1fr;
    }

    .tas-hommage-modal__visual {
        min-height: 200px;
        padding: 20px 16px;
    }

    .tas-hommage-modal__photo img {
        max-height: min(36dvh, 260px);
    }

    .tas-hommage-modal__content {
        max-height: none;
        padding: 20px 18px calc(16px + env(safe-area-inset-bottom, 0px));
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .chrono-table-wrap {
        margin: 0 -2px;
        border-radius: 12px;
    }

    .chrono-table {
        font-size: 0.8125rem;
    }

    .chrono-table th,
    .chrono-table td {
        padding: 10px 12px;
    }

    /* Lightbox galerie */
    .lightbox__chrome {
        flex-shrink: 0;
        padding:
            calc(max(12px, env(safe-area-inset-top, 0px)) + 4px)
            52px 6px 18px;
    }

    .lightbox__counter {
        display: none;
    }

    .lightbox__stage {
        flex: 1;
        min-height: 0;
        margin: 0 10px;
        padding: 6px 8px 8px;
        border-radius: 12px;
    }

    .lightbox__nav--side {
        display: none;
    }

    .lightbox__toolbar {
        display: flex;
        flex-shrink: 0;
        padding: 6px 16px 4px;
    }

    .lightbox__toolbar .lightbox__nav {
        position: static;
        transform: none;
        width: 44px;
        height: 44px;
    }

    .lightbox__toolbar .lightbox__nav:active {
        transform: scale(0.96);
    }

    .lightbox__caption {
        flex-shrink: 0;
        font-size: 0.875rem;
        padding: 8px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    /* Modale flipbook */
    .flipbook-modal__header {
        flex-shrink: 0;
        padding:
            calc(max(12px, env(safe-area-inset-top, 0px)) + 4px)
            52px 8px 16px;
    }

    .flipbook-modal__header-copy {
        padding-right: 0;
    }

    .flipbook-modal__eyebrow {
        display: none;
    }

    .flipbook-modal__title {
        font-size: 0.9375rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .flipbook-modal__body {
        min-height: 0;
    }

    .flipbook-modal__stage {
        flex: 1;
        min-height: 0;
        padding: 6px 8px;
        overflow: hidden;
    }

    .flipbook-mount {
        max-width: 100%;
    }

    .flipbook-mount .stf__parent {
        max-width: 100% !important;
    }

    .flipbook-modal__viewer-bar {
        flex-shrink: 0;
        gap: 16px;
        padding: 8px 16px;
    }

    .flipbook-modal__nav {
        width: 44px;
        height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .flipbook-modal__footer {
        flex-shrink: 0;
        justify-content: flex-end;
        gap: 8px;
        padding: 6px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        border-top: none;
        background: transparent;
    }

    .flipbook-modal__btn {
        display: none;
    }

    .flipbook-modal__download {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .tas-modal__header {
        padding-right: 48px;
    }

    .tas-modal__body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .lightbox__stage {
        margin: 0 8px;
    }

    .lightbox__caption {
        font-size: 0.8125rem;
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* ── Modale formulaire — Rejoindre nos équipes ── */

.tas-modal__panel--wide {
    width: min(640px, calc(100vw - 28px));
    max-height: min(92vh, 900px);
}

.tas-modal--form .tas-modal__body {
    padding: 0 28px 28px;
    overflow-y: auto;
}

.rejoindre-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.rejoindre-form__field--full {
    grid-column: 1 / -1;
}

.rejoindre-form__field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--modal-ink);
}

.rejoindre-form__req {
    color: var(--color-primary);
}

.rejoindre-form__field input[type="text"],
.rejoindre-form__field input[type="email"],
.rejoindre-form__field input[type="tel"],
.rejoindre-form__field input[type="file"],
.rejoindre-form__field textarea {
    width: 100%;
    max-width: 100%;
    padding: 11px 14px;
    font: inherit;
    font-size: 1rem; /* 16px — évite le zoom iOS au focus */
    color: var(--modal-ink);
    background: #fff;
    border: 1px solid var(--modal-line);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.rejoindre-form__field input:focus,
.rejoindre-form__field textarea:focus {
    outline: none;
    border-color: rgba(var(--color-primary-rgb), 0.45);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.rejoindre-form__field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.55;
}

.rejoindre-form__field input[type="file"] {
    padding: 9px 12px;
    font-size: 0.875rem;
}

.rejoindre-form__feedback {
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--color-text);
}

.rejoindre-form__feedback.is-success {
    border-left: 3px solid var(--color-secondary);
}

.rejoindre-form__feedback.is-error {
    border-left: 3px solid var(--color-primary);
}

.form-notice__mark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    position: relative;
}

.is-success .form-notice__mark {
    background: rgba(45, 106, 79, 0.12);
}

.is-success .form-notice__mark::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    width: 5px;
    height: 9px;
    border: solid var(--color-secondary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.is-error .form-notice__mark {
    background: rgba(var(--color-primary-rgb), 0.1);
}

.is-error .form-notice__mark::before,
.is-error .form-notice__mark::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.is-error .form-notice__mark::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.is-error .form-notice__mark::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.form-notice__body {
    min-width: 0;
    flex: 1;
}

.form-notice__title {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 2px;
}

.is-success .form-notice__title {
    color: var(--color-secondary);
}

.is-error .form-notice__title {
    color: var(--color-primary);
}

.form-notice__text {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.rejoindre-form__actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 560px) {
    .rejoindre-form__grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .tas-modal--form .tas-modal__body {
        padding: 0 max(16px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
    }

    .tas-modal__panel--wide {
        width: 100%;
        max-width: 100%;
        max-height: 100dvh;
    }

    .rejoindre-form__actions {
        justify-content: stretch;
    }

    .rejoindre-form__actions .btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .rejoindre-form__field input[type="text"],
    .rejoindre-form__field input[type="email"],
    .rejoindre-form__field input[type="tel"],
    .rejoindre-form__field input[type="file"],
    .rejoindre-form__field textarea {
        min-height: 48px;
        padding: 12px 14px;
    }

    .rejoindre-form__field textarea {
        min-height: 120px;
    }
}

/* Tablettes portrait */
@media (max-width: 900px) and (min-width: 561px) {
    .rejoindre-form__grid {
        grid-template-columns: 1fr 1fr;
    }

    .tas-modal__panel--wide {
        width: min(640px, calc(100vw - 24px));
    }
}
