/* Museum specific styles */

/* Gallery styles */
/* Override section-image constraints for the gallery */
.info-section .section-image .collection-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 20px;
    width: 100%;
    margin-bottom: 30px;
}

/* Override section-image width constraints */
.info-section .section-image {
    flex: 1 1 45% !important;
    max-width: 45% !important;
}

/* Fix layout for collection section specifically */
.info-section .section-content {
    flex: 1 1 55% !important;
    max-width: 55% !important;
}

/* Ensure proper spacing between gallery items */
.info-section .collection-gallery .gallery-item {
    margin-bottom: 0;
}

.gallery-item {
    margin: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.gallery-item a {
    display: block;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* PhotoSwipe caption styling only - letting native PhotoSwipe handle image centering */
.pswp__caption__center {
    text-align: center !important;
}

/* Commented out custom overrides to let PhotoSwipe's native centering work
.pswp__img {
    object-fit: contain;
    max-height: 90vh;
    max-width: 90vw;
    width: auto;
    height: auto;
}

.pswp__zoom-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pswp__container {
    display: flex;
    align-items: center;
    justify-content: center;
}
*/

.gallery-item figcaption {
    padding: 10px 0 5px;
    font-size: 0.9rem;
    color: #555;
    text-align: center;
    font-style: italic;
    display: block;
}

/* PhotoSwipe overrides */
.pswp__caption__center {
    text-align: center;
    max-width: 500px;
    font-size: 14px;
    padding: 10px;
    color: #ddd;
}

/* Hide gallery items with hidden class (but keep them available for PhotoSwipe) */
.gallery-item.hidden {
    display: none;
}

/* Responsive gallery */
@media (max-width: 960px) {
    .collection-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-item img {
        height: 200px; /* Increased from 180px */
    }
}

@media (max-width: 480px) {
    .collection-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* Slightly increased from 10px */
    }
    
    .gallery-item img {
        height: 180px; /* Significantly increased from 140px */
    }
    
    .gallery-item a {
        padding: 5px; /* Reduced padding to allow more space for image */
    }
    
    .gallery-item figcaption {
        font-size: 0.8rem;
    }
}
body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: #f8f8f6;
    margin: 0;
    padding: 0;
}

/* Hero section */
.museum-hero {
    position: relative;
    width: 100%;
    height: 320px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.4)), url('../images/events/new-photos/new5.jpg');
    background-size: cover;
    background-position: center;
}

.hero-title {
    width: 100%;
    padding: 30px 50px 20px;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    color: white;
}

.hero-title h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 2px;
}

/* Content section styling */
.section {
    background: white;
    padding: 0;
    width: 100%;
}

/* List styling - ensure markers align with text */
.info-section .section-content ul,
.info-section .section-content ol {
    padding-left: 1.2em;
    margin-left: 0;
    list-style-position: outside;
}

.info-section .section-content li {
    padding-left: 0.3em;
    margin-bottom: 0.5em;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* Museum intro section */
.section-label {
    color: var(--color-accent);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 10px;
}

.intro-content {
    flex: 1;
}

.intro-content h2 {
    font-size: 2.1rem;
    margin: 15px 0;
}

.intro-content .location {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.intro-content p {
    line-height: 1.6;
    margin-bottom: 20px;
}

.intro-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.intro-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* History section */
.history-section .section-container {
    flex-direction: row-reverse;
}

.history-image {
    flex: 1;
}

.history-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.history-content {
    flex: 1;
}

/* Collection section */
.collection-section .section-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    justify-content: space-between;
}

.collection-text {
    flex: 3;
    margin-bottom: 0;
    max-width: 60%;
    padding-right: 20px;
}

.collection-text h4 {
    font-size: 1.05rem;
    margin: 0 0 15px 0;
    font-weight: 500;
    line-height: 1.4;
    color: #444;
}

.collection-text ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.collection-text li {
    margin-bottom: 10px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* This style is being overridden by the one above */

/* This style is being overridden by the one above */

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    display: block;
}

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

.gallery-item figcaption {
    display: none;
}

/* PhotoSwipe overrides */
.pswp__caption__center {
    text-align: center;
    max-width: 500px;
    font-size: 14px;
    padding: 10px;
    color: #ddd;
}

/* Tours section */
.section.tours-section {
    background-color: #f8f8f6;
    padding: 0;
}

.tours-section .section-container {
    padding: 0;
    max-width: 100%;
    width: 100%;
    gap: 0;
    display: flex;
    min-height: 450px;
}

.tours-content {
    flex: 1;
    padding: 40px;
    width: 50%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.tours-content h3 {
    font-size: 1.5rem;
    color: var(--color-accent);
    margin: 15px 0;
}

.section-label.tours-label {
    color: #666;
    font-weight: 500;
}

.tours-content ul {
    padding-left: 20px;
    margin: 25px 0;
    list-style-type: none;
}

.tours-content li {
    margin-bottom: 12px;
    color: var(--color-text-muted);
    position: relative;
    padding-left: 25px;
    line-height: 1.4;
}

.tours-content li:before {
    content: '';
    width: 8px;
    height: 8px;
    display: inline-block;
    background-color: var(--color-accent);
    position: absolute;
    left: 0;
    top: 7px;
    border-radius: 50%;
}

.tour-contact {
    font-weight: 500;
    margin-top: 20px;
    font-size: 0.95rem;
}

.tours-map {
    flex: 1;
    width: 50%;
    height: 450px;
}

.tours-map iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.tours-map img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Responsive styles */
@media (max-width: 960px) {
    /* Header responsive adjustments */
    .main-header {
        height: auto;
        min-height: 80px;
    }
    
    /* Global mobile styles for consistent single-column layout */
    .section-container {
        flex-direction: column !important;
        padding: 30px 20px;
    }
    
    /* Fix for Tours section - content before map in mobile view */
    .info-section.content-section {
        display: flex;
        flex-direction: column;
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    /* Tours section - reorder elements for mobile */
    /* Target only the Tours section (4th section) */
    main .content-section:nth-of-type(4) .section-image {
        order: 2;
    }
    
    main .content-section:nth-of-type(4) .section-content {
        order: 1;
    }
    
    /* All images and content blocks go full width */
    .intro-content, .history-content, .collection-text,
    .intro-image, .history-image, .collection-gallery,
    .tours-content, .tours-map,
    .section-content, .section-image {
        max-width: 100% !important;
        width: 100% !important;
        flex-basis: 100% !important;
    }
    
    /* Override the previous constraints for section-image and section-content */
    .info-section .section-image,
    .info-section .section-content {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    
    /* Consistent spacing between stacked elements */
    .intro-image, .history-image, .collection-gallery, .section-image {
        margin-top: 30px;
    }
    
    /* Center images in their containers */
    .intro-image, .history-image {
        display: flex;
        justify-content: center;
    }
    
    /* Image sizing */
    .intro-image img, .history-image img {
        max-width: 90%;
    }
    
    /* Collection gallery maintains 2x2 grid */
    .collection-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        row-gap: 15px;
    }
    
    /* Tours section special handling */
    .section.tours-section .section-container {
        padding: 0;
    }
    
    .tours-content {
        max-width: 100%;
        width: 100%;
        padding: 30px 20px;
        order: 1; /* Move content above map */
    }
    
    .tours-section .section-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .tours-content {
        width: 100%;
        max-width: 100%;
        padding: 30px 20px;
    }
    
    .tours-map {
        width: 100%;
        height: 350px;
    }
    
    .tours-map iframe {
        height: 100%;
    }
}

@media (max-width: 600px) {
    /* Hero section adjustments */
    .museum-hero-adapted {
        min-height: 200px;
    }
    
    .hero-title-adapted {
        padding: 20px 20px 15px;
    }
    
    .hero-title-adapted h1 {
        font-size: 1.8rem;
    }
    
    .hero-title-adapted p {
        font-size: 1rem;
        max-width: 100%;
    }
    
    /* Further reduce section padding */
    .section-container {
        padding: 25px 15px;
    }
    
    /* Content sections padding */
    .info-section.content-section {
        padding: 30px 20px;
    }
    
    /* Make section headings smaller */
    .section-content h2 {
        font-size: 1.5rem;
    }
    
    .section-content h3 {
        font-size: 1.3rem;
    }
    
    /* Ensure images are full width */
    .section-image img {
        width: 100%;
        max-width: 100%;
    }
    
    /* Collection gallery adjustments */
    .collection-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .gallery-item img {
        height: 180px; /* Keep the height we set earlier */
    }
}

/* Hide gallery items with hidden class (but keep them available for PhotoSwipe) */
.gallery-item.hidden {
    display: none;
}
