/* ===========================
   VAO - Estilos para Artículos del Blog
   Se carga solo en single-post.php
   =========================== */

:root {
  --vao-navy: #1e2a38;
  --vao-red: #d2414a;
  --vao-bg: #f5f5f5;
  --vao-bdr: #e9edf2;
  --vao-text: #1e2a38;
  --vao-muted: #5a6470;

  /* ===== Sticky vars (header + admin bar) ===== */
  --vao-header-h: 72px;   /* alto aprox. del header fijo (JS opcional lo actualiza) */
  --vao-wpbar-h: 0px;     /* altura del admin bar de WP si estás logueado */
  --vao-sticky-gap: 16px; /* respiración */
  --vao-sticky-top: calc(var(--vao-header-h) + var(--vao-wpbar-h) + var(--vao-sticky-gap));
}

/* Admin bar presente (ajusta top sticky automáticamente) */
.admin-bar{ --vao-wpbar-h: 32px; }
@media (max-width: 782px){
  .admin-bar{ --vao-wpbar-h: 46px; }
}

/* Evitar que sticky se rompa por overflow en ancestros */
body, .vao-single, .vao-main, .container{ overflow: visible; }

/* --- Contenedor general --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- HERO CON BADGE SUPERPUESTO --- */
.vao-hero {
  width: 100%;
  margin-bottom: 40px;
}

.vao-hero__media {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  max-height: 420px;
}

.vao-hero__media img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

.vao-hero__media:hover img {
  transform: scale(1.02);
}

.vao-badge--overlay {
  position: absolute;
  top: 18px;
  left: 18px;
  background: rgba(30, 42, 56, 0.85); /* navy VAO con transparencia */
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(2px);
}

.vao-hero__meta {
  margin-top: 22px;
}

.vao-title {
  margin: 0.75rem 0 0.5rem;
  color: var(--vao-text);
  font-weight: 800;
  font-size: clamp(32px, 3.8vw, 44px);
  line-height: 1.15;
}

.vao-post-meta {
  display: flex;
  justify-content:center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--vao-muted);
  font-size: 14px;
}

/* Ajustes en pantallas pequeñas */
@media (max-width: 768px) {
  .vao-hero__media {
    max-height: 300px;
  }

  .vao-badge--overlay {
    top: 12px;
    left: 12px;
    font-size: 12px;
    padding: 5px 10px;
  }

  .vao-title {
    font-size: 26px;
  }
}

/* --- LAYOUT PRINCIPAL CON SIDEBAR (ajustado para sticky real) --- */
.vao-main {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1.1fr); /* contenido | sidebar */
  gap: 40px;
  align-items: start;
  margin: 40px auto;
}

.vao-main__content {
  max-width: 820px;
  min-width: 0; /* evita desbordes en grid */
}

/* Sidebar sticky: se pega bajo el header/admin bar y suelta al final del grid */
.vao-sidebar {
  position: sticky;
  top: var(--vao-sticky-top);
  align-self: start;
  height: fit-content;
}

@media (max-width: 900px) {
  .vao-main {
    grid-template-columns: 1fr;
  }
  .vao-sidebar {
    position: static;
    margin-top: 40px;
  }
}

/* --- CONTENIDO --- */
.vao-content p {
  font-size: 18px;
  line-height: 1.75;
  color: var(--vao-text);
  margin: 1em 0;
}
.vao-content h2 {
  font-size: clamp(26px, 2.6vw, 32px);
  margin: 2rem 0 0.75rem;
  color: var(--vao-text);
  font-weight: 700;
}
.vao-content h3 {
  font-size: clamp(20px, 2vw, 24px);
  margin: 1.5rem 0 0.5rem;
  color: var(--vao-text);
  font-weight: 700;
}
.vao-content a {
  color: var(--vao-red);
  text-decoration: underline;
}
.vao-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--vao-red);
  background: #fff7f7;
  color: var(--vao-text);
  font-style: italic;
}
.vao-page-links {
  margin-top: 20px;
}

/* --- CTA FINAL --- */
.vao-cta {
  margin: 48px auto;
}
.vao-cta__inner {
  background: var(--vao-navy);
  color: #fff;
  border-radius: 14px;
  padding: 28px;
  display: grid;
  gap: 8px;
  text-align: center;
}
.vao-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.vao-btn--primary {
  background: var(--vao-red);
  color: #fff;
}
.vao-btn--primary:hover {
  filter: brightness(0.95);
}

/* --- AUTOR --- */
.vao-author {
  margin: 36px auto;
  background: #f9f9f9;
  border: 1px solid var(--vao-bdr);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 820px;
}
.vao-author__media img {
  border-radius: 50%;
}
.vao-author h4 {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--vao-text);
}
.vao-author p {
  margin: 0;
  color: var(--vao-muted);
  font-size: 15px;
}

/* --- RELACIONADOS --- */
.vao-related {
  margin: 48px auto;
}
.vao-related h3 {
  margin: 0 0 16px;
  color: var(--vao-text);
  font-weight: 800;
}
.vao-related__grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  .vao-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .vao-related__grid {
    grid-template-columns: 1fr;
  }
}
.vao-card {
  background: #fff;
  border: 1px solid var(--vao-bdr);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vao-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.06);
}
.vao-card__thumb {
  display: block;
  aspect-ratio: 16/9;
  background: #ddd;
}
.vao-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vao-card__body {
  padding: 14px;
}
.vao-small-badge {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--vao-bdr);
  color: var(--vao-navy);
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 8px;
}
.vao-card__title {
  margin: 0;
}
.vao-card__title a {
  text-decoration: none;
  color: var(--vao-text);
  font-weight: 700;
}
.vao-card__title a:hover {
  text-decoration: underline;
}

/* --- WIDGETS DEL SIDEBAR --- */
.vao-widget {
  background: #fff;
  border: 1px solid #e9edf2;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}
.vao-widget__title {
  color: var(--vao-navy);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.vao-widget p {
  color: #555;
  font-size: 15px;
  margin-bottom: 16px;
}
.vao-widget a {
  color: var(--vao-red);
  font-weight: 600;
  text-decoration: none;
}
.vao-widget a:hover {
  text-decoration: underline;
}

/* ===========================
   Tipografía & estilos modernos de artículo (VAO)
   =========================== */

/* Fuente base (usa la del tema o añade aquí tu @import si procede) */
:root{
  --vao-font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

.vao-single,
.vao-content {
  font-family: var(--vao-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Escala tipográfica (desktop) */
.vao-content {
  font-size: 17.5px;
  line-height: 1.75;
  letter-spacing: 0;
  color: var(--vao-text);
}

.vao-content h1 { font-size: clamp(32px, 3.6vw, 40px); line-height: 1.15; margin: 2.2rem 0 1rem; font-weight: 800; }
.vao-content h2 { font-size: clamp(26px, 2.8vw, 32px); line-height: 1.25; margin: 2rem 0 .85rem; font-weight: 800; }
.vao-content h3 { font-size: clamp(22px, 2.2vw, 26px); line-height: 1.3;  margin: 1.6rem 0 .7rem;  font-weight: 700; }
.vao-content h4 { font-size: clamp(18px, 1.8vw, 20px); line-height: 1.35; margin: 1.2rem 0 .6rem;  font-weight: 700; color: var(--vao-navy); }
.vao-content h5 { font-size: 16px; line-height: 1.4; margin: 1rem 0 .5rem; font-weight: 700; color: var(--vao-navy); text-transform: uppercase; letter-spacing: .03em; }
.vao-content h6 { font-size: 14px; line-height: 1.4; margin: .8rem 0 .4rem; font-weight: 700; color: var(--vao-muted); text-transform: uppercase; letter-spacing: .05em; }

.vao-content p { font-size: 17.5px; margin: 1rem 0; }
.vao-content strong { font-weight: 700; }
.vao-content em { font-style: italic; }

/* Mobile: ajusta tamaños y ritmos */
@media (max-width: 768px) {
  .vao-content { font-size: 16px; line-height: 1.7; }
  .vao-content h1 { font-size: 28px; margin: 1.6rem 0 .8rem; }
  .vao-content h2 { font-size: 24px; margin: 1.4rem 0 .7rem; }
  .vao-content h3 { font-size: 20px; margin: 1.2rem 0 .6rem; }
  .vao-content h4 { font-size: 18px; }
  .vao-content p  { font-size: 16px; }
}

/* Enlaces */
.vao-content a {
  color: var(--vao-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.vao-content a:hover { text-underline-offset: 4px; }

/* Listas con bullets VAO */
.vao-content ul,
.vao-content ol { margin: 1rem 0 1rem 1.2rem; }
.vao-content ul li,
.vao-content ol li { margin: .4rem 0; }
.vao-content ul { list-style: none; padding-left: 0; }
.vao-content ul li {
  position: relative; padding-left: 1.35rem;
}
.vao-content ul li::before {
  content: ""; position: absolute; left: 0; top: .65em;
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--vao-red);
  box-shadow: 0 0 0 2px #fff; /* halo blanco para limpiar líneas */
}
.vao-content ol { list-style: decimal; }

/* Imágenes y figuras */
.vao-content img {
  display: block; max-width: 100%; height: auto; border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.vao-content figure { margin: 1.2rem 0; }
.vao-content figcaption {
  font-size: 13px; color: var(--vao-muted); text-align: center; margin-top: .5rem;
}

/* Citas y “pull quotes” */
.vao-content blockquote {
  margin: 1.6rem 0; padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--vao-red);
  background: #fff7f7;
  color: var(--vao-text);
  font-style: italic;
  border-radius: 8px;
}
.vao-content .pullquote {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.4;
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--vao-navy);
  background: #f8fafc;
}

/* Separadores */
.vao-content hr {
  border: 0; height: 1px; margin: 2rem 0;
  background: linear-gradient(90deg, transparent, var(--vao-bdr), transparent);
}

/* Tablas responsivas */
.vao-content .table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--vao-bdr); border-radius: 10px; background: #fff;
  margin: 1rem 0;
}
.vao-content table { width: 100%; border-collapse: collapse; }
.vao-content th, .vao-content td {
  padding: .75rem .9rem; border-bottom: 1px solid var(--vao-bdr); text-align: left;
}
.vao-content thead th {
  background: #f5f5f5; color: var(--vao-navy); font-weight: 700;
}
.vao-content tbody tr:nth-child(odd) { background: #fcfcfc; }

/* Código & pre */
.vao-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .95em; background: #f4f6f8; padding: .15em .35em; border-radius: 6px;
  border: 1px solid var(--vao-bdr);
}
.vao-content pre {
  background: #0f172a; color: #e2e8f0; padding: 1rem 1.2rem;
  border-radius: 12px; overflow: auto; border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.vao-content pre code { background: transparent; border: 0; color: inherit; padding: 0; }

/* Notas / Callouts (usa .note, .tip, .warn en bloques de grupo) */
.vao-content .note,
.vao-content .tip,
.vao-content .warn {
  border: 1px solid var(--vao-bdr);
  border-left-width: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  margin: 1rem 0;
}
.vao-content .note   { border-left-color: var(--vao-navy); }
.vao-content .tip    { border-left-color: var(--vao-red);  }
.vao-content .warn   { border-left-color: #c97700; background: #fffaf3; }

/* Listas de “pasos” (opcional, aplica a ol.is-steps) */
.vao-content ol.is-steps {
  counter-reset: step; list-style: none; margin-left: 0; padding-left: 0;
}
.vao-content ol.is-steps > li {
  counter-increment: step; position: relative; padding-left: 2.2rem; margin: .75rem 0;
}
.vao-content ol.is-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .1rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--vao-navy); color: #fff; font-weight: 700; font-size: .9rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Paginación interna de post */
.vao-page-links { margin-top: 24px; font-size: 14px; }
.vao-page-links a { color: var(--vao-red); text-decoration: none; font-weight: 700; }
.vao-page-links a:hover { text-decoration: underline; }

/* Accesibilidad: foco visible */
.vao-single a:focus {
  outline: 2px dashed var(--vao-red);
  outline-offset: 2px;
}

/* ===== TOC (Tabla de contenidos) ===== */
.vao-toc{
  background:#fff;
  border:1px solid var(--vao-bdr);
  border-radius:12px;
  padding:14px 16px;
  margin:16px auto 24px;
  max-width:820px;
  box-shadow:0 4px 12px rgba(0,0,0,.04);
}

.vao-toc__header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}

.vao-toc__title{
  margin:0;
  font-size:16px;
  font-weight:800;
  color:var(--vao-navy);
}

.vao-toc__toggle{
  margin-left:auto;                /* ⟵ botón a la derecha */
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px; height:34px;
  border-radius:8px;
  border:1px solid var(--vao-bdr);
  background:#f5f5f5;
  color:var(--vao-navy);
  cursor:pointer;
  transition:background .2s,border-color .2s,transform .15s;
}
.vao-toc__toggle:hover{ background:#eef1f5; border-color:#dfe5ea; }
.vao-toc__toggle:active{ transform: scale(.98); }
.vao-toc__toggle svg{ display:block; }

.vao-toc__list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:6px;
}
.vao-toc__list a{
  text-decoration:none;
  color:var(--vao-navy);
  font-size:15px;
  line-height:1.45;
  border-radius:8px;
  padding:6px 8px;
  display:block;
  border:1px solid transparent;
  transition:all .2s;
}
.vao-toc__list a:hover{ background:#f9fafb; border-color:var(--vao-bdr); }
.vao-toc__list a.is-active{ background:#f5f5f5; border-color:var(--vao-bdr); font-weight:700; }

.vao-toc__list li.toc-h3{ padding-left:16px; }

/* Colapsado: la lógica principal la maneja JS con [hidden] */
.vao-toc.is-collapsed { opacity:1; }

/* Scroll offset para headers anclados */
.vao-content h2, .vao-content h3{ scroll-margin-top:100px; }

@media (max-width:768px){
  .vao-toc{ padding:12px 14px; }
  .vao-toc__title{ font-size:15px; }
  .vao-toc__list a{ font-size:14.5px; }
}

/* ===== Hero para Portfolio ===== */
.vao-hero-portfolio {
  position: relative;
  width: 100%;
  min-height: 55vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
}

.vao-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.6));
  z-index: 1;
}

.vao-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem 1rem;
}

.vao-chip--hero {
  display: inline-block;
  background: #d2414a;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 1rem;
}

.vao-hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  font-weight: 800;
  color:#fff;
}

/* ===== Contenido principal ===== */
.vao-portfolio-main {
  width:100%;
  max-width: 100%;
  margin: 3rem auto;
  padding: 0 1.25rem;
}

.vao-portfolio-article {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1e2a38;
}

.vao-portfolio-article p {
  margin-bottom: 1.2rem;
}

/* Imágenes dentro del contenido */
.vao-portfolio-article img {
  border-radius: 8px;
  margin: 1.5rem 0;
  width: 100%;
  height: auto;
}

/* Responsivo */
@media (max-width: 768px) {
  .vao-hero-portfolio { min-height: 45vh; }
  .vao-hero-title { font-size: 1.8rem; }
}

/* ===== HERO con fondo (single post) ===== */
.vao-hero--bg{
  position: relative;
  min-height: 48vh;              /* altura contenida */
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.vao-hero__overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,.65));
}

.vao-hero__content{
  position: relative;
  z-index: 1;
  padding: 70px 0 50px;          /* espacio inferior para respirar */
}

/* Badges de categorías encima de la imagen */
.vao-hero__badges{
  display: flex;
  flex-wrap: wrap;
  justify-content:center;
  gap: 8px;
  margin: 0 0 12px;
}

.vao-hero__badges .vao-badge{
  background: #d2414a;           /* rojo VAO */
  color:#fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing:.02em;
  font-size:.75rem;
  padding:6px 12px;
  border-radius:999px;
  text-decoration:none;
}

/* Título sobre la imagen */
.vao-hero__title{
  margin: 0 0 10px;
  font-weight: 800;
  line-height: 1.5;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: #fff;
  text-align:center;
}

/* Meta en el hero (usamos la clase existente + ajuste de color) */
.vao-hero__meta{
  color: rgba(255,255,255,.9);
}

/* Responsivo */
@media (max-width: 768px){
  .vao-hero--bg{ min-height: 42vh; }
  .vao-hero__content{ padding: 56px 0 40px; }
}
