/* ═══════════════════════════════════════════════════════════
   cdx-content.css
   Blog + Portfolio — páginas internas
   Carga en todas las páginas excepto home
   ═══════════════════════════════════════════════════════════ */

/* ── Fondo oscuro + grid en todas las páginas internas ────── */
body:not(.home) {
  background-color: #050d1a;
  color: #fafafa;
}

body:not(.home)::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(59,130,246,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.05) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ── Contenedor base de página ───────────────────────────── */
.cdx-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.cdx-page__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 48px 120px;
}

.cdx-page__container--narrow {
  max-width: 760px;
  padding-top: 60px;
}

/* ── Page header ─────────────────────────────────────────── */
.cdx-page__header {
  text-align: center;
  margin-bottom: 72px;
  padding-top: 20px;
}

.cdx-page__label {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(96,165,250,.65);
  margin-bottom: 20px;
}

.cdx-page__title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.05;
  color: #fafafa;
  margin: 0 0 20px;
}

.cdx-page__desc {
  font-size: 18px;
  color: rgba(250,250,250,.52);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto;
}

/* ════════════════════════════════════════
   BLOG — LISTADO
════════════════════════════════════════ */
.cdx-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

/* Card de post */
.cdx-post-card {
  background: rgba(10,18,40,.72);
  border: 1px solid rgba(59,130,246,.1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s cubic-bezier(.16,1,.3,1), border-color .3s, box-shadow .3s;
}

.cdx-post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59,130,246,.3);
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

/* Thumbnail */
.cdx-post-card__thumb {
  display: block;
  overflow: hidden;
  height: 200px;
  flex-shrink: 0;
}

.cdx-post-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.cdx-post-card:hover .cdx-post-card__thumb img { transform: scale(1.05); }

.cdx-post-card__thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(5,13,26,.6) 100%);
}

/* Body */
.cdx-post-card__body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Meta row */
.cdx-post-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.cdx-post-card__cat {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #60a5fa;
  text-decoration: none;
  transition: background .2s;
}
.cdx-post-card__cat:hover { background: rgba(59,130,246,.28); }

.cdx-post-card__read {
  font-size: 12px;
  color: rgba(250,250,250,.35);
  letter-spacing: .3px;
}

/* Título */
.cdx-post-card__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.3;
  margin: 0 0 12px;
}
.cdx-post-card__title a {
  color: #fafafa;
  text-decoration: none;
  transition: color .2s;
}
.cdx-post-card__title a:hover { color: #60a5fa; }

/* Excerpt */
.cdx-post-card__excerpt {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(250,250,250,.52);
  margin: 0 0 20px;
  flex: 1;
}

/* Footer de la card */
.cdx-post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(59,130,246,.08);
}

.cdx-post-card__date {
  font-size: 12px;
  color: rgba(250,250,250,.3);
  letter-spacing: .3px;
}

.cdx-post-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #3b82f6;
  text-decoration: none;
  transition: color .2s, gap .2s;
}
.cdx-post-card__link:hover { color: #60a5fa; gap: 10px; }

/* ════════════════════════════════════════
   SINGLE POST
════════════════════════════════════════ */
.cdx-single__hero {
  position: relative;
  min-height: 55vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 60px;
  overflow: hidden;
}

.cdx-single__hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.cdx-single__hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: .2;
  filter: blur(2px) saturate(.7);
  transform: scale(1.04);
}
.cdx-single__hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(5,13,26,.3) 0%, #050d1a 100%);
}

.cdx-single__hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 120px 48px 0;
}

.cdx-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(250,250,250,.35);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cdx-breadcrumb a { color: rgba(250,250,250,.35); text-decoration: none; transition: color .2s; }
.cdx-breadcrumb a:hover { color: #60a5fa; }

.cdx-single__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cdx-single__title {
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.08;
  color: #fafafa;
  margin: 0 0 20px;
}

.cdx-single__excerpt {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(250,250,250,.55);
  max-width: 680px;
  margin: 0;
}

/* ── Prose — contenido del post ──────────────────────────── */
.cdx-prose {
  font-size: 17px;
  line-height: 1.85;
  color: rgba(250,250,250,.8);
}

.cdx-prose p { margin-bottom: 1.5em; }

.cdx-prose h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #fafafa;
  margin: 2.5em 0 .75em;
  padding-top: 1em;
  border-top: 1px solid rgba(59,130,246,.1);
}

.cdx-prose h3 {
  font-size: 20px;
  font-weight: 700;
  color: #fafafa;
  margin: 2em 0 .6em;
}

.cdx-prose h4 {
  font-size: 17px;
  font-weight: 700;
  color: rgba(250,250,250,.85);
  margin: 1.5em 0 .5em;
}

.cdx-prose a { color: #60a5fa; text-decoration: underline; text-underline-offset: 3px; }
.cdx-prose a:hover { color: #93c5fd; }

.cdx-prose strong { color: #fafafa; font-weight: 700; }
.cdx-prose em { color: rgba(250,250,250,.75); }

.cdx-prose ul, .cdx-prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}
.cdx-prose li { margin-bottom: .5em; }

.cdx-prose blockquote {
  border-left: 3px solid #3b82f6;
  margin: 2em 0;
  padding: 16px 24px;
  background: rgba(59,130,246,.06);
  border-radius: 0 8px 8px 0;
  font-size: 18px;
  font-style: italic;
  color: rgba(250,250,250,.7);
}

.cdx-prose code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .88em;
  padding: 2px 7px;
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 4px;
  color: #93c5fd;
}

.cdx-prose pre {
  background: rgba(10,18,40,.9);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.cdx-prose pre code { background: none; border: none; padding: 0; font-size: .9em; color: #e2e8f0; }

.cdx-prose img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.5em 0;
  border: 1px solid rgba(59,130,246,.1);
}

.cdx-prose hr {
  border: none;
  border-top: 1px solid rgba(59,130,246,.1);
  margin: 2.5em 0;
}

/* Tags */
.cdx-single__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0;
  padding-top: 32px;
  border-top: 1px solid rgba(59,130,246,.08);
}

.cdx-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 20px;
  font-size: 12px;
  color: rgba(250,250,250,.5);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.cdx-tag:hover { background: rgba(59,130,246,.18); color: #60a5fa; }

/* ════════════════════════════════════════
   PORTFOLIO — ARCHIVE
════════════════════════════════════════ */

/* Filtros */
.cdx-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 52px;
}

.cdx-filter {
  padding: 8px 20px;
  background: rgba(10,18,40,.72);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 8px;
  color: rgba(250,250,250,.55);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  transition: all .2s;
}
.cdx-filter:hover {
  border-color: rgba(59,130,246,.4);
  color: #fafafa;
  background: rgba(59,130,246,.1);
}
.cdx-filter.active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 24px rgba(59,130,246,.3);
}

/* Grid del portfolio — hereda estilos de cdx-harmony */
.cdx-portfolio-grid {
  transition: all .3s;
}
.portfolio-item {
  transition: opacity .3s, transform .3s;
}

/* ════════════════════════════════════════
   SINGLE PORTFOLIO
════════════════════════════════════════ */

/* Browser mockup */
.cdx-browser {
  max-width: 820px;
  margin: -30px auto 60px;
  background: rgba(10,18,40,.9);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.5), 0 0 0 1px rgba(59,130,246,.08);
  transition: transform .3s, box-shadow .3s;
}
.cdx-browser:hover {
  transform: translateY(-4px);
  box-shadow: 0 60px 120px rgba(0,0,0,.55), 0 0 40px rgba(59,130,246,.1);
}

.cdx-browser__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(5,13,26,.9);
  border-bottom: 1px solid rgba(59,130,246,.1);
}
.cdx-browser__dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cdx-browser__dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: block;
}
.cdx-browser__url {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(59,130,246,.1);
  border-radius: 20px;
  padding: 3px 14px;
  font-size: 12px;
  font-family: 'SF Mono', monospace;
  color: rgba(250,250,250,.3);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cdx-browser__screen {
  height: 440px;
  overflow: hidden;
  background: rgba(10,18,40,.5);
}
.cdx-browser__screen img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Info grid */
.cdx-portfolio-info {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 60px;
}

/* Meta sidebar */
.cdx-portfolio-meta {
  background: rgba(10,18,40,.72);
  border: 1px solid rgba(59,130,246,.1);
  border-radius: 16px;
  padding: 32px;
  position: sticky;
  top: 88px;
}

.cdx-portfolio-meta__title {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(96,165,250,.6);
  margin: 0 0 24px;
}

.cdx-meta-list { list-style: none; padding: 0; margin: 0; }

.cdx-meta-list__item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(59,130,246,.07);
}
.cdx-meta-list__item:last-child { border-bottom: none; }

.cdx-meta-list__item dt {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(250,250,250,.3);
  margin-bottom: 5px;
}
.cdx-meta-list__item dd {
  font-size: 14px;
  font-weight: 600;
  color: rgba(250,250,250,.85);
  margin: 0;
}

.cdx-meta-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #3b82f6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color .2s;
}
.cdx-meta-link:hover { color: #60a5fa; }

/* Portfolio body */
.cdx-portfolio-body__title {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(96,165,250,.6);
  margin: 0 0 28px;
}

/* ════════════════════════════════════════
   NAVEGACIÓN ANTERIOR / SIGUIENTE
════════════════════════════════════════ */
.cdx-post-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin: 60px 0;
  padding-top: 40px;
  border-top: 1px solid rgba(59,130,246,.08);
}

.cdx-post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  background: rgba(10,18,40,.72);
  border: 1px solid rgba(59,130,246,.1);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.cdx-post-nav__item:hover {
  border-color: rgba(59,130,246,.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.cdx-post-nav__item--next { text-align: right; }

.cdx-post-nav__dir {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(250,250,250,.3);
}
.cdx-post-nav__item--next .cdx-post-nav__dir { justify-content: flex-end; }

.cdx-post-nav__title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(250,250,250,.85);
  line-height: 1.4;
}

.cdx-post-nav__all {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(250,250,250,.3);
  text-decoration: none;
  transition: color .2s;
}
.cdx-post-nav__all:hover { color: #3b82f6; }

/* ════════════════════════════════════════
   CTA BOX FINAL
════════════════════════════════════════ */
.cdx-cta-box {
  text-align: center;
  padding: 60px 48px;
  background: rgba(10,18,40,.72);
  border: 1px solid rgba(59,130,246,.12);
  border-radius: 20px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}
.cdx-cta-box::before {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.1) 0%, transparent 68%);
  pointer-events: none;
}
.cdx-cta-box h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #fafafa;
  margin: 0 0 12px;
}
.cdx-cta-box p {
  font-size: 16px;
  color: rgba(250,250,250,.52);
  margin: 0 0 28px;
}

/* ════════════════════════════════════════
   PAGINACIÓN
════════════════════════════════════════ */
.cdx-pagination .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cdx-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 14px;
  background: rgba(10,18,40,.72);
  border: 1px solid rgba(59,130,246,.12);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(250,250,250,.55);
  text-decoration: none;
  transition: all .2s;
}
.cdx-pagination .page-numbers:hover {
  border-color: rgba(59,130,246,.4);
  color: #fafafa;
  background: rgba(59,130,246,.1);
}
.cdx-pagination .page-numbers.current {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(59,130,246,.3);
}
.cdx-pagination .page-numbers.dots { background: transparent; border-color: transparent; }

/* ── Empty state ─────────────────────────────────────────── */
.cdx-empty {
  text-align: center;
  padding: 80px 0;
  color: rgba(250,250,250,.35);
  font-size: 16px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .cdx-portfolio-info { grid-template-columns: 1fr; gap: 40px; }
  .cdx-portfolio-meta { position: static; }
  .cdx-post-nav { grid-template-columns: 1fr; }
  .cdx-post-nav__all { order: -1; }
  .cdx-post-nav__item--next { text-align: left; }
  .cdx-post-nav__item--next .cdx-post-nav__dir { justify-content: flex-start; }
}

@media (max-width: 768px) {
  .cdx-page__container { padding: 60px 24px 80px; }
  .cdx-page__container--narrow { padding: 40px 24px 60px; }
  .cdx-single__hero-content { padding: 100px 24px 0; }
  .cdx-posts-grid { grid-template-columns: 1fr; }
  .cdx-browser__screen { height: 280px; }
  .cdx-cta-box { padding: 40px 24px; }
  .cdx-post-nav { gap: 12px; margin: 40px 0; }
}
