/* ==========================================================================
 * Podium - Frontend (shortcode [podium])
 *
 * Notas:
 *  - Usamos divs (no ol/li) para escapar de estilos del theme (Noo iVent
 *    inyecta checks verdes ::before en cualquier <li>).
 *  - box-sizing: border-box en todo el subárbol.
 *  - Orden visual natural 1-2-3 de izquierda a derecha; oro destacado por
 *    color y borde, no por posición.
 * ========================================================================== */

.wcp-podium-publico,
.wcp-podium-publico *,
.wcp-podium-publico *::before,
.wcp-podium-publico *::after {
    box-sizing: border-box;
}

.wcp-podium-publico {
    max-width: 1100px;
    margin: 1.5em auto;
    padding: 0 1em;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset defensivo contra estilos heredados del theme sobre cualquier elemento
   dentro del podium (algunos themes pintan ::before/::after sobre divs en
   secciones específicas). */
.wcp-podium-publico .wcp-pos::before,
.wcp-podium-publico .wcp-pos::after,
.wcp-podium-publico .wcp-pos > div::before,
.wcp-podium-publico .wcp-pos > div::after {
    content: none !important;
    display: none !important;
}

.wcp-aviso {
    background: #fdf0f0;
    border-left: 4px solid #dc3232;
    color: #b32d2e;
    padding: 1em 1.2em;
    border-radius: 4px;
}

.wcp-edicion-titulo {
    text-align: center;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    margin: 0 0 1em;
    color: #2271b1;
}

/* Cada categoría es una sección */
.wcp-podium-publico .wcp-categoria {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    padding: 1.2em 1.5em 1.5em;
    margin-bottom: 2em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.wcp-podium-publico .wcp-categoria-titulo {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 0.6em;
    border-bottom: 2px solid #2271b1;
    margin: 0 0 1em;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
}

.wcp-cat-distancia,
.wcp-cat-genero,
.wcp-cat-tipo {
    display: inline-block;
    padding: 0.2em 0.7em;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
}

.wcp-cat-distancia { background: #2271b1; color: #fff; }
.wcp-cat-genero    { background: #f0f0f0; color: #333; }

.wcp-cat-tipo-absoluta  { background: #2271b1; color: #fff; }
.wcp-cat-tipo-local     { background: #46b450; color: #fff; }
.wcp-cat-tipo-veteranos { background: #9b51e0; color: #fff; }

/* Lista del podium: 3 columnas en desktop, 1 en móvil. Orden natural 1-2-3 */
.wcp-podium-lista {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.wcp-pos {
    background: #fafafa;
    border-radius: 8px;
    padding: 1em 0.9em 1.2em;
    text-align: center;
    border: 2px solid transparent;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.wcp-pos-oro {
    background: linear-gradient(135deg, #fff8e0 0%, #ffe88c 100%);
    border-color: #d4af37;
}

.wcp-pos-plata {
    background: linear-gradient(135deg, #f5f5f5 0%, #dcdcdc 100%);
    border-color: #aaa;
}

.wcp-pos-bronce {
    background: linear-gradient(135deg, #fff0e1 0%, #e8b78a 100%);
    border-color: #b87333;
}

.wcp-pos-medalla {
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 1;
    margin-bottom: 0.3em;
}

.wcp-pos-num {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 800;
    color: #555;
    margin-bottom: 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.wcp-pos-corredor {
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wcp-pos-nombre {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 0.2em;
}

.wcp-pos-apodo {
    color: #2271b1;
    font-style: italic;
    font-size: 0.95em;
    margin-bottom: 0.2em;
}

.wcp-pos-club {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 0.3em;
}

.wcp-pos-dorsal {
    display: inline-block;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 0.15em 0.5em;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 700;
    margin-top: 0.3em;
    max-width: 100%;
}

.wcp-pos-vacio {
    color: #999;
    font-size: 2em;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 720px) {
    .wcp-podium-lista {
        grid-template-columns: 1fr;
    }

    .wcp-pos {
        min-height: 0;
        padding: 0.9em 1em;
        flex-direction: row;
        text-align: left;
        gap: 14px;
        align-items: center;
    }

    .wcp-pos-medalla {
        flex: 0 0 auto;
        margin: 0;
    }

    .wcp-pos-num {
        flex: 0 0 auto;
        margin: 0;
    }

    .wcp-pos-corredor {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
    }
}
