/*
  _events.css: Updated to match the "Matches" card layout style.
*/

/* ⚡️ CLEANUP: Layout is handled by .homepage-layout */
.main-content-wrapper.events-listing-page {
    /* Styles inherited from homepage-layout */
}

/* --- 1. BASE GRID STYLES --- */
.events-list {
    margin-bottom: 4rem;
}

.events-list h2 {
    font-family: var(--font-heading);
    border-bottom: 2px solid var(--color-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.events-grid {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

/* --- 2. CARD STYLES (MATCHING MATCHES.CSS) --- */
.event-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.event-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* IMAGE AREA */
.event-card-image {
    width: 100%;
    height: 180px; /* Consistent height with Match cards */
    
    /* 'cover' is better for event photos than 'contain' */
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    
    background-color: var(--color-process-black); 
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-grey);
    border-bottom: 1px solid var(--color-light);
}

.event-card-image span {
    color: var(--color-white);
    font-weight: 600;
    padding: 1rem;
    text-align: center;
}

/* Grayscale for past events */
.event-card-image.grayscale {
    filter: grayscale(100%);
    opacity: 0.8;
}

/* CONTENT AREA - CENTERED */
.event-card-content {
    padding: 1.5rem;
    text-align: center; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

/* TITLE */
.event-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-process-black);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* DATE */
.event-meta-date {
    font-size: 0.85rem;
    color: var(--color-primary-red);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* LOCATION PILL */
.event-location-pill {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--color-mh-light-grey);
    border-radius: 4px;
    margin-bottom: 1rem;
    align-self: center; /* Ensures the pill stays centered */
    font-size: 0.9rem;
    color: var(--color-process-black);
    font-weight: 600;
}

/* EXCERPT */
.event-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-grey);
    margin-top: auto;
}

.event-excerpt .read-more {
    display: block; 
    margin-top: 0.5rem;
    color: var(--color-primary-red);
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- 3. FEATURED/IMPORTANT STYLES --- */
.important-flag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--color-primary-red);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 2;
}

.event-card.important-feature {
    border-color: var(--color-primary-red);
    border-width: 2px;
}

/* --- 4. DETAIL PAGE STYLES --- */

/* --- 5. RESPONSIVE GRID MEDIA QUERIES --- */
@media (min-width: 48em) {
    .events-list ul.events-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 64em) {
    .events-list ul.events-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
/* --- Event cards: readable text, tags --- */
.event-excerpt,
.event-card-location {
    color: #4a4a4a; /* was --color-grey: 2.3:1 on the white card */
}

.event-card-location {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.5rem;
}

.badge-cancelled {
    background-color: #3a3a3a;
}

/* --- Event detail page --- */
.event-detail-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-white);
    margin: 0 0 1rem;
}

.event-notice {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-grey);
    background-color: var(--color-mh-dark-grey);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 700;
}

.event-notice.is-cancelled {
    border-left-color: var(--color-primary-red);
}

.event-facts {
    margin-bottom: 1.75rem;
}

.event-body {
    display: grid;
    gap: 1.75rem;
    align-items: start;
}

.event-image {
    margin: 0;
}

.event-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    border-radius: 10px;
    background-color: var(--color-process-black);
}

.event-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #ccc;
}

.event-description {
    text-align: left;
    color: var(--color-light);
}

.event-description a {
    color: var(--color-white);
    text-decoration: underline;
}

@media (min-width: 48em) {
    .event-body:has(.event-image) {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    }
}

.event-back {
    margin: 2rem 0 0;
    font-family: var(--font-heading);
    font-weight: 700;
}

.event-back a {
    color: var(--color-red-on-dark);
}

/* Event page reads left to right like the rest of the site */
.event-page .event-detail,
.event-page .event-detail-header,
.event-page .event-notice,
.event-page .event-facts {
    text-align: left;
}
