/*
 Theme Name:   Cobreloa Child Theme
 Theme URI:    https://cobreloa.cl
 Description:  Child theme de Twenty Twenty-Five con identidad Cobreloa
 Author:       Cobreloa SADP
 Template:     hello-elementor
 Version:      1.0.0
 Text Domain:  cobreloa-child
*/

/* === Cobreloa Design System === */
:root {
    --cobreloa-orange: #F26424;
    --cobreloa-orange-light: #F59512;
    --cobreloa-gradient: linear-gradient(130deg, #F26424 0%, #F59512 100%);
    --cobreloa-dark: #1a1a1a;
    --cobreloa-white: #FEFEFE;
    --cobreloa-gray: #f5f5f5;
    --cobreloa-gray-border: #e0e0e0;
    --cobreloa-win: #2ecc40;
    --cobreloa-draw: #ffdc00;
    --cobreloa-loss: #ff4136;
}

/* === Typography === */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Varela+Round&display=swap');

body {
    font-family: 'Montserrat', sans-serif;
}

h1, h2, h3, h4, h5, h6,
.sp-table-caption,
.sp-template-league-table th,
.sp-event-list th {
    font-family: 'Varela Round', sans-serif;
}

/* === SportsPress Global Overrides === */

/* Table base styles */
.sp-template table {
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: 14px;
    border: none !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.sp-template table thead {
    background: linear-gradient(130deg, #F26424 0%, #F59512 100%) !important;
}

.sp-template table thead th {
    color: #FEFEFE !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.5px;
    padding: 12px 10px !important;
    border: none !important;
}

.sp-template table tbody td {
    padding: 10px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    border-left: none !important;
    border-right: none !important;
    vertical-align: middle;
}

.sp-template table tbody tr:last-child td {
    border-bottom: none !important;
}

.sp-template table tbody tr:hover {
    background-color: rgba(242, 100, 36, 0.05) !important;
}

.sp-template table tbody tr.odd,
.sp-template table tbody tr.alternate {
    background-color: #FEFEFE;
}

.sp-template table tbody tr.even,
.sp-template table tbody tr.sp-row:not(.alternate) {
    background-color: #f5f5f5;
}

/* All section captions */
.sp-template .sp-table-caption,
h4.sp-table-caption {
    background: linear-gradient(130deg, #F26424 0%, #F59512 100%) !important;
    color: #FEFEFE !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px 8px 0 0;
}

/* Remove border-radius from thead when it follows a caption */
.sp-template .sp-table-caption + .sp-table-wrapper table thead,
.sp-template .sp-table-caption + .sp-table-wrapper .sp-scrollable-table-wrapper table thead,
.sp-template-event-details table thead,
.sp-template-event-results table thead,
.sp-template-event-venue table thead {
    border-radius: 0 !important;
}

.sp-template-event-details table thead th:first-child,
.sp-template-event-results table thead th:first-child,
.sp-template-event-venue table thead th:first-child {
    border-radius: 0 !important;
}

.sp-template-event-details table thead th:last-child,
.sp-template-event-results table thead th:last-child,
.sp-template-event-venue table thead th:last-child {
    border-radius: 0 !important;
}

/* === League Table (Tabla de Posiciones) === */

.sp-template-league-table .sp-table-caption {
    background: linear-gradient(130deg, #F26424 0%, #F59512 100%) !important;
    color: #FEFEFE !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sp-template-league-table .sp-table-wrapper {
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.sp-template-league-table table {
    border-radius: 0;
    box-shadow: none;
}

.sp-template-league-table table thead {
    background: linear-gradient(130deg, #F26424 0%, #F59512 100%) !important;
}

.sp-template-league-table table thead th,
.sp-league-table thead th,
table.sp-league-table thead th,
.sp-data-table thead th,
.sp-sortable-table thead th,
.sp-template table thead th {
    color: #FEFEFE !important;
    background-color: transparent !important;
    background: transparent !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.5px;
    padding: 12px 10px !important;
    border: none !important;
    cursor: default !important;
}

/* Remove DataTables sort arrows and overrides */
.sp-data-table thead th::after,
.sp-data-table thead th::before,
table.dataTable thead th::after,
table.dataTable thead th::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    display: none !important;
    content: none !important;
}

table.dataTable thead th,
table.dataTable thead td {
    background-color: transparent !important;
    background: transparent !important;
    border-bottom: none !important;
}

/* Override SportsPress .sp-data-table th white background */
.sp-data-table th {
    background: transparent !important;
    background-color: transparent !important;
}

/* Highlighted row (Cobreloa) */
.sp-template-league-table tr.highlighted {
    background: rgba(242, 100, 36, 0.15) !important;
}

.sp-template-league-table tr.highlighted td {
    font-weight: 700 !important;
    color: #F26424 !important;
}

.sp-template-league-table tr.highlighted td.data-name a {
    color: #F26424 !important;
    font-weight: 800 !important;
}

.sp-template-league-table tr.highlighted td.data-pts {
    font-weight: 900 !important;
    font-size: 16px !important;
}

/* Rank column */
.sp-template-league-table .data-rank {
    font-weight: 700;
    text-align: center;
    width: 40px;
}

/* Team name */
.sp-template-league-table .data-name {
    font-weight: 600;
}

.sp-template-league-table .data-name a {
    color: var(--cobreloa-dark);
    text-decoration: none;
}

.sp-template-league-table .data-name a:hover {
    color: var(--cobreloa-orange);
}

/* Team logo in table */
.sp-template-league-table .team-logo {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.sp-template-league-table .team-logo img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Stats columns */
.sp-template-league-table .data-p,
.sp-template-league-table .data-w,
.sp-template-league-table .data-d,
.sp-template-league-table .data-l,
.sp-template-league-table .data-f,
.sp-template-league-table .data-a,
.sp-template-league-table .data-gd {
    text-align: center;
    width: 40px;
}

.sp-template-league-table .data-pts {
    text-align: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--cobreloa-orange);
    width: 50px;
}

/* === Event List (Calendario y Resultados) === */

.sp-template-event-list .sp-table-caption {
    background: var(--cobreloa-gradient);
    color: var(--cobreloa-white);
    padding: 14px 20px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sp-template-event-list .data-date {
    white-space: nowrap;
    font-weight: 600;
    font-size: 13px;
}

.sp-template-event-list .data-date a {
    color: var(--cobreloa-dark);
    text-decoration: none;
}

.sp-template-event-list .data-event a,
.sp-template-event-list .data-home a,
.sp-template-event-list .data-away a {
    color: var(--cobreloa-dark);
    text-decoration: none;
    font-weight: 600;
}

.sp-template-event-list .data-event a:hover,
.sp-template-event-list .data-home a:hover,
.sp-template-event-list .data-away a:hover {
    color: var(--cobreloa-orange);
}

.sp-template-event-list .data-time a,
.sp-template-event-list .data-results a {
    color: var(--cobreloa-orange);
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
}

.sp-template-event-list .data-article a {
    color: var(--cobreloa-orange);
    font-weight: 600;
    text-decoration: none;
}

.sp-template-event-list .data-venue {
    font-size: 12px;
    color: #777;
}

/* === Event Detail (Detalle de Partido) === */

/* Logos header */
.sp-template-event-logos {
    text-align: center;
    padding: 30px 20px;
}

.sp-template-event-logos .sp-event-team-name {
    font-family: 'Varela Round', sans-serif;
    font-weight: 700;
    font-size: 16px;
}

/* Results section */
.sp-template-event-results .sp-table-caption {
    background: var(--cobreloa-gradient);
    color: var(--cobreloa-white);
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Performance table */
.sp-template-event-performance table thead {
    background: var(--cobreloa-gradient);
}

.sp-template-event-performance table thead th {
    color: var(--cobreloa-white) !important;
}

.sp-template-event-performance .sp-table-caption {
    background: var(--cobreloa-dark);
    color: var(--cobreloa-white);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Event details table */
.sp-template-event-details table {
    box-shadow: none !important;
    border-radius: 8px;
    overflow: hidden;
    background: var(--e-global-color-secondary, #F59512) !important;
}

/* Plomo oscuro para thead de detalles, resultados, calendario, venue */
.sp-template.sp-template-event-details table thead,
.sp-template.sp-template-event-results table thead,
.sp-template-event-calendar table.sp-event-calendar thead,
.sp-template-event-venue table.sp-event-venue thead {
    background: #d5d5d5 !important;
    background-image: none !important;
}

.sp-template.sp-template-event-details table thead th,
.sp-template.sp-template-event-results table thead th,
.sp-template-event-calendar table.sp-event-calendar thead th,
.sp-template-event-venue table.sp-event-venue thead th {
    background: transparent !important;
    color: #333 !important;
    text-transform: none !important;
    font-size: 13px !important;
}

.sp-template-event-details table tbody td {
    background: transparent !important;
    color: inherit !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.sp-template-event-details .sp-table-caption {
    background: var(--e-global-color-secondary, #F59512) !important;
    color: #fff !important;
    padding: 10px 20px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Venue */
.sp-template-event-venue .sp-table-caption {
    background: var(--cobreloa-gradient);
    color: var(--cobreloa-white);
    padding: 10px 20px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Move venue name from thead to look like a subtitle */
.sp-template-event-venue table.sp-event-venue thead {
    background: none !important;
    background-image: none !important;
}

.sp-template-event-venue table.sp-event-venue thead th {
    background: none !important;
    color: var(--cobreloa-dark, #1a1a1a) !important;
    font-family: 'Varela Round', sans-serif;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    padding: 14px 10px 8px !important;
    text-align: center;
}

/* === Player List (Plantel) === */

.sp-template-player-list .sp-table-caption {
    background: var(--cobreloa-gradient);
    color: var(--cobreloa-white);
    padding: 14px 20px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sp-template-player-list .data-name a {
    color: var(--cobreloa-orange);
    font-weight: 600;
    text-decoration: none;
}

.sp-template-player-list .data-name a:hover {
    text-decoration: underline;
}

/* === Page titles === */
.entry-title,
.wp-block-post-title {
    font-family: 'Varela Round', sans-serif;
    color: var(--cobreloa-dark);
}

/* === Pagination SportsPress === */
.sp-template .dataTables_paginate .paginate_button {
    color: var(--cobreloa-orange) !important;
    font-weight: 600;
}

.sp-template .dataTables_paginate .paginate_button.current {
    background: var(--cobreloa-orange) !important;
    color: white !important;
    border-color: var(--cobreloa-orange) !important;
    border-radius: 4px;
}

/* Links */
/* Hide current page in breadcrumbs */
#breadcrumbs .breadcrumb_last {
    display: none !important;
}


.sp-view-all-link a {
    color: var(--cobreloa-orange);
    font-weight: 600;
    text-decoration: none;
}

.sp-view-all-link a:hover {
    text-decoration: underline;
}
