/* ==========================================================================
   Páginas legales (legal.php): Términos y condiciones, Política de privacidad y Política de cookies.
   Sobrio: título, pestañas entre documentos, índice a la izquierda y texto en una columna cómoda de leer.
   ========================================================================== */

.lg {
    max-width: 1120px;
    margin: 0 auto;
    color: #c4ccdb;
}

/* ---------- Cabecera ---------- */
.lg-hero {
    padding: clamp(18px, 3vw, 34px) 0 clamp(20px, 3vw, 28px);
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.lg-kicker {
    margin: 0 0 6px;
    color: #5fe3ff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lg-hero h1 {
    margin: 0;
    color: #ffffff;
    font-family: "Poppins", "Manrope", system-ui, sans-serif;
    font-size: clamp(1.7rem, 3.6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
}

.lg-updated {
    margin: 8px 0 0;
    color: #8f99ad;
    font-size: .88rem;
}

.lg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.lg-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 10px;
    background: #0f1117;
    color: #c4ccdb;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}

.lg-tabs a:hover {
    border-color: rgba(148, 163, 184, .5);
    color: #ffffff;
}

.lg-tabs a.is-active {
    border-color: #1fd8ff;
    background: rgba(31, 216, 255, .1);
    color: #ffffff;
}

/* ---------- Índice + texto ---------- */
.lg-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
    padding-top: clamp(24px, 3vw, 36px);
}

.lg-toc {
    position: sticky;
    top: 92px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: #0f1117;
}

.lg-toc h2 {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: none;
    color: #e6ecf6;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lg-toc ol {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: lg;
}

.lg-toc li {
    counter-increment: lg;
}

.lg-toc a {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #a3acbf;
    font-size: .86rem;
    line-height: 1.4;
    text-decoration: none;
}

.lg-toc a::before {
    content: counter(lg) ".";
    flex: 0 0 auto;
    min-width: 1.4em;
    color: #6b7690;
}

.lg-toc a:hover {
    background: rgba(255, 255, 255, .05);
    color: #ffffff;
}

.lg-body {
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.75;
}

.lg-body section {
    scroll-margin-top: 96px;
    padding-bottom: 26px;
}

.lg-body section + section {
    padding-top: 26px;
    border-top: 1px solid rgba(148, 163, 184, .1);
}

.lg-body h2 {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    background: none;
    color: #ffffff;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: none;
}

.lg-num {
    color: #5fe3ff;
}

.lg-body p,
.lg-body ul {
    margin: 0 0 12px;
    color: #c4ccdb;
}

.lg-body p:last-child,
.lg-body ul:last-child {
    margin-bottom: 0;
}

.lg-body ul {
    padding-left: 22px;
}

.lg-body li + li {
    margin-top: 6px;
}

.lg-body strong {
    color: #ffffff;
}

.lg-body a {
    color: #5fe3ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lg-body a:hover {
    color: #ffffff;
}

.lg-body code {
    color: #e6ecf6;
    font-size: .88em;
    word-break: break-word;
}

/* Botón "Configurar cookies" dentro de la política */
.lg-body a.lg-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    background: #1fd8ff;
    color: #03121f;
    font-weight: 800;
    text-decoration: none;
}

.lg-body a.lg-btn:hover {
    background: #7deaff;
    color: #03121f;
}

/* Tabla de cookies: se desliza en pantallas angostas */
.lg-table {
    margin: 16px 0;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 12px;
}

.lg-table table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: .86rem;
    line-height: 1.5;
}

.lg-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.lg-table th,
.lg-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .1);
    background: transparent;
    color: #c4ccdb;
    text-align: left;
    vertical-align: top;
}

.lg-table th {
    background: #141821;
    color: #ffffff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lg-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ---------- Tablet y celular ---------- */
@media (max-width: 900px) {
    .lg-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-toc {
        position: static;
    }

    .lg-toc ol {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .lg-toc ol {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-body {
        font-size: .96rem;
    }

    .lg-tabs a {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg-tabs a {
        transition: none;
    }
}
