/* ============================================================
   BLOG Y PÁGINAS — INUSpheresis Andorra
   Hereda los tokens y el sistema visual de site.css.
   Solo añade lo que WordPress necesita: artículos, tarjetas,
   paginación, comentarios y clases del editor de bloques.
   ============================================================ */

/* ---- Utilidad de accesibilidad (WP la usa) --------------- */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; white-space: nowrap;
}
.screen-reader-text:focus {
  background: var(--card); clip: auto; clip-path: none;
  color: var(--brand); display: block; height: auto; width: auto;
  padding: 14px 20px; left: 12px; top: 12px; z-index: 100;
  border-radius: var(--r-s); box-shadow: var(--shadow);
}

/* ============================================================
   Cabecera compacta de páginas internas
   ============================================================ */
.hero-inner {
  position: relative;
  padding-block: clamp(56px, 12vw, 96px) clamp(40px, 8vw, 64px);
  background:
    radial-gradient(120% 120% at 85% -20%, rgba(111,155,136,.28), transparent 55%),
    linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 60%, var(--hero-3) 100%);
  color: var(--on-brand);
  overflow: hidden;
}
.hero-inner__fx { position: absolute; inset: 0; pointer-events: none; }
.hero-inner__body { position: relative; z-index: 2; max-width: 760px; }
.hero-inner__title {
  font-family: 'Manrope', sans-serif; font-weight: 800;
  font-size: clamp(27px, 5.4vw, 44px); line-height: 1.15; letter-spacing: -0.01em;
  color: #fff; margin: 6px 0 0; text-wrap: balance; overflow-wrap: break-word;
}
.hero-inner__sub {
  font-size: clamp(16px, 2vw, 19px); line-height: 1.6;
  color: var(--hero-sub); margin: 14px 0 0; max-width: 60ch;
}
.hero-inner__meta {
  font-size: 14.5px; color: var(--on-brand-mute); margin: 14px 0 0;
}
.hero-inner__meta a { color: var(--accent-l); }

/* ============================================================
   Tarjetas de artículo
   ============================================================ */
.ev-cards { display: grid; gap: 28px; }
@media (min-width: 720px)  { .ev-cards { grid-template-columns: repeat(2, 1fr); gap: 32px; } }
@media (min-width: 1080px) { .ev-cards { grid-template-columns: repeat(3, 1fr); } }

.ev-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ev-card:hover {
  transform: translateY(-3px);
  border-color: var(--sage);
  box-shadow: 0 22px 48px -28px rgba(20,50,45,.42);
}
.ev-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); }
.ev-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ev-card:hover .ev-card__media img { transform: scale(1.03); }

.ev-card__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.ev-card__meta {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  font-size: 13px; color: var(--muted); margin-bottom: 10px;
}
.ev-card__meta a { color: var(--brand); text-decoration: none; font-weight: 600; }
.ev-card__meta a:hover { text-decoration: underline; }

.ev-card__title { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
.ev-card__title a { color: var(--ink); text-decoration: none; }
.ev-card__title a:hover { color: var(--brand); }

.ev-card__excerpt { font-size: 15.5px; color: var(--muted); margin: 0 0 16px; flex: 1; }

.ev-card__more {
  align-self: flex-start; font-weight: 600; font-size: 15px;
  color: var(--brand); text-decoration: none;
  display: inline-flex; gap: 7px; align-items: center;
}
.ev-card__more span { transition: transform .18s ease; }
.ev-card:hover .ev-card__more span { transform: translateX(3px); }

/* ============================================================
   Artículo (contenido del editor)
   ============================================================ */
.ev-article-wrap { max-width: 780px; }
.ev-article__cover { margin: 0 0 32px; }
.ev-article__cover img { width: 100%; height: auto; border-radius: var(--r); }
.ev-article__cover figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; text-align: center; }

.ev-prose { font-size: 18px; line-height: 1.75; color: var(--ink); }
.ev-prose > * + * { margin-top: 1.15em; }
.ev-prose p { max-width: none; }

.ev-prose h2 {
  font-size: clamp(23px, 4vw, 30px); line-height: 1.25;
  margin-top: 2em; margin-bottom: .5em;
}
.ev-prose h3 { font-size: clamp(19px, 3vw, 23px); margin-top: 1.7em; margin-bottom: .4em; }
.ev-prose h4 { font-size: 18px; margin-top: 1.5em; }

.ev-prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.ev-prose a:hover { color: var(--brand-d); }

.ev-prose ul, .ev-prose ol { padding-left: 1.3em; }
.ev-prose li + li { margin-top: .45em; }
.ev-prose li::marker { color: var(--sage); }

.ev-prose blockquote {
  margin: 1.8em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--sage);
  font-size: 20px; line-height: 1.6; color: var(--ink);
}
.ev-prose blockquote cite { display: block; font-size: 15px; color: var(--muted); font-style: normal; margin-top: 10px; }

.ev-prose img, .ev-prose video { max-width: 100%; height: auto; border-radius: var(--r-s); }
.ev-prose figure { margin: 1.8em 0; }
.ev-prose figcaption { font-size: 13.5px; color: var(--muted); margin-top: 9px; }

.ev-prose code {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; font-size: .9em;
}
.ev-prose pre {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 18px; overflow-x: auto; font-size: 15px;
}
.ev-prose pre code { background: none; border: 0; padding: 0; }

.ev-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

.ev-prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.ev-prose th, .ev-prose td { border: 1px solid var(--line); padding: 11px 13px; text-align: left; }
.ev-prose th { background: var(--surface); font-weight: 700; }

/* Clases del editor de bloques */
.ev-prose .alignleft  { float: left;  margin: .4em 1.4em 1em 0; }
.ev-prose .alignright { float: right; margin: .4em 0 1em 1.4em; }
.ev-prose .aligncenter { margin-inline: auto; display: block; }
.ev-prose .alignwide  { width: min(100vw - 2 * var(--pad), 980px); margin-inline: calc(50% - min(50vw - var(--pad), 490px)); max-width: none; }
.ev-prose .alignfull  { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; border-radius: 0; }
.ev-prose .wp-block-image { margin: 1.8em 0; }
.ev-prose .wp-caption-text { font-size: 13.5px; color: var(--muted); }
.ev-prose .wp-block-embed iframe { max-width: 100%; border-radius: var(--r-s); }
.ev-prose .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 22px; border-radius: var(--r-s);
  background: var(--brand); color: #fff; font-weight: 600; text-decoration: none;
}

/* Etiquetas */
.ev-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 36px; }
.ev-tags a {
  font-size: 13.5px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  background: var(--card);
}
.ev-tags a:hover { border-color: var(--sage); color: var(--brand); }

/* CTA al final del artículo */
.ev-post-cta { margin-top: 44px; }
.ev-post-disclaimer { margin-top: 18px; }

/* ============================================================
   Navegación entre artículos y relacionados
   ============================================================ */
.ev-postnav { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 26px; }
.ev-postnav .nav-links { display: grid; gap: 18px; }
@media (min-width: 700px) { .ev-postnav .nav-links { grid-template-columns: 1fr 1fr; } }
.ev-postnav a {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
  background: var(--card); transition: border-color .18s ease;
}
.ev-postnav a:hover { border-color: var(--sage); }
.ev-postnav .nav-next { text-align: right; }
.ev-postnav__k { display: block; font-size: 13px; color: var(--brand); font-weight: 600; margin-bottom: 6px; }
.ev-postnav__t { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 16.5px; line-height: 1.35; }

.ev-related { margin-top: 56px; }
.ev-related .h2v { margin-bottom: 22px; }

/* ============================================================
   Paginación, búsqueda y estados vacíos
   ============================================================ */
.ev-pagination {
  display: flex; flex-wrap: wrap; gap: 9px; justify-content: center;
  margin-top: 44px;
}
.ev-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--card); color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 15px;
}
.ev-pagination .page-numbers:hover { border-color: var(--sage); color: var(--brand); }
.ev-pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.ev-pagination .dots { border-color: transparent; background: none; }

.ev-searchbar { max-width: 560px; margin: 0 auto 40px; }
.ev-search { display: flex; gap: 10px; }
.ev-search input[type="search"] {
  flex: 1; min-width: 0; font-family: inherit; font-size: 16px;
  padding: 13px 15px; min-height: 52px;
  border: 1.5px solid var(--line); border-radius: var(--r-s); background: #fff; color: var(--ink);
}
.ev-search input[type="search"]:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,96,91,.14);
}

.ev-empty { text-align: center; max-width: 560px; margin: 0 auto; padding: 40px 0; }
.ev-empty h2 { margin-bottom: 12px; }
.ev-empty p { color: var(--muted); margin-inline: auto; }
.ev-empty .btn-row { justify-content: center; margin-top: 22px; }

/* ============================================================
   Comentarios
   ============================================================ */
.ev-comments { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 32px; }
.ev-comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.ev-comment-list .children { list-style: none; margin: 16px 0 0 22px; padding: 0; border-left: 1px solid var(--line); padding-left: 18px; }
.ev-comments .comment-body { padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.ev-comments .comment-author { display: flex; align-items: center; gap: 11px; font-weight: 600; }
.ev-comments .comment-author img { border-radius: 50%; }
.ev-comments .comment-metadata { font-size: 13px; color: var(--muted); margin: 5px 0 10px; }
.ev-comments .comment-metadata a { color: var(--muted); text-decoration: none; }
.ev-comments .reply a {
  font-size: 14px; font-weight: 600; color: var(--brand); text-decoration: none;
}
.ev-comments .comment-form { display: grid; gap: 14px; }
.ev-comments .comment-form label { font-size: 14px; font-weight: 600; }
.ev-comments .comment-form input[type="text"],
.ev-comments .comment-form input[type="email"],
.ev-comments .comment-form input[type="url"],
.ev-comments .comment-form textarea {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink);
  padding: 13px 14px; min-height: 50px;
  border: 1.5px solid var(--line); border-radius: var(--r-s); background: #fff;
}
.ev-comments .comment-form textarea { min-height: 130px; resize: vertical; }
.ev-comments .comment-form input:focus,
.ev-comments .comment-form textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,96,91,.14);
}

/* ============================================================
   Aviso de cookies (opcional, se activa en el Personalizador)
   ============================================================ */
.ev-cookies {
  position: fixed; z-index: 70; left: 16px; right: 16px; bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: 0 20px 50px -22px rgba(20,50,45,.45);
}
.ev-cookies p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: 70ch; }
.ev-cookies a { color: var(--brand); }
.ev-cookies .btn { min-height: 46px; }
@media (min-width: 760px) {
  .ev-cookies { left: auto; right: 20px; bottom: 20px; max-width: 560px; }
}
/* No tapar el botón flotante de WhatsApp en móvil */
@media (max-width: 1079px) {
  .ev-cookies { bottom: 84px; }
}

/* ============================================================
   Barra de administración: no romper el header sticky
   ============================================================ */
.admin-bar .header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .header { top: 46px; }
}
