/* =========================================================
   EVENTS — index and detail
   ========================================================= */

.ev-page {
    --ev-green: var(--brand-sec-color, #013F1F);
    --ev-accent: var(--brand-color, #02A550);
    --ev-gold: #C08A2E;
    --ev-paper: #FFFFFF;
    --ev-ground: #F7F6F1;
    --ev-line: #E5E3DA;
    --ev-text: #1C2B23;
    --ev-muted: #6B7A72;

    font-family: var(--primary-font, 'Poppins', sans-serif);
    color: var(--ev-text);
    background: var(--ev-ground);
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */

.ev-hero {
    padding: clamp(36px, 6vw, 68px) 0 clamp(28px, 4vw, 44px);
    text-align: center;
    background: linear-gradient(180deg, #F6F1E2 0%, var(--ev-ground) 100%);
    border-bottom: 1px solid var(--ev-line);
}

.ev-hero-title {
    margin: 0;
    font-size: clamp(30px, 5.2vw, 46px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ev-green);
}

.ev-hero-text {
    max-width: 56ch;
    margin: 12px auto 0;
    font-size: clamp(14px, 1.6vw, 16px);
    line-height: 1.65;
    color: var(--ev-muted);
}

.ev-body {
    padding: clamp(24px, 4vw, 44px) 0 clamp(44px, 7vw, 84px);
}

/* ---------------------------------------------------------
   SECTIONS
   --------------------------------------------------------- */

.ev-section + .ev-section {
    margin-top: clamp(36px, 5vw, 60px);
}

.ev-section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ev-line);
}

.ev-section-title {
    margin: 0;
    font-size: clamp(19px, 2.4vw, 24px);
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ev-green);
}

.ev-section-count {
    font-size: 13px;
    color: var(--ev-muted);
}

/* ---------------------------------------------------------
   YEAR TABS
   --------------------------------------------------------- */

.ev-years {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.ev-year {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ev-text);
    background: var(--ev-paper);
    border: 1px solid var(--ev-line);
    border-radius: 20px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ev-year:hover {
    border-color: #C9CFC9;
}

.ev-year.is-active {
    color: #FFFFFF;
    background: var(--ev-green);
    border-color: var(--ev-green);
}

.ev-year-count {
    padding: 1px 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ev-muted);
    background: var(--ev-ground);
    border-radius: 20px;
}

.ev-year.is-active .ev-year-count {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.18);
}

.ev-year:focus-visible {
    outline: 2px solid var(--ev-accent);
    outline-offset: 2px;
}

/* ---------------------------------------------------------
   CARD GRID
   --------------------------------------------------------- */

.ev-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

.ev-card {
    overflow: hidden;
    background: var(--ev-paper);
    border: 1px solid var(--ev-line);
    border-radius: 12px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.ev-card:hover {
    border-color: #C9CFC9;
    transform: translateY(-2px);
}

.ev-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.ev-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(160deg, #EFEADC 0%, #DCD6C4 100%);
}

.ev-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ev-card-media-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 30px;
    color: rgba(1, 63, 31, 0.25);
}

/* Date chip sits on the media so the card scans by date first. */
.ev-card-date {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ev-card-day {
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    color: var(--ev-green);
}

.ev-card-month {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ev-muted);
}

.ev-card-body {
    padding: 16px 18px 18px;
}

.ev-card-tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ev-green);
    background: rgba(2, 165, 80, 0.1);
    border-radius: 20px;
}

.ev-card-title {
    margin: 0 0 10px;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ev-text);
}

.ev-card-meta {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ev-card-meta li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 5px;
    font-size: 13px;
    color: var(--ev-muted);
}

.ev-card-meta i {
    margin-top: 2px;
    color: var(--ev-accent);
    font-size: 12px;
}

/* Past events read quieter until hovered. */
.ev-card.is-past .ev-card-media img {
    filter: saturate(0.72);
}

.ev-card.is-past:hover .ev-card-media img {
    filter: none;
}

/* ---------------------------------------------------------
   EMPTY / LINKS
   --------------------------------------------------------- */

.ev-empty {
    padding: 40px 24px;
    text-align: center;
    background: var(--ev-paper);
    border: 1px solid var(--ev-line);
    border-radius: 12px;
}

.ev-empty p {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--ev-muted);
}

.ev-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--ev-accent);
    text-decoration: none;
}

.ev-link:hover {
    text-decoration: underline;
}

/* =========================================================
   DETAIL PAGE
   ========================================================= */

.ev-detail-hero {
    padding: clamp(20px, 3vw, 34px) 0 clamp(22px, 3vw, 34px);
    background: linear-gradient(180deg, #F6F1E2 0%, var(--ev-ground) 100%);
    border-bottom: 1px solid var(--ev-line);
}

.ev-crumbs {
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--ev-muted);
}

.ev-crumbs a {
    color: var(--ev-accent);
    text-decoration: none;
}

.ev-crumbs a:hover {
    text-decoration: underline;
}

.ev-crumbs span[aria-hidden] {
    margin: 0 7px;
    opacity: 0.5;
}

.ev-detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ev-status {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: #0B5C33;
    background: rgba(2, 165, 80, 0.12);
    border: 1px solid rgba(2, 165, 80, 0.3);
    border-radius: 20px;
}

.ev-status.is-past {
    color: #7A5510;
    background: rgba(192, 138, 46, 0.12);
    border-color: rgba(192, 138, 46, 0.3);
}

.ev-detail-title {
    margin: 0;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--ev-green);
}

.ev-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 34px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.ev-detail-meta li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--ev-text);
}

.ev-detail-meta i {
    margin-top: 3px;
    color: var(--ev-accent);
}

.ev-detail-meta strong {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ev-muted);
}

/* Event artwork is often a poster whose text is the content, so it is
   never cropped. The image is shown whole and centred; the frame takes
   whatever space is left over at the sides or below. */
.ev-detail-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 1.5vw, 16px);
    overflow: hidden;
    background: #F1EFE7;
    border: 1px solid var(--ev-line);
    border-radius: 12px;
}

.ev-detail-banner img {
    width: auto;
    max-width: 100%;
    height: auto;
    /* Bounded so a tall poster cannot push the rest of the page away,
       while still scaling down to fit any screen. */
    max-height: min(72vh, 640px);
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.ev-detail-body {
    max-width: 72ch;
    margin: clamp(20px, 3vw, 30px) 0 0;
    font-size: 15px;
    line-height: 1.75;
    color: var(--ev-muted);
}

/* Separate the intro from the media sections that follow it. */
.ev-detail-banner + .ev-section,
.ev-detail-body + .ev-section {
    margin-top: clamp(32px, 4.5vw, 56px);
}

/* ---------------------------------------------------------
   EVENT MEDIA
   --------------------------------------------------------- */

.ev-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.ev-photo,
.ev-video {
    margin: 0;
    overflow: hidden;
    background: var(--ev-paper);
    border: 1px solid var(--ev-line);
    border-radius: 10px;
}

/* Media tiles open in the shared lightbox, so the whole thumbnail
   is the control. */
.ev-media-button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #EFEDE4;
    border: 0;
    cursor: pointer;
}

.ev-media-grid--video .ev-media-button {
    aspect-ratio: 16 / 9;
}

.ev-media-button[disabled] {
    cursor: default;
}

.ev-media-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.ev-media-button:hover img {
    transform: scale(1.04);
}

.ev-media-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 24px;
    color: rgba(1, 63, 31, 0.25);
}

.ev-media-zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 12px;
    color: var(--ev-green);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ev-media-button:hover .ev-media-zoom,
.ev-media-button:focus-visible .ev-media-zoom {
    opacity: 1;
    transform: translateY(0);
}

.ev-media-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 15px;
    color: #FFFFFF;
    background: rgba(1, 63, 31, 0.82);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.15s ease, transform 0.15s ease;
}

.ev-media-button:hover .ev-media-play {
    background: var(--ev-accent);
    transform: translate(-50%, -50%) scale(1.06);
}

.ev-media-button:focus-visible {
    outline: 2px solid var(--ev-accent);
    outline-offset: -2px;
}

.ev-media-grid--video {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ev-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.ev-video-frame iframe,
.ev-video-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ev-video-link {
    display: block;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ev-accent);
    text-decoration: none;
}

.ev-photo figcaption,
.ev-video figcaption {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--ev-muted);
}

.ev-back {
    margin: clamp(30px, 4vw, 48px) 0 0;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 640px) {

    .ev-grid {
        grid-template-columns: 1fr;
    }

    .ev-media-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .ev-detail-meta {
        gap: 12px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ev-card,
    .ev-year {
        transition: none;
    }
}

/* Inline SVG icons (see frontend/partials/icon.blade.php) */
.ic {
    flex-shrink: 0;
    vertical-align: -0.14em;
}
