/* =========================================================
   EVENTS ARCHIVE (Premium) — Deliciously Pro
   - Matches Global Theme Variables
   - Light/Dark Mode Friendly
========================================================= */

:root {
    /* Inherits: --color-accent, --color-surface, --font-serif */
    --ev-primary: var(--color-accent, #CCA845);
    --ev-surface: var(--color-surface, #E8E0D2);
}

.tf-events-archive {
    width: 100%;
    padding-bottom: 4rem;
    background-color: var(--color-bg);
    overflow-x: hidden;
}

/* ---------------------------
   1. PREMIUM HEADER & PARALLAX
--------------------------- */
.tf-events-archive .page-header {
    position: relative;
    width: 100%;
    text-align: center;
    margin-bottom: 4rem;
    padding: 6rem 0 4rem 0;
    background-color: var(--color-surface);
    overflow: hidden; /* Contain parallax bg */
    border-bottom: 1px solid var(--color-border);
}

.ev-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%; /* Taller for parallax movement */
    background-size: cover;
    background-position: center;
    z-index: 0;
    will-change: transform;
}

.ev-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 23, 20, 0.4); /* Luxury Dark Overlay */
    z-index: 1;
}

.ev-hero-content {
    position: relative;
    z-index: 2;
}

.tf-events-archive .page-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: #fff; /* White text on hero image */
    margin: 0 0 2rem 0;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ---------------------------
   2. TABS (Switch Style)
--------------------------- */
.events-tabs {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.3);
}

.events-tab {
    display: inline-flex;
    align-items: center;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.events-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.events-tab.active {
    background: var(--ev-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(204, 168, 69, 0.4);
}

/* ---------------------------
   3. GRID SYSTEM
--------------------------- */
.tf-grid-events {
    display: grid;
    gap: 2.5rem;
    transition: opacity 0.3s ease;
}

.tf-grid-3-2-1 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .tf-grid-3-2-1 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .tf-grid-3-2-1 { grid-template-columns: 1fr; }
    .events-tabs { width: 100%; flex-direction: column; border-radius: var(--radius-md); }
    .events-tab { width: 100%; justify-content: center; border-radius: var(--radius-sm); }
    .tf-events-archive .page-header { padding-top: 4rem; }
}

/* ---------------------------
   4. EVENT CARD (Luxury Style)
--------------------------- */
.tf-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.1s ease-out, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0; /* Hidden initially for JS animation */
    transform: translateY(30px);
    will-change: transform, opacity;
}

/* Class added by JS */
.tf-card.is-visible {
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.tf-card:hover {
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--ev-primary), var(--color-border) 60%);
}

/* Media */
.tf-card__media {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.tf-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
    will-change: transform;
}

.tf-card:hover .tf-card__image {
    transform: scale(1.05);
}

.tf-event-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 16px;
    border-radius: 50px;
    background: var(--ev-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Content */
.tf-card__content {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* 3D Pop effect */
    transform: translateZ(20px);
}

.tf-event-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.tf-card__title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.tf-card__title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.tf-card__title a:hover {
    color: var(--ev-primary);
}

/* Footer */
.tf-card__footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.ev-btn--primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(180deg, var(--ev-primary), var(--color-accent-dark));
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ev-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, var(--color-accent-dark), var(--ev-primary));
}

/* ---------------------------
   5. PAST EVENT STATE
--------------------------- */
.tf-card--past {
    opacity: 0.9;
}

.tf-card--past .tf-card__image {
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.tf-card--past:hover .tf-card__image {
    filter: grayscale(0%);
}

.tf-card--past .tf-event-badge {
    background: #999;
    box-shadow: none;
}

/* ---------------------------
   6. PAGINATION
--------------------------- */
.tf-pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tf-pagination .page-numbers {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.tf-pagination .page-numbers a,
.tf-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tf-pagination .page-numbers a:hover {
    border-color: var(--ev-primary);
    color: var(--ev-primary);
    transform: translateY(-2px);
}

.tf-pagination .page-numbers .current {
    background: var(--ev-primary);
    color: #fff;
    border-color: var(--ev-primary);
    box-shadow: 0 4px 10px rgba(204, 168, 69, 0.3);
}