/* =========================================
   EVENTS PAGE - LIVING TIMELINE
   ========================================= */

.living-container {
    position: relative;
    padding-left: 50px;
    padding-right: 20px;
    /* Prevent edge touching */
    max-width: 1000px;
    margin: 0 auto;
}

/* The Main Vertical Line */
.living-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 14px;
    /* Center of the padding area */
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0.2) 90%, transparent);
}

.living-item {
    position: relative;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
}

.living-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

/* The Dot On The Line */
.living-item::before {
    content: '';
    position: absolute;
    left: -40px;
    /* Aligned with line */
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 11px;
    background: var(--bg-body);
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Next Event Highlight */
.living-item.is-next-event {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(187, 10, 10, 0.2);
}

.living-item.is-next-event::before {
    background: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
    transform: translateY(-50%) scale(1.3);
}

.next-event-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.1em;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 5;
    animation: pulseBadge 2s infinite;
}

@media (max-width: 768px) {
    .next-event-badge {
        top: -8px;
        right: 15px;
        padding: 2px 10px;
        font-size: 0.6rem;
    }
}

@keyframes pulseBadge {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(187, 10, 10, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(187, 10, 10, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(187, 10, 10, 0);
    }
}

.living-item:hover::before {
    border-color: var(--accent-red);
    background: var(--accent-red);
    box-shadow: 0 0 15px var(--accent-red);
    transform: translateY(-50%) scale(1.3);
}

/* Background Effect (Video/Gradient) */
.living-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: var(--accent-red);
    /* Fallback/Tint */
    opacity: 0;
    z-index: 0;
    transform: scale(1.1);
    transition: all 0.5s ease;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.living-item:hover .living-bg {
    opacity: 0.15;
    transform: scale(1);
}

/* Past Events - Specific Styling */
.living-item.is-past .living-date {
    opacity: 0.5;
}

.living-item.is-past .living-title {
    color: #ddd;
}

/* Content Layout */
.living-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Mobile Responsive */
/* Mobile Responsive Override */
@media (max-width: 768px) {
    .living-container {
        padding-left: 15px;
        /* Minimal indent */
        padding-right: 15px;
        /* Match indent */
    }

    .living-item {
        padding: 10px 12px;
        /* Very slim padding */
        margin-bottom: 8px;
        /* Tighter vertical stack */
        border-radius: 6px;
    }

    .living-content {
        /* Grid Layout: Date Left | Content Right */
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 2px 12px;
        /* Row gap, Col gap */
        align-items: center;
    }

    /* Date: Spans 2 rows on the left */
    .living-date {
        grid-row: 1 / span 2;
        grid-column: 1;
        font-size: 0.9rem;
        min-width: 45px;
        line-height: 1;
        display: flex;
        /* Ensure vertical center */
        flex-direction: column;
        justify-content: center;
        text-align: center;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        /* Subtle separator */
        padding-right: 10px;
        margin-right: 0;
    }

    .living-date .text-xl {
        font-size: 1.1rem;
    }

    .living-date .text-xs {
        font-size: 0.7rem;
    }

    /* Info: Top Right */
    .living-info {
        grid-row: 1;
        grid-column: 2;
        width: 100%;
    }

    .living-title {
        font-size: 0.95rem;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .living-details {
        font-size: 0.75rem;
        gap: 6px;
    }

    /* Action: Bottom Right */
    .living-action {
        grid-row: 2;
        grid-column: 2;
        transform: none !important;
        opacity: 1 !important;
        margin-left: 0;
        /* Align left with text */
        margin-top: 4px;
        /* Space from details */
        justify-self: start;
        /* Align button to start */
    }

    .living-action .btn {
        padding: 0.3rem 0.8rem !important;
        /* Even smaller button */
        font-size: 0.7rem !important;
        height: auto;
    }

    /* Adjust the dot position */
    .living-item::before {
        left: -21px;
        width: 8px;
        height: 8px;
    }

    .living-container::before {
        left: 8px;
    }

    /* Reveal thumbnail on scroll for mobile */
    .living-item.is-in-view .living-bg {
        opacity: 0.2; /* Slightly higher than desktop hover for better visibility on mobile */
        transform: scale(1);
    }
}


.living-date {
    font-size: 1.5rem;
    font-weight: 300;
    min-width: 80px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.living-item:hover .living-date {
    color: var(--accent-red);
}

.living-info {
    flex: 1;
}

.living-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.living-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.living-action {

    /* Desktop: Hidden until hover */
    @media (min-width: 769px) {
        transform: translateX(20px);
        opacity: 0;
        transition: all 0.3s ease;
    }
}



.living-item:hover .living-action {
    transform: translateX(0);
    opacity: 1;
}

/* =========================================
   MEMORY GRID MODAL
   ========================================= */

#memoryGrid {
    padding: 10px 0;
    /* Use auto-fill for responsive grid without media queries */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.memory-grid-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.memory-grid-item:hover {
    transform: scale(1.02);
    border-color: var(--accent-red);
    z-index: 10;
}

.memory-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.memory-grid-item:hover video {
    opacity: 1;
}

.memory-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.8));
    pointer-events: none;
    transition: transform 0.3s ease;
}

.memory-grid-item:hover .memory-play-icon {
    transform: translate(-50%, -50%) scale(1.2);
    color: var(--accent-red);
}

/* =========================================
   CINEMATIC MEMORY MODAL
   ========================================= */

/* Hero Section */
#memoryHero {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.text-gradient {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Filmstrip */
#memoryFilmstrip {
    display: flex;
    gap: 10px;
    padding-bottom: 10px;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) rgba(255, 255, 255, 0.1);
}

/* Webkit Scrollbar */
#memoryFilmstrip::-webkit-scrollbar {
    height: 6px;
}

#memoryFilmstrip::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#memoryFilmstrip::-webkit-scrollbar-thumb {
    background-color: var(--accent-red);
    border-radius: 3px;
}

/* Filmstrip Items */
.filmstrip-item {
    flex: 0 0 160px;
    /* Fixed width thumbnails */
    height: 90px;
    /* 16:9 approx */
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    /* Default border */
    transition: all 0.2s ease;
    opacity: 0.6;
}

.filmstrip-item:hover {
    transform: scale(1.05);
    opacity: 1;
    z-index: 2;
}

.filmstrip-item.is-active {
    border-color: var(--accent-red);
    opacity: 1;
    transform: scale(1.02);
}

.filmstrip-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   CINEMATIC MODAL OVERRIDES
   ========================================= */

/* Modal Container Content Padding */
#memoryGridModal .modal-content {
    padding: 40px !important;
    width: 95% !important;
    max-width: 1100px !important;
    background: #080808;
    /* Darker bg */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Memory Text */
.memory-text-content {
    white-space: pre-wrap;
    color: #ccc;
    line-height: 1.8;
    text-align: justify;
    padding: 0 40px 20px 40px;
    /* Top padding removed */
    /* Increased vertical padding */
    font-size: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Cinematic Links */
.cinematic-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    /* Larger click area */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 20px;
    /* Lift off the bottom */
}

.cinematic-link:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(187, 10, 10, 0.4);
}

/* Mobile Overrides for Cinematic Modal */
@media (max-width: 768px) {
    #memoryGridModal .modal-content {
        padding: 15px !important;
        width: 95% !important;
    }

    .memory-text-content {
        padding: 0 0 20px 0;
        /* Remove side padding, let container handle it */
    }