/* ========================================
   ESTILOS PARA POSTS INDIVIDUALES
   ======================================== */

/* FORZAR RESPONSIVE VIEWPORT */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    min-width: 320px;
    overflow-x: hidden;
}

/* Breadcrumb */
.breadcrumb-container {
    background: var(--light-gray);
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 28px;
    justify-content: center;
    flex-wrap: wrap;
} 

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* Post Individual */
.post-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header del Post */
.post-header {
    text-align: center;
    margin-bottom: 40px;
}

.post-meta-single {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.post-meta-single .post-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.2;
    margin-bottom: 20px;
}

.post-excerpt {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
    font-style: italic;
}

/* Imagen Principal */
.post-image-hero {
    margin: 40px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    /* altura por defecto del hero (ajustable por breakpoint abajo) */
    height: 360px;
}

.post-image-hero img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Post image container (cards / related posts) */
.post-image-container {
    position: relative;
    overflow: hidden;
    /* altura fija para mantener proporción; responsive en media queries */
    height: 220px;
}
 
.post-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Regla más específica para los cards relacionados: asegurar cover y centrar */
.post-card .post-image-container img,
.related-posts .post-card .post-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
}

/* Asegurar que los thumbnails en "Artículos relacionados" coincidan con el blog general */
.related-posts .post-card {
    overflow: hidden;
    border-radius: 15px;
}

.related-posts .post-card .post-image-container {
    height: 220px; /* misma altura que el blog general */
    overflow: hidden;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    position: relative;
}

.related-posts .post-card .post-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
}

/* Contenido del Post */
.post-content-single {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-content-single p {
    margin-bottom: 25px;
}

.post-content-single h2,
.post-content-single h3,
.post-content-single h4 {
    color: var(--dark-color);
    font-weight: 700;
    margin: 30px 0 20px 0;
}

.post-content-single h2 {
    font-size: 1.8rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
}

.post-content-single h3 {
    font-size: 1.5rem;
}

.post-content-single h4 {
    font-size: 1.3rem;
}

.post-content-single ul,
.post-content-single ol {
    margin-bottom: 25px;
    padding-left: 30px;
}

.post-content-single li {
    margin-bottom: 8px;
}

.post-content-single blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 20px 30px;
    margin: 30px 0;
    background: var(--light-gray);
    border-radius: 0 10px 10px 0;
    font-style: italic;
    font-size: 1.1rem;
}

/* Llamada a la acción en el post */
.post-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin: 50px 0;
}

.post-cta h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.post-cta p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.post-cta .btn-post {
    background: white;
    color: var(--primary-color);
    font-weight: 700;
}

.post-cta .btn-post:hover {
    background: var(--light-gray);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Compartir */
.post-share {
    border-top: 1px solid #e0e0e0;
    padding-top: 40px;
    margin-top: 50px;
    text-align: center;
}

.post-share h4 {
    color: var(--dark-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    padding-top: 3px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.email {
    background: var(--dark-color);
}

/* Posts Relacionados */
.related-posts {
    margin: 80px 0 40px 0;
}

.related-posts .section-title {
    margin-bottom: 40px;
}

.related-posts .post-card h4 {
    font-size: 1.1rem; 
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* Navegación entre posts */
.post-navigation {
    border-bottom: 1px solid #e0e0e0;
    padding-top: 40px;
}

.nav-post {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    gap: 10px;
}

.nav-post:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-post i {
    font-size: 1.2rem;
}

/* Responsive para posts individuales */
@media (max-width: 768px) {
    .post-single {
        padding: 20px 15px;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-excerpt {
        font-size: 1.1rem;
    }
    
    .post-meta-single {
        gap: 15px;
        justify-content: center;
    }
    
    .post-content-single {
        font-size: 1rem;
    }
    
    .post-content-single h2 {
        font-size: 1.5rem;
        padding-left: 15px;
    }
    
    .post-cta {
        padding: 30px 20px;
    }
    
    .post-cta h3 {
        font-size: 1.5rem;
    }
    
    .share-buttons {
        gap: 10px;
    }
    
    .share-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .nav-post {
        font-size: 0.9rem;
    }
}

/* Ajustes de altura del hero en breakpoints */
@media screen and (max-width: 992px) {
    .post-image-hero {
        height: 300px;
    }
}

@media screen and (max-width: 768px) {
    .post-image-hero {
        height: 220px;
    }
    .post-image-container {
        height: 180px;
    }
}

@media screen and (max-width: 576px) {
    .post-image-hero {
        height: 180px;
    }
    .post-image-container {
        height: 140px;
    }
}

@media (max-width: 576px) {
    .post-title {
        font-size: 1.8rem;
    }
    
    .post-meta-single {
        flex-direction: column;
        gap: 10px;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .post-navigation .row > div {
        text-align: center !important;
        margin-bottom: 20px;
    }
    
    .post-navigation .row > div:last-child {
        margin-bottom: 0;
    }
}

/* ================================
   RESPONSIVE ENHANCEMENTS
   ================================ */

/* Forzar responsive behavior */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Centrar breadcrumb container */
.breadcrumb-container .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mejorar grid de posts relacionados - FORZAR RESPONSIVE */
.related-posts .row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    margin: 0 !important;
}

.related-posts .row > div {
    flex: 1 1 calc(33.333% - 15px) !important;
    max-width: calc(33.333% - 15px) !important;
    margin-bottom: 20px !important;
}

/* Asegurar que las imágenes escalen correctamente */
.post-content-single img,
.post-image-hero img,
.related-posts img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Evitar overflow de texto largo */
.post-content-single,
.post-content-single p,
.post-content-single li {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* TABLET RESPONSIVE */
@media screen and (max-width: 992px) {
    .related-posts .row > div {
        flex: 1 1 calc(50% - 15px) !important;
        max-width: calc(50% - 15px) !important;
    }
    
    .post-single {
        padding: 30px 20px !important;
    }
    
    .post-title {
        font-size: 2.2rem !important;
    }
}

/* MOBILE RESPONSIVE - MÁS AGRESIVO */
@media screen and (max-width: 768px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        max-width: 100% !important;
    }
    
    .related-posts .row > div {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        margin-bottom: 25px !important;
    }
    
    .related-posts .row {
        gap: 0 !important;
        flex-direction: column !important;
    }
    
    .post-single {
        max-width: 100% !important;
        padding: 20px 15px !important;
        margin: 0 !important;
    }
    
    .post-title {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
    }
    
    .post-excerpt {
        font-size: 1rem !important;
    }
    
    .post-content-single {
        font-size: 0.95rem !important;
    }
    
    .post-content-single h2 {
        font-size: 1.4rem !important;
    }
    
    .post-content-single h3 {
        font-size: 1.2rem !important;
    }
}

/* MOBILE PEQUEÑO - ULTRA RESPONSIVE */
@media screen and (max-width: 576px) {
    body {
        font-size: 14px !important;
    }
    
    .breadcrumb-container .container {
        justify-content: flex-start !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .breadcrumb {
        gap: 10px !important;
        font-size: 0.75rem !important;
    }
    
    .post-single {
        padding: 15px 10px !important;
    }
    
    .post-title {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    .post-excerpt {
        font-size: 0.9rem !important;
    }
    
    .post-content-single {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }
    
    .post-cta {
        padding: 20px 15px !important;
        margin: 25px 0 !important;
    }
    
    .post-cta h3 {
        font-size: 1.3rem !important;
    }
    
    .share-buttons {
        gap: 8px !important;
    }
    
    .share-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
    }
    
    .related-posts .post-card {
        margin-bottom: 20px !important;
    }
    
    .related-posts .post-card h4 {
        font-size: 1rem !important;
    }
    
    .btn-post {
        font-size: 0.8rem !important;
        padding: 10px 20px !important;
        width: auto !important;
        min-width: 120px !important;
    }
}

/* Pantallas grandes: aumentar max-width */
@media (min-width: 1200px) {
    .post-single {
        max-width: 900px;
    }
    
    .post-title {
        font-size: 3rem;
    }
}
