/* =========================================================================
   NEXO AZUL · Blog (listado, artículo y tipografía de lectura)
   Se carga después de styles.css y reutiliza sus tokens.
   ========================================================================= */

.icon--fill { fill: currentColor; stroke: none; }

/* ---------- Encabezado oscuro ---------- */
.blog-hero,
.post-hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--navy-950); color: var(--white);
}
.blog-hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(55% 75% at 88% 8%, rgba(22, 100, 210, 0.42), transparent 70%),
    radial-gradient(45% 60% at 0% 100%, rgba(56, 182, 244, 0.13), transparent 70%),
    linear-gradient(180deg, #030b1c 0%, #051230 58%, #071a3e 100%);
}
.blog-hero__bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(122, 208, 255, 0.16) 1px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(70% 80% at 80% 20%, #000 0%, transparent 75%);
  mask-image: radial-gradient(70% 80% at 80% 20%, #000 0%, transparent 75%);
}
.blog-hero__bg::after {
  content: ""; position: absolute; width: min(70vw, 620px); aspect-ratio: 1; right: -12%; top: -20%;
  background: url("../img/marca/simbolo-azul.webp") center / contain no-repeat;
  opacity: 0.07; animation: slow-spin 120s linear infinite;
}
.blog-hero__waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42%; z-index: 0; pointer-events: none; }
.blog-hero__inner { position: relative; z-index: 1; padding-top: calc(var(--header-h) + clamp(44px, 7vw, 104px)); padding-bottom: clamp(56px, 7vw, 108px); }
.blog-hero__title { max-width: 15ch; }
.blog-hero .hero-lead { max-width: 54ch; }
.blog-hero--404 .blog-hero__inner { padding-bottom: clamp(72px, 9vw, 128px); }
@media (prefers-reduced-motion: reduce) { .blog-hero__bg::after { animation: none; } }

.blog-cats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.blog-cat {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.04);
  color: var(--on-dark-2); font-size: 0.88rem; font-weight: 600;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.blog-cat span { font-size: 0.74rem; color: var(--on-dark-3); }
.blog-cat:hover { border-color: rgba(255, 255, 255, 0.4); color: var(--white); }
.blog-cat.is-active { background: var(--white); border-color: var(--white); color: var(--navy-900); }
.blog-cat.is-active span { color: var(--muted); }

/* ---------- Listado ---------- */
.blog-list { padding-block: clamp(56px, 7vw, 112px); }

.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: 0.8rem; font-weight: 550; color: var(--muted); line-height: 1.4;
}
.post-cat { font-size: 0.7rem; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-600); }
.post-meta__dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }

.post-ph {
  position: relative; display: grid; place-items: center;
  background:
    radial-gradient(70% 80% at 80% 0%, rgba(22, 119, 224, 0.55), transparent 70%),
    linear-gradient(150deg, var(--navy-800), var(--navy-950));
}
.post-ph img { width: 34%; height: auto; opacity: 0.55; }

/* Destacado */
.post-feature {
  position: relative; display: grid; gap: 0; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--white);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  margin-bottom: clamp(40px, 5vw, 64px);
}
.post-feature__media { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--mist-2); }
.post-feature__media > img, .post-feature__media > .post-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.post-feature:hover .post-feature__media > img { transform: scale(1.04); }
.post-feature__body { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: clamp(26px, 4vw, 56px); }
.post-feature__flag {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.17em; text-transform: uppercase; color: var(--orange-500);
}
.post-feature__flag::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--orange-500); }
.post-feature__title {
  font-size: clamp(1.6rem, 1.05rem + 1.9vw, 2.6rem); line-height: 1.12; letter-spacing: -0.03em; font-weight: 750; color: var(--ink);
}
.post-feature__title a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.5s var(--ease-out), color 0.3s; }
.post-feature__title a:hover { color: var(--blue-600); background-size: 100% 2px; }
.post-feature__excerpt { font-size: 1.04rem; line-height: 1.65; max-width: 60ch; }
.post-feature .btn { margin-top: 8px; }
@media (min-width: 1024px) {
  .post-feature { grid-template-columns: 1.12fr 0.88fr; }
  .post-feature__media { aspect-ratio: auto; min-height: 440px; }
  .post-feature__body { justify-content: center; }
}

/* Tarjetas */
.post-grid { display: grid; gap: 24px; }
@media (min-width: 700px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }
.post-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); background: var(--white); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out), border-color 0.4s;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(22, 119, 224, 0.25); }
.post-card:focus-within { border-color: var(--blue-500); }
.post-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--mist-2); }
.post-card__img, .post-card__media > .post-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.post-card:hover .post-card__img { transform: scale(1.05); }
.post-card__body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 22px 24px 26px; }
.post-card__title { font-size: 1.22rem; line-height: 1.28; letter-spacing: -0.018em; font-weight: 700; color: var(--ink); }
.post-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post-card__title a:focus-visible { outline: none; }
.post-card:has(a:focus-visible) { outline: 3px solid var(--cyan-400); outline-offset: 3px; }
.post-card__excerpt { font-size: 0.95rem; line-height: 1.6; }
.post-card__more { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 650; color: var(--blue-600); }
.post-card__more .icon { transition: transform 0.45s var(--ease-out); }
.post-card:hover .post-card__more .icon { transform: translateX(4px); }
.section--mist .post-card { border-color: transparent; }

/* Paginación */
.blog-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; margin-top: clamp(44px, 5vw, 72px); }
.pager-nums { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pager-num, .pager-gap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 6px;
  border-radius: 999px; font-weight: 650; font-size: 0.95rem; color: var(--ink-2);
}
.pager-num { border: 1px solid var(--line-strong); transition: border-color 0.3s, color 0.3s, background-color 0.3s; }
.pager-num:hover { border-color: var(--blue-500); color: var(--blue-600); }
.pager-num.is-current { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.pager-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 650; font-size: 0.93rem; color: var(--blue-600); transition: background-color 0.3s; }
.pager-btn:hover { background: var(--mist); }
.pager-btn.is-disabled { color: var(--muted); opacity: 0.45; pointer-events: none; }
@media (max-width: 560px) { .pager-btn span { display: none; } .pager-btn { padding: 0 12px; } }

/* Estado vacío */
.blog-empty {
  position: relative; max-width: 820px; margin-inline: auto; text-align: center;
  padding: clamp(40px, 6vw, 80px) clamp(22px, 5vw, 64px);
  border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--mist), var(--white));
  border: 1px solid var(--line);
}
.blog-empty__mark {
  width: 96px; height: 96px; margin: 0 auto 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.blog-empty__mark img { width: 56px; height: auto; animation: slow-spin 60s linear infinite; }
.blog-empty .eyebrow { justify-content: center; }
.blog-empty .h2 { font-size: clamp(1.9rem, 1.1rem + 2.6vw, 3.2rem); }
.blog-empty .lead { max-width: 54ch; margin: 20px auto 0; }
.blog-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
@media (max-width: 520px) { .blog-empty__actions .btn { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .blog-empty__mark img { animation: none; } }

/* ---------- Artículo ---------- */
.post-hero__inner {
  position: relative; z-index: 1; text-align: center;
  padding-top: calc(var(--header-h) + clamp(40px, 6vw, 88px));
  padding-bottom: clamp(120px, 15vw, 220px);
}
.post-hero--nocover .post-hero__inner { padding-bottom: clamp(56px, 7vw, 100px); }
.post-hero .crumbs { justify-content: center; }
.post-title {
  max-width: 22ch; margin: 0 auto;
  font-size: clamp(2rem, 1.15rem + 3.4vw, 4rem); line-height: 1.06; letter-spacing: -0.04em; font-weight: 800; color: var(--white);
}
.post-lead { max-width: 60ch; margin: 24px auto 0; }
.post-byline { display: inline-flex; align-items: center; gap: 14px; margin-top: 30px; text-align: left; }
.post-avatar {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18);
}
.post-avatar img { width: 28px; height: auto; }
.post-author { font-size: 0.95rem; color: var(--on-dark-2); }
.post-author strong { color: var(--white); font-weight: 650; }
.post-when { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 2px; font-size: 0.84rem; color: var(--on-dark-3); }
.post-when span { display: inline-flex; align-items: center; gap: 6px; }
.post-when .icon { width: 0.95em; height: 0.95em; color: var(--cyan-300); }

.post-cover { position: relative; z-index: 2; margin-top: calc(-1 * clamp(84px, 11vw, 170px)); }
.post-cover__img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-lg);
  background: var(--mist-2); box-shadow: var(--shadow-lg);
}
@media (min-width: 1024px) { .post-cover__img { aspect-ratio: 21 / 9; } }

.post-layout { display: grid; gap: 32px; padding-top: clamp(48px, 6vw, 88px); }
.post-aside { display: none; }
@media (min-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 740px) minmax(0, 1fr); gap: 48px; }
  .post-layout .prose { grid-column: 2; }
  .post-aside {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    grid-column: 1; grid-row: 1; justify-self: end; align-self: start;
    position: sticky; top: calc(var(--header-h) + 32px);
  }
  body.header-hidden .post-aside { top: 32px; }
  .post-aside__label { font-size: 0.68rem; font-weight: 750; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 4px; }
}

.share { display: flex; flex-wrap: wrap; gap: 10px; }
.share--col { flex-direction: column; }
.share-btn {
  width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); background: var(--white); border: 1px solid var(--line-strong);
  transition: transform 0.45s var(--ease-out), background-color 0.3s, color 0.3s, border-color 0.3s;
}
.share-btn .icon { width: 19px; height: 19px; }
.share-btn:hover { transform: translateY(-3px); color: var(--white); border-color: transparent; }
.share-btn--wa:hover { background: #25d366; }
.share-btn--in:hover { background: #0a66c2; }
.share-btn--fb:hover { background: #1877f2; }
.share-btn--link:hover, .share-btn--link.is-copied { background: var(--navy-900); color: var(--white); border-color: transparent; }

.post-end {
  max-width: 740px; margin: clamp(48px, 6vw, 80px) auto 0; padding-block: 34px clamp(64px, 8vw, 110px);
  border-top: 1px solid var(--line); display: grid; gap: 28px;
}
@media (min-width: 1024px) { .post-end { width: 740px; } }
.post-end__share { display: grid; gap: 16px; }
.post-end__title { font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem); line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; color: var(--ink); }
.post-end__title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.12em; color: var(--blue-600); }
.native-share { justify-self: start; }
.post-back { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--blue-600); }
.post-back .icon { transition: transform 0.45s var(--ease-out); }
.post-back:hover .icon { transform: translateX(-4px); }

.post-related__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; margin-bottom: clamp(36px, 4vw, 56px); }
.post-related__head .h2 { font-size: clamp(1.9rem, 1.1rem + 2.4vw, 3.3rem); }
.post-related { padding-block: clamp(72px, 8vw, 128px); }

.copy-toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 120;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 20px; border-radius: 999px; background: var(--navy-900); color: var(--white);
  font-size: 0.9rem; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
}
.copy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.preview-bar {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 130; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 11px 20px; border-radius: 999px; background: var(--orange-500); color: var(--white);
  font-size: 0.86rem; font-weight: 650; box-shadow: var(--shadow-lg); text-align: center;
}

/* ---------- Tipografía de lectura ---------- */
.prose {
  min-width: 0; font-size: clamp(1.06rem, 1rem + 0.25vw, 1.16rem); line-height: 1.78; color: var(--ink-2);
  overflow-wrap: break-word;
}
.prose > * + * { margin-top: 1.3em; }
.prose p { color: var(--ink-2); }
.prose > p:first-child { font-size: 1.12em; line-height: 1.7; color: var(--ink); }
.prose h2, .prose h3, .prose h4 { color: var(--ink); font-weight: 700; text-wrap: balance; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.2; letter-spacing: -0.026em; margin-top: 2.1em; }
.prose h3 { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.45rem); line-height: 1.3; letter-spacing: -0.018em; margin-top: 1.8em; }
.prose h4 { font-size: 1.1rem; line-height: 1.4; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.7em; }
.prose a { color: var(--blue-600); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: rgba(10, 95, 200, 0.35); transition: text-decoration-color 0.3s, color 0.3s; }
.prose a:hover { color: var(--blue-500); text-decoration-color: currentColor; }
.prose strong, .prose b { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.55em; }
.prose li::marker { color: var(--blue-500); font-weight: 700; }
.prose li > ul, .prose li > ol { margin-top: 0.55em; }
.prose blockquote {
  position: relative; margin-block: 1.9em; padding: 0.2em 0 0.2em 1.2em; border-left: 3px solid var(--orange-500);
  font-family: var(--font-serif); font-style: italic; font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); line-height: 1.35; color: var(--ink);
}
.prose img { border-radius: 16px; margin-inline: auto; box-shadow: var(--shadow-sm); }
.prose p:has(> img:only-child) { margin-block: 2em; }
.prose figure figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--muted); text-align: center; }
.prose iframe.ql-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; background: var(--navy-950); margin-block: 2em; }
.prose hr { border: 0; height: 1px; background: var(--line-strong); margin-block: 2.6em; }
.prose pre { padding: 18px 20px; border-radius: 14px; background: var(--navy-950); color: var(--on-dark); font-size: 0.9rem; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.prose :not(pre) > code { padding: 0.15em 0.4em; border-radius: 6px; background: var(--mist-2); color: var(--ink); }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; hyphens: auto; }
.prose .ql-indent-1 { padding-left: 2em; } .prose .ql-indent-2 { padding-left: 4em; } .prose .ql-indent-3 { padding-left: 6em; }
.prose p:empty, .prose p:has(> br:only-child) { margin-top: 0.6em; }
