/* =============================================
   THE DAY READ - EVENTS GALLERY & MODAL STYLES
   ============================================= */

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.aura-glass {
    background: rgba(254, 249, 242, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-float { animation: float 6s ease-in-out infinite; }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Overrides to ensure old modals and nav still look good */
.history-section { margin-top: 5rem; padding: 2rem; max-width: 1200px; margin-left: auto; margin-right: auto; }
.history-title { font-size: 1.75rem; font-weight: 600; margin-bottom: 1.5rem; border-bottom: 1px solid #e7e5e4; padding-bottom: 1rem; color: #000; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; }
.history-table th, .history-table td { padding: 1rem; border-bottom: 1px solid #e7e5e4; color: #333; white-space: nowrap; }
.history-table th { background: #6ae48400; font-weight: 600; color: #57534e; }

.status-badge { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.85rem; font-weight: 500; }
.status-paid { background: #dcfce7; color: #166534; }
.empty-history { text-align: center; color: #57534e; padding: 3rem; background: #fafafa; border-radius: 12px; }

@media (max-width: 768px) {
    .history-section { padding: 1rem; margin-top: 3rem; }
    .history-title { font-size: 1.5rem; margin-bottom: 1rem; }
    .history-table th, .history-table td { padding: 0.75rem 0.5rem; font-size: 0.875rem; }
}

.logo-container { position: absolute; top: 25px; left: 24px; z-index: 10; }
.site-logo { width: 80px; height: auto; object-fit: contain; }

/* Custom shapes for ticket cutouts */
.ticket-shadow {
    box-shadow: 0 20px 40px -10px rgba(130, 82, 79, 0.15), 0 10px 20px -5px rgba(0, 0, 0, 0.05);
}

/* Adjust profile/login button position since there is no cart icon on events page */
.auth-nav-btn {
    right: calc(var(--nav-padding) + var(--menu-button-size) + 15px) !important;
}
@media (max-width: 768px) {
    .auth-nav-btn {
        right: calc(var(--nav-padding) + var(--menu-button-size) + 10px) !important;
    }
}

/* =============================================
   PEERSPACE MEMORIES SECTION & ORIGINAL ASPECT RATIO MASONRY
   ============================================= */
.memories-section {
    background: #fef9f2;
    padding: 6rem 0;
}
.memories-badge {
    display: inline-block;
    background: rgba(130,82,79,0.10);
    color: #82524f;
    padding: 0.35rem 1.1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    font-family: 'Manrope', sans-serif;
}
.memories-title {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: #1d1b18;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
}
.memories-desc-preview {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.05rem;
    color: #514442;
    max-width: 540px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
    position: relative;
}
.memories-desc-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5rem;
    background: linear-gradient(to bottom, transparent, #fef9f2);
    pointer-events: none;
}
.memories-desc-inner {
    max-height: 4.5em;
    overflow: hidden;
}

/* Explicit 4-Column Grid Layout preserving original aspect ratio & guaranteeing top row alignment */
.memories-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
    max-width: 1150px;
    margin: 0 auto 2.8rem;
    padding: 0 10px;
    text-align: left;
}

.gallery-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

@media (max-width: 900px) {
    .memories-preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}
@media (max-width: 500px) {
    .memories-preview-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.memories-preview-item {
    display: block;
    width: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: #ece7e2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    outline-offset: 4px;
}
@media (max-width: 768px) {
    .memories-preview-item { margin-bottom: 14px; }
}
@media (max-width: 480px) {
    .memories-preview-item { margin-bottom: 12px; }
}

.memories-preview-item:focus-visible {
    outline: 2px solid #82524f;
}
/* Identification Numbering Badge (Hidden for production view) */
.item-number-badge {
    display: none;
}

/* Images & videos keep 100% natural, uncropped original aspect ratio */
.memories-preview-item img,
.memories-preview-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.35s ease;
}
.memories-preview-item:hover img,
.memories-preview-item:hover video {
    transform: scale(1.04);
    filter: brightness(0.90);
}
.memories-preview-item .video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.20);
    border-radius: 16px;
    transition: background 0.3s ease;
}
.memories-preview-item:hover .video-overlay {
    background: rgba(0,0,0,0.35);
}
.play-btn-circle {
    width: 54px;
    height: 54px;
    background: rgba(255,255,255,0.94);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.memories-preview-item:hover .play-btn-circle {
    transform: scale(1.14);
}
.play-btn-circle svg {
    width: 22px;
    height: 22px;
    fill: #82524f;
    margin-left: 3px;
}

/* CTA Button */
.memories-cta-btn {
    display: inline-block;
    background: #82524f;
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1rem 2.6rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 6px 24px rgba(130,82,79,0.28);
    outline-offset: 4px;
}
.memories-cta-btn:focus-visible {
    outline: 2px solid #82524f;
}
.memories-cta-btn:hover {
    background: #6b403d;
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(130,82,79,0.38);
}
.memories-cta-btn:active {
    transform: scale(0.97);
}

/* =============================================
   GALLERY MODAL OVERLAY
   ============================================= */
#galleryModal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
#galleryModal.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.gallery-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18,15,12,0.84);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}
#galleryModal.is-open .gallery-modal-backdrop {
    opacity: 1;
}
.gallery-modal-panel {
    position: relative;
    z-index: 1;
    background: #fef9f2;
    width: 100%;
    max-width: 1060px;
    margin: 40px 20px 60px;
    border-radius: 28px;
    padding: 3rem 2.5rem 4rem;
    box-shadow: 0 40px 100px rgba(0,0,0,0.4);
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.45s ease;
}
#galleryModal.is-open .gallery-modal-panel {
    transform: translateY(0);
    opacity: 1;
}
@media (max-width: 640px) {
    .gallery-modal-panel { padding: 2rem 1.2rem 3rem; margin: 20px 10px 40px; border-radius: 20px; }
}
.gallery-modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 44px;
    height: 44px;
    background: rgba(130,82,79,0.12);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #82524f;
    transition: background 0.2s ease, transform 0.2s ease;
    line-height: 1;
}
.gallery-modal-close:hover {
    background: rgba(130,82,79,0.22);
    transform: scale(1.1);
}
.gallery-modal-event-title {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #1d1b18;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
    padding-right: 3rem;
}
.gallery-modal-event-desc {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 1.05rem;
    color: #514442;
    line-height: 1.75;
    max-width: 700px;
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(130,82,79,0.15);
}

/* Full gallery masonry - Original Aspect Ratio */
.gallery-full-grid {
    column-count: 3;
    column-gap: 16px;
    text-align: left;
}
@media (max-width: 900px) { .gallery-full-grid { column-count: 2; } }
@media (max-width: 480px) { .gallery-full-grid { column-count: 1; } }

.gallery-full-item {
    break-inside: avoid;
    margin-bottom: 16px;
    display: inline-block;
    width: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: #ece7e2;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.3s ease;
    outline-offset: 4px;
}
.gallery-full-item:focus-visible {
    outline: 2px solid #82524f;
}
.gallery-full-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}
.gallery-full-item img,
.gallery-full-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.3s ease;
}
.gallery-full-item:hover img {
    transform: scale(1.035);
    filter: brightness(0.90);
}
.gallery-full-item .video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.20);
    border-radius: 16px;
    transition: background 0.3s ease;
}
.gallery-full-item:hover .video-overlay {
    background: rgba(0,0,0,0.35);
}

/* =============================================
   LIGHTBOX
   ============================================= */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0,0,0,0.94);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#lightbox.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
#lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#lightbox .lb-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}
#lightbox .lb-close:hover { background: rgba(255,255,255,0.28); }

/* =============================================
   IN-MODAL VIDEO PLAYER
   ============================================= */
#videoPlayerModal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0,0,0,0.96);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#videoPlayerModal.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
#videoPlayerModal .vp-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
}
#videoPlayerModal video {
    width: 100%;
    height: auto;
    border-radius: 14px;
    max-height: 85vh;
    object-fit: contain;
    background: #000;
    display: block;
}
#videoPlayerModal .vp-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}
#videoPlayerModal .vp-close:hover { background: rgba(255,255,255,0.28); }
