/* Events Specific Styles */
.events-grid {
    display: grid; /* Switched to CSS Grid */
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 40px; /* Keep gap */
    padding: 20px 0;
}

.events-card {
    background-position: center;
    background-size: cover; /* Added: Ensures image covers the whole card */
    background-repeat: no-repeat; /* Added: Prevents tiling */
    background-image: url(/img/textures/white_flame_12.jpg); /* Added: New universal texture fallback */
    filter: grayscale(100%) opacity(0.75);
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 200px; /* Ensure consistent height for items */
    position: relative; /* ADDED: For ::before positioning */
    overflow: hidden; /* ADDED: To contain ::before */
    border-color: var(--border-color);
}

.events-card:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); 
    transform: translateY(-5px);
    filter: grayscale(0%) opacity(1); 
}

.events-card > * {
    position: relative;
    z-index: 2; /* Ensures content is always on top of the scrim (z-index: 1) */
}

.events-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75); 
    z-index: 1; 
    transition: background-color 0.3s ease;
}

.events-card:hover::before {
    background-color: transparent; /* Scrim disappears on hover */
}

/* --- NEW / MODIFIED LAYOUT STYLES --- */

/* Target the featured event card (which is dynamically generated with class `featured-event` in events.js) */
.events-card.featured-event {
    /* Span the featured card across both columns to sit at the top */
    grid-column: 1 / span 2;
    min-height: 350px; /* Give the featured card more prominence/height */
}

.events-card:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); 
    filter: none; /* Removed: Keep the grayscale filter for a more noir aesthetic */
    transform: scale(1.02); /* Slight scale on hover */
    z-index: 10;
}

.events-card .cta-link {
    color: white; 
    padding: 0px 8px 0px 8px;
    border: 1px dotted var(--font-family-header);
    background-color: rgba(0, 0, 0, 0.3); /* ADDED: Semi-transparent black background */
    box-shadow: 1px 1px #aaaaaa;
}

.events-card .cta-link:hover {
    color: white; 
    padding: 0px 8px 0px 8px;
    border: 1px dotted var(--font-family-header);
    background-color: rgba(0, 0, 0, 0.8); /* ADDED: Semi-transparent black background */
    backdrop-filter: blur(4px); 
    box-shadow: 1px 1px #aaaaaa;
}

.event-title {
    color: white;
    font-family: var(--font-family-header);
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 1px 1px #aaaaaa;
}

.event-meta {
    color: white;
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 15px;

    border: 1px dotted var(--font-family-header);
    padding: 8px; /* ADDED: Padding inside the border */
    background-color: rgba(0, 0, 0, 0.3); /* ADDED: Semi-transparent black background */
    backdrop-filter: blur(4px); 
    box-shadow: 1px 1px #aaaaaa;
}

.event-description {
    color: white;
    font-size: 0.95em;
    margin-bottom: 15px;

    border: 1px dotted var(--font-family-header);
    padding: 8px; /* ADDED: Padding inside the border */
    background-color: rgba(0, 0, 0, 0.3); /* ADDED: Semi-transparent black background */
    backdrop-filter: blur(4px); 
    box-shadow: 1px 1px #aaaaaa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr 1fr; /* Stack columns on smaller screens */
        gap: 30px;
    }
    .events-card {
        min-height: 250px; /* NEW: Set a more robust minimum height for mobile */
        height: auto; /* Allow height to adjust based on content */
    }
    .events-card .event-description {
        display: none; 
    }
    .events-card.no-image .event-description {
        display: block; /* Show description if no background image is present */
    }
    .event-title {
        font-size: 1.3em;
    }
}

/* Landscape/Portrait adaptation (subtle changes) - Consistent with Société il Noir homepage */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Adjustments for very narrow landscape views (e.g., small phones held sideways) */
    .events-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    /* FIX: Corrected selector from .event-card to .events-card */
    .events-card { 
        min-height: 300px; /* Adjust height for smaller landscape items */
    }
    .event-image-placeholder {
        height: 150px;
    }
    .container { padding: 10px; }
    /* Adjust nav links for very narrow landscape */
    .header-nav {
        flex-direction: row; /* Keep horizontal in landscape */
        gap: 15px;
        margin-top: 0;
        margin-bottom: 0;
    }
}

@media screen and (orientation: portrait) and (max-width: 500px) {
    /* Specific adjustments for smaller portrait views */
    .events-grid {
        gap: 20px;
    }
    .events-card {
        padding: 15px;
    }
    .event-title {
        font-size: 1em;
    }
}

