/* ------------------- */
/* -- SERIES PAGE STYLES -- */
/* ------------------- */

/* This file contains styles for the template series page (e.g., collections/fly-dont-sink/index.html). */

/* Styles for the main content area of the series page. */
.series-page-content {
    padding: 2rem 0 4rem; /* Adds vertical padding. Reduced top padding due to breadcrumb. */
}

/* Container for the series content. */
.series-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- BREADCRUMB NAVIGATION --- */
/* Styles for the breadcrumb navigation link list. */
.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 2rem;
    color: #555;
}

/* Styles for links within the breadcrumb. */
.breadcrumb a {
    color: var(--primary-accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* --- SERIES HEADER --- */
/* A container for the series title and introductory paragraph. */
.series-header {
    text-align: center;
    margin-bottom: 4rem;
}

/* Styles for the main title of the series. */
.series-main-title {
    font-size: 2.8rem;
    color: var(--primary-accent);
    margin-bottom: 1rem;
    font-family: var(--main-font);
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Styles for the introductory paragraph. */
.series-intro-paragraph {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px; /* Constrains the width for readability. */
    margin-left: auto;
    margin-right: auto;
    color: #333;
}

/* --- WORKS GRID --- */
/* The grid container for all individual artworks in the series. */
.works-grid {
    display: grid;
    /* Creates a 3-column grid. 'fr' unit distributes space equally. */
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem; /* Sets the space between grid items. */
}

/* Styles for a single artwork item in the grid. */
.work-item {
    position: relative;
    overflow: hidden; /* Hides overflowing parts of child elements. */
    cursor: pointer; /* Changes the cursor to a pointer to indicate it's clickable. */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Adds a subtle shadow for depth. */
    transition: box-shadow 0.3s ease;
}

.work-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Enhances the shadow on hover. */
}

/* Styles for the artwork image. */
.work-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block; /* Removes any bottom spacing on the image. */
}

/* Container for the artwork's information (title and button). */
/* Info box inside the image container */
.work-info {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    padding: 1rem;
    text-align: center;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 2;
    width: 100%;
    max-width: 100%;
    min-width: 120px;
    opacity: 1;
    pointer-events: auto;
}

/* Styles for the title of the artwork. */
.work-title {
    margin: 0 0 0.75rem 0; /* Adds space below the title. */
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Styles for the "View Details" button. */
.view-details-btn {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--primary-accent);
    text-decoration: none;
    border: 1px solid var(--secondary-accent);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.view-details-btn:hover {
    background-color: var(--primary-accent);
    color: #FFFFFF;
    border-color: var(--primary-accent);
    opacity: 0.8;
}

/* --- LIGHTBOX STYLES --- */
/* This section is cleaned up - using only the improved lightbox styles below */


/* --- RESPONSIVE STYLES FOR SERIES PAGE --- */
/* For tablets. */
@media (max-width: 992px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets. */
    }
}

/* For mobile phones. */
@media (max-width: 576px) {
    .works-grid {
        grid-template-columns: 1fr; /* 1 column on mobile. */
    }

    .series-main-title {
        font-size: 2.2rem;
    }

    .series-intro-paragraph {
        font-size: 1rem;
    }
}

/* --- IMPROVED LIGHTBOX STYLES --- */

.lightbox {
    display: none !important;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox.active {
    display: flex !important;
    opacity: 1 !important;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
}

.lightbox-image {
    position: relative;
    max-width: min(90vw, 100%);
    max-height: 70vh;
    display: block;
    width: auto;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.lightbox-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    overflow: hidden;
    text-align: center;
    position: relative;
    z-index: 1;
}

.lightbox-nav-left,
.lightbox-nav-right {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: #fff;
    border: none;
    font-size: 56px;
    cursor: pointer;
    padding: 0;
    user-select: none;
    z-index: 1002;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    width: 64px;
    outline: none;
}

.lightbox-nav-left {
    left: 24px;
}

.lightbox-nav-right {
    right: 24px;
}

.lightbox-nav-left:hover,
.lightbox-nav-right:hover {
    opacity: 1;
}

/* Special handling for portrait/tall images on mobile devices */
@media (max-width: 768px) and (orientation: portrait) {
    .lightbox-image {
    max-width: calc(100vw - 80px); /* Reduce horizontal space for nav buttons */
    max-height: 70vh; /* Limit image to 70% of viewport height */
    }
    
    .lightbox-image-container {
        max-width: calc(100vw - 80px);
        max-height: calc(100vh - 120px);
    }
}

.lightbox-info-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    min-width: 120px;
    max-width: 220px;
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    padding: 10px 14px;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-image-container:hover .lightbox-info-overlay {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-inquiry-link {
    position: absolute;
    bottom: 0;
    left: 0;
    min-width: 100px;
    max-width: 180px;
    display: inline-block;
    background: rgba(255,255,255,0.95);
    color: #222;
    text-decoration: none;
    border: 1px solid #4A90E2;
    padding: 8px 14px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 2;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
}

.lightbox-image-container:hover .lightbox-inquiry-link {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-inquiry-link:hover {
    background: #4A90E2;
    color: white;
}

.lightbox-info-overlay {
    /* removed duplicate/incorrect always-visible overlay */
}
.lightbox-inquiry-link {
    /* removed duplicate/incorrect always-visible overlay */
}
.lightbox-artwork-medium {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 4px;
}

.lightbox-artwork-size {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 10px;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 1002;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-prev,
    .lightbox-next {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        color: #111;
        border: none;
        font-size: 56px;
        cursor: pointer;
        padding: 0;
        border-radius: 50%;
        transition: color 0.2s, box-shadow 0.2s;
        user-select: none;
        z-index: 1002;
        opacity: 0.7;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
        outline: none;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 64px;
        width: 64px;
        background: none;
        border: 2px solid transparent;
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-prev:hover,
    .lightbox-next:hover {
        color: #000;
        opacity: 1;
        box-shadow: 0 4px 16px rgba(0,0,0,0.18);
        border: 2px solid #000;
}

/* Desktop enhancements for lightbox */
@media (min-width: 1024px) {
    .lightbox-content {
        max-width: 90vw;
        max-height: 90vh;
    }
    
    .lightbox-image {
    max-width: calc(90vw - 140px); /* Account for larger nav buttons */
    max-height: 70vh; /* Limit image to 70% of viewport height on desktop too */
    }
    
    .lightbox-image-container {
        max-width: calc(90vw - 140px);
        max-height: calc(90vh - 140px);
    }
    
    .lightbox-close {
        top: 30px;
        right: 30px;
        width: 45px;
        height: 45px;
        font-size: 30px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 20px;
        font-size: 28px;
    }
    
    .lightbox-prev {
        left: 30px;
    }
    
    .lightbox-next {
        right: 30px;
    }
}

/* Extra large screens */
@media (min-width: 1440px) {
    .lightbox-content {
        max-width: 85vw;
        max-height: 85vh;
    }
    
    .lightbox-image {
        max-width: calc(85vw - 140px);
        max-height: calc(85vh - 140px);
    }
    
    .lightbox-image-container {
        max-width: calc(85vw - 140px);
        max-height: calc(85vh - 140px);
    }
}

/* Mobile adjustments for lightbox */
@media (max-width: 768px) {
    .lightbox {
        padding: 0;
        /* Prevent scrolling on mobile when lightbox is open */
        overflow: hidden;
    }
    
    .lightbox-info-overlay {
        padding: 8px 10px;
        bottom: 0;
        right: 0;
        font-size: 12px;
        min-width: 90px;
        max-width: 160px;
        border-radius: 0;
        opacity: 0;
        pointer-events: none;
    }
    .lightbox-inquiry-link {
        bottom: 0;
        left: 0;
        padding: 6px 10px;
        font-size: 12px;
        min-width: 70px;
        max-width: 120px;
        border-radius: 0;
        opacity: 0;
        pointer-events: none;
    }
    /* Show overlays on tap (when .visible is added by JS) */
    .lightbox-info-overlay.visible,
    .lightbox-inquiry-link.visible {
        opacity: 1;
        pointer-events: auto;
    }
    /* Disable hover effect on mobile */
    .lightbox-image-container:hover .lightbox-info-overlay,
    .lightbox-image-container:hover .lightbox-inquiry-link {
        opacity: 0;
        pointer-events: none;
    }
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 12px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-info-overlay {
        padding: 8px 10px;
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        min-width: 90px;
        max-width: 160px;
        border-radius: 5px;
    }
    .lightbox-inquiry-link {
        bottom: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 12px;
        min-width: 70px;
        max-width: 120px;
        border-radius: 5px;
    }
    /* Show overlays on tap (when .visible is added by JS) */
    .lightbox-info-overlay.visible,
    .lightbox-inquiry-link.visible {
        opacity: 1;
        pointer-events: auto;
    }
    /* Disable hover effect on mobile */
    .lightbox-image-container:hover .lightbox-info-overlay,
    .lightbox-image-container:hover .lightbox-inquiry-link {
        opacity: 0;
        pointer-events: none;
    }
    
    .lightbox-artwork-title {
        font-size: 14px;
        font-style: italic;
    }
    
    .lightbox-artwork-year {
        font-size: 12px;
    }
    
    .lightbox-artwork-medium {
        font-size: 12px;
    }
    
    .lightbox-artwork-size {
        font-size: 12px;
    }
    
    .lightbox-inquiry-link {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* Additional responsive adjustments for very small screens */
@media (max-width: 480px) {
    .lightbox {
        padding: 5px;
    }
    
    .lightbox-content {
        max-width: calc(100vw - 10px);
        max-height: calc(100vh - 10px);
    }
    
    .lightbox-image {
        max-width: calc(100vw - 70px); /* Account for very small nav buttons */
        max-height: calc(100vh - 80px); /* Account for very small close button */
    }
    
    .lightbox-image-container {
        max-width: calc(100vw - 70px);
        max-height: calc(100vh - 80px);
    }
    
    .lightbox-close {
        top: 5px;
        right: 5px;
        font-size: 20px;
        width: 25px;
        height: 25px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 18px;
        padding: 8px;
    }
    
    .lightbox-prev {
        left: 5px;
    }
    
    .lightbox-next {
        right: 5px;
    }
    
    .lightbox-info-overlay {
        padding: 12px;
        max-width: 160px;
        min-width: 140px;
        bottom: 0;
        right: 0;
    }
    
    .lightbox-artwork-title {
        font-size: 13px;
        font-style: italic;
    }
    
    .lightbox-artwork-year {
        font-size: 11px;
    }
    
    .lightbox-artwork-medium {
        font-size: 11px;
    }
    
    .lightbox-artwork-size {
        font-size: 11px;
    }
    
    .lightbox-inquiry-link {
        font-size: 11px;
        padding: 4px 6px;
    }
}

/* Enhanced hover effects for work items */
.work-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer !important;
    position: relative;
    overflow: hidden;
}

.work-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.work-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
    pointer-events: auto;
    pointer-events: none;
}

.work-item:hover::after {
    opacity: 1;
}
