/* ============================================================
   Galería pública — la pantalla del deportista

   Acento VERDE, no morado: el morado es del fotógrafo (su panel), el verde
   es del atleta. El tema ya hace esa distinción en .ps-logo--athlete.

   Dos decisiones de fondo:
   1. El buscador es el producto, no un filtro. Ocupa el hero, sobre placa
      fotográfica — el deportista llega con un solo trabajo: encontrar su
      carrera.
   2. La foto manda en cada marco. Antes la tarjeta lideraba con el título y
      listaba metadatos con iconitos; lo que decide el clic es la imagen.

   Primitivas en ps-system.css (.ps-page, .ps-plate, .ps-slab).
   ============================================================ */

.ga { padding-bottom: 64px; }

/* ----------- Hero con buscador ----------- */
.ga-hero {
    align-items: flex-start;
    justify-content: center;
    min-height: 340px;
    padding-top: 56px;
    padding-bottom: 48px;
    margin-bottom: 40px;
}
.ga-hero__inner { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.ga-hero .ps-slab { max-width: 240px; }
.ga-hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: .92;
    letter-spacing: -.025em;
    color: var(--white);
    margin: 0;
}
.ga-hero__title em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: .82em;
    color: var(--accent);
}
.ga-hero__sub {
    font-size: var(--ps-fs-body);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 8px;
    max-width: 46ch;
}

/* Un solo campo, grande. Cuadrado y a ras, como el buscador de la landing. */
.ga-search { display: flex; width: 100%; max-width: 620px; }
.ga-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 58px;
    padding: 0 20px;
    background: rgba(255, 255, 255, .96);
    border: 0;
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: #1a1a1a;
    outline: none;
}
.ga-search__input::placeholder { color: #8a8a94; }
.ga-search__input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.ga-search__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 58px;
    padding: 0 26px;
    background: var(--accent);
    color: var(--black);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    transition: background .2s ease;
}
.ga-search__btn:hover { background: var(--accent-dark); }
.ga-search__btn:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

/* ----------- Agrupación temporal ----------- */
.ga-group { margin-bottom: 44px; }
.ga-group__head { margin-bottom: 18px; color: var(--accent); }
.ga-group__head::after { background: var(--border); }

.ga-resultbar {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 22px;
    font-size: var(--ps-fs-body);
    color: var(--muted);
}
.ga-resultbar__count {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--white);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ----------- Marco de evento ----------- */
/* Mortero de 2px: la grilla se lee como una hoja de contacto de carreras. */
.ga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--ps-mortar);
}

.ga-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-left: 2px solid var(--border);
    color: inherit;
    transition: border-left-color .18s ease;
}
.ga-frame:hover { border-left-color: var(--accent); }
/* El foco se dibuja en la ficha, no en el <a>: el enlace principal está
   extendido sobre toda la tarjeta y su contorno propio no la abarcaría. */
.ga-frame:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }

.ga-frame__cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--charcoal);
}
.ga-frame__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Viva, no apagada: en la galería la foto es la oferta. Solo se hunde lo
       justo para que el contador encima se lea. */
    transition: transform .35s ease;
}
.ga-frame:hover .ga-frame__cover img { transform: scale(1.03); }
.ga-frame__cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 95% 85% at 50% 40%, transparent 40%, rgba(10, 10, 15, .55) 100%);
    pointer-events: none;
}
.ga-frame__nocover {
    position: absolute;
    inset: 0;
    background: var(--charcoal);
}
.ga-frame__count {
    position: absolute;
    bottom: 12px;
    left: 14px;
    z-index: 2;
    font-family: var(--font-display);
    font-size: var(--ps-fs-label);
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--white);
    text-shadow: 0 1px 6px rgba(10, 10, 15, .9);
    font-variant-numeric: tabular-nums;
}

.ga-frame__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.ga-frame__date {
    font-family: var(--font-display);
    font-size: var(--ps-fs-label);
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.ga-frame__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.05;
    letter-spacing: -.01em;
    color: var(--white);
    margin: 0;
}
/* Enlace extendido: cubre la ficha entera sin envolverla en un <a>, para que
   el enlace al perfil del fotógrafo pueda convivir dentro. */
.ga-frame__link { color: inherit; text-decoration: none; }
.ga-frame__link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.ga-frame__link:hover { color: var(--white); text-decoration: none; }
.ga-frame__link:focus-visible { outline: none; }

.ga-frame__place { font-size: var(--ps-fs-support); color: var(--muted); }
.ga-frame__foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.ga-frame__price {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--white);
    font-variant-numeric: tabular-nums;
}
/* Va por encima del enlace extendido para seguir siendo clicable, y con un
   área táctil propia: es un destino distinto al del evento. */
.ga-frame__author {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    font-size: var(--ps-fs-support);
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.ga-frame__author:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-decoration: none;
}
.ga-frame__author:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Esqueleto de carga: mantiene la grilla en su sitio y evita el salto. */
.ga-frame--skeleton {
    min-height: 340px;
    border-left-color: var(--border);
    background: var(--panel);
    opacity: .5;
}

/* ----------- Vacío ----------- */
.ga-empty { padding: 72px 0; max-width: 520px; }
.ga-empty h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--ps-fs-title);
    color: var(--white);
    margin: 0 0 12px;
    letter-spacing: -.01em;
}
.ga-empty p { font-size: var(--ps-fs-body); color: var(--muted); line-height: 1.6; margin: 0; }

/* ----------- Responsive ----------- */
@media (max-width: 767px) {
    .ga-hero { min-height: 280px; padding-top: 40px; padding-bottom: 36px; }
    .ga-search { flex-direction: column; gap: var(--ps-mortar); max-width: none; }
    .ga-search__input { height: 54px; }
    /* El botón a ancho completo: en móvil un icono de 58px al lado del campo
       deja el campo demasiado angosto para leer lo que se escribe. */
    .ga-search__btn { height: 54px; justify-content: center; }
    .ga-grid { grid-template-columns: minmax(0, 1fr); }
    .ga-group { margin-bottom: 36px; }
    .ga-frame__title { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ga-frame, .ga-frame__cover img { transition: none; }
    .ga-frame:hover .ga-frame__cover img { transform: none; }
}
