/* ═══════════════════════════════════════════════════════════
   Equipos — Página dedicada
   Depende de index.css para las variables corporativas y el header.

   Variables del panel hover (ajusta aquí los colores del club):
   ─────────────────────────────────────────────────────────────
   --eq-panel-bg     fondo sólido del panel           → azul corporativo
   --eq-panel-cat    color etiqueta de categoría      → amarillo corporativo
   --eq-panel-text   color del nombre del equipo      → blanco
   ═══════════════════════════════════════════════════════════ */

:root {
    --eq-panel-bg:   var(--primary-blue);
    --eq-panel-cat:  var(--primary-yellow);
    --eq-panel-text: #ffffff;
}

/* ── Layout general ── */
.equipos-page {
    background: #f8fafc;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ── Hero ── */
.equipos-hero {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
    /* +100px para compensar el .header absolute (100px desktop) */
    padding: calc(64px + 100px) 0 52px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.equipos-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='28' fill='none' stroke='rgba(255,215,0,0.06)' stroke-width='1'/%3E%3Ccircle cx='30' cy='30' r='18' fill='none' stroke='rgba(255,215,0,0.04)' stroke-width='1'/%3E%3C/svg%3E")
        center / 80px 80px;
    pointer-events: none;
}

.equipos-hero-inner {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 24px;
}

.equipos-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-yellow);
    margin-bottom: 14px;
}

.equipos-hero h1 {
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin: 0 0 14px;
}

.equipos-hero p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* ── Contenedor principal ── */
.equipos-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 52px 24px 0;
}

/* ════════════════════════════════════════
   SELECTOR DE TEMPORADA
   ════════════════════════════════════════ */

.eq-season-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
}

.eq-season-btn {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--primary-blue);
    background: #e8eef6;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}

.eq-season-btn:hover {
    background: #d0dff0;
    color: var(--primary-blue);
    text-decoration: none;
}

.eq-season-btn.is-active {
    background: var(--primary-blue);
    color: #fff;
    pointer-events: none;
}

/* ════════════════════════════════════════
   FOTOS DESTACADAS (familia + staff)
   ════════════════════════════════════════ */

.equipos-featured {
    display: flex;
    gap: 20px;
    margin-bottom: 48px;
}

.featured-card {
    flex: 1;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    height: 380px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    will-change: transform;
}

.featured-card:hover img {
    transform: scale(1.04);
}

.featured-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 28px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
}

.featured-label-title {
    margin: 0;
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .equipos-featured {
        flex-direction: column;
        gap: 14px;
        margin-bottom: 32px;
    }
    .featured-card {
        height: 240px;
    }
}

/* ════════════════════════════════════════
   GRID DE TARJETAS
   ════════════════════════════════════════ */

/* Grid intrínseco: las columnas se ajustan solas sin media queries de columnas.
   min(280px, 100%) evita desbordamiento en viewports muy estrechos. */
.equipos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 16px;
}

/* Altura de tarjeta por tamaño de pantalla */
@media (min-width: 480px) {
    .equipo-card { height: 260px; }
}

@media (min-width: 900px) {
    .equipos-grid { gap: 20px; }
    .equipo-card  { height: 340px; }
}

/* ════════════════════════════════════════
   TARJETA
   ════════════════════════════════════════ */

.equipo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 240px;
    background-color: var(--eq-panel-bg);   /* fondo si no hay imagen */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: default;
    contain: layout style;
}

/* ── Foto ── */
.equipo-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.equipo-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* La imagen no se mueve: el panel sólido la tapa por completo */
}

/* Placeholder cuando no hay foto */
.equipo-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
}

.equipo-card-img:has(img) .equipo-card-placeholder {
    display: none;
}

/* ── Panel de color sólido (hover) ── */
.equipo-card-panel {
    position: absolute;
    inset: 0;
    background: var(--eq-panel-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.equipo-card:hover .equipo-card-panel {
    opacity: 1;
}

/* Etiqueta de categoría */
.equipo-card-categoria {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--eq-panel-cat);
}

/* Nombre del equipo */
.equipo-card-nombre {
    margin: 0;
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--eq-panel-text);
    line-height: 1.3;
}

/* Género del equipo */
.equipo-card-genero {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.45);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-yellow);
    margin-top: 6px;
}

/* ── Táctil: panel como barra inferior con gradiente ── */
@media (hover: none) {
    .equipo-card-panel {
        opacity: 1;
        /* Solo ocupa la parte inferior, no tapa la foto entera */
        inset: auto 0 0 0;
        background: linear-gradient(to top, rgba(0, 39, 82, 0.93) 0%, rgba(0, 39, 82, 0.0) 100%);
        padding: 32px 14px 14px;
        justify-content: flex-end;
        align-items: flex-start;
    }

    .equipo-card-categoria {
        font-size: 0.65rem;
    }

    .equipo-card-nombre {
        font-size: 0.95rem;
    }
}

/* ════════════════════════════════════════
   ESTADOS ESPECIALES
   ════════════════════════════════════════ */

.equipos-load-error {
    padding: 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 0.9rem;
    text-align: center;
}

.equipos-empty {
    text-align: center;
    padding: 80px 24px;
    color: #94a3b8;
}

.equipos-empty svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.equipos-empty p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
}

/* ════════════════════════════════════════
   RESPONSIVE — HERO Y LAYOUT
   ════════════════════════════════════════ */

@media (max-width: 768px) {
    .equipos-hero {
        /* +70px para compensar el .header absolute en tablet/móvil
           + env(safe-area-inset-top) para PWA standalone en iOS (notch/isla) */
        padding: calc(48px + 70px + env(safe-area-inset-top)) 0 36px;
    }

    .equipos-main {
        padding: 36px 16px 0;
    }
}

@media (max-width: 480px) {
    .equipos-hero {
        /* +60px para compensar el .header absolute en móvil pequeño */
        padding: calc(40px + 60px + env(safe-area-inset-top)) 0 32px;
    }
}

/* ════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════ */

.featured-card,
.equipo-card.has-foto {
    cursor: zoom-in;
}

.eq-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 8, 24, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.eq-lb.is-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.eq-lb-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 1;
    transition: background 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.eq-lb-close:hover { background: rgba(255, 255, 255, 0.25); }

/* Wrap con dos imágenes apiladas para cross-fade real (mismo patrón que galería) */
.eq-lb-img-wrap {
    position: relative;
    width: min(92vw, 1100px);
    height: 82vh;
    max-width: 100%;
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.eq-lb-img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    display: block;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.97);
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}
.eq-lb-img.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* Capa transparente que bloquea el menú contextual (clic derecho / mantener pulsado) */
.eq-lb-guard {
    position: absolute;
    inset: 0;
}

.eq-lb-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 20px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: white;
    pointer-events: none;
}

.eq-lb-caption {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eq-lb-counter {
    font-size: 0.82rem;
    opacity: 0.65;
    white-space: nowrap;
    flex-shrink: 0;
    padding-left: 12px;
}

/* ── Botones prev / next ── */
.eq-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.eq-lb-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.eq-lb-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.eq-lb-nav:disabled:hover {
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
}

.eq-lb-nav--prev { left: 20px; }
.eq-lb-nav--next { right: 20px; }

@media (max-width: 600px) {
    .eq-lb-nav {
        width: 44px;
        height: 44px;
        top: auto;
        bottom: 76px;
        transform: none;
    }
    .eq-lb-nav--prev { left: 16px; }
    .eq-lb-nav--next { right: 16px; }
    .eq-lb-nav:not(:disabled):hover { transform: scale(1.06); }
    .eq-lb-nav:disabled:hover { transform: none; }
    .eq-lb-close {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
    }
    .eq-lb-img-wrap {
        width: 96vw;
        height: 70vh;
        max-height: 70vh;
    }
    .eq-lb-footer { padding: 14px 18px 18px; }
    .eq-lb-caption { font-size: 0.82rem; }
    .eq-lb-counter { font-size: 0.76rem; }
}

/* Respeto reduced motion */
@media (prefers-reduced-motion: reduce) {
    .eq-lb,
    .eq-lb-img,
    .eq-lb-close,
    .eq-lb-nav { transition: none !important; animation: none !important; }
    .eq-lb-img { transform: translate(-50%, -50%) !important; }
}
