/* Portada (index.php): diseño de las capturas del 23-11-2026. Solo la carga la portada (render_header «css»). */

/* Ilustración: colores por tema */
.is-home {
  --tray: #e4e5f6; --tray-edge: #c9cbea; --tray-in: #eceefa;
  --paper: #ffffff; --paper-line: #dfe2ec; --fold: #e9ebf3;
  --qrtile: #cfc9fb; --qr: #3b2a86;
  --h2-accent: #5b4ff0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .is-home { --tray: #2a2d6b; --tray-edge: #1d1f4d; --tray-in: #30347a; --paper: #f1f0ec; --paper-line: #c9cbd3; --fold: #dcdad3; --qrtile: #b9b0f7; --qr: #2a1f6b; --h2-accent: #8b80ff; }
}
:root[data-theme="dark"] .is-home { --tray: #2a2d6b; --tray-edge: #1d1f4d; --tray-in: #30347a; --paper: #f1f0ec; --paper-line: #c9cbd3; --fold: #dcdad3; --qrtile: #b9b0f7; --qr: #2a1f6b; --h2-accent: #8b80ff; }
.a-tray { fill: var(--tray); } .a-tray-edge { fill: var(--tray-edge); } .a-tray-in { fill: var(--tray-in); }
.a-paper { fill: var(--paper); stroke: rgba(14, 18, 48, .08); stroke-width: 1.5; }
.a-fold { fill: var(--fold); stroke: none; }
.a-lines rect { fill: var(--paper-line); }
.a-qrtile { fill: var(--qrtile); } .a-qr { color: var(--qr); }
.a-qrcard { fill: #fff; stroke: rgba(14, 18, 48, .1); stroke-width: 1.5; } .a-qrdark { color: #111; }

/* Cabecera de la web: sin recuadros en los botones, como en la captura */
.is-home .topbar { background: var(--bg); backdrop-filter: none; }
.is-home .langbtn, .is-home .navtoggle, .is-home .themebtn { border-color: transparent; background: none; }

/* Hero */
.h2hero { padding: 54px 0 40px; }
.h2hero__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 40px; border-bottom: 1px solid var(--line); padding-bottom: 54px; }
.h2hero h1 { margin: 0 0 14px; font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 800; }
.h2hero h1 span { display: block; color: var(--h2-accent); }
.h2hero__sub { margin: 0 0 28px; font-size: clamp(1.15rem, 1.8vw, 1.6rem); color: var(--text); font-weight: 500; }
.h2search { display: flex; align-items: center; gap: 12px; max-width: 640px; padding: 6px 6px 6px 20px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; }
.h2search:focus-within { border-color: var(--primary); }
.h2search > .ico { color: var(--muted); flex: none; }
.h2search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 1.12rem; color: var(--text); padding: 12px 0; outline: none; }
.h2search input::placeholder { color: var(--muted); }
.h2search__btn { flex: none; border: 0; border-radius: 10px; background: #5b4ff0; color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; padding: 13px 30px; cursor: pointer; }
.h2search__btn:hover { background: #4a3fe0; }
.h2quick { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
.h2quick a { display: inline-flex; align-items: center; padding: 9px 26px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--text); font-weight: 600; text-decoration: none; }
.h2quick a:hover { border-color: var(--primary); }
.h2art { min-width: 0; }
.h2art svg { display: block; width: 100%; height: auto; }
.h2art__mini { display: none !important; }

/* Herramientas */
.h2tools { padding-top: 8px; padding-bottom: 30px; }
.h2tools__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.h2tools__head h2 { margin: 0; font-size: clamp(1.9rem, 3vw, 2.7rem); letter-spacing: -.02em; }
.h2tools__all { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--h2-accent); text-decoration: none; white-space: nowrap; }
.h2tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.h2tabs::-webkit-scrollbar { display: none; }
.h2tab { flex: none; display: inline-flex; align-items: center; gap: 9px; padding: 12px 13px; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; background: none; color: var(--text); font: inherit; font-size: 1rem; font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none; }
.h2tab .ico { color: var(--muted); }
.h2tab:hover { background: var(--surface-2); text-decoration: none; }
.h2tab[aria-current="true"] { background: var(--primary-50); border-bottom-color: var(--h2-accent); font-weight: 650; }
.h2tab[aria-current="true"] .ico { color: var(--h2-accent); }
.h2count { margin: -14px 0 16px; color: var(--muted); font-weight: 600; }
.h2count:focus, .h2empty:focus { outline: none; }
.h2grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.h2card { display: flex; align-items: center; gap: 18px; min-height: 124px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.h2card[hidden] { display: none; }
.h2card:hover { border-color: color-mix(in srgb, var(--h2-accent) 55%, var(--line)); text-decoration: none; }
.h2card__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 62px; height: 62px; border-radius: 14px; color: #fff; background: var(--ic); }
.h2card__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.h2card__txt strong { font-size: 1.14rem; line-height: 1.25; }
.h2card__txt small { color: var(--muted); font-size: .9rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.h2card__go { flex: none; color: var(--text); display: flex; }
.h2card__go .ico + .ico { display: none; }
.h2empty { color: var(--muted); }
.h2more { text-align: center; margin: 26px 0 0; }
.h2more[hidden] { display: none; }
/* Colores de los iconos (uno por categoría) */
.is-red { --ic: #ee6a6a; } .is-blue { --ic: #4f8ff0; } .is-green { --ic: #2fbf86; } .is-amber { --ic: #ea9d2c; } .is-orange { --ic: #f07a45; }
.is-violet { --ic: #8a78f5; } .is-teal { --ic: #22a8b5; } .is-indigo { --ic: #6470f0; } .is-gold { --ic: #c58a2e; } .is-sky { --ic: #3aa0dc; }

@media (max-width: 1180px) { .h2grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .h2hero__in { grid-template-columns: 1fr; }
  .h2grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Móvil: como la captura (ilustración pequeña arriba a la derecha, enlaces subrayados, pestañas en pastilla y filas) */
@media (max-width: 640px) {
  .is-home .themebtn { display: inline-flex; }
  .h2hero { padding: 26px 0 0; }
  .h2hero__in { position: relative; display: block; padding-bottom: 26px; }
  .h2hero h1 { font-size: clamp(2.5rem, 12.5vw, 3.4rem); padding-right: 0; }
  .h2hero h1 { max-width: calc(100% - 118px); }
  .h2hero h1 span { white-space: nowrap; }
  .h2hero__sub { font-size: 1.12rem; margin-bottom: 22px; }
  /* Dentro del margen de la página: con right negativo se salía 12 px y el móvil dejaba deslizar de lado */
  .h2hero { overflow-x: clip; }
  .h2art { position: absolute; top: -10px; right: 12px; width: 120px; }
  .h2art__big { display: none !important; }
  .h2art__mini { display: block !important; }
  .h2search { padding: 5px 5px 5px 16px; border-radius: 14px; }
  .h2search input { font-size: 1rem; padding: 10px 0; }
  .h2search__btn { padding: 12px 20px; font-size: 1rem; }
  .h2quick { gap: 6px 24px; margin-top: 18px; }
  .h2quick a { padding: 0; border: 0; border-radius: 0; color: var(--h2-accent); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; font-weight: 500; }
  .h2tools { padding-top: 22px; }
  .h2tools__head h2 { font-size: 1.75rem; }
  .h2tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 10px; border-bottom: 0; margin: 0 -16px 20px; padding: 0 16px 4px; }
  .h2tab { padding: 9px 22px; border: 1.5px solid var(--line); border-radius: 999px; margin: 0; }
  .h2tab .ico { display: none; }
  .h2tab[aria-current="true"] { background: var(--h2-accent); border-color: var(--h2-accent); color: #fff; }
  .h2grid { grid-template-columns: 1fr; gap: 12px; }
  .h2card { min-height: 0; padding: 18px; border-radius: 14px; }
  .h2card__ico { width: 56px; height: 56px; }
  .h2card__go .ico:first-child { display: none; }
  .h2card__go .ico + .ico { display: block; color: var(--muted); }
}
/* Móviles estrechos o con la letra del sistema grande: la cabecera (con el botón de tema) no debe salirse */
@media (max-width: 400px) {
  .is-home .topbar__in { gap: 6px; }
  .is-home .langbtn { padding: 0 6px; }
  .is-home .themebtn, .is-home .navtoggle { width: 38px; padding: 0; justify-content: center; }
  .is-home .brand { min-width: 0; flex-shrink: 1; }
  .is-home .brand__name { overflow: hidden; text-overflow: ellipsis; }
  .h2tools__head { flex-wrap: wrap; gap: 4px 16px; }
}

/* Aviso de herramienta nueva (7 dÃ­as): ventana abajo a la derecha; en el mÃ³vil, abajo a lo ancho */
.nvtag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--h2-accent); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; flex: none; }
:root[data-theme="dark"] .nvtag { color: #0b1020; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nvtag { color: #0b1020; } }
.h2card { position: relative; }
.h2card__new { position: absolute; top: 12px; right: 12px; }
.nvpop { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 380px; display: flex; gap: 14px; align-items: flex-start; padding: 16px 12px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .25s; }
.nvpop.is-in { opacity: 1; transform: none; }
.nvpop__ico { width: 48px; height: 48px; border-radius: 12px; background: var(--ic); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.nvpop__t { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); }
.nvpop__t strong { color: var(--text); font-size: 16px; margin: 6px 0 2px; }
.nvpop__t a { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--h2-accent); font-weight: 700; text-decoration: none; }
.nvpop__t a:hover { text-decoration: underline; }
.nvpop__x { width: 36px; height: 36px; margin: -6px -2px 0 0; border: 0; border-radius: 8px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.nvpop__x:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 760px) {
  .nvpop { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
  .h2card__new { top: 10px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .nvpop { transition: none; transform: none; } }