/* ================================================================ */
/*                    GLOBAL RESET + VARIABLES                      */
/* ================================================================ */
:root {
    /* Acento — usado con moderación (CTAs, estado activo, links) */
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, 0.1);

    /* Estados semánticos (solo para indicadores puntuales, no para bloques grandes) */
    --success: #2fa84f;
    --danger: #e5342a;
    --danger-soft: rgba(229, 52, 42, 0.1);
    --warning: #c9820a;
    --neutral: #86868b;

    /* Superficies */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-elevated: #ffffff;
    --surface-fill: #eeeef0;

    /* Texto */
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --text-on-accent: #ffffff;

    /* Líneas */
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --fill-hover: rgba(0, 0, 0, 0.04);
    --fill-active: rgba(0, 0, 0, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);

    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 40px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #2997ff;
        --accent-hover: #4ba3ff;
        --accent-soft: rgba(41, 151, 255, 0.15);

        --success: #3dd160;
        --danger: #ff4b3e;
        --danger-soft: rgba(255, 75, 62, 0.15);
        --warning: #e6a23c;
        --neutral: #98989d;

        --bg-primary: #000000;
        --bg-secondary: #000000;
        --bg-elevated: #1c1c1e;
        --surface-fill: #2c2c2e;

        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-tertiary: #6e6e73;

        --border: rgba(255, 255, 255, 0.09);
        --border-strong: rgba(255, 255, 255, 0.14);
        --fill-hover: rgba(255, 255, 255, 0.06);
        --fill-active: rgba(255, 255, 255, 0.09);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', sans-serif;
    font-size: 1.6rem;
    line-height: 1.45;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background-color: var(--accent-soft);
    color: var(--text-primary);
}

svg {
    display: block;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ================================================================ */
/*                              NAVBAR                               */
/* ================================================================ */
.navbar {
    position: sticky;
    top: 0;
    height: 60px;
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-xl);
    background: rgba(251, 251, 253, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(10, 10, 11, 0.82);
    }
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.nav-brand-mark {
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-brand-mark img {
    width: auto;
    height: 100%;
    object-fit: contain;
}

.logo {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.nav-center {
    display: flex;
    gap: var(--spacing-xl);
    margin: 0 auto;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
}

.nav-right {
    flex-shrink: 0;
}

.nav-organizer-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-organizer-link:hover {
    color: var(--accent-hover);
}

/* ================================================================ */
/*                              HERO                                 */
/* ================================================================ */
.hero {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg) var(--spacing-2xl);
    max-width: 640px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: var(--spacing-sm);
}

.hero-title {
    font-size: 3.6rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    font-size: 1.6rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ================================================================ */
/*                           PAGE CONTAINER                          */
/* ================================================================ */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl) var(--spacing-3xl);
}

/* ================================================================ */
/*                           EVENTS GRID                             */
/* ================================================================ */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
    gap: var(--spacing-xl);
}

/* ================================================================ */
/*                           EVENT CARD                              */
/* ================================================================ */
.event-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.event-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: var(--surface-fill);
    display: block;
}

.event-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-title {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-date,
.event-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.3rem;
    color: var(--text-secondary);
}

.event-date .icon,
.event-location .icon {
    width: 13px;
    height: 13px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ================================================================ */
/*                         EMPTY / ERROR STATES                      */
/* ================================================================ */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-fill);
    border-radius: 50%;
    color: var(--text-tertiary);
}

.empty-icon .icon {
    width: 24px;
    height: 24px;
}

.empty-icon.spin .icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state h3 {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.empty-state p {
    font-size: 1.4rem;
    line-height: 1.5;
    max-width: 360px;
    margin: 0 auto;
}

.error {
    color: var(--danger);
}

/* ================================================================ */
/*                           RESPONSIVE                              */
/* ================================================================ */
@media (max-width: 767px) {
    .navbar {
        padding: 0 var(--spacing-lg);
        gap: var(--spacing-md);
    }

    .nav-center {
        display: none;
    }

    .hero {
        padding: var(--spacing-2xl) var(--spacing-lg) var(--spacing-xl);
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.45rem;
    }

    .page-container {
        padding: 0 var(--spacing-lg) var(--spacing-2xl);
    }

    .event-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 380px) {
    .nav-organizer-link {
        font-size: 1.2rem;
    }

    .logo {
        font-size: 1.5rem;
    }
}

/* Touch improvements */
@media (hover: none) {
    .event-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .event-card:active {
        transform: scale(0.98);
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ================================================================ */
/*   REDISEÑO 2026 (paleta, tipografía y modo oscuro: panel.css)     */
/* ================================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 56px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--topbar-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-left {
    gap: 10px;
}

.nav-brand-mark {
    height: 28px;
    border-radius: 6px;
    background: #121214;
}

.logo {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-theme {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.nav-theme:hover {
    background: var(--fill-hover);
    color: var(--text-primary);
}

.nav-theme svg {
    width: 18px;
    height: 18px;
}

.nav-organizer-link {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-primary) !important;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.nav-organizer-link:hover {
    background: var(--fill-hover);
    opacity: 1;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    text-align: left;
    padding: 36px 0 24px;
    margin: 0;
    max-width: none;
}

.hero-title {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.022em;
    margin: 0 0 4px;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    max-width: 640px;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 320px;
    max-width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-tertiary);
}

.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search .icon {
    width: 16px;
    height: 16px;
}

.search input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 14px;
    color: var(--text-primary);
    padding: 0;
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
    gap: 20px;
    max-width: none;
    margin: 0;
    padding: 0;
}

.event-grid:has(> .empty-state) {
    display: block;
}

.event-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.event-card:hover {
    transform: none;
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

/* Las portadas se suben cuadradas: se muestran completas */
.event-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--surface-fill);
    border-radius: 0;
}

.event-content {
    padding: 14px 16px 16px;
}

.event-date {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--accent);
    margin: 0 0 4px;
}

.event-date::first-letter {
    text-transform: uppercase;
}

.event-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.event-location {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.event-location .icon {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.event-location span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 767px) {
    .navbar {
        padding: 0 16px;
    }

    .page-container {
        padding: 0 16px 48px;
    }

    .hero {
        padding: 24px 0 18px;
        gap: 14px;
    }

    .hero-title {
        font-size: 26px;
    }

    .search {
        width: 100%;
    }

    /* Dos por fila en el celular: se ven más eventos sin scrollear tanto */
    .event-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .event-content {
        padding: 10px 12px 12px;
    }

    .event-title {
        font-size: 14.5px;
    }

    .event-date,
    .event-location {
        font-size: 12px;
    }
}

@media (max-width: 340px) {
    .event-grid {
        grid-template-columns: 1fr;
    }
}
