
/* =========================================
   CIME — MÉDIATHÈQUE
   ========================================= */

.media-page {
    background: #ffffff;
    color: #17212b;
}

.media-container {
    width: min(1180px, 92%);
    margin: 0 auto;
}

/* En-tête secondaire */

.media-hero {
    padding: 76px 0 70px;
    text-align: center;
    background: #f5f8fc;
    border-bottom: 1px solid #e8eef5;
}

.media-hero-small {
    padding: 56px 0 54px;
}

.media-eyebrow,
.media-label {
    display: inline-block;
    color: #075cae;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.7px;
    line-height: 1.6;
}

.media-hero h1 {
    margin: 15px 0 14px;
    color: #17212b;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.2;
    font-weight: 750;
}

.media-hero p {
    max-width: 720px;
    margin: 0 auto;
    color: #657180;
    font-size: 16px;
    line-height: 1.8;
}

.media-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    color: #075cae;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.media-back:hover {
    text-decoration: underline;
}

.media-total {
    display: inline-block;
    margin-top: 19px;
    padding: 7px 13px;
    border-radius: 30px;
    background: #e7f1fc;
    color: #075cae;
    font-size: 13px;
    font-weight: 650;
}

/* Section et titres */

.media-section {
    padding: 65px 0 80px;
}

.media-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 30px;
}

.media-section-heading h2 {
    margin: 8px 0 8px;
    color: #17212b;
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.3;
}

.media-section-heading p {
    margin: 0;
    color: #657180;
    font-size: 15px;
    line-height: 1.7;
}

/* Cartes des albums */

.media-albums {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.media-album-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5ebf2;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(20, 47, 82, 0.045);
    transition: transform 0.2s ease, box-shadow 0.2s ease,
                border-color 0.2s ease;
}

.media-album-card:hover {
    transform: translateY(-4px);
    border-color: #c7dbf0;
    box-shadow: 0 12px 28px rgba(20, 47, 82, 0.10);
}

.media-album-cover {
    position: relative;
    height: 225px;
    overflow: hidden;
    background: #edf3f9;
}

.media-album-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.media-album-card:hover .media-album-cover img {
    transform: scale(1.04);
}

.media-no-cover {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #71839a;
    font-size: 13px;
}

.media-camera {
    color: #075cae;
    font-size: 36px;
}

.media-photo-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 7px 11px;
    border-radius: 6px;
    background: rgba(20, 47, 82, 0.88);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
}

.media-album-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 23px 22px 22px;
}

.media-album-content h3 {
    margin: 0 0 10px;
    color: #17212b;
    font-size: 19px;
    line-height: 1.4;
}

.media-album-content p {
    margin: 0 0 22px;
    color: #657180;
    font-size: 14px;
    line-height: 1.75;
}

.media-enter {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    color: #075cae;
    font-size: 14px;
    font-weight: 700;
}

.media-enter span {
    transition: transform 0.2s ease;
}

.media-album-card:hover .media-enter span {
    transform: translateX(4px);
}

/* Galerie des photos */

.media-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.media-photo {
    position: relative;
    display: block;
    height: 260px;
    overflow: hidden;
    border-radius: 10px;
    background: #edf3f9;
    text-decoration: none;
}

.media-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-photo:hover img {
    transform: scale(1.045);
}

.media-photo-overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 25px 15px 14px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(transparent, rgba(20, 47, 82, 0.82));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-photo:hover .media-photo-overlay,
.media-photo:focus-visible .media-photo-overlay {
    opacity: 1;
}

/* Album vide ou absent */

.media-empty {
    padding: 55px 20px;
    text-align: center;
    border: 1px solid #e5ebf2;
    border-radius: 12px;
    background: #f8fafc;
}

.media-empty-icon {
    margin-bottom: 12px;
    color: #075cae;
    font-size: 38px;
}

.media-empty h1,
.media-empty h2 {
    margin: 0 0 12px;
    color: #17212b;
    font-size: 24px;
}

.media-empty p {
    margin: 0 0 18px;
    color: #657180;
    font-size: 15px;
    line-height: 1.7;
}

.media-empty .media-back {
    margin: 0;
}

/* Responsive */

@media (max-width: 950px) {
    .media-albums,
    .media-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-album-cover {
        height: 210px;
    }

    .media-photo {
        height: 240px;
    }
}

@media (max-width: 600px) {
    .media-hero {
        padding: 48px 0 43px;
    }

    .media-hero-small {
        padding: 35px 0 40px;
    }

    .media-hero h1 {
        font-size: 29px;
    }

    .media-hero p {
        font-size: 14px;
    }

    .media-section {
        padding: 42px 0 52px;
    }

    .media-albums,
    .media-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .media-album-cover {
        height: 230px;
    }

    .media-album-content {
        padding: 20px;
    }

    .media-photo {
        height: 250px;
    }

    .media-photo-overlay {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .media-album-card,
    .media-album-cover img,
    .media-photo img,
    .media-photo-overlay,
    .media-enter span {
        transition: none;
    }
}
