/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 600;
    height: 100vh;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    color: #1a1a1a;
}

/* Menu Styles */
.menu {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    padding: 1.5rem 2rem;
    z-index: 3000; /* Above canvas and everything */
    border-bottom: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none; /* Let clicks pass through to logo */
}

.menu-container {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
    z-index: 3000;
    pointer-events: none; /* Let clicks pass through to logo */
}

.logo-type {
    font-family: "swear-text", serif;
    font-weight: 500;
    font-style: normal;
    line-height: 0.95;
    pointer-events: none; /* Text not clickable */
}

.logo-line-1 {
    font-size: 1.4rem;
    text-align: left;
}

.logo-line-2 {
    font-size: 1.4rem;
    text-align: center;
}

.logo-line-3 {
    font-size: 1.4rem;
    text-align: left;
}

.menu-buttons {
    display: flex;
    gap: 1rem;
    position: relative;
    z-index: 9999; /* HIGHEST z-index to be above everything */
    pointer-events: auto !important; /* Force buttons to be clickable */
}

.menu-btn {
    padding: 0.75rem 1.5rem;
    font-family: "swear-text", serif;
    font-size: 1rem;
    font-weight: 500;
    font-style: normal;
    border: none;
    background: transparent;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    letter-spacing: 0;
    text-transform: none;
    position: relative;
    z-index: 9999; /* HIGHEST z-index */
    pointer-events: auto !important; /* Force clickable */
    -webkit-user-select: none;
    user-select: none;
}

.menu-btn span {
    position: static; /* Needed for pseudo-elements */
}

.menu-btn::before, .menu-btn::after,
.menu-btn span::before, .menu-btn span::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1px solid #1a1a1a;
    transition: all 0.2s ease;
}

/* top-left */
.menu-btn::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 10px 0 0 0;
}
/* top-right */
.menu-btn::after {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 10px 0 0;
}
/* bottom-left */
.menu-btn span::before {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 10px;
}
/* bottom-right */
.menu-btn span::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 10px 0;
}


.menu-btn:hover::before, .menu-btn:hover::after,
.menu-btn:hover span::before, .menu-btn:hover span::after {
    width: 15px;
    height: 15px;
}


.menu-btn:active {
    transform: none;
}

.menu-btn.active {
    color: #1a1a1a;
}

/* Main Visual Area */
.main-visual {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 1; /* Lowest layer */
}

.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: opacity 0.3s ease, filter 0.3s ease;
    pointer-events: none; /* Canvas NEVER captures clicks - only p5 handles internally */
}

.canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: auto; /* p5 can handle its own events */
}

/* Desktop: NO blur/dim effect when popup is active */
body.popup-active .canvas-container {
    pointer-events: none;
}

body.popup-active .canvas-container canvas {
    pointer-events: none;
}

/* Control Panel Styles */
.toggle-panel-btn {
    position: fixed;
    right: 24px;
    bottom: 120px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #1a1a1a;
    border-radius: 5px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 400;
    transition: all 0.3s ease;
    z-index: 2001;
}

.toggle-panel-btn:hover {
    background: #ffffff;
    border-color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.2);
}

.toggle-panel-btn.panel-open {
    right: 344px;
}

.controls {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    overflow-y: auto;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    border-left: 1px solid #e0e0e0;
    z-index: 2001;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    display: none;
}

.controls.collapsed {
    transform: translateX(320px);
}

.controls::-webkit-scrollbar {
    width: 6px;
}

.controls::-webkit-scrollbar-track {
    background: transparent;
}

.controls::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

.controls::-webkit-scrollbar-thumb:hover {
    background: #c0c0c0;
}

.subtitle {
    font-size: 9px;
    color: #666;
    letter-spacing: 0.3px;
    font-weight: 600;
    line-height: 1.4;
}

.section {
    margin-bottom: 32px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 24px;
}

.section:first-child {
    margin-top: 0;
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.text-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    background: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    margin-bottom: 8px;
}

.text-input:focus {
    border-color: #1a1a1a;
}

.text-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.control-group {
    margin-bottom: 20px;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.control-value {
    font-size: 10px;
    color: #666;
    font-weight: 600;
}

.slider {
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    outline: none;
    border: none;
    cursor: pointer;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #1a1a1a;
    cursor: pointer;
    border-radius: 0;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #1a1a1a;
    cursor: pointer;
    border-radius: 0;
    border: none;
}

.color-input {
    width: 100%;
    height: 40px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    background: none;
    appearance: none;
    border-radius: 0;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 0;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #e0e0e0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-switch.active {
    background: #1a1a1a;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    transition: transform 0.2s ease;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.action-btn {
    width: 100%;
    padding: 14px;
    border: 2px solid #1a1a1a;
    background: #1a1a1a;
    color: white;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.action-btn:hover {
    background: white;
    color: #1a1a1a;
}

.action-btn.secondary {
    background: white;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
}

.action-btn.secondary:hover {
    background: #f0f0f0;
}

/* Popup Panels */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    z-index: 5000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 5rem 2rem 2rem 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#pastPanel .popup-content {
    width: 900px;
}

.popup-content {
    width: 600px;
    max-width: 90%;
    max-height: calc(100vh - 12rem);
    background: white;
    border: 1px solid #1a1a1a;
    border-radius: 7px;
    position: relative;
    z-index: 5001;
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0;
    display: flex;
    flex-direction: column;
}

.popup-overlay.active .popup-content {
    transform: translateY(0) scale(1);
}

.popup-inner {
    padding: 2rem 2.5rem 3rem 2.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.popup-inner h2 {
    font-family: "swear-text", serif;
    font-size: 0.85rem;
    font-weight: 500;
    font-style: normal;
    margin-bottom: 1rem;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.popup-inner p {
    font-family: "swear-text", serif;
    font-size: 1rem;
    font-weight: 500;
    font-style: normal;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.popup-inner p.intro-text {
    line-height: 1 !important;
    margin-bottom: 1.5rem;
}

.open-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "swear-text", serif;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0.5rem 0;
    color: #1a1a1a;
    line-height: 1;
}

.open-call-left {
    text-align: left;
}

.open-call-right {
    text-align: right;
}

.exhibition-subtitle {
    text-align: center;
    max-width: 500px;
    margin: 0.5rem auto 2rem auto;
    line-height: 1;
}

.exhibition-title {
    text-align: center;
    font-family: "swear-text", serif;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1;
    margin: 2rem auto 3rem auto;
    color: #1a1a1a;
    max-width: 300px;
}

.exhibition-title div:nth-child(1) {
    text-align: left;
}

.exhibition-title div:nth-child(2) {
    text-align: right;
}

.exhibition-title div:nth-child(3) {
    text-align: center;
}

.about-list {
    list-style: none;
    padding-left: 3rem;
    margin: 1.5rem 0 1.5rem 2rem;
}

.about-list li {
    font-family: "swear-text", serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0;
    color: #1a1a1a;
    position: relative;
    padding-left: 0;
}

.about-list li::before {
    content: "○";
    position: absolute;
    left: -1.5rem;
    font-size: 0.8rem;
}

.about-list li em {
    font-weight: 700;
    font-style: italic;
}

.submission-link {
    color: #1a1a1a;
    text-decoration: underline;
    font-weight: 500;
    display: inline-block;
}

.submission-link:hover {
    text-decoration: none;
}

.email-link {
    color: #1a1a1a;
    text-decoration: underline;
}

.email-link:hover {
    text-decoration: none;
}

.popup-inner p:has(.submission-link) {
    margin-top: 3rem;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.download-btn {
    padding: 0.5rem 1.25rem;
    font-family: "swear-text", serif;
    font-size: 0.85rem;
    font-weight: 500;
    font-style: normal;
    border: none;
    background: transparent;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    letter-spacing: 0;
    text-transform: uppercase;
    position: relative;
    text-decoration: none;
    display: inline-block;
}

.download-btn span {
    position: static;
}

.download-btn::before, .download-btn::after,
.download-btn span::before, .download-btn span::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1px solid #1a1a1a;
    transition: all 0.2s ease;
}

/* top-left */
.download-btn::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 10px 0 0 0;
}
/* top-right */
.download-btn::after {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 10px 0 0;
}
/* bottom-left */
.download-btn span::before {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 10px;
}
/* bottom-right */
.download-btn span::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 10px 0;
}

.download-btn:hover::before, .download-btn:hover::after,
.download-btn:hover span::before, .download-btn:hover span::after {
    width: 15px;
    height: 15px;
}

.download-btn:active {
    transform: none;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid #1a1a1a;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #1a1a1a;
    z-index: 5010;
    font-weight: 300;
    flex-shrink: 0;
}

.close-btn:hover {
    color: #666;
}

/* Gallery Layout */
.gallery-grid {
    margin-top: 2rem;
}

.gallery-main {
    width: 100%;
    aspect-ratio: 4/3;
    background: #e0e0e0;
    border: 1px solid #1a1a1a;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "swear-text", serif;
    font-weight: 500;
    font-style: normal;
    font-size: 1.2rem;
    color: #666;
}

.gallery-nav {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.gallery-nav button {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #1a1a1a;
    border-radius: 5px;
    cursor: pointer;
    font-family: "swear-text", serif;
    font-weight: 500;
    font-style: normal;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.gallery-nav button:hover {
    background: white;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.gallery-thumbnail {
    aspect-ratio: 4/3;
    background: #e0e0e0;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "swear-text", serif;
    font-weight: 500;
    font-style: normal;
    font-size: 0.7rem;
    color: #999;
    transition: all 0.3s ease;
    overflow: hidden;
}

.gallery-thumbnail:hover {
    border-color: #1a1a1a;
    background: #d0d0d0;
}

.gallery-thumbnail.active {
    border-color: #1a1a1a;
    border-width: 2px;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.gallery-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 7px;
    transition: border-radius 0.3s ease;
}

.gallery-main-image:hover img {
    border-radius: 7px 7px 0 0;
}

/* Gallery aspect ratio variations */
.gallery-main.ratio-4-3 {
    aspect-ratio: 4/3;
}

.gallery-main.ratio-vertical {
    aspect-ratio: 3/4;
}

/* Gallery Navigation Buttons */
.gallery-nav-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #1a1a1a;
    border-radius: 3px;
    cursor: pointer;
    font-family: "swear-text", serif;
    font-weight: 500;
    font-size: 1rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.2);
}

.gallery-nav-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-nav-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Gallery Caption */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    padding: 2rem 1.5rem;
    border-top: 1px solid #1a1a1a;
    border-radius: 0 0 7px 7px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-main-image:hover .gallery-caption {
    transform: translateY(0);
}

.caption-content {
    font-family: "swear-text", serif;
    font-weight: 500;
    font-style: normal;
}

.caption-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    line-height: 1.1;
    border-bottom: 1px solid #1a1a1a;
    color: #1a1a1a;
}

.caption-location-date {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.25rem;
    font-size: 0.85rem;
    color: #1a1a1a;
    line-height: 1.2;
}

.caption-location {
    flex: 1;
    font-style: italic;
}

.caption-date {
    flex-shrink: 0;
    font-style: italic;
}

.caption-details {
    font-size: 0.75rem;
    line-height: 1.3;
    color: #1a1a1a;
    max-width: 100%;
}

.caption-details.narrow-details {
    max-width: 70%;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    padding: 1.5rem 2rem;
    z-index: 3000; /* Above canvas */
    pointer-events: none;
}

.footer .sponsors,
.footer .sponsor-item,
.footer .sponsor-logo,
.footer .sponsor-divider {
    pointer-events: auto;
}

.sponsors {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
    width: 100%;
    animation: none;
}

.sponsor-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Hide duplicate logos on desktop (show first 3, hide duplicates 4-6) */
.sponsor-item:nth-child(n+4) {
    display: none;
}

.sponsor-logo {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    padding-right: 0.25rem;
}

.sponsor-logo img {
    max-height: 70px;
    max-width: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sponsor-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sponsor-logo.dual-logo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.sponsor-logo.dual-logo img {
    max-height: 70px;
    max-width: 110px;
}

/* Bigger sizing for specific logos */
.sponsor-logo.dual-logo img[src*="eth_logo_kurz_pos"] {
    max-height: 120px;
    max-width: 180px;
}

.sponsor-logo img[src*="Bezalel-logo"] {
    max-height: 145px;
    max-width: 300px;
}

.sponsor-divider {
    width: 1px;
    height: 70px;
    background: #1a1a1a;
    flex-shrink: 0;
}

/* Mobile handle for panel */
.controls::before {
    content: '';
    display: none;
}

/* Responsive Design */
@media screen and (max-width: 768px), (max-device-width: 768px) {
    /* Mobile ONLY: Blur and dim canvas when popup is active */
    body.popup-active .canvas-container {
        opacity: 0.15 !important;
        filter: blur(3px) !important;
    }
    
    .menu {
        padding: 0.75rem 1rem;
        z-index: 3000;
        pointer-events: none;
    }

    .menu-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
        z-index: 3000;
        pointer-events: none;
    }
    
    .logo-type {
        flex: 0 0 auto !important;
        max-width: 50% !important;
    }
    
    .menu-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
        flex: 0 0 auto;
        z-index: 9999 !important; /* HIGHEST on mobile */
        pointer-events: auto !important;
    }

    .menu-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: auto;
        white-space: nowrap;
        display: block;
        min-height: 44px;
        min-width: 44px;
        z-index: 9999 !important;
        pointer-events: auto !important;
        background: rgba(255, 255, 255, 0.95); /* Add visible background on mobile */
    }

    .controls::before {
        display: block;
        width: 40px;
        height: 4px;
        background: #e0e0e0;
        border-radius: 2px;
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .controls {
        width: 100%;
        height: auto;
        max-height: 70vh;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        padding: 28px 20px 20px;
        transform: translateY(0);
        border-radius: 16px 16px 0 0;
    }
    
    .controls.collapsed {
        transform: translateY(100%);
    }
    
    .toggle-panel-btn {
        right: 24px;
        bottom: 120px;
        width: 56px;
        height: 56px;
        font-size: 24px;
        border-radius: 50%;
    }
    
    .text-input {
        font-size: 16px;
        padding: 14px;
    }
    
    .control-group {
        margin-bottom: 24px;
    }
    
    .section {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    
    .action-btn {
        padding: 16px;
        font-size: 12px;
    }
    
    .popup-inner {
        padding: 2rem 1.5rem;
    }
    
    .popup-inner h2 {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .popup-inner p {
        font-size: 0.95rem;
    }
    
    .open-call-header {
        font-size: 1.8rem;
    }
    
    .exhibition-subtitle {
        max-width: 90%;
    }
    
    .exhibition-title {
        font-size: 1.8rem;
        margin: 2rem auto;
        max-width: 85%;
    }
    
    .about-list {
        margin-left: 1rem;
        padding-left: 2rem;
    }
    
    .about-list li {
        font-size: 0.95rem;
    }
    
    .download-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .download-btn {
        width: 100%;
        text-align: center;
        padding: 0.65rem 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer {
        padding: 1rem 0;
        overflow: hidden;
    }
    
    .sponsors {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 2rem;
        width: max-content;
        animation: marquee 20s linear infinite;
        padding: 0 1rem;
    }
    
    @keyframes marquee {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(-50%);
        }
    }
    
    .sponsor-item {
        gap: 2rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    
    /* Show all logos on mobile for marquee (including duplicates 4-6 for infinite loop) */
    .sponsor-item:nth-child(n+4) {
        display: flex !important;
    }
    
    .sponsor-logo {
        height: 60px;
        padding-right: 0;
        width: auto;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .sponsor-logo img {
        max-height: 60px;
        width: auto;
        height: 60px;
        object-fit: contain;
    }
    
    .sponsor-logo.dual-logo {
        gap: 1rem;
        justify-content: center;
        display: flex;
    }
    
    .sponsor-logo.dual-logo img {
        max-height: 60px;
        height: 60px;
        width: auto;
    }
    
    .sponsor-divider {
        height: 60px;
        flex-shrink: 0;
    }
    
    .popup-overlay {
        padding: 0;
        align-items: flex-start;
        padding-top: 80px;
        z-index: 5000;
        display: flex;
        justify-content: center;
    }
    
    .popup-overlay.active {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }
    
    .popup-content {
        width: calc(100% - 2rem);
        max-width: calc(100% - 2rem);
        margin: 0 1rem;
        max-height: calc(100vh - 100px);
        position: relative;
        z-index: 5001;
    }
    
    .popup-inner {
        padding: 2rem 1.5rem;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .close-btn {
        position: absolute !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 5002 !important; /* Above popup content */
        pointer-events: auto !important; /* Always clickable */
        touch-action: manipulation !important;
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    /* Smaller caption text for mobile to prevent cutoff */
    .gallery-caption {
        padding: 1.25rem 1rem;
    }
    
    .caption-title {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .caption-location-date {
        font-size: 0.7rem;
        margin-bottom: 1.5rem;
    }
    
    .caption-details {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    /* Make gallery image slightly taller on mobile for better caption fit */
    .gallery-main {
        aspect-ratio: 3/4;
    }
    
    .gallery-main.ratio-4-3 {
        aspect-ratio: 3/4;
    }
    
    .gallery-main.ratio-vertical {
        aspect-ratio: 2/3;
    }
}

@media screen and (max-width: 480px), (max-device-width: 480px) {
    .controls {
        max-height: 75vh;
    }
    
    .toggle-panel-btn.panel-open {
        bottom: calc(75vh - 44px);
    }
    
    .popup-content {
        width: calc(100% - 1.5rem);
        margin: 0 0.75rem;
    }
    
    .close-btn {
        width: 44px;
        height: 44px;
        font-size: 24px;
        top: 1rem;
        right: 1rem;
    }
    
    .logo-type {
        font-size: 1.3rem;
        line-height: 1.2;
    }
    
    .logo-type .logo-line-1,
    .logo-type .logo-line-2,
    .logo-type .logo-line-3 {
        font-size: 1.3rem;
    }
    
    .menu-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 0.75rem 0;
    }
    
    .sponsors {
        gap: 1.5rem;
        animation: marquee 18s linear infinite;
    }
    
    .sponsor-item {
        gap: 1.5rem;
    }
    
    .sponsor-logo {
        height: 50px;
    }
    
    .sponsor-logo img {
        max-height: 50px;
        height: 50px;
    }
    
    .sponsor-logo.dual-logo img {
        max-height: 50px;
        height: 50px;
    }
    
    .sponsor-divider {
        height: 50px;
    }
    
    .open-call-header {
        font-size: 1.5rem;
    }
    
    .exhibition-title {
        font-size: 1.5rem;
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Even smaller for very small screens */
    .caption-title {
        font-size: 0.75rem;
    }
    
    .caption-location-date {
        font-size: 0.65rem;
        margin-bottom: 1rem;
    }
    
    .caption-details {
        font-size: 0.6rem;
    }
}

