/* Páginas legales (accesibilidad.html, privacidad.html) con la cáscara del Observatorio.
   Se carga DESPUÉS de fonts.css y main.css: reutiliza #sidebar, .sb-head, .sb-langs .lang-btn,
   #nav-items .nav-item, .nav-plogo, .sb-sellos, .sb-legal, #mobilebar, .mb-legal, .me-head,
   .me-title, .me-sub, .mx-subh y .me-acc-link tal cual los pinta el sitio.
   Sin JavaScript: el idioma lo decide el ancla (#es / #eu / #en, o un id dentro de una sección,
   p. ej. #es-participa) con :target y :has(). Sin ancla (o con un ancla fuera de las secciones), euskera.
   Todo va bajo body.lg para que nada de esta hoja afecte a otras páginas. */

/* ── 1. Color del idioma (el mismo que _MARCO_LANG_INK / LANG_ACCENT del sitio) ── */
body.lg {
  --lang-ink: #002F6C;
  --lang-ink-aa: var(--lang-ink);          /* lo usa .me-acc-link */
  --rc: var(--lang-ink);                   /* .mx-subh: banda = tinte 42 % de este color */
  --rci: var(--lang-ink);
}
body.lg:has(#es:target, #es :target) { --lang-ink: #07523A; }
body.lg:has(#en:target, #en :target) { --lang-ink: #A12A1B; }

/* ── 2. Textos de la cáscara en tres idiomas: se ve solo el del idioma activo ── */
body.lg:not(:has(#es:target, #es :target, #en:target, #en :target)) .lg-t:not([lang="eu"]),
body.lg:has(#es:target, #es :target) .lg-t:not([lang="es"]),
body.lg:has(#en:target, #en :target) .lg-t:not([lang="en"]) { display: none; }

/* ── 3. Página y cáscara (escritorio ≥901 px: menú fijo a la izquierda, papel blanco) ── */
html:has(body.lg) { height: auto; }
body.lg { height: auto; min-height: 100%; background: #fff; }
body.lg .lg-layout { display: flex; align-items: flex-start; min-height: 100vh; }
body.lg #sidebar { position: sticky; top: 0; height: 100vh; }
body.lg .lg-main { flex: 1 1 auto; min-width: 0; background: #fff; }
body.lg .lg-main:focus, body.lg .lg-lang:focus { outline: none; }
body.lg .lg-paper [id] { scroll-margin-top: 16px; }

/* sin botón de plegar (necesita JS): el logo ocupa la cabecera como en el menú desplegado */
body.lg .sb-brand { flex: 0 0 auto; }
/* enlaces del menú con el aspecto de los botones del sitio */
body.lg #nav-items a.nav-item { text-decoration: none; color: #070F25; }
body.lg #nav-items .nav-ic { fill: var(--lang-ink); }
body.lg a.nav-plogo { text-decoration: none; color: inherit; }
body.lg .sb-legal a, body.lg .mb-legal a { color: var(--lang-ink); }
body.lg .sb-legal a[aria-current="page"], body.lg .mb-legal a[aria-current="page"] { font-weight: 800; text-decoration-thickness: 2px; }

/* botones de idioma = anclas con el aspecto de .sb-langs .lang-btn (44×44, Poppins 800 11,5 px).
   Hay un grupo .sb-langs.lg-t por idioma; en cada uno, el botón de ese idioma lleva aria-current="true"
   (estado para lectores de pantalla y para colores forzados, además del relleno) */
body.lg a.lang-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
body.lg a.lang-btn:hover { text-decoration: none; }
body.lg .sb-langs .lang-btn[aria-current="true"] { background: var(--lang-ink); color: #fff; }
/* foco: tinta; blanco sobre el relleno del idioma activo (igual que #sidebar .lang-btn) */
body.lg .lang-btn:focus-visible { outline: 3px solid #070F25; outline-offset: -3px; }
body.lg .lang-btn[aria-current="true"]:focus-visible,
body.lg #sidebar .sb-langs .lang-btn[aria-current="true"]:focus-visible { outline-color: #fff; }   /* #sidebar: gana a la tinta de main.css */
@media (forced-colors: active) {
  body.lg .sb-langs .lang-btn[aria-current="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  body.lg .lang-btn[aria-current="true"]:focus-visible,
  body.lg #sidebar .sb-langs .lang-btn[aria-current="true"]:focus-visible { outline-color: HighlightText; }
}

/* ── 4. Idioma del contenido ── */
body.lg .lg-lang { display: none; }
body.lg .lg-lang:is(:target, :has(:target)) { display: block; }
body.lg .lg-main:not(:has(.lg-lang:target, .lg-lang :target)) #eu { display: block; }

/* ── 5. Cabecera centrada (= .me-head / .me-title / .me-sub del sitio) ── */
body.lg .me-head { padding: 24px 24px 20px; }
body.lg .me-sub { min-height: 0; max-width: 760px; margin: 14px auto 0; }

/* ── 6. Papel: columna centrada; las bandas ocupan todo su ancho, como en la ficha ── */
body.lg .lg-paper { max-width: 792px; margin: 0 auto; padding: 0 16px 56px;
  font-family: var(--font-ficha); font-size: 15.5px; line-height: 1.5; color: #070F25; }
body.lg .lg-paper p { margin: 0 0 12px; }
body.lg .lg-paper h2.mx-subh { line-height: 1.6; margin: 24px -16px 12px; }   /* main.css da 1.16 a los h2 */
body.lg .lg-paper h3 { font-family: var(--font-display); font-size: 12px; font-weight: 700; line-height: 1.6;
  letter-spacing: .04em; text-transform: uppercase; color: var(--lang-ink); margin: 18px 0 6px; }
body.lg .lg-paper ul { margin: 0 0 12px; padding-left: 22px; list-style: square; }
body.lg .lg-paper li { margin: 0 0 6px; padding-left: 2px; }
body.lg .lg-paper li::marker { color: var(--lang-ink); }
body.lg .lg-paper strong { font-weight: 700; }
body.lg .lg-paper em { font-style: italic; }
/* enlaces dentro del texto: color del idioma + subrayado (el color solo queda por debajo de 3:1 frente a la tinta) */
body.lg .lg-paper a { color: var(--lang-ink); font-weight: 700; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
body.lg .lg-paper a:hover { color: color-mix(in srgb, var(--lang-ink), #000 34%); text-decoration-thickness: 2px; }
body.lg .lg-paper a:focus-visible, body.lg .sb-legal a:focus-visible, body.lg .mb-legal a:focus-visible { outline: 3px solid var(--lang-ink); outline-offset: 2px; }
/* enlaces sueltos del pie de sección (= .me-acc-link: subrayado solo al pasar o enfocar) */
body.lg .lg-more { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 28px 0 0; padding-top: 14px; border-top: 1px solid #DCDCDC; }
body.lg .lg-more a.me-acc-link { margin-top: 0; text-decoration: none; }
body.lg .lg-more a.me-acc-link:hover, body.lg .lg-more a.me-acc-link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* versión del aviso (fecha del texto que se acepta en el alta de PARTICIPA) */
body.lg .lg-paper p.lg-version { margin: 24px 0 0; font-size: 14px; color: #4A4A4A; }
/* aviso de borrador: bloque plano con el tinte claro del idioma, a sangre del papel */
body.lg .lg-pending { margin: 4px -16px 16px; padding: 12px 16px; background: color-mix(in srgb, var(--lang-ink) 12%, #fff);
  font-size: 15px; line-height: 1.5; }
/* huecos por rellenar: marca de trabajo amarilla */
body.lg .lg-paper mark { background: #FFF3C4; color: #070F25; font-weight: 600; padding: 0 3px; }
/* datos rellenos a la espera de confirmación: fondo arena suave + trazo discontinuo */
body.lg .lg-paper mark.lg-confirmar { background: #F3EEDF; color: inherit; font-weight: inherit; padding: 1px 3px;
  border-bottom: 1px dashed #8A7442; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* tabla (privacidad): mismo contrato que las tablas de Mapas temáticos */
body.lg .lg-table-wrap { overflow-x: auto; border: 1px solid #DCDCDC; margin: 8px 0 16px; }
body.lg .lg-paper table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
body.lg .lg-paper th { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; text-align: left; color: #070F25; padding: 10px 14px; border-bottom: 1px solid #DCDCDC; }
body.lg .lg-paper td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid #ECECEC; }
body.lg .lg-paper tbody tr:nth-child(even) td { background: #F6F6F6; }
body.lg .lg-paper tbody tr:last-child td { border-bottom: 0; }
/* en estrecho la tabla cabe entera: menos relleno; solo la 1.ª columna puede cortar dentro de palabra
   (la dirección larga lleva <wbr> en los puntos); uso y proveedor cortan solo entre palabras */
@media (max-width: 600px) {
  body.lg .lg-paper table { font-size: 14px; }
  body.lg .lg-paper th, body.lg .lg-paper td { padding: 8px 8px; }
  body.lg .lg-paper td { overflow-wrap: normal; hyphens: manual; }
  body.lg .lg-paper td:first-child { overflow-wrap: anywhere; }
}
/* ≤420 px: cada fila es una ficha (servicio como título; uso y proveedor con su etiqueta data-label).
   Los role= del HTML mantienen la semántica de tabla con display:block; la cabecera queda solo para lectores
   y la etiqueta visible lleva texto alternativo vacío para que se anuncie una sola vez */
@media (max-width: 420px) {
  body.lg .lg-table-wrap { border: 0; overflow: visible; }
  body.lg .lg-paper table, body.lg .lg-paper tbody, body.lg .lg-paper tr, body.lg .lg-paper td { display: block; width: auto; }
  body.lg .lg-paper thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body.lg .lg-paper tbody tr { border: 1px solid #DCDCDC; margin: 0 0 8px; }
  body.lg .lg-paper td { border-bottom: 0; padding: 3px 12px; overflow-wrap: break-word; }
  body.lg .lg-paper td:first-child { font-weight: 700; padding-top: 10px; overflow-wrap: break-word; }
  body.lg .lg-paper td:last-child { padding-bottom: 10px; }
  body.lg .lg-paper td[data-label]::before { content: attr(data-label) ": "; content: attr(data-label) ": " / ""; font-family: var(--font-display); font-size: 12px;
    font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
}

/* ── 7. Enlace de salto: al ancla del idioma activo (así se conserva el idioma) ── */
body.lg .skip-link { background: var(--lang-ink); }
body.lg .skip-link:focus, body.lg .skip-link:focus-visible { outline: 3px solid #070F25; outline-offset: 2px; }

/* ── 8. Móvil (≤900 px): barra superior del sitio + idiomas a la derecha; menú lateral fuera ── */
@media (max-width: 900px) {
  body.lg #sidebar { display: none; }
  body.lg #mobilebar { position: sticky; top: 0; z-index: 20; }
  body.lg .lg-mb-home { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; min-height: 44px; text-decoration: none; color: #070F25; }
  body.lg #mobilebar .mb-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.lg .lg-mb-home:hover { text-decoration: none; }
  body.lg .lg-mb-home:focus-visible { outline: 3px solid #070F25; outline-offset: 2px; }
  body.lg #mobilebar .sb-langs { margin-left: auto; padding: 0; flex: 0 0 auto; }
  body.lg .lg-lang, body.lg .lg-paper [id] { scroll-margin-top: 62px; }
  body.lg .me-head { padding: 22px 16px 14px; }
  body.lg .mb-legal { gap: 8px; }
}
/* hasta 430 px el título corto cabe entero también con el espaciado de texto de WCAG 1.4.12 */
@media (max-width: 430px) { body.lg #mobilebar .lg-mb-suffix { display: none; } }
@media (max-width: 300px) { body.lg #mobilebar .mb-title { display: none; } }

/* ── 9. Navegador sin :has(): los tres idiomas apilados (euskera primero en el HTML), cáscara en euskera ── */
@supports not selector(:has(a)) {
  body.lg .lg-lang { display: block; }
  body.lg .lg-lang + .lg-lang { border-top: 1px solid #DCDCDC; margin-top: 32px; }
  body.lg .lg-t:not([lang="eu"]) { display: none; }
}

/* ── 10. Impresión: solo el idioma que se ve, sin menú ni barras ── */
@media print {
  body.lg #sidebar, body.lg #mobilebar, body.lg .mb-legal, body.lg .skip-link, body.lg .lg-more { display: none; }
  body.lg .lg-layout { display: block; min-height: 0; }
  body.lg .lg-paper h2.mx-subh, body.lg .lg-pending, body.lg .lg-paper mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
