/* =====================================================================
   BasukoCFG — estilos adicionales (páginas de texto, fichas, accesibilidad).
   Se carga DESPUÉS de colors.css y styles.css y usa sus variables
   (--bg, --surface, --surface-2, --border, --text, --text-dim, --accent…).
===================================================================== */

[hidden]{ display:none !important; }

/* ---------- Accesibilidad ---------- */
.skip-link{
  position:absolute; left:12px; top:-60px; z-index:100;
  background:var(--accent); color:#1a0f06; font-weight:600; font-size:14px;
  padding:10px 14px; border-radius:8px;
}
.skip-link:focus{ top:12px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px;
}

/* ---------- Partners en la cabecera ---------- */
.partners-bar{
  border-top:1px solid var(--border);
  background:rgba(16,19,26,.92);
}
.partners-inner{
  display:flex; align-items:center; gap:16px;
  min-height:58px; padding-top:6px; padding-bottom:6px;
}
.partners-label{
  display:flex; align-items:center; gap:8px; flex-shrink:0;
  font-family:'Inter',sans-serif; font-size:11px; font-weight:600;
  letter-spacing:.14em; text-transform:uppercase; color:var(--text-faint);
}
.partners-label::before{
  content:""; width:6px; height:6px; border-radius:50%;
  background:var(--accent); box-shadow:0 0 8px rgba(255,138,61,.7);
}
.partners-list{
  display:flex; align-items:center; gap:10px;
  margin:0; padding:0; list-style:none;
  overflow-x:auto; scrollbar-width:none;
}
.partners-list::-webkit-scrollbar{ display:none; }
.partner-link{
  display:block; width:50px; height:50px; padding:2px; border-radius:50%;
  background:var(--surface-2); border:1px solid var(--border);
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.partner-link img{ width:100%; height:100%; border-radius:50%; object-fit:cover; }
.partner-link:hover, .partner-link:focus-visible{
  transform:translateY(-2px) scale(1.06);
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(255,138,61,.25), 0 6px 14px rgba(0,0,0,.35);
}
@media (max-width: 700px){
  .partners-inner{ gap:12px; min-height:52px; }
  .partners-label{ font-size:10px; letter-spacing:.12em; }
  .partner-link{ width:42px; height:42px; }
}
@media (prefers-reduced-motion: reduce){
  .partner-link{ transition:none; }
}

/* ---------- Márgenes laterales ----------
   En móvil, estos bloques perdían el margen lateral de .wrap (su padding vertical lo sobrescribía). */
.hero.wrap, .page-hero.wrap, .page-body.wrap, .content-layout.wrap{ padding-left:20px; padding-right:20px; }

/* En pantallas pequeñas, los cuadros laterales se apilan en vez de recortarse en una fila con scroll */
@media (max-width: 860px){
  .sidebar{ flex-direction:column; overflow-x:visible; }
  .sidebar-box{ min-width:0; }
}

/* ---------- Enlaces dentro de textos ---------- */
.page-body a, .intro a, .ficha-body a:not(.btn-download), .notice a, .breadcrumb a{
  color:var(--accent); text-decoration:underline; text-underline-offset:2px;
}
.page-body a:hover, .intro a:hover, .ficha-body a:not(.btn-download):hover{ color:#ffa460; }
.breadcrumb a{ text-decoration:none; }
.breadcrumb a:hover{ text-decoration:underline; }

/* ---------- Anuncios ---------- */
.ad-block{ max-width:1180px; margin:24px auto; padding:0 20px; clear:both; }
.ad-label{
  margin:0 0 6px; font-size:11px; text-align:center; color:var(--text-faint);
  text-transform:uppercase; letter-spacing:.8px;
}
.ad-block ins{ min-height:90px; }

/* ---------- Títulos de barra lateral y pie (h2 con el aspecto de los antiguos h4) ---------- */
.sidebar-box .side-title, .footer-col .footer-title{
  font-family:'Inter',sans-serif; font-weight:600; font-size:12.5px;
  color:var(--text-dim); margin:0 0 10px; letter-spacing:0; text-transform:none;
}
.link-button{
  background:none; border:none; padding:4px 0; margin:0; text-align:left;
  color:var(--text-dim); font:inherit; font-size:13px; text-decoration:underline; cursor:pointer;
}
.link-button:hover{ color:var(--text); }
.sidebar-note{ margin:0; font-size:13px; color:var(--text-dim); }

/* ---------- Tarjetas ---------- */
h3.card-title{ font-family:'Inter',system-ui,sans-serif; margin:0; }
.card-title a:hover{ text-decoration:underline; text-underline-offset:2px; }
.card-desc{ margin:0; }
.card-preview img{ width:100%; height:100%; object-fit:contain; }
.category-form{ margin:0; }

/* ---------- Portada ---------- */
.intro{ padding:28px 20px 4px; max-width:1180px; margin:0 auto; }
.intro h2{ font-size:19px; margin-bottom:10px; }
.intro p{ color:var(--text-dim); max-width:760px; margin:0 0 10px; font-size:14.5px; }
.search-big button.visually-hidden{ position:absolute; }

/* ---------- Migas de pan ---------- */
.breadcrumb{ padding:22px 0 0; font-size:12.5px; color:var(--text-faint); font-family:var(--mono); }
.breadcrumb ol{ list-style:none; display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; }
.breadcrumb li + li::before{ content:"›"; margin-right:6px; color:var(--text-faint); }

/* ---------- Ficha de descarga ---------- */
.ficha{ padding-bottom:60px; }
.ficha-body{ max-width:780px; }
.ficha-head{ padding:14px 0 6px; }
.ficha-head h1{ font-size:clamp(24px,4vw,32px); margin-top:4px; }
.ficha-body .ficha-meta{ padding:0; }
.ficha-meta{
  display:flex; flex-wrap:wrap; gap:6px 18px; list-style:none; padding:0; margin:12px 0 0;
  font-size:12.5px; color:var(--text-faint); font-family:var(--mono);
}
.ficha-preview{ margin:18px 0 0; max-width:640px; }
.ficha-actions{ display:flex; flex-wrap:wrap; gap:10px; margin:20px 0 6px; align-items:stretch; }
.ficha-actions .btn-download{ flex:0 0 auto; min-width:220px; padding:13px 24px; font-size:14.5px; }
.ficha-actions .btn-copy{ width:46px; }
.ficha-nota{ font-size:12.5px; color:var(--text-faint); margin:6px 0 0; }
.ficha-body section{ margin-top:30px; }
.ficha-body h2{ font-size:18px; margin-bottom:8px; }
.ficha-body p, .ficha-body li{ font-size:14.5px; color:var(--text-dim); }
.ficha-body ul, .ficha-body ol{ padding-left:20px; margin:8px 0; }
.ficha-body li{ margin-bottom:6px; }
.def-list{ display:grid; grid-template-columns:max-content 1fr; gap:8px 18px; margin:8px 0 0; font-size:14px; }
.def-list dt{ color:var(--text-faint); font-family:var(--mono); font-size:12.5px; padding-top:2px; }
.def-list dd{ margin:0; color:var(--text-dim); overflow-wrap:anywhere; }
.notice{
  border:1px solid var(--border-strong); background:var(--surface); border-radius:var(--radius);
  padding:14px 16px; font-size:13.5px; color:var(--text-dim); margin:26px 0 0;
}
.notice p{ margin:0; font-size:13.5px; }
.related{ margin-top:40px; }
.related h2{ font-size:18px; margin-bottom:14px; }

/* ---------- Tablas (política de cookies) ---------- */
.table-wrap{ overflow-x:auto; margin:12px 0; }
.page-body table{ border-collapse:collapse; width:100%; font-size:13.5px; min-width:520px; }
.page-body th, .page-body td{ border:1px solid var(--border); padding:9px 11px; text-align:left; vertical-align:top; color:var(--text-dim); }
.page-body th{ background:var(--surface-2); color:var(--text); font-weight:600; }

@media (max-width: 700px){
  .page-body table{ min-width:0; }
  .page-body thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .page-body tr{ display:block; margin-bottom:14px; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
  .page-body td{ display:block; border:none; border-bottom:1px solid var(--border); }
  .page-body td:last-child{ border-bottom:none; }
  .page-body td::before{
    content:attr(data-label); display:block; margin-bottom:2px;
    font-family:var(--mono); font-size:11.5px; color:var(--text-faint);
  }
}

/* ---------- Tutoriales ---------- */
.toc{ padding:0; list-style:none; margin:10px 0 0; }
.toc li{ margin:0 0 6px; }
.tutorial{ margin-top:34px; padding-top:22px; border-top:1px solid var(--border); }
.tutorial:first-of-type{ border-top:none; padding-top:0; }
.tutorial h2{ margin-top:0; }
.page-body ol{ padding-left:22px; margin:8px 0; }
.page-body ol li{ margin-bottom:8px; }

/* ---------- Estado vacío ---------- */
.empty-state{ grid-column:1/-1; text-align:center; padding:60px 20px; color:var(--text-dim); }
.empty-state svg{ width:38px; height:38px; margin:0 auto 14px; color:var(--text-faint); }
.empty-state h3{ font-size:16px; margin-bottom:6px; color:var(--text); }
.empty-state p{ font-size:13.5px; margin:0; }

@media (max-width: 700px){
  .def-list{ grid-template-columns:1fr; gap:2px 0; }
  .def-list dd{ margin-bottom:10px; }
  .ficha-actions .btn-download{ flex:1 1 100%; }
}

/* ---------- Filtros de categoría (barra lateral) ---------- */
.category-form{ display:flex; flex-direction:column; gap:2px; margin:0; }

/* La lista de categorías tiene su propio scroll: no arrastra el resto de la página. */
.sidebar-box.categories{ display:flex; flex-direction:column; min-height:0; }
.category-scroll{
  display:flex; flex-direction:column; gap:2px;
  max-height:min(56vh, 430px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:var(--border-strong) transparent;
  padding-right:6px;
  margin-right:-6px;
}
.category-scroll::-webkit-scrollbar{ width:8px; }
.category-scroll::-webkit-scrollbar-track{ background:transparent; }
.category-scroll::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:8px; }
.category-scroll:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

@media (max-width: 860px){
  .category-scroll{ max-height:none; overflow:visible; padding-right:0; margin-right:0; }
}

/* ---------- «Ver más» del catálogo ---------- */
.page-back{ margin:0 0 14px; font-size:13px; font-family:var(--mono); }
.page-back a{ color:var(--text-dim); text-decoration:none; }
.page-back a:hover{ color:var(--accent); }
.load-more-wrap{ display:flex; justify-content:center; margin:26px 0 0; }
.btn-more{
  display:inline-flex; align-items:center; gap:8px;
  padding:11px 22px; border-radius:8px; border:1px solid var(--border-strong);
  background:var(--surface); color:var(--text); font-size:14px; font-weight:600;
  text-decoration:none; cursor:pointer;
}
.btn-more:hover{ border-color:var(--accent); color:var(--accent); }
.btn-more[aria-busy="true"]{ opacity:.55; pointer-events:none; }
.btn-more-arrow{ font-family:var(--mono); }
.grid[aria-busy="true"]{ opacity:.55; transition:opacity .15s ease; }
.category-filter{
  display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%;
  background:none; border:none; color:var(--text-dim); text-align:left;
  padding:8px 10px; border-radius:7px; font-size:13.5px; font-family:inherit; cursor:pointer;
}
.category-filter:hover{ background:var(--surface-2); color:var(--text); }
.category-filter.active{ background:var(--surface-2); color:var(--text); }
.category-filter-name{ display:flex; align-items:center; gap:8px; min-width:0; }
.category-filter .cat-dot{ background:var(--category-color, var(--accent)); }
