/* ============================================================
   www.tecnopacific.com — blog.css   Páginas de artículo del blog
   Ficha lateral con el índice + columna de lectura.
   El único elemento destacado es la nota técnica, dibujada sobre
   la misma retícula de plano de los banners del sitio.
   ============================================================ */
#app { padding-top: var(--nav-h); }

.post { padding: 72px 56px 88px; }
.post-wrap {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 72px;
  align-items: start;
}

/* ── Ficha lateral ── */
.post-rail { position: sticky; top: calc(var(--nav-h) + 32px); font-size: 14px; }
.post-facts { display: grid; gap: 14px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.post-facts dt { font-size: 13px; color: var(--muted); }
.post-facts dd { font-weight: 600; color: var(--text); line-height: 1.4; }
.post-facts dd a { color: var(--blue-mid); }
.post-facts dd a:hover { color: var(--orange); }
.post-toc-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.post-toc ol { list-style: none; display: grid; gap: 2px; border-left: 2px solid var(--border); }
.post-toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted); line-height: 1.4; transition: color .2s, border-color .2s;
}
.post-toc a:hover { color: var(--text); }
.post-toc a.is-current { color: var(--blue-mid); border-left-color: var(--orange); font-weight: 600; }
.post-back { display: inline-block; margin-top: 26px; color: var(--blue-mid); font-weight: 600; }
.post-back:hover { color: var(--orange); }

/* ── Columna de lectura ── */
.post-body { max-width: 700px; }
.post-figure { margin: 0 0 40px; }
.post-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--bg); }
.post-lead { font-size: 21px; line-height: 1.65; color: var(--text); margin-bottom: 8px; }
.post-body h2 {
  font-family: 'Montserrat', sans-serif; font-size: 25px; font-weight: 800;
  letter-spacing: -.4px; line-height: 1.25; color: var(--text);
  margin: 48px 0 14px; scroll-margin-top: calc(var(--nav-h) + 24px);
}
.post-body p { font-size: 18px; line-height: 1.75; color: #33354A; margin-bottom: 20px; }
.post-body p strong { color: var(--text); }

/* Nota técnica: el consejo práctico de cada artículo */
.post-note {
  margin: 44px 0; padding: 26px 30px 28px;
  border-radius: 10px; color: #fff;
  background-color: var(--blue);
  background-image: linear-gradient(rgba(91,168,212,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(91,168,212,.13) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}
.post-note-title { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 700; color: var(--orange-lt); margin-bottom: 8px; }
.post-body .post-note p { font-size: 17px; line-height: 1.7; color: #fff; margin: 0; }

/* Lista de verificación (artículo de compra de equipos) */
.post-check { margin: 8px 0 28px; }
.post-check h2 { margin-top: 44px; }
.post-check ul { list-style: none; display: grid; gap: 12px; }
.post-check li { position: relative; padding-left: 26px; font-size: 18px; line-height: 1.55; color: #33354A; }
.post-check li::before {
  content: ''; position: absolute; left: 2px; top: .62em;
  width: 8px; height: 8px; background: var(--blue-mid); border-radius: 2px;
}

/* Cierre: una sola invitación a contactar */
.post-close { margin-top: 56px; padding: 30px 32px 32px; background: var(--bg); border-radius: 10px; }

.post-body .post-close .post-close-q { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 800; line-height: 1.3; color: var(--text); margin-bottom: 8px; }
.post-body .post-close p { font-size: 16px; color: var(--muted); margin-bottom: 22px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-wa {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--whatsapp); color: #fff; font-weight: 700; font-size: 14px;
  padding: 13px 24px; border-radius: 8px; transition: background .2s;
}
.btn-wa:hover { background: #1fb457; }
.btn-wa svg { width: 18px; height: 18px; }
.btn-wa:focus-visible, .post-toc a:focus-visible, .post-back:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* ── Sigue leyendo ── */
.post-more { background: var(--bg); padding: 72px 56px 88px; }
.post-more-inner { max-width: 1080px; margin: 0 auto; }
.post-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.post-more-head h2 { font-family: 'Montserrat', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -.4px; color: var(--text); }
.post-more-head a { color: var(--blue-mid); font-weight: 600; white-space: nowrap; }
.post-more-head a:hover { color: var(--orange); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .post-wrap { grid-template-columns: 1fr; gap: 0; }
  .post-rail { position: static; }
  .post-facts { grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 36px; }
  .post-toc, .post-back { display: none; }
  .post-body { max-width: 720px; }
}
@media (max-width: 768px) {
  .post { padding: 44px 20px 64px; }
  .post-more { padding: 52px 20px 64px; }
  .post-lead { font-size: 19px; }
  .post-body h2 { font-size: 22px; margin-top: 40px; }
  .post-body p, .post-check li { font-size: 17px; }
  .post-note { padding: 22px 22px 24px; }
  .post-more-head { flex-direction: column; gap: 6px; }
}
@media (max-width: 480px) {
  .post-facts { grid-template-columns: 1fr 1fr; }
  .post-actions a { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════
   ÍNDICE DEL BLOG (pages/blog.html)
   Filtros como la barra de servicios, un destacado y la cuadrícula.
   ══════════════════════════════════════════════════════════ */
.blog-switch button {
  display: block; white-space: nowrap; padding: 18px 14px;
  font: 600 14px 'DM Sans', sans-serif; color: var(--muted);
  background: none; border: none; cursor: pointer; transition: color .2s;
}
.blog-switch button:hover { color: var(--text); }
.blog-switch button.active { color: var(--blue-mid); font-weight: 800; }
.blog-switch button:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.blog-count { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.blog-count strong { color: var(--text); }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.blog-grid .post-card h2 { font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--text); transition: color .2s; }
.blog-grid .post-card:hover h2 { color: var(--blue-mid); }
.blog-grid .post-card p { font-size: 14px; }
.blog-meta { margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--muted); }

/* Destacado: el primer artículo, grande y horizontal */
.blog-feature {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  transition: box-shadow .25s, border-color .25s;
}
.blog-feature:hover { border-color: #CBD3E1; box-shadow: 0 10px 30px rgba(26,37,112,.08); }
.blog-feature:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.blog-feature .post-card-img { height: auto; min-height: 340px; }
.blog-feature .post-card-body { padding: 36px 40px; justify-content: center; gap: 12px; }
.blog-feature h2 { font-family: 'Montserrat', sans-serif; font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.5px; line-height: 1.2; color: var(--text); transition: color .2s; }
.blog-feature:hover h2 { color: var(--blue-mid); }
.blog-feature p { font-size: 16px; line-height: 1.7; color: #33354A; }
.blog-feature .blog-meta { margin-top: 6px; }
.blog-empty { display: none; grid-column: 1 / -1; padding: 48px 0; color: var(--muted); }
.blog-empty svg { display: none; }
.blog-empty h3 { font-family: 'Montserrat', sans-serif; font-size: 18px; color: var(--text); margin-bottom: 6px; }

@media (max-width: 1000px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .blog-feature { grid-template-columns: 1fr; }
  .blog-feature .post-card-img { min-height: 0; aspect-ratio: 16 / 10; }
  .blog-feature .post-card-body { padding: 24px; }
}
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

/* Listas y pasos dentro del artículo */
.post-body .post-list, .post-body .post-steps { margin: 0 0 22px; display: grid; gap: 10px; }
.post-body .post-list { list-style: none; }
.post-body .post-list li { position: relative; padding-left: 24px; font-size: 18px; line-height: 1.65; color: #33354A; }
.post-body .post-list li::before { content: ''; position: absolute; left: 2px; top: .66em; width: 8px; height: 8px; border-radius: 2px; background: var(--blue-mid); }
.post-body .post-steps { list-style: none; counter-reset: paso; }
.post-body .post-steps li { counter-increment: paso; position: relative; padding-left: 40px; font-size: 18px; line-height: 1.65; color: #33354A; }
.post-body .post-steps li::before {
  content: counter(paso); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue-mid); color: #fff;
  font: 800 13px 'Montserrat', sans-serif;
}
.post-body li strong { color: var(--text); }
.post-body p a, .post-body li a { color: var(--blue-mid); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.post-body p a:hover, .post-body li a:hover { color: var(--orange); }
@media (max-width: 768px) { .post-body .post-list li, .post-body .post-steps li { font-size: 17px; } }

/* ── Video dentro del artículo (Shorts verticales de YouTube) ──
   Se muestra la portada local; el reproductor de YouTube solo se
   carga al darle play. Sin JavaScript, el enlace abre el video. */
.post-video {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: center;
  margin: 40px 0; padding: 22px; background: var(--bg); border-radius: 12px;
}
.post-video-player {
  position: relative; display: block; aspect-ratio: 9 / 16;
  border-radius: 10px; overflow: hidden; background: #0B0D18;
}
.post-video-player img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-video-player:hover img { transform: scale(1.03); }
.post-video-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-video-play {
  position: absolute; top: 50%; left: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border-radius: 50%; background: rgba(255,255,255,.94); box-shadow: 0 6px 20px rgba(0,0,0,.28);
  transition: transform .25s ease, background .25s ease;
}
.post-video-play::before {
  content: ''; position: absolute; top: 50%; left: 50%; margin: -10px 0 0 -6px;
  border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent var(--blue-mid);
}
.post-video-player:hover .post-video-play, .post-video-player:focus-visible .post-video-play { transform: scale(1.08); background: #fff; }
.post-video-player:focus-visible { outline: 3px solid var(--blue-mid); outline-offset: 3px; }
.post-video-time {
  position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 4px;
  background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
.post-video-kicker { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.post-body .post-video-text p { font-size: 16px; line-height: 1.7; color: #33354A; margin-bottom: 16px; }
.post-body .post-video-text .post-video-title { font-family: 'Montserrat', sans-serif; font-size: 21px; font-weight: 800; line-height: 1.3; color: var(--text); margin-bottom: 10px; }
.post-video-channel { color: var(--blue-mid); font-weight: 700; font-size: 15px; text-underline-offset: 4px; }
.post-video-channel:hover { color: var(--orange); text-decoration: underline; }
@media (max-width: 640px) {
  .post-video { grid-template-columns: 1fr; gap: 20px; padding: 18px; }
  .post-video-player { width: min(100%, 280px); margin: 0 auto; }
}
