/* ================================================
   BINGU — Páginas legales, diseño «Noche de bingo»: terminos.php, privacidad.php (y privacy.php) y cookies.php.
   Lienzo: Legal.dc.html. Fondo --b-bg, tarjeta blanca, títulos Fredoka, número de apartado = bola de color.
   Marcado: .lg > .lg-wrap > .lg-tabs (includes/legal_tabs.php) + .lg-head + .lg-layout
   (.lg-toc índice + .lg-doc texto con .lg-section). Extras: .lg-box (datos de contacto) y .lg-table.
   ================================================ */
body:has(.lg) { background: var(--b-bg); }

.lg { padding: 44px 0 72px; }
.lg-wrap { width: var(--b-max); margin: 0 auto; }   /* mismo ancho que la portada */

.lg-head { margin-bottom: 32px; display: flex; flex-direction: column; gap: 12px; }
.lg-head h1 { font-size: var(--b-fs-h1, clamp(32px, 3.6vw, 50px)); font-weight: 600; line-height: 1.1; }
.lg-updated { color: var(--b-muted); font-size: 18px; font-weight: 700; }
/* Aviso «documento solo en inglés» (visible solo en otros idiomas) */
.lg-lang {
    display: flex; align-items: center; gap: 12px;
    max-width: 680px; margin-top: 6px !important; padding: 14px 18px;
    border-radius: 18px; background: var(--b-blue-soft); color: var(--b-blue-ink);
    font-size: 18px; font-weight: 700;
}
.lg-lang::before {
    content: ''; width: 24px; height: 24px; flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306739C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.lg-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }

/* Índice */
.lg-toc {
    flex: 1 1 280px; max-width: 340px; min-width: 0;
    position: sticky; top: calc(var(--site-header-h, 80px) + 20px);
    max-height: calc(100vh - var(--site-header-h, 80px) - 40px); overflow: auto;
    padding: 22px 22px 14px;
    border-radius: var(--b-radius-lg); background: var(--b-surface); box-shadow: var(--b-shadow);
}
.lg-toc summary { min-height: 48px; display: flex; align-items: center; font-family: var(--b-font); font-size: 22px; font-weight: 600; cursor: pointer; list-style: none; }
.lg-toc summary::-webkit-details-marker { display: none; }
.lg-toc ol { list-style: none; counter-reset: lg; padding: 0 0 8px 2px; margin: 0; }
.lg-toc li { counter-increment: lg; }
.lg-toc a {
    display: flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 2px 8px; border-radius: 12px;
    color: var(--b-text); font-size: 17px; font-weight: 700; line-height: 1.3; text-decoration: none;
}
.lg-toc a::before { content: counter(lg) '.'; min-width: 24px; color: var(--b-muted); font-weight: 700; }
.lg-toc a:hover { background: var(--b-surface-2); }

/* Texto */
.lg-doc { flex: 999 1 560px; min-width: 0; padding: 16px 48px 44px; border-radius: var(--b-radius-lg); background: var(--b-surface); box-shadow: var(--b-shadow); }
.lg-section { max-width: 78ch; scroll-margin-top: calc(var(--site-header-h, 80px) + 20px); }
.lg-section + .lg-section { margin-top: 8px; }
.lg-section h2 { display: flex; align-items: center; gap: 14px; margin: 40px 0 16px !important; font-size: var(--b-fs-h2, 26px); font-weight: 600; line-height: 1.15; }
.lg-section:first-child h2 { margin-top: 28px !important; }
/* Número de apartado: bola de color, en orden amarillo, azul, rosa */
.lg-num { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--b-sun); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); color: var(--b-text); font-family: var(--b-font); font-size: 19px; font-weight: 700; line-height: 1; }
.lg-section:nth-child(3n+2) .lg-num { background: var(--b-blue); }
.lg-section:nth-child(3n) .lg-num { background: var(--b-pink); }
.lg-section p, .lg-section li { color: var(--b-text); font-size: 18px; font-weight: 400; line-height: 1.65; }
.lg-section p + p, .lg-section ul + p, .lg-section p + ul { margin-top: 14px !important; }
.lg-section p > strong:only-child { display: block; margin-top: 18px; }
.lg-section ul { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.lg-section li { position: relative; padding-left: 26px; }
.lg-section li::before { content: ''; position: absolute; left: 4px; top: .6em; width: 10px; height: 10px; border-radius: 50%; background: var(--b-pink); }
.lg-section strong { color: var(--b-text); font-weight: 800; }
.lg-section a { color: var(--b-pink-ink); font-weight: 700; text-underline-offset: 3px; }

/* Pestañas entre documentos legales */
.lg-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.lg-tabs a { display: inline-flex; align-items: center; min-height: 52px; padding: 0 22px; border: 3px solid var(--b-line); border-radius: 999px; background: var(--b-surface); color: var(--b-text); font-family: var(--b-font); font-size: 19px; font-weight: 600; text-decoration: none; }
.lg-tabs a:hover { border-color: var(--b-line-strong); }
.lg-tabs a:focus-visible { outline: 4px solid var(--b-focus); outline-offset: 3px; }
.lg-tabs a[aria-current="page"] { border-color: var(--b-text); background: var(--b-text); color: var(--b-on-accent); }

/* Caja de datos de contacto y tabla (cookies) */
.lg-box { margin-top: 12px; display: grid; gap: 8px; }
.lg-section .lg-box p { margin: 0 !important; padding: 12px 18px; border-radius: 14px; background: var(--b-surface-2); }
.lg-table-wrap { margin-top: 12px; overflow-x: auto; border: 2px solid var(--b-line); border-radius: 16px; }
.lg-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.lg-table th { padding: 12px 14px; background: var(--b-surface-2); text-align: left; font-weight: 800; white-space: nowrap; }
.lg-table td { padding: 10px 14px; border-top: 1px solid var(--b-line); color: var(--b-muted); }
.lg-table td:first-child { white-space: nowrap; }

@media (max-width: 900px) {
    .lg-toc { position: static; max-height: none; max-width: 100%; flex-basis: 100%; }
    .lg-toc summary::after { content: '+'; margin-left: auto; color: var(--b-muted); font-size: 26px; }
    .lg-toc details[open] summary::after { content: '−'; }
}
@media (max-width: 640px) {
    .lg { padding-top: 28px; }
    .lg-tabs a { min-height: 48px; padding: 0 18px; font-size: 18px; }
    .lg-toc { padding: 12px 16px 6px; }
    .lg-doc { padding: 8px 18px 28px; }
    .lg-section h2 { margin-top: 32px !important; }
    .lg-section p, .lg-section li { font-size: 17px; }
    .lg-table { font-size: 15px; }
}
