/* Producteurs Page Specific Styles */

/* Prevent any horizontal overflow on mobile devices */
.producers-grid,
.producer-card,
.producer-content,
.producer-images-grid,
.producer-image-wrapper {
    min-width: 0;
}

/* Make images safe: never exceed their container and preserve aspect ratio */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Producers Section */
.producers-section {
    padding: 3rem 2rem 5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.intro-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    color: var(--dark);
}

.producers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.producer-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.producer-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.producer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* images grid: always 3 columns (left->right), fixed row height to keep cards consistent */
.producer-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
    gap: 2px;
    background: #f0f0f0;
    width: 100%;
}

.producer-image-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--cream);
    cursor: pointer;
}

.producer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
    max-width: 100%;
}

/* Position winemaker photos to show faces (3rd image in grid) */
.producer-image-wrapper:nth-child(3) .producer-image {
    object-position: center top;
}

.producer-card:hover .producer-image {
    transform: scale(1.1);
}

.producer-image.placeholder {
    background: linear-gradient(135deg, var(--wine-light), var(--wine-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--cream);
}

.producer-image.placeholder:nth-child(2) {
    background: linear-gradient(135deg, var(--wine-dark), var(--dark));
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 1rem;
    color: white;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.producer-card:hover .image-overlay {
    opacity: 1;
}

.producer-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.producer-name {
    font-size: 1.3rem;
    color: var(--wine-dark);
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.producer-appellation {
    font-size: 0.85rem;
    color: var(--wine-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
}

.producer-domain {
    font-size: 0.9rem;
    color: var(--gold);
    font-style: italic;
    margin-bottom: 0.8rem;
}

.producer-website {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--wine-dark);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    background: var(--cream);
    border-radius: 5px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    align-self: flex-start;
    word-break: break-word;
}

.producer-website:hover {
    background: var(--wine-dark);
    color: var(--cream);
    border-color: var(--gold);
}

.producer-website::before {
    content: "🌐";
    font-size: 1rem;
}

.producer-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--dark);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.producer-specialties {
    background: var(--cream);
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 3px solid var(--wine-dark);
    margin-top: auto;
}

.producer-specialties h4 {
    color: var(--wine-dark);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.producer-specialties ul {
    margin-left: 1.2rem;
    color: var(--dark);
}

.producer-specialties li {
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
}

/* Modal/Lightbox Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--cream);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--gold);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cream);
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    transition: color 0.3s ease;
}

.modal-nav:hover {
    color: var(--gold);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--cream);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .producers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .producers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .producer-images-grid {
        grid-auto-rows: 150px;
    }
}

@media (max-width: 480px) {
    .producers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .producer-images-grid {
        grid-auto-rows: 120px;
    }

    .producer-info {
        padding: 1.5rem;
    }

    .producer-name {
        font-size: 1.2rem;
    }
}
