/* =========================================================
   PHOTOS, GIF ET GALERIES — FICHIERS LOCAUX
   ========================================================= */
.legacy .content-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 550px;
    margin: 22px auto;
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-in;
}

.legacy a:has(>.content-image) {
    display: inline-block;
    vertical-align: top;
    max-width: 100%;
    margin: 6px;
}

.legacy a>.content-image {
    max-height: 340px;
    margin: 0;
}

.media-gallery>tbody {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.media-gallery>tbody>tr {
    display: contents;
}

.media-gallery>tbody>tr>td {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 13px;
    border: 1px solid #e3edf5;
    border-radius: 11px;
    background: #f7fbfe;
}

.media-gallery>tbody>tr>td:empty {
    display: none;
}

.media-gallery .content-image {
    margin: 0;
    max-height: 250px;
    border-radius: 5px;
}

.media-unavailable {
    display: block;
    background: #f6f8fb;
    padding: 15px;
    border-left: 3px solid #b5cee0;
    color: #61788c;
    font-size: 12px;
}

.media-unavailable small {
    display: block;
    font-size: 10px;
}

.image-viewer {
    position: fixed;
    width: min(960px, 94vw);
    max-height: 94vh;
    margin: auto;
    padding: 35px;
    border: 0;
    border-radius: 15px;
    background: white;
    color: var(--navy);
    box-shadow: 0 20px 70px #001c3280;
}

.image-viewer::backdrop {
    background: #032a47d4;
}

.image-viewer>img {
    display: block;
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    margin: auto;
}

.image-viewer>p {
    font-size: 13px;
    text-align: center;
    margin: 18px 0 0;
}

.image-viewer .actions {
    justify-content: center;
}

.viewer-close {
    position: absolute;
    top: 3px;
    right: 12px;
    border: 0;
    background: none;
    font-size: 32px;
}

.viewer-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.viewer-nav button {
    border: 0;
    background: var(--blue-light);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 12px;
}

.sound-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 25px 0 40px;
}

.sound-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid #dceaf4;
    border-radius: 12px;
    background: var(--blue-light);
}

.sound-card h3 {
    font-size: 22px;
    margin: 0 0 15px;
}

.sound-card audio {
    display: block;
    width: 100%;
    max-width: 100%;
}

.sound-card a {
    font-size: 12px;
}

.daily-collection .daily-feature {
    padding: 22px;
    background: #e7f3fe;
    border-radius: 13px;
    margin: 15px 0 25px;
    border: 1px solid #c5e0f2;
}

.daily-feature h2 {
    font-size: 28px;
    margin-top: 5px;
}

@media (max-width: 650px) {
    .media-gallery>tbody {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .sound-grid {
        grid-template-columns: 1fr;
    }

    .image-viewer {
        padding: 30px 15px 20px;
    }
}
