/* ============================================
   BLOG (index + posts)
   ============================================ */

/* Contenedor base */
.blog-index {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem; /* sin padding vertical para que las bandas lleguen al hero y al footer */
}

.blog-post {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.2rem 1rem 3rem; /* los posts se quedan como estaban */
}


/* Migas */
.blog-breadcrumbs,
.post-breadcrumbs {
    margin: 1.2rem 0 1.6rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.blog-breadcrumbs a,
.post-breadcrumbs a {
    text-decoration: none;
    font-weight: 700;
}

/* =========================
   INDEX: GRID
   ========================= */
.blog-grid-wrap {
    margin-top: 1.2rem;
}

.blog-grid-header h2 {
    margin: 0 0 0.4rem;
}

.blog-grid-header p {
    margin: 0 0 1.2rem;
    opacity: 0.85;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

/* Card */
.blog-card {
    grid-column: span 6;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: var(--bg-panel);
    box-shadow: var(--shadow-soft);

    transition: transform 160ms ease;
    will-change: transform;
}

.blog-card__link {
    display: grid;
    grid-template-rows: auto 1fr;
    text-decoration: none;
    height: 100%;
}

.blog-card__media img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}

.blog-card__body {
    padding: 1rem 1rem 1.1rem;
}

.blog-card__meta {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    opacity: 0.85;
}

.blog-card__title {
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
    line-height: 1.25;
}

.blog-card__excerpt {
    margin: 0 0 0.9rem;
    opacity: 0.9;
    line-height: 1.55;
}

.blog-card__cta {
    display: inline-block;
    font-weight: 700;
    padding: 0.6rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background-color: #137b85;
    color: #ffffff;
    box-shadow: var(--shadow-soft);
}

.blog-card__cta:hover {
    background-color: #155858;
    transform: translateY(-1px);
}

.blog-card:hover {
    transform: translateY(-2px);
}

/* Responsive index */
@media (max-width: 860px) {
    .blog-card {
        grid-column: span 12;
    }

    .blog-card__media img {
        height: 200px;
    }
}

/* =========================
   POST: PLANTILLA
   ========================= */
.post-article {
    background: var(--bg-panel);
    border-radius: 18px;
    padding: 2rem 1.9rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
    margin-top: 1rem;
}

.post-header .post-label {
    margin: 0 0 0.4rem;
    opacity: 0.85;
    font-weight: 700;
}

.post-header h1 {
    margin: 0 0 0.75rem;
    line-height: 1.12;
}

.post-lead {
    margin: 0 0 1.4rem;
    opacity: 0.92;
    line-height: 1.6;
}

/* Bloque de metadatos */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 1.6rem;
    padding: 0;
    list-style: none;
    opacity: 0.9;
}

.post-meta li {
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.9rem;
}

/* =========================
   Índice de contenidos (TOC)
   ========================= */
.post-toc {
    background-color: #f9fafb;
    border-radius: 0.8rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-soft);
    max-width: 520px;
    margin: 0 auto 1.8rem;
}

.post-toc h2 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    color: var(--accent-dark);
}

.post-toc ol {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.post-toc li {
    margin-bottom: 0.3rem;
}

.post-toc a {
    color: var(--accent);
    text-decoration: none;
}

.post-toc a:hover {
    text-decoration: underline;
}

/* =========================
   Contenido
   ========================= */
.post-content h2 {
    margin-top: 1.8rem;
    margin-bottom: 0.7rem;
}

.post-content p,
.post-content li {
    line-height: 1.7;
    opacity: 0.95;
}

.post-content ul,
.post-content ol {
    padding-left: 1.2rem;
}

/* =========================
   Media del post
   ========================= */
.post-figure {
    margin: 0 0 1.2rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}


.post-figure--video {
    padding-top: 1.5rem;    /* aire dentro del borde superior */
}


.post-figure img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
}

.post-figure figcaption {
    padding: 0.75rem 1rem;
    opacity: 0.85;
    font-size: 0.95rem;
}

/* Video centrado tipo YouTube (no full width) */
.video-wrapper--youtube {
    width: 100%;            /* que use el ancho disponible del contenedor */
    max-width: 560px;       /* tope clásico de YouTube */
    margin: 0 auto;         /* centrado */
    aspect-ratio: 16 / 9;   /* forma panorámica */
    display: block;         /* nos aseguramos de que actúa como bloque */
}

.video-wrapper--youtube iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}



/* Ajuste específico para los vídeos de los posts */
.post-figure--video .video-wrapper.video-wrapper--youtube {
  /* anulamos posibles trucos globales de .video-wrapper */
  padding: 0;
  height: auto;

  width: 100%;
  max-width: 900px;       /* tamaño típico YouTube */
  margin: 0 auto;
  aspect-ratio: 16 / 9;   /* forma 16:9 del contenedor */
  position: relative;
  display: block;
}

.post-figure--video .video-wrapper.video-wrapper--youtube iframe {
  position: absolute;
  inset: 0;               /* top:0; right:0; bottom:0; left:0 */
  width: 100%;
  height: 100%;           /* rellena exactamente el contenedor 16:9 */
  display: block;
  border: 0;
}




/* Desmontaje: texto + foto a la derecha */
.post-grid-2 {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 0.9rem;
    align-items: start;
    margin: 1rem 0 1.2rem;
}

.post-grid-2__media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}

.post-grid-2__media--ajuste img {
  max-width: 370px;   /* o el tamaño especial que quieras */
  margin: 0 auto;     /* si quieres que quede centrada dentro del figure */
}


.post-grid-2__media figcaption {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    opacity: 0.85;
}

@media (max-width: 820px) {
    .post-grid-2 {
        grid-template-columns: 1fr;
    }

    .post-grid-2__media {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;   /* 👈 muy importante para que border+padding no sumen más de 100% */
        margin: 0 auto;   
    }

    .post-grid-2__media img {
        width: 100%;
        height: auto;
        display: block;
    }
}


/* =========================
   TIP
   ========================= */
.post-tip,
.tipos-tip.post-tip {
    margin: 1rem 0 1.4rem;
    background-color: #ecfdf5;
    border-radius: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
}

.post-tip p,
.tipos-tip.post-tip p {
    margin: 0;
    font-size: 0.9rem;
    color: #166534;
}

/* =========================
   CTA (intermedia + final) con look "hero"
   ========================= */
.post-cta {
    border-radius: 22px;
    padding: 1.6rem 1.5rem;
    margin: 1.6rem 0 1.8rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(circle at top left, rgba(149, 211, 190, 0.55) 0, transparent 55%),
        radial-gradient(circle at bottom right, rgba(234, 159, 34, 0.35) 0, transparent 55%),
        linear-gradient(135deg, #091e26, #020617);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    position: relative;
    overflow: hidden;
}

.post-cta h2,
.post-cta p {
    position: relative;
    z-index: 1;
}

.post-cta h2 {
    margin: 0 0 0.5rem;
    color: #fff;
}

.post-cta p {
    margin: 0 0 1rem;
    color: rgba(255, 255, 255, 0.90);
}

.post-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* Botones CTA */
.post-cta .post-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    padding: 0.85rem 1.05rem;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.2px;

    color: #111;
    background: var(--accent-warm);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);

    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.post-cta .post-btn:hover {
    background: #b98428;
    transform: translateY(-2px);
    filter: brightness(1.02);
    color: beige;
}

.post-cta .post-btn:active {
    transform: translateY(0px);
    opacity: 0.95;
}

/* Base button */
.post-btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
}

/* Grid de botones cuando lo uses */
.post-cta-actions--grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .post-cta-actions--grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive post */
@media (max-width: 860px) {
    .post-article {
        padding: 1.5rem 1.1rem;
    }

    .post-figure img {
        height: 220px;
    }
}

/* ============================================
   BLOG: BANDAS FULL WIDTH + TARJETA GRANDE
   - Reutilizable para Quick + Popular
   ============================================ */

.blog-band {
    position: relative;
    padding: 1.2rem 0 1.4rem;
    margin: 0; /* importante: sin margen arriba/abajo */
}

.blog-band::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;

    left: 50%;
    transform: translateX(-50%);
    width: 100vw;

    background: #fefce8;
    z-index: -1;
}

/* Migas dentro de la banda */
.blog-band .blog-breadcrumbs {
    margin: 0 0 1rem;
}

/* Extra de aire para que la última banda no se quede “corta” antes del footer */
.blog-band--popular {
    padding-bottom: 2.2rem;
}


/* Tarjeta grande (panel) */
.blog-panel {
    background: linear-gradient(135deg, #fff3c4 0%, #fffdf2 70%);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    padding: 1.4rem 1.4rem 1.6rem;
}

/* Grid 3 columnas dentro del panel */
.blog-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.blog-grid--3 .blog-card {
    grid-column: auto;
}

.blog-grid--3 .blog-card__media img {
    height: 180px;
}

/* Responsive panel */
@media (max-width: 980px) {
    .blog-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .blog-grid--3 .blog-card__media img {
        height: 190px;
    }
}

@media (max-width: 680px) {
    .blog-panel {
        padding: 1.1rem 1rem 1.2rem;
    }

    .blog-grid--3 {
        grid-template-columns: 1fr;
    }

    .blog-grid--3 .blog-card__media img {
        height: 200px;
    }
}
