/* ==========================================================
   blog.css — Estilos del blog integrado (Blogger → IT)

   Usa EXCLUSIVAMENTE los tokens del design system del sitio
   definidos en it-shared.css (--blue, --ink, --gray, --border,
   --ease, --shadow-*). No redefine :root ni la tipografía:
   todo hereda 'Plus Jakarta Sans' desde el body.

   Carga después de it-shared.css:
     <link rel="stylesheet" href="it-shared.css">
     <link rel="stylesheet" href="blog/blog.css">
   ========================================================== */

/* ══════════════════════════════════════════════════════════
   1. POST DESTACADO (hero del blog, sobre fondo oscuro)
   ══════════════════════════════════════════════════════════ */
.featured-post {
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.featured-post .fp-bg {
  position: absolute; inset: 0; z-index: 0;
  background-color: var(--dark-bg-solid);
  transition: transform 0.6s var(--ease);
}
.featured-post:hover .fp-bg { transform: scale(1.04); }

/* Retícula decorativa sobre el fondo */
.fp-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(75,174,214,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75,174,214,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
/* Ícono gigante cuando el post no trae imagen */
.fp-glyph {
  position: absolute; right: clamp(32px,6%,80px); top: 50%;
  transform: translateY(-50%);
  font-size: clamp(100px,14vw,180px);
  opacity: 0.18; user-select: none; pointer-events: none;
}
.fp-glow {
  position: absolute; top: -80px; left: 40%;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(75,174,214,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.featured-post .fp-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top,
    rgba(13,15,18,0.94) 0%,
    rgba(13,15,18,0.62) 50%,
    rgba(13,15,18,0.15) 100%);
}
.featured-post .fp-body {
  position: relative; z-index: 2;
  padding: clamp(28px,4vw,48px);
  width: 100%;
}

.fp-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px;
  background: rgba(75,174,214,0.2);
  border: 1px solid rgba(75,174,214,0.3);
  color: #7fd4f5;
  margin-bottom: 16px;
}
.fp-title {
  font-size: clamp(24px, 3.5vw, 44px); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1.05; color: #fff;
  margin-bottom: 14px; max-width: 700px;
}
.fp-excerpt {
  font-size: 15px; color: rgba(255,255,255,0.55);
  line-height: 1.65; max-width: 600px; margin-bottom: 24px;
}
.fp-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fp-author-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
  letter-spacing: 0.02em;
}
.fp-meta-text { font-size: 13px; color: rgba(255,255,255,0.45); }
.fp-meta-text strong { color: rgba(255,255,255,0.75); font-weight: 600; }
.fp-meta-sep { opacity: 0.4; }
.fp-read-more {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--blue);
  padding: 9px 18px; border-radius: 9px;
  background: rgba(75,174,214,0.12);
  border: 1px solid rgba(75,174,214,0.22);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
  white-space: nowrap;
}
.featured-post:hover .fp-read-more {
  background: rgba(75,174,214,0.2);
  transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════════
   2. SECCIÓN DE LA GRILLA
   ══════════════════════════════════════════════════════════ */
.blog-grid-section {
  padding: 96px 0;
  background: var(--gray);
}
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 48px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

/* ══════════════════════════════════════════════════════════
   3. CARDS DE POST
   ══════════════════════════════════════════════════════════ */
.post-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pc-img-wrap {
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--mid);
}
.pc-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.post-card:hover .pc-img { transform: scale(1.07); }

/* Placeholder cuando el post no trae imagen */
.pc-img-ph {
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 0 20px;
}
.pc-img-ph span {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0.75;
}

.pc-body {
  padding: 24px;
  display: flex; flex-direction: column; flex: 1;
}
.pc-cat {
  display: inline-block; align-self: flex-start;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 10px;
}
.pc-title {
  font-size: 16px; font-weight: 800; letter-spacing: -0.025em;
  color: var(--ink); line-height: 1.3; margin-bottom: 10px;
}
.pc-excerpt {
  font-size: 13px; color: rgba(13,15,18,0.48);
  line-height: 1.65; flex: 1; margin-bottom: 18px;
}
.pc-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.pc-date { font-size: 11px; color: rgba(13,15,18,0.32); font-weight: 500; }
.pc-link {
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap;
  transition: gap 0.2s var(--ease);
}
.post-card:hover .pc-link { gap: 7px; }

/* ══════════════════════════════════════════════════════════
   4. FILTROS POR ETIQUETA (sobre el hero oscuro)
   ══════════════════════════════════════════════════════════ */
.blog-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.blog-tag {
  font-size: 12px; font-weight: 600; letter-spacing: -0.01em;
  padding: 6px 16px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  cursor: pointer; font-family: inherit;
  transition: all 0.18s var(--ease);
}
.blog-tag:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.24);
}
.blog-tag.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

/* ══════════════════════════════════════════════════════════
   5. SKELETONS DE CARGA
   ══════════════════════════════════════════════════════════ */
.blog-skeleton {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  min-height: 360px;
  position: relative;
  overflow: hidden;
}
.blog-skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(13,15,18,0.045) 50%, transparent 100%);
  animation: blog-shimmer 1.5s ease-in-out infinite;
}
@keyframes blog-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .blog-skeleton::after { animation: none; }
}

/* ══════════════════════════════════════════════════════════
   6. ESTADO VACÍO / ERROR
   ══════════════════════════════════════════════════════════ */
.blog-empty {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(40px, 6vw, 72px) 32px;
  text-align: center;
}
.blog-empty-icon { font-size: 40px; margin-bottom: 16px; }
.blog-empty-title {
  font-size: 20px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink); margin-bottom: 10px;
}
.blog-empty-text {
  font-size: 14px; color: rgba(13,15,18,0.48);
  line-height: 1.7; max-width: 420px; margin: 0 auto 22px;
}

/* ══════════════════════════════════════════════════════════
   7. VISTA DE POST COMPLETO
   ══════════════════════════════════════════════════════════ */
.blog-single {
  display: none;               /* JS lo muestra al abrir un post */
  max-width: 800px;
  margin: 0 auto;
}
.blog-back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 18px;
  margin-bottom: 28px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.blog-back-btn:hover {
  transform: translateX(-3px);
  box-shadow: var(--shadow-sm);
}

.single-post {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 56px);
}
.single-post-header { margin-bottom: 32px; }
.single-post-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.08;
  color: var(--ink);
  margin: 4px 0 20px;
}
.single-post-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: rgba(13,15,18,0.42);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.single-post-meta strong { color: var(--ink); font-weight: 700; }
.single-post-meta .fp-meta-sep { color: rgba(13,15,18,0.22); }

.single-post-hero-image {
  width: 100%; height: auto;
  max-height: 460px; object-fit: cover;
  border-radius: 16px;
  margin-bottom: 36px;
}

/* ── Prosa del artículo ── */
.single-post-content {
  font-size: 16px;
  color: rgba(13,15,18,0.78);
  line-height: 1.8;
}
.single-post-content > *:first-child { margin-top: 0; }
.single-post-content p { margin-bottom: 1.4em; }
.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
  color: var(--ink);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.2;
  margin: 2em 0 0.7em;
}
.single-post-content h1 { font-size: 28px; }
.single-post-content h2 { font-size: 24px; }
.single-post-content h3 { font-size: 19px; }
.single-post-content h4 { font-size: 16px; }
.single-post-content a {
  color: var(--blue); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(75,174,214,0.35);
  transition: text-decoration-color 0.2s;
}
.single-post-content a:hover { text-decoration-color: var(--blue); }
.single-post-content ul,
.single-post-content ol { margin: 0 0 1.4em 1.3em; }
.single-post-content li { margin-bottom: 0.5em; }
.single-post-content img {
  max-width: 100%; height: auto;
  border-radius: 14px;
  margin: 2em 0;
}
.single-post-content blockquote {
  margin: 2em 0;
  padding: 20px 26px;
  background: var(--soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 14px 14px 0;
  font-size: 17px; font-style: italic;
  color: rgba(13,15,18,0.66);
}
.single-post-content blockquote p:last-child { margin-bottom: 0; }
.single-post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}
.single-post-content pre {
  background: var(--ink);
  color: #e8e6e0;
  border-radius: 14px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 2em 0;
  font-size: 13px; line-height: 1.6;
}
.single-post-content pre code {
  background: none; border: none; padding: 0; color: inherit;
}
.single-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 14px;
  display: block; overflow-x: auto;
}
.single-post-content th,
.single-post-content td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.single-post-content th { background: var(--soft); font-weight: 700; color: var(--ink); }
.single-post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Videos / mapas embebidos, responsivos */
.embed-responsive {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 2em 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ink);
}
.embed-responsive iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ── Pie del artículo ──
   Debe ser un <div>: it-shared.css pinta el elemento <footer> con el
   fondo oscuro del pie del sitio y aquí quedaría ilegible. */
.single-post-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-top: 44px; padding-top: 26px;
  border-top: 1px solid var(--border);
  background: none;
}
.single-post-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Etiquetas clicables → filtran la grilla por esa categoría */
.single-post-tag {
  margin: 0;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid transparent;   /* el color lo pone el JS */
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.single-post-tag:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Enlace a la fuente original */
.single-post-source {
  font-size: 13px; font-weight: 700;
  color: rgba(13,15,18,0.45);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.single-post-source:hover { color: var(--blue); }

/* ══════════════════════════════════════════════════════════
   8. RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .featured-post { min-height: 420px; }
  .blog-grid-section { padding: 72px 0; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .fp-read-more { margin-left: 0; }
  .fp-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .single-post-meta { align-items: flex-start; }
  .single-post-footer { flex-direction: column; align-items: flex-start; }
}
