/* ═══════════════════════════════════════════════════════
   post-styles.css — Blog Post Template (Optimizado)
   Soporte nativo para Gutenberg + Sidebar + Transparencias
═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   VARIABLES
───────────────────────────────────────── */
:root {
    --post-green:        #2ecc71;
    --post-green-dark:   #27ae60;
    --post-navy:         #1a2e44;
    --post-navy-light:   #243b55;
    --post-text:         #2d3748;
    --post-text-light:   #5a6a85; /* Ajustado para mejor contraste/legibilidad */
    --post-border:       #e2e8f0;
    --post-shadow:       0 4px 24px rgba(0,0,0,.06);
    --post-radius:       12px;
    --post-transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --post-max-width:    740px; 
}

/* ─────────────────────────────────────────
   CONTAINER & LAYOUT GRID
───────────────────────────────────────── */
.slowy-post-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* El motor que divide el Contenido del Sidebar */
.slowy-post-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: start;
}

@media (min-width: 992px) {
    .slowy-post-layout-grid {
        grid-template-columns: 7fr 3fr; /* Contenido 70% | Sidebar 30% */
    }
}

/* ─────────────────────────────────────────
   BREADCRUMB
───────────────────────────────────────── */
.slowy-post-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--post-text-light);
    margin-bottom: 16px;
}
.slowy-post-breadcrumb a { color: inherit; text-decoration: none; transition: color var(--post-transition); }
.slowy-post-breadcrumb a:hover { color: var(--post-green); }
.slowy-post-breadcrumb--light,
.slowy-post-breadcrumb--light a { color: rgba(255,255,255,.8); }
.slowy-post-breadcrumb--light a:hover { color: #ffffff; }

/* ─────────────────────────────────────────
   HERO — CON IMAGEN
───────────────────────────────────────── */
.slowy-post-hero--has-img {
    position: relative;
    min-height: 520px; /* Un poco más alto para dar elegancia */
    display: flex;
    align-items: flex-end;
    background: var(--post-navy) center/cover no-repeat;
    margin-bottom: 50px;
}
.slowy-post-hero--has-img .slowy-post-hero__overlay {
    position: absolute;
    inset: 0;
    background: 
        /* Capa 1: Oscurecimiento sutil general para mitigar fondos blancos/brillantes */
        linear-gradient(to right, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.1) 100%),
        /* Capa 2: Degradado vertical profundo para elevar el contraste del texto */
        linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 40%, rgba(15, 23, 42, 0.2) 100%);
    z-index: 1;
}

.slowy-post-hero--has-img .slowy-post-container { 
    width: 100%; 
    z-index: 2; /* Asegura que el texto flote por encima del overlay oscuro */
    position: relative;
}

.slowy-post-hero--has-img .slowy-post-hero__content {
    padding: 80px 0 60px; /* Más espacio arriba y abajo para que respire */
    max-width: 800px;
}
.slowy-post-hero--has-img .slowy-post-hero__title {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4); /* Sombra proyectada sutil para despegarlo del fondo */
}

/* Metadatos (Autor, Fecha, Lectura) super legibles */
.slowy-post-hero--has-img .slowy-post-hero__meta { 
    color: rgba(255, 255, 255, 0.95); 
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.slowy-post-hero--has-img .slowy-post-hero__meta svg { 
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* Separador entre metas en modo imagen */
.slowy-post-hero--has-img .slowy-post-meta-sep {
    color: rgba(255, 255, 255, 0.6);
}
/* ─────────────────────────────────────────
   HERO — SIN IMAGEN
───────────────────────────────────────── */
.slowy-post-hero--no-img {
    background: transparent;
    border-bottom: 1px solid var(--post-border);
    padding: 48px 0 32px;
    margin-bottom: 40px;
}
.slowy-post-hero--no-img .slowy-post-hero__content {
    max-width: 100%;
}
.slowy-post-hero--no-img .slowy-post-hero__title {
    color: var(--post-navy);
}
.slowy-post-hero--no-img .slowy-post-hero__meta { color: var(--post-text-light); }
.slowy-post-hero--no-img .slowy-post-hero__meta svg { fill: var(--post-text-light); }

/* ─────────────────────────────────────────
   HERO ELEMENTOS COMUNES
───────────────────────────────────────── */
.slowy-post-cat-badge {
    display: inline-block;
    background: var(--post-green-dark); /* Cambiado a la variante oscura para contraste AAA */
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 50px;
    text-decoration: none;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background var(--post-transition), transform var(--post-transition);
}
.slowy-post-cat-badge:hover { 
    background: var(--post-navy-light); 
    transform: translateY(-1px);
}

.slowy-post-hero__title {
    font-size: clamp(30px, 5.5vw, 48px); /* Ligeramente más grande y de impacto */
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 24px;
    letter-spacing: -.5px;
}

.slowy-post-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px; /* Mayor espacio entre elementos */
    font-size: 14px;
}

.slowy-post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.slowy-post-meta-avatar {
    width: 32px; /* Un pelín más grande para que luzca bien */
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.slowy-post-hero--no-img .slowy-post-meta-avatar {
    border-color: var(--post-border);
}
.slowy-post-meta-sep { opacity: 0.4; }

/* ─────────────────────────────────────────
   CUERPO DEL POST (TRANSPARENTE)
───────────────────────────────────────── */
.slowy-post-body {
    padding-bottom: 60px;
    background: transparent; /* Fondo transparente activado */
}

/* Área que contiene el contenido textual del post */
.slowy-post-content-area {
    max-width: 100%;
    overflow: hidden;
}

/* ─────────────────────────────────────────
   COMPARTIR ESTRUCTURA ÚNICA (Sticky / Flex)
───────────────────────────────────────── */
.slowy-post-share-wrapper {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--post-border);
}

@media (min-width: 1240px) {
    /* Se transforma en flotante sticky solo si hay espacio en pantalla ultra-amplia */
    .slowy-post-share-wrapper {
        position: sticky;
        top: 100px;
        float: left;
        flex-direction: column;
        margin-left: -70px;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        z-index: 10;
    }
}

.slowy-post-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: transform var(--post-transition), filter var(--post-transition);
}
.slowy-post-share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.slowy-post-share-btn svg { fill: #ffffff; }
.slowy-post-share-btn--fb { background: #1877f2; }
.slowy-post-share-btn--wa { background: #25d366; }
.slowy-post-share-btn--tw { background: #14171a; }

/* ─────────────────────────────────────────
   CONTENIDO GUTENBERG — TIPOGRAFÍA
───────────────────────────────────────── */
.slowy-post-entry {
    font-size: 17px;
    line-height: 1.8;
    color: var(--post-text);
}
.slowy-post-entry p { margin-bottom: 1.6em; }

/* Headings del Editor */
.slowy-post-entry h2, 
.slowy-post-entry h3, 
.slowy-post-entry h4 {
    color: var(--post-navy);
    font-weight: 700;
    line-height: 1.3;
    margin: 1.8em 0 0.6em;
}
.slowy-post-entry h2 { font-size: 28px; border-bottom: 1px solid var(--post-border); padding-bottom: 8px; }
.slowy-post-entry h3 { font-size: 22px; }
.slowy-post-entry h4 { font-size: 19px; }

/* Enlaces */
.slowy-post-entry a {
    color: var(--post-green-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--post-transition);
}
.slowy-post-entry a:hover { color: var(--post-navy); }

/* Listas */
.slowy-post-entry ul,
.slowy-post-entry ol { margin: 0 0 1.6em 1.5em; padding: 0; }
.slowy-post-entry li { margin-bottom: 0.5em; }

/* Bloques de Cita */
.slowy-post-entry blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--post-green);
    background: rgba(0, 0, 0, 0.02); /* Fondo sutil adaptable */
    border-radius: 0 var(--post-radius) var(--post-radius) 0;
    font-size: 18px;
    font-style: italic;
}
.slowy-post-entry blockquote p { margin: 0; color: var(--post-navy); }

/* Elementos Multimedia */
.slowy-post-entry img { max-width: 100%; height: auto; border-radius: var(--post-radius); }
.slowy-post-entry figure { margin: 24px 0; }
.slowy-post-entry figcaption { font-size: 13px; color: var(--post-text-light); text-align: center; margin-top: 8px; }

/* Alineaciones Gutenberg */
.slowy-post-entry .alignwide { max-width: 100%; width: 100%; }
.slowy-post-entry .alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); border-radius: 0; }

/* Tablas */
.slowy-post-entry table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.slowy-post-entry th { background: var(--post-navy); color: #ffffff; padding: 12px; text-align: left; }
.slowy-post-entry td { padding: 12px; border-bottom: 1px solid var(--post-border); }
.slowy-post-entry tr:nth-child(even) td { background: rgba(0, 0, 0, 0.01); }

/* Bloques de código nativos */
.slowy-post-entry code {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 14px;
    color: #d35400;
}
.slowy-post-entry pre {
    background: var(--post-navy);
    padding: 20px;
    border-radius: var(--post-radius);
    overflow-x: auto;
    margin: 24px 0;
}
.slowy-post-entry pre code { background: transparent; color: #52ef9b; padding: 0; } /* Contraste mejorado a verde brillante */

/* ─────────────────────────────────────────
   TAGS (Limpio y Transparente)
───────────────────────────────────────── */
.slowy-post-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--post-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.slowy-post-tags__list { display: flex; flex-wrap: wrap; gap: 8px; }
.slowy-post-tag {
    display: inline-block;
    padding: 6px 14px;
    background: transparent;
    border: 1.5px solid var(--post-border);
    border-radius: 50px;
    font-size: 13px;
    color: var(--post-text-light);
    text-decoration: none;
    transition: all var(--post-transition);
}
.slowy-post-tag:hover { border-color: var(--post-green); color: var(--post-green); }

/* ─────────────────────────────────────────
   CAJA DE AUTOR
───────────────────────────────────────── */
.slowy-post-author {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 28px 0;
    border-top: 1px solid var(--post-border);
}
.slowy-post-author__avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--post-border);
}
.slowy-post-author__label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--post-green); margin-bottom: 2px; }
.slowy-post-author__name { font-size: 18px; color: var(--post-navy); }
.slowy-post-author__bio { font-size: 14px; color: var(--post-text-light); margin-top: 4px; line-height: 1.5; }

/* ─────────────────────────────────────────
   SIDEBAR (Estilos globales base)
───────────────────────────────────────── */
.slowy-post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
/* Estilo universal adaptado para cualquier Widget de WordPress */
.slowy-post-sidebar .widget {
    list-style: none;
    margin: 0;
    padding: 0;
}
.slowy-post-sidebar .widgettitle,
.slowy-post-sidebar .widget-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--post-navy);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--post-border);
}
.slowy-post-sidebar ul { list-style: none; padding: 0; margin: 0; }
.slowy-post-sidebar li { padding: 8px 0; border-bottom: 1px dashed var(--post-border); font-size: 15px; }
.slowy-post-sidebar li a { color: var(--post-text); text-decoration: none; transition: color var(--post-transition); }
.slowy-post-sidebar li a:hover { color: var(--post-green); }

/* ─────────────────────────────────────────
   POSTS RELACIONADOS (Grid Fluido)
───────────────────────────────────────── */
.slowy-related-posts {
    padding: 56px 0;
    border-top: 1px solid var(--post-border);
}
.slowy-related-posts__title { font-size: 22px; font-weight: 700; color: var(--post-navy); margin-bottom: 28px; text-align: center; }
.slowy-related-posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.slowy-post-card {
    background: rgba(255, 255, 255, 0.6); /* Transparencia sutil para tarjetas */
    backdrop-filter: blur(4px);
    border: 1px solid var(--post-border);
    border-radius: var(--post-radius);
    overflow: hidden;
    box-shadow: var(--post-shadow);
    transition: transform var(--post-transition), box-shadow var(--post-transition);
}
.slowy-post-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.1); }
.slowy-post-card__img-wrap { display: block; position: relative; aspect-ratio: 16/10; overflow: hidden; }
.slowy-post-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.slowy-post-card:hover .slowy-post-card__img { transform: scale(1.04); }
.slowy-post-card__body { padding: 16px 20px; }
.slowy-post-card__meta { display: flex; gap: 8px; font-size: 12px; color: var(--post-text-light); margin-bottom: 8px; }
.slowy-post-card__title { font-size: 16px; margin: 0 0 8px; line-height: 1.4; }
.slowy-post-card__title a { color: var(--post-navy); text-decoration: none; }
.slowy-post-card__title a:hover { color: var(--post-green); }
.slowy-post-card__excerpt { font-size: 13px; color: var(--post-text-light); line-height: 1.5; margin: 0 0 12px; }
.slowy-post-card__link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--post-green); text-decoration: none; }

/* ─────────────────────────────────────────
   NAVEGACIÓN DE ENTRADAS (PREV / NEXT)
───────────────────────────────────────── */
.slowy-post-nav {
    border-top: 1px solid var(--post-border);
    padding: 28px 0;
}
.slowy-post-nav__inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.slowy-post-nav__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    padding: 14px 18px;
    border: 1.5px solid var(--post-border);
    border-radius: var(--post-radius);
    transition: all var(--post-transition);
}
.slowy-post-nav__item:hover { border-color: var(--post-green); background: rgba(0, 0, 0, 0.01); }
.slowy-post-nav__item--next { text-align: right; }
.slowy-post-nav__dir { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--post-green); }
.slowy-post-nav__item--next .slowy-post-nav__dir { justify-content: flex-end; }
.slowy-post-nav__title { font-size: 14px; font-weight: 600; color: var(--post-navy); }

/* ─────────────────────────────────────────
   RESPONSIVE (Ajustes finales de quiebre)
───────────────────────────────────────── */
@media (max-width: 991px) {
    .slowy-post-layout-grid { gap: 40px; }
    .slowy-post-sidebar { border-top: 1px solid var(--post-border); padding-top: 40px; }
}
@media (max-width: 768px) {
    .slowy-post-hero--has-img { min-height: 380px; }
    .slowy-post-author { flex-direction: column; text-align: center; }
    .slowy-post-nav__item--next { text-align: left; }
    .slowy-post-nav__item--next .slowy-post-nav__dir { justify-content: flex-start; }
}
@media (max-width: 480px) {
    .slowy-post-container { padding: 0 16px; }
    .slowy-post-entry { font-size: 16px; }
    .slowy-post-entry h2 { font-size: 24px; }
}