/* Creando Historias - identidad visual v1
   Moderno, minimalista, alto contraste. Pensado para Astra gratuito.
   Para cambiar la marca basta con editar las variables de :root. */

/* Fuente autoalojada (ver instrucciones). Si el archivo no existe, se usa la fuente del sistema. */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-grotesk-variable.woff2") format("woff2");
}

:root {
  --ch-ink: #18212f;          /* azul noche del logo */
  --ch-ink-soft: #44505f;     /* texto secundario (8:1 sobre blanco) */
  --ch-magenta: #c2105b;      /* magenta del logo (6:1 sobre blanco) */
  --ch-magenta-deep: #9b0c48; /* hover y enlaces visitados */
  --ch-rose: #fdeef4;         /* fondo suave para avisos */
  --ch-mist: #f5f6f8;
  --ch-line: #e3e6ec;
  --ch-radius: 6px;
  --ch-font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Paleta global de Astra */
  --ast-global-color-0: var(--ch-magenta);
  --ast-global-color-1: var(--ch-magenta-deep);
  --ast-global-color-2: var(--ch-ink);
  --ast-global-color-3: var(--ch-ink);
  --ast-global-color-4: #ffffff;
  --ast-global-color-5: var(--ch-mist);
  --ast-global-color-6: var(--ch-ink);
  --ast-global-color-7: var(--ch-line);
  --ast-global-color-8: var(--ch-ink);
}

/* ---------- Tipografia ---------- */
body, button, input, select, textarea, .ast-button { font-family: var(--ch-font); }
body { color: var(--ch-ink); -webkit-font-smoothing: antialiased; }
::selection { background: var(--ch-magenta); color: #fff; }

body h1, body h2, body h3, body h4 {
  font-family: var(--ch-font);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
body h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem); font-weight: 800; }
body h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
body h3 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem); }

/* Enlaces de texto. Se excluyen botones y componentes del plugin (filtros, tarjetas, paginacion). */
.entry-content a:not(.wp-block-button__link, .ast-button, [class*="chnh-"], [class*="chnh-"] a) {
  color: var(--ch-magenta);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.entry-content a:not(.wp-block-button__link, .ast-button, [class*="chnh-"], [class*="chnh-"] a):hover {
  color: var(--ch-magenta-deep);
  text-decoration-thickness: 2px;
}

/* ---------- Foco visible y movimiento reducido ---------- */
body a:focus-visible, body button:focus-visible, body input:focus-visible,
body select:focus-visible, body textarea:focus-visible, body summary:focus-visible,
body [tabindex]:focus-visible {
  outline: 3px solid var(--ch-magenta) !important;
  outline-offset: 3px !important;
}
.ch-hero a:focus-visible, .site-footer a:focus-visible { outline-color: #fff !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Cabecera ---------- */
.site-header .ast-primary-header-bar {
  border-top: 4px solid var(--ch-magenta);
  border-bottom: 1px solid var(--ch-line);
}
.site-title a { font-weight: 800; letter-spacing: -0.02em; }
.main-header-menu .menu-link { font-weight: 600; font-size: 0.95rem; }
.main-header-menu .current-menu-item > .menu-link { box-shadow: inset 0 -3px 0 var(--ch-magenta); }

/* ---------- Botones y formularios ---------- */
.wp-block-button .wp-block-button__link, .ast-button, button, input[type="submit"] {
  background: var(--ch-magenta);
  color: #fff;
  border-radius: var(--ch-radius);
  font-weight: 700;
  transition: background-color 0.15s;
}
.wp-block-button .wp-block-button__link:hover, .ast-button:hover, button:hover, input[type="submit"]:hover {
  background: var(--ch-magenta-deep);
  color: #fff;
}
.wp-block-button.is-style-outline > .wp-block-button__link {
  background: transparent;
  color: var(--ch-ink);
  border: 2px solid var(--ch-ink);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--ch-ink); color: #fff; }

input[type="text"], input[type="email"], input[type="search"], input[type="url"], textarea, select {
  background: #fff;
  border: 1px solid var(--ch-ink-soft);
  border-radius: var(--ch-radius);
}

/* ---------- Portada ---------- */
/* Envuelve el H1, el parrafo y el boton en un bloque Grupo con la clase "ch-hero" */
.ch-hero {
  background: var(--ch-ink);
  color: #fff;
  border-left: 8px solid var(--ch-magenta);
  border-radius: var(--ch-radius);
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem);
}
.entry-content .ch-hero h1 { color: #fff; max-width: 16ch; margin-bottom: 1rem; }
.entry-content .ch-hero p { color: #dde2ea; max-width: 52ch; font-size: 1.2rem; }

.home .entry-content h2 {
  border-top: 3px solid var(--ch-ink);
  padding-top: 0.9rem;
  margin-top: 3.5rem;
}

/* Tarjetas de articulos (plugin de la red) */
.chnh-card { border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: none; transition: border-color 0.15s; }
.chnh-card:hover { border-color: var(--ch-ink); }
.chnh-card__site { color: var(--ch-magenta); opacity: 1; font-weight: 700; }
.chnh-card__excerpt, .chnh-card__meta { opacity: 1; color: var(--ch-ink-soft); }
.chnh-card__title a { color: var(--ch-ink); }
.chnh-card__title a:hover { color: var(--ch-magenta); }
.chnh-empty {
  opacity: 1;
  background: var(--ch-rose);
  border-left: 4px solid var(--ch-magenta);
  border-radius: var(--ch-radius);
  padding: 1.1rem 1.25rem;
}
.chnh-filter, .chnh-pagination a { border-color: var(--ch-line); color: var(--ch-ink); font-weight: 600; text-decoration: none; }
.chnh-filter:hover, .chnh-pagination a:hover { background: var(--ch-rose); color: var(--ch-magenta-deep); border-color: var(--ch-magenta); }
.chnh-filter.is-active, .chnh-filter.is-active:hover,
.chnh-pagination .is-current { background: var(--ch-ink); color: #fff; border-color: var(--ch-ink); text-decoration: none; }
.chnh-search-form button { background: var(--ch-magenta); color: #fff; }

/* ---------- Entradas ---------- */
.single .entry-header, .single .entry-content[data-ast-blocks-layout] > *:not(.alignwide):not(.alignfull) {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}
body.single header.entry-header .entry-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); font-weight: 800; }
.single .entry-content { font-size: 1.125rem; line-height: 1.75; }
.single .entry-content h2 { margin-top: 2.5rem; }
.entry-content img { border-radius: var(--ch-radius); }
.entry-meta { font-size: 0.9rem; }

.wp-block-quote, .entry-content blockquote {
  border: 0;
  border-left: 4px solid var(--ch-magenta);
  margin: 2rem 0;
  padding: 0 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ch-ink);
}

/* Caja de autor (Simple Author Box) */
.saboxplugin-wrap {
  border: 0;
  border-top: 3px solid var(--ch-ink);
  background: var(--ch-mist);
  border-radius: 0 0 var(--ch-radius) var(--ch-radius);
  padding: 1.25rem 0;
}
.saboxplugin-wrap .saboxplugin-authorname a { color: var(--ch-ink); font-weight: 700; }
.saboxplugin-wrap .saboxplugin-web a { color: var(--ch-ink-soft); text-decoration: underline; }

/* Hueco reservado para anuncios: evita saltos de maquetacion */
.ch-ad { min-height: 280px; margin: 2.5rem auto; display: flex; align-items: center; justify-content: center; max-width: 100%; overflow: hidden; }
.ch-ad:empty { display: none; }

/* ---------- Paginas de texto: legales, Quienes somos, Contacto ---------- */
body:is(.page-id-14, .page-id-18, .page-id-20, .page-id-22, .page-id-24) .entry-header,
body:is(.page-id-14, .page-id-18, .page-id-20, .page-id-22, .page-id-24) .entry-content[data-ast-blocks-layout] > *:not(.alignwide):not(.alignfull) {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}
body:is(.page-id-14, .page-id-18, .page-id-20, .page-id-22, .page-id-24) .entry-content { font-size: 1.05rem; line-height: 1.75; }
body:is(.page-id-14, .page-id-18, .page-id-20, .page-id-22, .page-id-24) .entry-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ch-line);
}
.entry-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.95rem; }
.entry-content th { background: var(--ch-ink); color: #fff; text-align: left; }
.entry-content th, .entry-content td { border: 1px solid var(--ch-line); padding: 0.7rem 0.9rem; }
.ch-updated { color: var(--ch-ink-soft); font-size: 0.95rem; border-top: 1px solid var(--ch-line); padding-top: 0.75rem; }

/* ---------- Estructura general y pie ---------- */
.ast-plain-container.ast-no-sidebar .site-main {
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 6vw, 5rem);
}
.site-footer .site-below-footer-wrap[data-section="section-below-footer-builder"] {
  background: var(--ch-ink);
  border-top: 4px solid var(--ch-magenta);
}
.site-footer .ast-footer-copyright.site-footer-focus-item { color: #e4e8ef; }
.site-footer #astra-footer-menu { background: transparent; }
.site-footer #astra-footer-menu .menu-item > a { color: #fff; text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer #astra-footer-menu .menu-item > a:hover { color: #ffd1e3; }
#ast-scroll-top { background: var(--ch-ink); border-radius: var(--ch-radius); }
