/**
 * HC Year Gallery - Styles
 */

/* ==========================================================================
   Sélecteur d'année
   ========================================================================== */

.hc-year-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hc-year-selector.hc-layout-stacked {
    flex-direction: column;
    align-items: flex-start;
}

.hc-year-selector.hc-layout-stacked .hc-year-label {
    margin-bottom: 8px;
}

.hc-year-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.hc-year-select {
    min-width: 200px;
    padding: 12px 40px 12px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.hc-year-select:hover {
    border-color: #999;
}

.hc-year-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* ==========================================================================
   Container de la galerie
   ========================================================================== */

.hc-gallery-container {
    margin-top: 30px;
    min-height: 100px;
}

/* ==========================================================================
   Grille de la galerie
   ========================================================================== */

.hc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--hc-columns, 3), 1fr);
    gap: 40px;
    width: 100%;
}

@media (max-width: 1024px) {
    .hc-gallery-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hc-year-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hc-year-select {
        width: 100%;
    }
}

/* ==========================================================================
   Items de la galerie
   ========================================================================== */

.hc-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f5f5f5;
    aspect-ratio: 1;
}

.hc-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.4s ease;
}

.hc-gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Effet zoom au survol */
.hc-gallery-widget[data-hover="zoom"] .hc-gallery-item:hover img {
    transform: scale(1.1);
}

/* Effet luminosité au survol */
.hc-gallery-widget[data-hover="brightness"] .hc-gallery-item:hover img {
    filter: brightness(1.2);
}

/* Effet niveaux de gris au survol */
.hc-gallery-widget[data-hover="grayscale"] .hc-gallery-item img {
    filter: grayscale(100%);
}

.hc-gallery-widget[data-hover="grayscale"] .hc-gallery-item:hover img {
    filter: grayscale(0%);
}

/* Overlay au survol */
.hc-gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.hc-gallery-item:hover::after {
    background: rgba(0, 0, 0, 0.1);
}

/* Icône de zoom */
.hc-gallery-item .hc-zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.hc-gallery-item .hc-zoom-icon svg {
    width: 24px;
    height: 24px;
    fill: #333;
}

.hc-gallery-item:hover .hc-zoom-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* ==========================================================================
   Chargement
   ========================================================================== */

.hc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    gap: 15px;
}

.hc-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: hc-spin 1s linear infinite;
}

@keyframes hc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hc-loading-text {
    font-size: 14px;
    color: #666;
}

/* ==========================================================================
   Message aucune image
   ========================================================================== */

.hc-no-images {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.hc-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hc-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.hc-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hc-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.hc-lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 15px;
    font-size: 14px;
    max-width: 600px;
}

.hc-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.hc-lightbox-close:hover {
    opacity: 0.7;
}

.hc-lightbox-prev,
.hc-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hc-lightbox-prev:hover,
.hc-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hc-lightbox-prev {
    left: -70px;
}

.hc-lightbox-next {
    right: -70px;
}

@media (max-width: 768px) {
    .hc-lightbox-prev {
        left: 10px;
    }
    
    .hc-lightbox-next {
        right: 10px;
    }
    
    .hc-lightbox-close {
        top: 10px;
        right: 10px;
    }
}

/* ==========================================================================
   Animation d'apparition
   ========================================================================== */

.hc-gallery-item {
    opacity: 0;
    animation: hc-fadeIn 0.5s ease forwards;
}

.hc-gallery-item:nth-child(1) { animation-delay: 0.05s; }
.hc-gallery-item:nth-child(2) { animation-delay: 0.1s; }
.hc-gallery-item:nth-child(3) { animation-delay: 0.15s; }
.hc-gallery-item:nth-child(4) { animation-delay: 0.2s; }
.hc-gallery-item:nth-child(5) { animation-delay: 0.25s; }
.hc-gallery-item:nth-child(6) { animation-delay: 0.3s; }
.hc-gallery-item:nth-child(7) { animation-delay: 0.35s; }
.hc-gallery-item:nth-child(8) { animation-delay: 0.4s; }
.hc-gallery-item:nth-child(n+9) { animation-delay: 0.45s; }

@keyframes hc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Placeholder pour l'éditeur Elementor
   ========================================================================== */

.hc-gallery-placeholder {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.hc-gallery-placeholder img {
    opacity: 0.5;
}

/* ==========================================================================
   États d'erreur
   ========================================================================== */

.hc-error {
    text-align: center;
    padding: 30px;
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}
