/* ============================================================
   ARCHIVO: ea-plataforma/assets/css/ea-plataforma-guias.css
   QUÉ ES: Estilos de la página Guías ([eapf_guias]) v1.4.0:
           encabezado azul con buscador, selector de temas tipo
           tablero (cada tema con el color de su conductor y un
           interruptor que marca el tema encendido) y un panel por
           tema con la portada del artículo principal (color e ícono
           del tema, sin fotos), cuatro artículos más y el botón a la
           herramienta.
           Letra y colores de la portada (Syne + Space Grotesk).
   DÓNDE VA: wp-content/plugins/ea-plataforma/assets/css/ea-plataforma-guias.css
   ============================================================ */

/* El encabezado de la página lleva el título: el del tema sobra */
body.eapf-guias-page .entry-header { display: none; }

.eapf-guias {
  --g-navy: #0d2137; --g-blue: #1355a0; --g-line: #e4ecf7; --g-muted: #4a5565; --g-amber: #f59e0b; --g-soft: #f4f7fb;
  font-family: "Space Grotesk", sans-serif; color: var(--g-navy);
  max-width: 1180px; margin: 0 auto;
}
.eapf-guias *, .eapf-guias *::before, .eapf-guias *::after { box-sizing: border-box; }
.eapf-guias a { text-decoration: none; }
.eapf-guias [hidden] { display: none !important; }
.eapf-guias .eapf-ico { flex: none; display: block; }
.eapf-g-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eapf-guias a:focus-visible, .eapf-guias button:focus-visible { outline: 3px solid var(--g-amber); outline-offset: 2px; }

/* ---------- Encabezado ---------- */
.eapf-g-hero { background: var(--g-navy); border-radius: 20px; padding: 28px 22px 24px; margin: 0 0 18px; }
.eapf-guias .eapf-g-hero h1 {
  margin: 0 0 18px; max-width: 22ch;
  font-family: Syne, "Space Grotesk", sans-serif; font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; color: #fff;
}
.eapf-g-search { display: flex; gap: 8px; margin: 0; max-width: 720px; }
.eapf-g-search input[type="search"] {
  flex: 1 1 auto; min-width: 0; min-height: 54px; padding: 12px 18px;
  border: 2px solid transparent; border-radius: 12px; background: #fff; color: var(--g-navy);
  font: inherit; font-size: 17px;
}
.eapf-g-search input[type="search"]:focus { outline: none; border-color: var(--g-amber); }
.eapf-guias .eapf-g-search button {
  flex: none; min-height: 54px; padding: 12px 24px; border: 0; border-radius: 12px;
  background: var(--g-amber); color: var(--g-navy); font: inherit; font-size: 16px; font-weight: 700;
  text-transform: none; letter-spacing: 0; cursor: pointer;
}
.eapf-guias .eapf-g-search button:hover { background: #ffb42e; }
.eapf-guias .eapf-g-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 14px; color: #b9c8dc; }
.eapf-g-pop span { margin-right: 4px; }
.eapf-guias a.eapf-g-chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; color: #fff; font-size: 14px; font-weight: 500;
}
.eapf-guias a.eapf-g-chip:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }

/* ---------- Selector de temas: fila de interruptores ---------- */
.eapf-g-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.eapf-guias a.eapf-g-tab {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 10px 12px 10px 16px; overflow: hidden;
  background: #fff; border: 1px solid var(--g-line); border-radius: 12px;
  color: var(--g-navy); font-size: 15px; font-weight: 600; line-height: 1.2;
}
/* El color del conductor de cada tema */
.eapf-g-tab::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--g-c, var(--g-blue)); }
.eapf-g-tab .eapf-ico { color: var(--g-muted); }
.eapf-g-tab span { flex: 1 1 auto; min-width: 0; }
.eapf-guias a.eapf-g-tab:hover { border-color: #b9c8dc; }
/* Interruptor: apagado a la izquierda, encendido a la derecha */
.eapf-g-sw { flex: none; width: 30px; height: 16px; border-radius: 999px; background: #d5dde8; position: relative; display: none; }
.eapf-g-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.eapf-g-on .eapf-g-sw { display: block; }
.eapf-g-on a.eapf-g-tab[aria-current="true"] { background: var(--g-navy); border-color: var(--g-navy); color: #fff; }
.eapf-g-on .eapf-g-tab[aria-current="true"] .eapf-ico { color: #fff; }
.eapf-g-on .eapf-g-tab[aria-current="true"] .eapf-g-sw { background: var(--g-amber); }
.eapf-g-on .eapf-g-tab[aria-current="true"] .eapf-g-sw::after { transform: translateX(14px); }

/* ---------- Panel del tema ---------- */
.eapf-g-panel { background: #fff; border: 1px solid var(--g-line); border-radius: 20px; padding: 20px 18px; margin: 0 0 18px; }
.eapf-g-head { margin: 0 0 18px; padding-left: 14px; border-left: 5px solid var(--g-c, var(--g-blue)); }
.eapf-guias .eapf-g-head h2 {
  margin: 0 0 4px; font-family: Syne, "Space Grotesk", sans-serif; font-size: 24px; font-weight: 800; line-height: 1.15; color: var(--g-navy);
}
.eapf-guias .eapf-g-head p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--g-muted); }

.eapf-g-body { display: grid; grid-template-columns: 1fr; gap: 18px; }

/* Portada del artículo principal: igual en todos los temas, cambia el color y el ícono */
.eapf-guias a.eapf-g-lead { display: flex; color: var(--g-navy); }
.eapf-g-cover {
  position: relative; flex: 1 1 auto; display: flex; align-items: flex-end;
  min-height: 210px; padding: 22px; border-radius: 16px; overflow: hidden;
  background: var(--g-soft); background: color-mix(in srgb, var(--g-c, #1355a0) 12%, #fff);
  border: 1px solid var(--g-line); border-color: color-mix(in srgb, var(--g-c, #1355a0) 30%, #fff);
}
.eapf-guias .eapf-g-cover .eapf-ico {
  position: absolute; right: -14px; top: -14px; width: 170px; height: 170px;
  color: var(--g-c, var(--g-blue)); opacity: .3; stroke-width: 1.2;
}
.eapf-guias .eapf-g-cover strong {
  position: relative; display: block; max-width: 21ch;
  font-family: Syne, "Space Grotesk", sans-serif; font-size: 21px; font-weight: 700; line-height: 1.2; color: var(--g-navy);
}
.eapf-guias a.eapf-g-lead:hover .eapf-g-cover { border-color: var(--g-c, var(--g-blue)); }
.eapf-guias a.eapf-g-lead:hover strong, .eapf-guias .eapf-g-list a:hover span { color: var(--g-blue); text-decoration: underline; }

.eapf-guias ul.eapf-g-list { list-style: none; margin: 0; padding: 0; height: 100%; display: flex; flex-direction: column; }
.eapf-guias .eapf-g-list li { flex: 1 1 auto; display: flex; margin: 0; padding: 0; border-top: 1px solid #eef2f8; }
.eapf-guias .eapf-g-list li:first-child { border-top: 0; }
.eapf-guias .eapf-g-list a {
  position: relative; flex: 1 1 auto; display: flex; align-items: center; padding: 14px 0 14px 20px;
  color: var(--g-navy); font-size: 17px; font-weight: 500; line-height: 1.35;
}
/* Punto con el color del tema */
.eapf-guias .eapf-g-list a::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--g-c, var(--g-blue));
}

.eapf-g-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #eef2f8; }
.eapf-guias a.eapf-g-tool {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 12px; background: var(--g-amber); color: var(--g-navy); font-size: 15px; font-weight: 700;
}
.eapf-guias a.eapf-g-tool:hover { background: #ffb42e; }
.eapf-guias a.eapf-g-tool .eapf-ico { width: 20px; height: 20px; }
.eapf-guias a.eapf-g-all { display: inline-block; padding: 12px 0; font-size: 15px; font-weight: 600; color: var(--g-blue); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pantallas medianas y grandes ---------- */
@media (min-width: 720px) {
  .eapf-g-hero { padding: 28px 32px 26px; }
  .eapf-guias .eapf-g-hero h1 { font-size: 30px; max-width: none; margin-bottom: 16px; }
  .eapf-guias .eapf-g-pop { margin-top: 14px; }
  .eapf-g-panel { padding: 30px; }
  .eapf-guias .eapf-g-head h2 { font-size: 28px; }
}
/* Escritorio: los ocho temas en cuatro columnas y el tema en dos columnas */
@media (min-width: 1100px) {
  .eapf-g-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .eapf-g-body { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 34px; align-items: stretch; }
  .eapf-g-cover { min-height: 250px; padding: 26px; }
  .eapf-guias .eapf-g-cover strong { font-size: 24px; }
}
/* Celular y tablet: los temas en una fila que se desliza (en cuatro columnas no caben) */
@media (max-width: 1099px) {
  .eapf-g-tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    padding-right: 28px;
  }
  .eapf-g-tabs::-webkit-scrollbar { display: none; }
  .eapf-guias a.eapf-g-tab { flex: none; white-space: nowrap; }
}
/* ---------- Celular: "lo más consultado" también en una fila que se desliza ---------- */
@media (max-width: 719px) {
  .eapf-g-hero { padding: 20px 16px 16px; border-radius: 16px; margin-bottom: 12px; }
  .eapf-guias .eapf-g-hero h1 { font-size: 23px; margin-bottom: 14px; }
  .eapf-g-search input[type="search"] { font-size: 16px; }   /* 16 px: iOS no hace zoom al tocar el campo */
  .eapf-guias .eapf-g-pop {
    display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    /* el borde derecho se desvanece: se nota que hay más para deslizar */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    padding-right: 28px;
  }
  .eapf-guias .eapf-g-pop::-webkit-scrollbar { display: none; }
  .eapf-guias .eapf-g-pop { margin-top: 14px; }
  .eapf-g-pop span { flex: none; }
  .eapf-guias a.eapf-g-chip { flex: none; min-height: 40px; white-space: nowrap; }
  .eapf-g-tabs { gap: 8px; margin-bottom: 12px; }
  .eapf-guias a.eapf-g-tab { min-height: 48px; padding: 8px 12px 8px 15px; }
  .eapf-g-sw { display: none !important; }   /* el tema elegido ya se ve en azul oscuro */
  .eapf-g-panel { padding: 18px 14px; border-radius: 16px; }
  .eapf-g-head { margin-bottom: 14px; padding-left: 12px; }
  .eapf-guias .eapf-g-head h2 { font-size: 21px; }
  .eapf-guias .eapf-g-head p { font-size: 15px; }
  .eapf-g-cover { min-height: 150px; padding: 18px; }
  .eapf-guias .eapf-g-cover .eapf-ico { width: 120px; height: 120px; }
  .eapf-guias .eapf-g-cover strong { font-size: 19px; }
  .eapf-guias .eapf-g-list a { font-size: 16px; min-height: 48px; }
  .eapf-g-foot { gap: 12px; }
  .eapf-guias a.eapf-g-tool { flex: 1 1 100%; justify-content: center; min-height: 48px; }
}
@media (max-width: 479px) {
  .eapf-guias .eapf-g-search button { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .eapf-g-sw::after { transition: none; } }
@media print { .eapf-g-tabs, .eapf-g-search, .eapf-g-foot { display: none; } }
