/**
 * Portal Público — identidad Liga Tucumana de Fútbol
 */

:root {
    --portal-ltf-primary: #1e3a5f;
    --portal-ltf-primary-dark: #152a45;
    --portal-ltf-primary-rgb: 30, 58, 95;
    --portal-body-bg: #f5f6f8;
    --portal-surface: #ffffff;
    --portal-border: #e3e6ea;
    --portal-text: #212529;
    --portal-text-muted: #6c757d;
    --portal-footer-bg: #ffffff;
}

body.portal-publico {
    background-color: var(--portal-body-bg);
    color: var(--portal-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.portal-nav {
    background: linear-gradient(180deg, var(--portal-ltf-primary) 0%, var(--portal-ltf-primary-dark) 100%);
    border-bottom: 3px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

.portal-brand {
    align-items: center;
    display: inline-flex;
    gap: 0.75rem;
    max-width: 100%;
    text-decoration: none;
}

.portal-brand:hover,
.portal-brand:focus {
    color: #fff;
    text-decoration: none;
}

.portal-brand__logo {
    background: #fff;
    border-radius: 0.375rem;
    flex-shrink: 0;
    height: 44px;
    object-fit: contain;
    padding: 0.2rem;
    width: 44px;
}

.portal-brand__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.15;
    min-width: 0;
}

.portal-brand__name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.portal-brand__tagline {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.75rem;
    font-weight: 400;
}

.portal-nav .navbar-brand {
    color: #fff;
}

.portal-nav .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
}

.portal-nav .navbar-nav .nav-link:hover,
.portal-nav .navbar-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.portal-context-bar {
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    box-shadow: 0 1px 2px rgba(var(--portal-ltf-primary-rgb), 0.04);
}

.portal-subnav .nav-link {
    color: #495057;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.portal-subnav .nav-link.active {
    background-color: var(--portal-ltf-primary);
}

.portal-content {
    flex: 1 0 auto;
    padding: 1.5rem;
}

.portal-app-footer {
    background: var(--portal-footer-bg);
    border-top: 1px solid var(--portal-border);
    margin-top: auto;
}

.portal-footer__institution {
    color: var(--portal-ltf-primary);
    font-size: 0.9375rem;
}

.portal-footer__tagline {
    color: var(--portal-text-muted);
}

.portal-footer__tech {
    color: var(--portal-text-muted);
    font-size: 0.8125rem;
}

@media (max-width: 767.98px) {
    .portal-brand__name {
        font-size: 0.9375rem;
    }

    .portal-brand__tagline {
        display: none;
    }

    .portal-brand__logo {
        height: 38px;
        width: 38px;
    }
}

.portal-page-header .h3 {
    font-weight: 600;
}

.portal-breadcrumb {
    font-size: 0.875rem;
}

.portal-card {
    border-color: rgba(0, 0, 0, 0.08);
}

.portal-link-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.portal-link-card:hover {
    box-shadow: 0 0.35rem 1rem rgba(30, 58, 95, 0.12) !important;
    transform: translateY(-1px);
}

.portal-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.portal-stat-card .portal-stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.competencia-tabla-posiciones thead th {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.competencia-tabla-posiciones tbody td {
    font-size: 0.875rem;
}

.portal-table thead th {
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* —— Posiciones —— */

.portal-posiciones-card .card-body {
    padding-bottom: 0;
}

.portal-posiciones-tabla {
    margin-bottom: 0;
}

.portal-posiciones-tabla.table-striped {
    --vz-table-bg: #fff;
    --vz-table-striped-bg: #dee2e6;
    --vz-table-hover-bg: rgba(30, 58, 95, 0.1);
}

.portal-posiciones-tabla thead th {
    background-color: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}

.portal-posiciones-tabla.table > tbody > tr > td,
.portal-posiciones-tabla.table > tbody > tr > th {
    border-bottom: 1px solid #eef0f2;
    vertical-align: middle;
}

.portal-posiciones-tabla tbody tr:last-child td {
    border-bottom: 0;
}

.portal-posiciones-col-pos {
    width: 3rem;
}

.portal-posiciones-col-equipo {
    min-width: 10rem;
}

.portal-posiciones-col-pts {
    color: #1e3a5f;
    font-size: 1rem;
    font-weight: 700 !important;
    min-width: 3.25rem;
}

.portal-posiciones-stat {
    color: #6c757d;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.portal-posiciones-equipo {
    align-items: center;
    display: inline-flex;
    gap: 0.625rem;
    max-width: 100%;
    min-width: 0;
}

.portal-posiciones-equipo__nombre {
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-posiciones-dif--pos {
    color: #198754;
    font-weight: 600;
}

.portal-posiciones-dif--neg {
    color: #dc3545;
    font-weight: 600;
}

/* Zona de descenso — últimos 4 de Tabla General */
.portal-posiciones-tabla.table-striped > tbody > tr.portal-tabla-general-descenso > td,
.portal-posiciones-tabla > tbody > tr.portal-tabla-general-descenso > td {
    background-color: #fde8e8 !important;
}

.portal-posiciones-tabla.table-hover > tbody > tr.portal-tabla-general-descenso:hover > td {
    background-color: #f8d4d4 !important;
}

.portal-posiciones-card__header {
    border-bottom: 0;
}

.portal-posiciones-card__categoria {
    letter-spacing: 0.04em;
}

@media (max-width: 767.98px) {
    .portal-posiciones-tabla thead th:nth-child(n+4):nth-child(-n+9),
    .portal-posiciones-tabla tbody td:nth-child(n+4):nth-child(-n+9) {
        display: none;
    }

    .portal-posiciones-col-equipo {
        min-width: 0;
    }

    .portal-posiciones-col-pts {
        font-size: 1.0625rem;
    }
}

/* —— Goleadores —— */

.portal-goleadores-card .card-body {
    padding-bottom: 0;
}

.portal-goleadores-tabla {
    margin-bottom: 0;
}

.portal-goleadores-tabla.table-striped {
    --vz-table-bg: #fff;
    --vz-table-striped-bg: #dee2e6;
    --vz-table-hover-bg: rgba(30, 58, 95, 0.1);
}

.portal-goleadores-tabla thead th {
    background-color: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}

.portal-goleadores-tabla.table > tbody > tr > td,
.portal-goleadores-tabla.table > tbody > tr > th {
    border-bottom: 1px solid #eef0f2;
    vertical-align: middle;
}

.portal-goleadores-tabla tbody tr:last-child td {
    border-bottom: 0;
}

.portal-goleadores-col-pos {
    color: var(--portal-text-muted);
    width: 3rem;
}

.portal-goleadores-col-pos--top {
    color: var(--portal-ltf-primary);
    font-weight: 700;
}

.portal-goleadores-col-jugador {
    min-width: 9rem;
}

.portal-goleadores-col-equipo {
    min-width: 10rem;
}

.portal-goleadores-col-goles {
    color: var(--portal-ltf-primary);
    font-size: 1rem;
    font-weight: 700 !important;
    min-width: 3.5rem;
}

.portal-goleadores-jugador {
    font-weight: 600;
    line-height: 1.25;
}

.portal-goleadores-equipo {
    align-items: center;
    display: inline-flex;
    gap: 0.625rem;
    max-width: 100%;
    min-width: 0;
}

.portal-goleadores-equipo__nombre {
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-goleadores-card__header {
    border-bottom: 0;
}

.portal-goleadores-card__categoria {
    letter-spacing: 0.04em;
}

@media (max-width: 767.98px) {
    .portal-goleadores-col-equipo {
        min-width: 0;
    }

    .portal-goleadores-col-goles {
        font-size: 1.0625rem;
    }
}

.portal-partido-cruce .fs-5 {
    line-height: 1.3;
}

.portal-btn-detalle {
    white-space: nowrap;
}

/* —— Fase Visual 1: Fixture —— */

.portal-fixture-toolbar {
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
}

.portal-fixture-fase-nav .nav-link {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    white-space: nowrap;
    color: #1e3a5f;
    border: 1px solid #c5d0dc;
    background-color: #f8fafc;
    margin-right: 0.35rem;
}

.portal-fixture-fase-nav .nav-link:hover {
    background-color: #eef2f6;
    color: #1e3a5f;
}

.portal-fixture-fase-nav .nav-link.active {
    background-color: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
}

.portal-fixture-grupo-nav .nav-link {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    white-space: nowrap;
    color: #1e3a5f;
    border: 1px solid #dee2e6;
    background-color: #fff;
}

.portal-fixture-grupo-nav .nav-link:hover {
    background-color: #f1f3f5;
    color: #1e3a5f;
}

.portal-fixture-grupo-nav .nav-link.active {
    background-color: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
}

.portal-fixture-jornada-nav .nav-link {
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
    color: #495057;
}

.portal-fixture-jornada-nav .nav-link.active {
    background-color: #1e3a5f;
    color: #fff;
}

.portal-fixture-fase-label {
    letter-spacing: 0.02em;
    text-transform: none;
}

.portal-fixture-jornada--eliminatoria .portal-fixture-jornada-header .fw-semibold {
    font-size: 1.05rem;
}

.portal-fixture-jornada {
    scroll-margin-top: 5.5rem;
    overflow: hidden;
}

.portal-fixture-jornada--highlight {
    border-left: 4px solid #1e3a5f;
}

.portal-fixture-jornada-header {
    background: #f1f3f5;
    border-bottom: 1px solid #e9ebec !important;
    padding: 0.5rem 1rem !important;
}

.portal-fixture-grupo-header {
    background: #e9ecef;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    color: #1e3a5f;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.45rem 1rem;
    text-transform: uppercase;
}

.portal-fixture-grupo-header:first-child {
    border-top: none;
}

.portal-fixture-grupo-header--interzonal {
    background: #e7f1ff;
    color: #0d6efd;
}

.portal-fixture-match-list {
    display: flex;
    flex-direction: column;
}

.portal-fixture-match {
    display: block;
    color: inherit;
    border-bottom: 1px solid #e9ebec;
}

.portal-fixture-match:last-child {
    border-bottom: none;
}

.portal-fixture-match--link {
    color: inherit;
    transition: background-color 0.15s ease;
}

.portal-fixture-match--link:hover {
    background-color: #f8f9fa;
    color: inherit;
}

.portal-fixture-match__inner {
    display: grid;
    grid-template-columns: 4.5rem 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.875rem 1rem;
}

.portal-fixture-match__inner--categorias {
    grid-template-columns: 4.5rem 1fr auto;
    grid-template-areas:
        "meta teams status"
        "meta categorias categorias";
    align-items: start;
}

.portal-fixture-match__inner--categorias .portal-fixture-match__meta {
    grid-area: meta;
}

.portal-fixture-match__inner--categorias .portal-fixture-match__status {
    grid-area: status;
    align-self: start;
}

.portal-fixture-match__teams {
    grid-area: teams;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.portal-fixture-match__categorias {
    grid-area: categorias;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eef0f2;
    margin-top: 0.15rem;
}

.portal-fixture-categoria {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.portal-fixture-categoria__nombre {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-fixture-categoria__marcador {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    min-width: 3.5rem;
    text-align: right;
}

.portal-fixture-categoria__marcador--pending {
    font-weight: 500;
    color: #adb5bd;
}

.portal-fixture-categoria__marcador--suspendido {
    font-size: 0.8125rem;
    color: #dc3545;
}

.portal-fixture-categoria__marcador--encurso {
    color: #0d6efd;
}

.portal-fixture-match__footer {
    padding: 0 1rem 0.75rem 5.25rem;
}

.portal-fixture-match__meta {
    text-align: center;
    min-width: 3.5rem;
}

.portal-fixture-match__meta-time {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.portal-fixture-match__meta-date {
    font-size: 0.6875rem;
    color: #6c757d;
    margin-top: 0.15rem;
}

.portal-fixture-match__body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem 0.75rem;
    align-items: center;
    min-width: 0;
}

.portal-fixture-match__team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.portal-fixture-match__team--local {
    justify-content: flex-end;
    flex-direction: row-reverse;
    text-align: right;
}

.portal-fixture-match__team--away {
    justify-content: flex-start;
    text-align: left;
}

.portal-fixture-match__team-name {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.portal-fixture-match__score {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    min-width: 4rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.portal-fixture-match__score--pending {
    font-size: 1rem;
    font-weight: 500;
    color: #adb5bd;
}

.portal-fixture-match__status {
    text-align: right;
    min-width: 5.5rem;
}

.portal-fixture-match__secondary {
    padding: 0 1rem 0.75rem 5.25rem;
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.portal-sport-escudo {
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 0.25rem;
}

.portal-sport-escudo--sm {
    width: 28px;
    height: 28px;
}

.portal-sport-escudo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dee2e6;
    color: #495057;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid #ced4da;
}

.portal-sport-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.3em 0.55em;
    border-radius: 999px;
    text-transform: none;
}

.portal-sport-badge--finalizado {
    background-color: #198754;
    color: #fff;
}

.portal-sport-badge--encurso {
    background-color: #0d6efd;
    color: #fff;
}

.portal-sport-badge--programado {
    background-color: #6c757d;
    color: #fff;
}

.portal-sport-badge--pendiente,
.portal-sport-badge--default {
    background-color: #e9ecef;
    color: #495057;
}

.portal-sport-badge--postergado {
    background-color: #ffc107;
    color: #212529;
}

.portal-sport-badge--suspendido {
    background-color: #dc3545;
    color: #fff;
}

.portal-sport-badge--parcial {
    background-color: #212529;
    color: #fff;
}

@media (max-width: 767.98px) {
    .portal-fixture-fase-nav .nav-link {
        font-size: 0.8125rem;
        padding: 0.4rem 0.75rem;
    }

    .portal-fixture-jornada--eliminatoria .portal-fixture-jornada-header .fw-semibold {
        font-size: 1rem;
    }

    .portal-fixture-match__inner--categorias {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "meta status"
            "teams teams"
            "categorias categorias";
        gap: 0.625rem 0.75rem;
        padding: 0.875rem 1rem 0.625rem;
        align-items: start;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__meta {
        grid-area: meta;
        display: block;
        text-align: left;
        min-width: 0;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__status {
        grid-area: status;
        text-align: right;
        align-self: start;
        min-width: 0;
        max-width: 48%;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__status .badge {
        font-size: 0.6875rem;
        line-height: 1.25;
        white-space: normal;
        text-align: right;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__teams {
        grid-area: teams;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.5rem 0.75rem;
        align-items: start;
        width: 100%;
        min-width: 0;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__team {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        min-width: 0;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__team--local {
        justify-content: flex-start;
        flex-direction: row;
        text-align: left;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__team--away {
        justify-content: flex-end;
        flex-direction: row-reverse;
        text-align: right;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__team-name {
        -webkit-line-clamp: 3;
        word-break: break-word;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-match__categorias {
        grid-area: categorias;
        width: 100%;
        min-width: 0;
        margin-top: 0;
        padding-top: 0.625rem;
        border-top: 1px solid #eef0f2;
        gap: 0.5rem;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-categoria {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: center;
        min-height: 1.5rem;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-categoria__nombre {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.3;
    }

    .portal-fixture-match__inner--categorias .portal-fixture-categoria__marcador {
        flex-shrink: 0;
        min-width: 3.25rem;
    }

    .portal-fixture-match__inner--categorias + .portal-fixture-match__footer,
    .portal-fixture-match__footer {
        padding: 0 1rem 0.75rem;
    }

    .portal-fixture-match__inner:not(.portal-fixture-match__inner--categorias) {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "meta status"
            "body body";
        gap: 0.5rem 0.75rem;
        padding: 0.875rem 1rem 0.5rem;
    }

    .portal-fixture-match__inner:not(.portal-fixture-match__inner--categorias) .portal-fixture-match__meta {
        grid-area: meta;
        display: block;
        text-align: left;
        min-width: 0;
    }

    .portal-fixture-match__inner:not(.portal-fixture-match__inner--categorias) .portal-fixture-match__body {
        grid-area: body;
        grid-template-columns: 1fr;
        gap: 0.35rem;
        text-align: center;
    }

    .portal-fixture-match__inner:not(.portal-fixture-match__inner--categorias) .portal-fixture-match__status {
        grid-area: status;
        text-align: right;
        align-self: start;
        min-width: 0;
    }

    .portal-fixture-match__inner:not(.portal-fixture-match__inner--categorias) .portal-fixture-match__team {
        justify-content: center !important;
        flex-direction: row !important;
        text-align: center !important;
    }

    .portal-fixture-match__inner:not(.portal-fixture-match__inner--categorias) .portal-fixture-match__team--local,
    .portal-fixture-match__inner:not(.portal-fixture-match__inner--categorias) .portal-fixture-match__team--away {
        flex-direction: row;
    }

    .portal-fixture-match__score {
        font-size: 1.5rem;
        min-width: 0;
        padding: 0.15rem 0;
    }

    .portal-fixture-match__secondary {
        padding: 0 1rem 0.875rem;
    }

    .portal-sport-escudo--sm {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
}

@media (max-width: 575.98px) {
    .portal-content {
        padding: 1rem;
    }

    .portal-subnav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }
}
