/**
 * Exhibitions Gallery - Styles
 * Clean, minimal CSS for responsive grid and slide-in panel
 */

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.exhibitions-gallery {
    width: 100%;
    margin: 2rem auto;
}

.exhibitions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Empty state */
.exhibitions-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-size: 1.1rem;
}

/* ==========================================================================
   Exhibition Cards
   ========================================================================== */

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

.exhibition-card:hover,
.exhibition-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.exhibition-card:focus {
    outline-style: solid;
}

/* Image container - always square */
.exhibition-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Creates 1:1 aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.exhibition-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Card content */
.exhibition-content {
    padding: 1.5rem;
}

.exhibition-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
}

.exhibition-excerpt {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
}

.exhibition-excerpt p {
    margin: 0;
}

.exhibition-dates {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.exhibition-dates time {
    font-style: normal;
}

/* ==========================================================================
   Slide-in Panel
   ========================================================================== */

.exhibition-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease;
}

.exhibition-panel.is-active {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.3s ease;
}

/* Overlay */
.exhibition-panel-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Panel content container */
.exhibition-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 600px;
    background: #fff;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.exhibition-panel.is-active .exhibition-panel-content {
    transform: translateX(0);
}

/* Close button */
.exhibition-panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    color: #333;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exhibition-panel-close:hover,
.exhibition-panel-close:focus {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    transform: rotate(90deg);
}

.exhibition-panel-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.exhibition-panel-close span {
    display: block;
    line-height: 1;
}

/* Panel body */
.exhibition-panel-body {
    padding: 2rem;
}

/* Panel image */
.exhibition-panel-image {
    margin: 0 0 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.exhibition-panel-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Panel title */
.exhibition-panel-title {
    margin: 0 0 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
}

/* Panel description */
.exhibition-panel-description {
    margin: 0 0 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.exhibition-panel-description p {
    margin: 0 0 1rem;
}

.exhibition-panel-description p:last-child {
    margin-bottom: 0;
}

/* Panel dates */
.exhibition-panel-dates {
    margin: 0 0 1.5rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
}

.exhibition-panel-dates time {
    font-style: normal;
}

/* Panel maps button */
.exhibition-panel-maps a {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.3s ease, transform 0.2s ease;
}

.exhibition-panel-maps a:hover,
.exhibition-panel-maps a:focus {
    background: #005177;
    transform: translateY(-2px);
}

.exhibition-panel-maps a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.exhibition-panel-maps a::after {
    content: " →";
    margin-left: 0.5rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .exhibitions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .exhibition-panel-content {
        max-width: 500px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .exhibitions-gallery {
        margin: 1rem auto;
    }
    
    .exhibitions-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .exhibition-content {
        padding: 1.25rem;
    }
    
    .exhibition-title {
        font-size: 1.15rem;
    }
    
    .exhibition-panel-content {
        max-width: 100%;
        width: 100%;
    }
    
    .exhibition-panel-body {
        padding: 1.5rem;
    }
    
    .exhibition-panel-title {
        font-size: 1.5rem;
    }
    
    .exhibition-panel-close {
        width: 36px;
        height: 36px;
        font-size: 1.75rem;
    }
}

/* Extra small mobile */
@media (max-width: 400px) {
    .exhibition-content {
        padding: 1rem;
    }
    
    .exhibition-panel-body {
        padding: 1rem;
    }
}

/* ==========================================================================
   Accessibility & Print
   ========================================================================== */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .exhibition-card,
    .exhibition-panel,
    .exhibition-panel-content,
    .exhibition-panel-close,
    .exhibition-panel-maps a {
        transition: none;
    }
}

/* Focus visible support */
.exhibition-card:focus:not(:focus-visible),
.exhibition-panel-close:focus:not(:focus-visible),
.exhibition-panel-maps a:focus:not(:focus-visible) {
    outline: none;
}

/* Print styles */
@media print {
    .exhibition-panel {
        display: none;
    }
    
    .exhibitions-grid {
        grid-template-columns: 1fr;
    }
    
    .exhibition-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
