/* Plantilla común de Support (S2). Sin librerías. La página se lee igual sin JS:
   el JS solo añade el resaltado de «En esta página» y el cajón «Índice» en el móvil. */

/* ---------- Columna izquierda fija ---------- */
/* La columna no hace scroll (así el desplegable del buscador puede salir por encima del contenido);
   solo .tpl-scroll, con las tarjetas, se desplaza. */
.ssc-tpl .sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 84px; align-self: flex-start; z-index: 50;
  max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.ssc-tpl .sidebar .tpl-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 4px; }
.ssc-tpl .sidebar .nav-card { padding: 16px 16px 12px; margin-bottom: 14px; }
.ssc-tpl .sidebar h2 { font-size: .78em; margin-bottom: 10px; letter-spacing: .08em; }
.ssc-tpl .sidebar ul li { margin: 2px 0; }
.ssc-tpl .sidebar ul li a { padding: 5px 10px; font-size: .9em; line-height: 1.35; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; }
.ssc-tpl .sidebar ul li a:hover { padding-left: 10px; }
.ssc-tpl .sidebar ul li a.is-active,
.ssc-tpl .sidebar ul li a[aria-current="page"] { background: #eaf3fd; color: #0b5fa5; border-left-color: #1e7ec8; font-weight: 600; }

/* Buscador pequeño (search.js lo engancha: es la primera .search-bar de la página) */
.ssc-tpl .sidebar .ssc-search-wrap, .ssc-tpl .sidebar .tpl-search { position: relative; margin: 0 0 14px; padding: 0; max-width: none; width: auto; }
.ssc-tpl .sidebar .search-bar { display: flex; margin: 0; max-width: none; background: #fff; border: 1px solid #c7d8f0;
  border-radius: 8px; overflow: hidden; box-shadow: none; }
.ssc-tpl .sidebar .search-bar input { flex: 1; min-width: 0; border: 0; padding: 9px 10px; font: inherit; font-size: .92em; background: transparent; color: #2c3e50; }
.ssc-tpl .sidebar .search-bar input:focus { outline: none; }
.ssc-tpl .sidebar .search-bar:focus-within { border-color: #1e7ec8; box-shadow: 0 0 0 3px rgba(30,126,200,.15); }
.ssc-tpl .sidebar .search-bar button { border: 0; background: #1e7ec8; color: #fff; font: inherit; font-size: .85em; font-weight: 600; padding: 0 12px; cursor: pointer; }
.ssc-tpl .sidebar .ssc-search-results { width: min(560px, calc(100vw - 32px)); left: 0; right: auto; transform: none; z-index: 300; }

/* «Estás en» */
.ssc-tpl .tpl-here p { margin: 0; font-size: .9em; color: #475569; line-height: 1.45; }
.ssc-tpl .tpl-here strong { color: #0b5fa5; font-weight: 600; }

/* «Todas las ayudas»: grupos plegables (el grupo de esta página, abierto) */
.ssc-tpl .tpl-all details { border-top: 1px solid #edf2f7; }
.ssc-tpl .tpl-all details:first-of-type { border-top: 0; }
.ssc-tpl .tpl-all summary { cursor: pointer; list-style: none; padding: 8px 4px; font-size: .9em; font-weight: 600; color: #2c3e50; display: flex; gap: 6px; align-items: center; }
.ssc-tpl .tpl-all summary::-webkit-details-marker { display: none; }
.ssc-tpl .tpl-all summary::after { content: "▸"; margin-left: auto; color: #94a3b8; transition: transform .15s; }
.ssc-tpl .tpl-all details[open] > summary::after { transform: rotate(90deg); }
.ssc-tpl .tpl-all details.tpl-g-problemas > summary { color: #b45309; }
.ssc-tpl .tpl-all ul { padding-bottom: 6px; }
.ssc-tpl .tpl-all .tpl-soon { display: block; padding: 5px 10px 5px 13px; font-size: .88em; color: #94a3b8; line-height: 1.35; }
.ssc-tpl .tpl-all .tpl-soon small { font-size: .85em; font-style: italic; }

/* ---------- Ruta (encima del título) ---------- */
.ssc-tpl .tpl-crumbs { font-size: .85em; margin: 0 auto 10px; opacity: .92; }
.ssc-tpl .tpl-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; padding: 0; margin: 0; }
.ssc-tpl .tpl-crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.ssc-tpl .tpl-crumbs li + li::before { content: "›"; opacity: .6; }
.ssc-tpl .tpl-crumbs a { color: #cfe6ff; text-decoration: none; border-bottom: 1px solid rgba(207,230,255,.4); }
.ssc-tpl .tpl-crumbs a:hover { color: #fff; border-bottom-color: #fff; }
.ssc-tpl .tpl-crumbs [aria-current="page"] { color: #fff; }

/* ---------- Las dos puertas ---------- */
.ssc-tpl .tpl-doors { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 22px auto 0; max-width: 760px; }
.ssc-tpl .tpl-door { flex: 1 1 260px; display: flex; gap: 12px; align-items: center; text-align: left; text-decoration: none;
  border-radius: 12px; padding: 14px 18px; border: 1px solid rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.08);
  transition: background .15s, border-color .15s, transform .15s; }
.ssc-tpl .tpl-door:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.55); transform: translateY(-1px); }
.ssc-tpl .tpl-door:focus-visible { outline: 3px solid #fde68a; outline-offset: 2px; }
.ssc-tpl .tpl-door .tpl-door-i { font-size: 1.6em; line-height: 1; }
.ssc-tpl .tpl-door b { display: block; font-size: 1.05em; font-weight: 600; }
.ssc-tpl .tpl-door small { display: block; font-size: .85em; opacity: .85; }
.ssc-tpl .tpl-door.tpl-help { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }
.ssc-tpl .tpl-door.tpl-help:hover { background: #fbbf24; border-color: #fbbf24; }

/* Marca de destino de cada puerta dentro de la página */
.ssc-tpl .tpl-target { scroll-margin-top: 96px; }
.ssc-tpl :target.tpl-target, .ssc-tpl .tpl-flash { animation: tplFlash 1.6s ease-out 1; }
@keyframes tplFlash { 0% { box-shadow: 0 0 0 4px rgba(245,158,11,.55); } 100% { box-shadow: 0 0 0 4px rgba(245,158,11,0); } }

/* Ficha técnica (Referencia técnica) */
.ssc-tpl table.tpl-ficha { width: 100%; border-collapse: collapse; font-size: .9em; margin: 8px 0 18px; }
.ssc-tpl table.tpl-ficha th, .ssc-tpl table.tpl-ficha td { border-bottom: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; vertical-align: top; }
.ssc-tpl table.tpl-ficha th { width: 34%; color: #0b5fa5; font-weight: 600; background: #f8fbff; }
.ssc-tpl .tpl-ficha-wrap { overflow-x: auto; }

/* ---------- Botón «Índice» y cajón en el móvil (solo con JS) ---------- */
.ssc-tpl .tpl-index-btn, .ssc-tpl .tpl-drawer-close, .ssc-tpl .tpl-scrim { display: none; }
@media (max-width: 900px) {
  .ssc-tpl .sidebar { position: static; max-height: none; width: 100%; }
  .ssc-tpl .sidebar .tpl-scroll { overflow: visible; padding-right: 0; }
  .ssc-tpl .tpl-doors { margin-top: 18px; }
  .ssc-tpl .tpl-door { flex-basis: 100%; }
  html.tpl-js .ssc-tpl .sidebar { position: fixed; z-index: 1001; top: 0; bottom: 0; left: 0; width: min(86vw, 340px);
    max-height: none; overflow-y: auto; display: block; background: #fafbfc; padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 24px max(14px, env(safe-area-inset-left, 0px));
    transform: translateX(-105%); transition: none; box-shadow: 0 0 40px rgba(2,12,27,.25); visibility: hidden; }
  html.tpl-js .ssc-tpl.tpl-open .sidebar { transform: none; visibility: visible; }
  html.tpl-js .ssc-tpl .tpl-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(2,12,27,.45); }
  html.tpl-js .ssc-tpl.tpl-open .tpl-scrim { display: block; }
  html.tpl-js .ssc-tpl .tpl-drawer-close { display: block; margin: 0 0 12px auto; background: #fff; border: 1px solid #c7d8f0; border-radius: 8px;
    padding: 6px 12px; font: inherit; font-size: .9em; color: #0b5fa5; cursor: pointer; }
  html.tpl-js .ssc-tpl .tpl-index-btn { display: inline-flex; align-items: center; gap: 6px; position: fixed; z-index: 999;
    left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: #0b5fa5; color: #fff; border: 0; border-radius: 999px; padding: 11px 18px; font: inherit; font-weight: 600; font-size: .95em;
    box-shadow: 0 6px 18px rgba(2,12,27,.3); cursor: pointer; }
  html.tpl-js .ssc-tpl.tpl-open .tpl-index-btn { display: none; }
  /* S3: en el cajón, la caja de resultados mide lo que el buscador (con 100vw se salía del cajón y se cortaba). */
  html.tpl-js .ssc-tpl .sidebar .ssc-search-results { width: 100%; left: 0; right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ssc-tpl .tpl-door, html.tpl-js .ssc-tpl .sidebar { transition: none; }
  .ssc-tpl :target.tpl-target, .ssc-tpl .tpl-flash { animation: none; }
}

/* ---------- Saltos a un apartado: el destino queda debajo de la cabecera fija (turno 316) ----------
   --tpl-head lo pone el JS con la altura real de la cabecera; sin JS, 72 px. */
.ssc-tpl [id], .ssc-tpl .section, .ssc-tpl .tpl-target { scroll-margin-top: calc(var(--tpl-head, 72px) + 16px) !important; }

/* ---------- Idiomas: en PC, los 4 botones; en el móvil, un desplegable «🌐 ES ▾» (turno 316) ---------- */
.ssc-tpl .tpl-lang-btn { display: none; }
.ssc-tpl .tpl-lang-list { display: flex; gap: 4px; }
@media (max-width: 700px) {
  /* Sin JS la cabecera no se queda fija: no le quita pantalla a nadie. */
  .ssc-tpl .top-header { position: relative; }
  html.tpl-js .ssc-tpl .top-header { position: sticky; }
  html.tpl-js .ssc-tpl .header-inner { flex-wrap: nowrap; justify-content: space-between; gap: 8px; padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); }
  html.tpl-js .ssc-tpl .logo { height: 30px; }
  html.tpl-js .ssc-tpl .site-title { font-size: 1em; white-space: nowrap; }
  html.tpl-js .ssc-tpl .ssc-exit-support { font-size: .8em; padding: 5px 8px; white-space: nowrap; margin-left: auto; }
  html.tpl-js .ssc-tpl .lang-bar { position: relative; right: auto; margin-left: 0; flex: 0 0 auto; width: auto; order: 4; justify-content: flex-end; }
  html.tpl-js .ssc-tpl .tpl-lang-btn { display: inline-flex; align-items: center; gap: 4px; background: #f0f5ff; border: 1px solid #c7d8f0; border-radius: 6px;
    padding: 5px 9px; font: inherit; font-size: .85em; font-weight: 600; color: #1e7ec8; cursor: pointer; white-space: nowrap; }
  html.tpl-js .ssc-tpl .tpl-lang-list { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 300; flex-direction: column; gap: 4px;
    background: #fff; border: 1px solid #c7d8f0; border-radius: 10px; padding: 6px; box-shadow: 0 10px 28px rgba(15,60,110,.18); min-width: 150px; }
  html.tpl-js .ssc-tpl .lang-bar.tpl-open .tpl-lang-list { display: flex; }
  html.tpl-js .ssc-tpl .tpl-lang-list .lang-btn { display: block; text-align: left; font-size: .95em; padding: 8px 12px; }
  /* El botón «Índice» también sube mientras está abierto el aviso de cookies. */
  html.ssc-cc-open.tpl-js .ssc-tpl .tpl-index-btn { bottom: calc(var(--ssc-cc-h, 0px) + 12px); }
}

/* Turno 318: en fr/de la cabecera de una línea no cabía en 375 px y ensanchaba toda la página (586 px).
   Ahora el título se encoge (con «…») y, en pantallas muy estrechas, desaparece: el logo ya lleva al inicio de la ayuda. */
@media (max-width: 700px) {
  html.tpl-js .ssc-tpl .header-inner > * { min-width: 0; flex-shrink: 0; }
  html.tpl-js .ssc-tpl .header-inner .site-title { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 400px) {
  html.tpl-js .ssc-tpl .header-inner .site-title { display: none; }
}
/* Turno 318: orden fijo de la cabecera en el móvil (logo, título, «← Inicio», idioma) y «← Inicio» se recorta con «…»
   antes que ensanchar la página (en alemán «← Startseite» no cabía a 320 px). */
@media (max-width: 700px) {
  html.tpl-js .ssc-tpl .header-inner .ssc-logo-link { order: 1; }
  html.tpl-js .ssc-tpl .header-inner .site-title { order: 2; }
  html.tpl-js .ssc-tpl .header-inner .ssc-exit-support { order: 3; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
}
/* Turno 318: una tabla ancha se desplaza dentro de su caja en vez de ensanchar la página; secciones con menos relleno
   en pantallas estrechas (32 px por lado se comían un quinto de un móvil de 320 px). */
.ssc-tpl .content table { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 480px) {
  .ssc-tpl .section { padding: 20px 16px; }
}
/* Turno 321: un <code> o <pre> largo (rutas, cabeceras, reglas) se parte o se desplaza dentro de su caja en vez de
   ensanchar la página (en firewall/ medía 536-613 px en el móvil). */
.ssc-tpl .content code { overflow-wrap: anywhere; word-break: break-word; }
.ssc-tpl .content pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.ssc-tpl .content img, .ssc-tpl .content video, .ssc-tpl .content iframe { max-width: 100%; height: auto; }
/* Turno 321: palabras largas sin espacios (p. ej. «(SQL/NoSQL/XSS/LFI/Comandos/XXE/SSRF)» en un título) se parten solo
   cuando no caben, en vez de ensanchar la página. */
.ssc-tpl .content, .ssc-tpl .hero { overflow-wrap: anywhere; }
/* Turno 322: el cajón empieza ya oculto; la animación solo existe al abrir y cerrar (antes se veía deslizarse al cargar). */
@media (max-width: 900px) {
  html.tpl-js.tpl-ready .ssc-tpl .sidebar { transition: transform .22s ease, visibility 0s linear .22s; }
  html.tpl-js.tpl-ready .ssc-tpl.tpl-open .sidebar { transition: transform .22s ease, visibility 0s; }
}
/* Turno 323: las rejillas de cajas (info-grid…) usaban «1fr», cuyo mínimo es el contenido más largo de la caja
   (uploads medía 457 px y hardening 416 en el móvil). Ahora las columnas pueden encoger y el código se desplaza dentro. */
.ssc-tpl .content [class*="grid"] > *, .ssc-tpl .content .info-box { min-width: 0; }
@media (max-width: 900px) { .ssc-tpl .content .info-grid { grid-template-columns: minmax(0, 1fr); } }
.ssc-tpl .content .code-block { max-width: 100%; overflow-x: auto; }
