/* CSS Variables & Reset */
:root {
    --primary-color: #003366;
    /* Navy Blue - Smart/Trustworthy */
    --secondary-color: #f4f7f6;
    /* Very light grey/blue ish background */
    --accent-color: #0099cc;
    /* Brighter blue for actions */
    --text-main: #333333;
    --text-sub: #666666;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --font-family: 'Noto Sans JP', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Header */
header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo h1 {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
}

.header-subtitle {
    font-size: 0.85rem;
    color: var(--text-sub);
    border-left: 1px solid var(--border-color);
    padding-left: 1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #002244);
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Controls Section */
.controls {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

/* Day Tabs */
/* Tabs Container */
#day-tabs,
.tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    overflow-x: auto;
    /* Fallback for very small screens without wrap */
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-sub);
    cursor: pointer;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s;
    white-space: nowrap;
    /* Prevent text wrap inside button */
}

.tab-btn:after {
    content: '';
    position: absolute;
    bottom: -1rem;
    /* Match parent padding-bottom */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active:after {
    transform: scaleX(1);
}

/* Presentation List Container (for overlay positioning) */
#presentation-list {
    position: relative;
    min-height: 200px;
}

/* Coming Soon Overlay */
.coming-soon-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius);
    backdrop-filter: blur(2px);
}

.coming-soon-content {
    text-align: center;
    color: var(--text-sub);
    font-weight: 700;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem 4rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px dashed #ccc;
}

/* Mobile Adjustments for Tabs */
@media (max-width: 600px) {

    #day-tabs,
    .tabs {
        flex-wrap: wrap;
        /* Allow wrapping */
        gap: 0.5rem;
        /* Smaller gap */
        justify-content: center;
        /* Align left or modify as needed */
        border-bottom: none;
        /* remove bottom border on wrapper if buttons have borders, or keep */
    }

    .tab-btn {
        flex: 1 1 45%;
        /* 2 items per row approx */
        text-align: center;
        border-bottom: 2px solid transparent;
        /* individual borders */
        padding: 0.8rem 0.5rem;
        background: #f5f5f5;
        /* Slight background for touch target */
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }

    .tab-btn:after {
        display: none;
        /* Hide the underline effect on mobile for button-like appearance */
    }

    .tab-btn.active {
        background: var(--primary-color);
        color: white;
        border-bottom-color: var(--primary-color);
    }
}

/* Schedule Image Container */
.schedule-image-container {
    width: 100%;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.schedule-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Updated Card Styles */
.venue-badge {
    /* margin-bottom removed for correct flex alignment */
    position: relative;
}

.search-bar {
    margin-bottom: 1.5rem;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--white);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-sub);
}

.filter-chip:hover {
    background-color: #f0f0f0;
}

.filter-chip.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

#result-count {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-sub);
    text-align: right;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
    /* Added Side Padding */
}

/* Card Style */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Featured Card (Full Width) */
.card-featured {
    grid-column: 1 / -1;
    /* 全幅表示 */
    border: 2px solid var(--accent-color);
    /* 強調ボーダー */
    background-color: #fff;
}

/* Featured card layout adjustments for larger screens */
@media (min-width: 768px) {
    .card-featured .card-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

.card-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.header-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.card-header>.badge {
    align-self: flex-end;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Venue Badge */
.venue-badge {
    background-color: var(--text-main);
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin-right: auto;
    /* Push others to right if needed */
}

.cat-default {
    background-color: #e3f2fd;
    color: #1565c0;
}

.type-badge {
    background-color: #f5f5f5;
    color: #616161;
}

.card-body {
    padding: 0 0.8rem 0.8rem 0.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.time-slot {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--text-main);
    line-height: 1.4;
}

.card-speaker {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    /* ボタンとの間に余白を確保 */
}

.tag {
    font-size: 0.8rem;
    color: var(--text-sub);
    background-color: #f5f5f5;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Buttons and Actions */
.card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: auto;
    /* 下端に固定 */
    padding-top: 1rem;
    /* 最小限の余白 */
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #002244;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: #e3f2fd;
}

.btn-material {
    background-color: var(--white);
    color: #cc7a7a;
    border: 1px solid #cc7a7a;
}

.btn-material:hover {
    background-color: #cc7a7a;
    color: var(--white);
}

.btn-youtube {
    color: #cc0000;
    border: 1px solid #cc0000;
}

.btn-youtube:hover {
    background-color: #ffebee;
}

.btn-survey {
    color: #ff8c00;
    /* Dark Orange */
    border: 1px solid #ff8c00;
}

.btn-survey:hover {
    background-color: #fff3e0;
    /* Light Orange */
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 2rem;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-sub);
    background: none;
    border: none;
}

.modal-header-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-time {
    margin-left: auto;
    color: var(--accent-color);
    font-weight: 600;
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.modal-speaker {
    font-size: 1rem;
    color: var(--text-main);
}

.modal-content hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.modal-description h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--text-sub);
}

.modal-description p {
    margin-bottom: 1.5rem;
}

.modal-tags {
    display: flex;
    gap: 0.5rem;
}

/* Video Container for Modal */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    background-color: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.btn-survey {
    background-color: var(--white);
    color: #69a67b;
    border: 1px solid #69a67b;
}

.btn-survey:hover {
    background-color: #69a67b;
    color: var(--white);
}

.btn-question {
    background-color: var(--white);
    color: #6b8eb5;
    border: 1px solid #6b8eb5;
}

.btn-question:hover {
    background-color: #6b8eb5;
    color: var(--white);
}

.material-badge {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85em;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid;
    line-height: 1.2;
    width: fit-content;
}

.material-badge.available {
    color: var(--white);
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.material-badge.unavailable {
    color: #999;
    background-color: transparent;
    border-color: #ddd;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .header-logo h1 {
        font-size: 1.1rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    /* タブボタンのモバイル対応 */
    .tabs {
        gap: 0.5rem;
    }

    .tab-btn {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        min-width: 90px;
        white-space: nowrap;
    }
}

/* Sub-Schedule Responsive Styles */
.sub-schedule-item {
    display: flex;
    gap: 1.5rem;
    padding: 0.8rem 0;
    border-bottom: 1px dashed #ddd;
    font-size: 0.95rem;
    align-items: flex-start;
}

.sub-schedule-time-col {
    width: 130px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sub-time {
    font-weight: 700;
    color: #555;
}

.sub-label {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.sub-schedule-content-col {
    flex-grow: 1;
}

.sub-title {
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    font-size: 1rem;
}

.sub-title.special,
.sub-title.advice {
    font-weight: 700;
    color: var(--primary-color);
}

.sub-speaker {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.3rem;
    line-height: 1.4;
}

.modal-close-btn-bottom {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-top: 2rem;
    background-color: #f0f0f0;
    color: #333;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-ondemand {
    background-color: #ffffff;
    color: #2e7d32;
    /* Dark Green */
    border: 1px solid #2e7d32;
    /* Dark Green Border */
}

.btn-ondemand:hover {
    background-color: #e8f5e9;
    /* Light Green Hover */
}

.modal-close-btn-bottom:hover {
    background-color: #e0e0e0;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .sub-schedule-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .sub-schedule-time-col {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        background: #f0f4f8;
        padding: 0.3rem 0.5rem;
        border-radius: 4px;
    }

    .sub-label {
        font-size: 0.95rem;
        /* Make label slightly larger on mobile */
    }

    .sub-schedule-content-col {
        padding-left: 0.5rem;
    }

    .modal-content {
        padding: 1rem;
        width: 95%;
        max-height: 95vh;
    }

    .close-modal {
        top: 0.5rem;
        right: 0.8rem;
    }
}

/* Venue Badge Updates */
a.venue-badge {
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: inherit;
}

a.venue-badge:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Venue Colors (Softer/Pastel Theme) */
.venue-seminar {
    background-color: #ffebee;
    /* Light Red */
    color: #c62828 !important;
    /* Dark Red Text */
    border: 1px solid #ffcdd2;
}

.venue-hall {
    background-color: #e3f2fd;
    /* Light Blue */
    color: #1565c0 !important;
    /* Dark Blue Text */
    border: 1px solid #bbdefb;
}

.venue-room1 {
    background-color: #e8f5e9;
    /* Light Green */
    color: #2e7d32 !important;
    /* Dark Green Text */
    border: 1px solid #c8e6c9;
}

.venue-room2 {
    background-color: #fff3e0;
    /* Light Orange */
    color: #ef6c00 !important;
    /* Dark Orange Text */
    border: 1px solid #ffe0b2;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-sub);
    font-size: 1.1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px dashed var(--border-color);
}

/* Schedule Image Wrapper & Overlay */
.schedule-image-container {
    cursor: pointer;
    overflow: hidden;
}

.schedule-img-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.schedule-img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease-in-out;
    /* Smooth transition for image switch */
}

/* Fade Effect Classes */
.fade-out {
    opacity: 0.5;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 51, 102, 0.4);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
    pointer-events: none;
    /* Let clicks pass through to wrapper/img */
}

.img-overlay i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.img-overlay span {
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.schedule-img-wrapper:hover .img-overlay {
    opacity: 1;
}

/* Lightbox Modal */
/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Initially hidden, JS will toggle display flex/none */
.lightbox-modal[style*="display: block"] {
    display: flex !important;
}

.lightbox-content-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease;
    cursor: zoom-in;
    /* デフォルトで拡大可能を示す */
}

.lightbox-content.zoomed-1 {
    transform: scale(1.5);
    cursor: zoom-in;
    /* さらに拡大可能 */
    transition: transform 0.25s ease;
}

.lightbox-content.zoomed-2 {
    transform: scale(3.0);
    cursor: grab;
    /* パンニング可能 */
    transition: none;
    /* パンニング時はスムーズに */
}

.lightbox-content:not(.zoomed-1):not(.zoomed-2) {
    cursor: zoom-in;
}

#lightbox-caption {
    margin-top: 1rem;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    max-width: 800px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.lightbox-index {
    color: #ccc;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
    transition: all 0.2s;

    /* Visibility improvements */
    background: rgba(0, 0, 0, 0.6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover,
.lightbox-close:focus {
    background: var(--accent-color);
    color: #fff;
    transform: scale(1.1);
}

/* Navigation Buttons */
.lightbox-nav {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2010;
}

.lightbox-nav:hover {
    color: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}




@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .lightbox-nav.prev {
        left: 5px;
    }

    .lightbox-nav.next {
        right: 5px;
    }

    .lightbox-content {
        max-width: 95%;
    }
}



/* On-Demand Thumbnail Overlay */
.od-thumbnail-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.od-label-overlay {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 51, 102, 0.8);
    /* Primary color with opacity */
    color: #fff;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-top-left-radius: 4px;
    border-bottom-right-radius: 4px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.od-thumbnail-wrapper:hover .od-label-overlay {
    background: rgba(0, 51, 102, 1);
}

/* Gallery Grid Styles (Moved to end for safety) */
.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.gallery-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.gallery-thumb-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: #fff;
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Gallery Info Styles (Configurable) */
.gallery-info {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.gallery-desc {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Special Needs Exhibition Styles */
/* .sp-container removed for flat design */

.sp-header {
    margin-bottom: 2rem;
    text-align: center;
}

.sp-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.sp-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: left;
    max-width: 800px;
    /* Readability limit */
    margin-left: auto;
    margin-right: auto;
}

/* Video Wrapper */
.sp-video-wrapper {
    max-width: 800px;
    margin: 0 auto 3rem auto;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: #000;
}

.sp-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Table Styles */
.sp-table-container {
    overflow-x: auto;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    /* Ensure table has background */
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.sp-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    font-size: 0.95rem;
}

.sp-table th,
.sp-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.sp-table th {
    background-color: #e8eaf6;
    /* Light Indigo */
    color: var(--primary-color);
    font-weight: 700;
    white-space: nowrap;
}

.sp-table tr:hover {
    background-color: #f5f5f5;
}

.sp-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* Mobile Adjustments for Table */
@media (max-width: 600px) {

    .sp-table th,
    .sp-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .sp-description {
        font-size: 0.9rem;
    }
}

/* Materials Modal Grid */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.material-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.material-item:hover {
    transform: translateY(-4px);
}

.material-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: #eee;
}

.material-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.material-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.material-item:hover .material-overlay {
    opacity: 1;
}

.material-info {
    text-align: left;
}

.material-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.material-type {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 700;
}

/* Lightbox Video Container */
.lightbox-video-container {
    width: 90vw;
    /* Use mostly full width */
    max-width: 1200px;
    /* Optional cap for very large screens if desired, or remove */
    aspect-ratio: 16 / 9;
    max-height: 80vh;
    /* Prevent overflowing height */
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-video-container iframe,
.lightbox-video-container video {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}