/* galerie.css - styles spécifiques à la page galerie */

h1 {
    text-align: center;
    color: var(--marron);
    margin-bottom: 2.5rem;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.category-cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: #f0f0f0;
}

.category-cover-mashup {
    width: 100%;
    height: 300px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    background: #f0f0f0;
}

.category-cover-mashup img {
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    object-fit: cover;
}

/* Si une seule photo dans le mashup, elle prend toute la place */
.category-cover-mashup.single-photo {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

/* Si 3 photos, la 1ère occupe toute la colonne de gauche */
.category-cover-mashup.three-photos img:first-child {
    grid-row: 1 / 3;
}

.category-info {
    padding: 20px;
}

.category-name {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: bold;
    color: var(--marron);
    margin-bottom: 10px;
}

.category-count {
    color: #666;
    font-size: 14px;
}

.animals-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.animal-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.animal-card:hover {
    transform: translateY(-3px);
}

.animal-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}

.animal-name {
    font-family: var(--font-heading);
    padding: 15px;
    font-weight: bold;
    color: var(--marron);
    text-align: center;
}

.back-button {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
}

.back-button:hover {
    background: #357abd;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

.modal-content {
    position: relative;
    margin: 50px auto;
    max-width: 900px;
    background: white;
    border-radius: 12px;
    padding: 30px;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    background: #f2f2f2;
    border: none;
    border-radius: 50%;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.close-modal:hover {
    background: #e6e6e6;
    color: #000;
}

.close-modal:focus-visible {
    outline: 2px solid var(--rose-principal);
    outline-offset: 2px;
}

.modal-animal-name {
    font-size: 32px;
    font-weight: bold;
    color: var(--marron);
    margin-bottom: 20px;
    padding-right: 40px;
}

.modal-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
    white-space: pre-wrap;
}

.modal-description:empty {
    display: none;
}

@media (max-width: 600px) {
    .modal-content {
        margin: 20px auto;
        width: calc(100% - 24px);
        padding: 20px;
    }

    .modal-animal-name {
        font-size: 26px;
    }
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.modal-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modal-gallery img:hover {
    transform: scale(1.05);
}

/* Lightbox plein écran */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
    color: var(--rose-clair);
}

.lightbox-close:focus-visible {
    outline: 2px solid var(--rose-clair);
    outline-offset: 2px;
}
