﻿/* Hero del Post */
.post-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0 60px;
    margin-top: -20px;
    color: white;
    position: relative;
    overflow: hidden;
}

    .post-hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    }

/* Progress Bar de Lectura */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 1050;
    transition: width 0.2s ease;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 20px 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-weight: bold;
}

/* Imagen Destacada */
.featured-image-container {
    margin: -80px auto 40px;
    max-width: 900px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    background: white;
    position: relative;
    z-index: 10;
}

.featured-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Contenido del Post */
.post-content {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
}

    .post-content h2 {
        margin-top: 2.5rem;
        margin-bottom: 1rem;
        color: #2c3e50;
        font-weight: 600;
        position: relative;
        padding-left: 20px;
    }

        .post-content h2::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 100%;
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-radius: 2px;
        }

    .post-content h3 {
        margin-top: 2rem;
        margin-bottom: 0.75rem;
        color: #34495e;
        font-weight: 600;
    }

    .post-content p {
        margin-bottom: 1.5rem;
    }

    .post-content ul, .post-content ol {
        margin-bottom: 1.5rem;
        padding-left: 30px;
    }

    .post-content li {
        margin-bottom: 0.5rem;
    }

    .post-content img {
        max-width: 100%;
        height: auto;
        border-radius: 10px;
        margin: 2rem 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .post-content blockquote {
        border-left: 4px solid #667eea;
        padding-left: 20px;
        margin: 2rem 0;
        font-style: italic;
        color: #555;
        background: #f8f9fa;
        padding: 20px;
        border-radius: 0 10px 10px 0;
    }

    .post-content code {
        background: #f4f4f4;
        padding: 2px 6px;
        border-radius: 4px;
        font-family: 'Courier New', monospace;
        font-size: 0.9em;
    }

    .post-content pre {
        background: #2c3e50;
        color: #fff;
        padding: 20px;
        border-radius: 10px;
        overflow-x: auto;
        margin: 2rem 0;
    }

/* Meta información */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 30px;
    font-size: 0.95rem;
    color: #6c757d;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabla de Contenidos */
.table-of-contents {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    position: sticky;
    top: 100px;
}

    .table-of-contents h5 {
        color: #2c3e50;
        margin-bottom: 15px;
        font-weight: 600;
    }

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .toc-list li {
        padding: 8px 0;
        border-bottom: 1px solid #e9ecef;
    }

        .toc-list li:last-child {
            border-bottom: none;
        }

    .toc-list a {
        color: #6c757d;
        text-decoration: none;
        transition: all 0.3s ease;
        display: block;
        padding-left: 10px;
        border-left: 3px solid transparent;
    }

        .toc-list a:hover,
        .toc-list a.active {
            color: #667eea;
            border-left-color: #667eea;
            padding-left: 15px;
        }

/* Botones de Compartir */
.share-buttons {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

    .share-btn:hover {
        transform: scale(1.1);
        color: white;
    }

    .share-btn.facebook {
        background: #3b5998;
    }

    .share-btn.twitter {
        background: #1da1f2;
    }

    .share-btn.whatsapp {
        background: #25d366;
    }

    .share-btn.linkedin {
        background: #0077b5;
    }

    .share-btn.copy-link {
        background: #6c757d;
    }

/* Tags */
.post-tags {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid #e9ecef;
    border-bottom: 2px solid #e9ecef;
}

.tag-badge {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    background: #f8f9fa;
    border-radius: 25px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

    .tag-badge:hover {
        background: #667eea;
        color: white;
        transform: translateY(-2px);
    }

/* Posts Relacionados */
.related-posts {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e9ecef;
}

.related-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    height: 100%;
}

    .related-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    }

    .related-card img {
        height: 200px;
        object-fit: cover;
    }

/* Mobile Styles */
@media (max-width: 768px) {
    .post-hero {
        padding: 80px 0 40px;
    }

        .post-hero h1 {
            font-size: 1.75rem;
        }

    .featured-image-container {
        margin: -40px 15px 30px;
        border-radius: 15px;
    }

    .post-content {
        font-size: 1rem;
        padding: 0 15px;
    }

    .share-buttons {
        position: fixed;
        left: auto;
        right: 0;
        top: auto;
        bottom: 80px;
        flex-direction: row;
        background: white;
        padding: 10px;
        border-radius: 30px 0 0 30px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }

    .share-btn {
        width: 40px;
        height: 40px;
    }

    .table-of-contents {
        position: relative;
        top: 0;
        margin-bottom: 30px;
    }

        /* Collapse TOC en móvil */
        .table-of-contents .toc-list {
            max-height: 200px;
            overflow-y: auto;
        }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease;
}

/* Zoom de imágenes */
.image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-zoom-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

    .image-zoom-container img {
        max-width: 100%;
        max-height: 90vh;
        display: block;
        margin: 0 auto;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

.zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
    transition: transform 0.3s;
}

    .zoom-close:hover {
        transform: rotate(90deg);
    }

.zoom-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.8;
}

/* Copy code button */
.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

    .copy-code-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.share-btn.pulse {
    animation: pulse 0.6s ease;
}

/* Mobile floating share */
.floating-share-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #667eea;
    border-radius: 50%;
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .floating-share-toggle {
        display: flex;
    }

        .floating-share-toggle.active {
            background: #764ba2;
            transform: rotate(45deg);
        }

    .share-buttons.active {
        display: flex !important;
    }
}

/* AJUSTE IMPORTANTE: Márgenes para LayoutLanding */
.post-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 120px 0 60px; /* Aumentado para compensar banner + menú */
    margin-top: 0;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Para compensar el menú fijo con banner */
@media (min-width: 769px) {
    .post-hero {
        margin-top: 56px; /* Altura del banner */
    }
}

.post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Progress Bar de Lectura - Ajustada para el banner */
.reading-progress {
    position: fixed;
    top: 0; /* Encima de todo */
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 9999; /* Mayor z-index para estar sobre el banner */
    transition: width 0.2s ease;
}

/* Imagen Destacada - Sin margen negativo excesivo */
.featured-image-container {
    margin: 40px auto; /* Margen positivo normal */
    max-width: 900px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    background: white;
    position: relative;
}

/* Resto de estilos se mantienen... */
.featured-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Tabla de Contenidos - Ajuste sticky */
.table-of-contents {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    position: sticky;
    top: 120px; /* Ajustado para el banner + menú */
}

/* Botones de Compartir - Ajuste posición */
.share-buttons {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .post-hero {
        padding: 100px 0 40px; /* Ajustado para móvil */
        margin-top: 80px;
    }

    .featured-image-container {
        margin: 30px 15px; /* Márgenes laterales en móvil */
        border-radius: 15px;
    }

    .table-of-contents {
        position: relative;
        top: 0;
    }

    .share-buttons {
        position: fixed;
        left: auto;
        right: 0;
        top: auto;
        bottom: 80px;
        flex-direction: row;
        background: white;
        padding: 10px;
        border-radius: 30px 0 0 30px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
}

/* Zoom de imágenes */
.image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-zoom-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

    .image-zoom-container img {
        max-width: 100%;
        max-height: 90vh;
        display: block;
        margin: 0 auto;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

.zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
    transition: transform 0.3s;
}

    .zoom-close:hover {
        transform: rotate(90deg);
    }

.zoom-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.8;
}

/* Copy code button */
.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

    .copy-code-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

/* Animación para botón copiado */
.share-btn.copied {
    background: #27AE60 !important;
    transform: scale(1.1);
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.share-btn.pulse {
    animation: pulse 0.6s ease;
}

/* Asegurar que los botones sean clickeables */
.share-btn {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 1000;
}

    .share-btn:active {
        transform: scale(0.95);
    }

/* Mobile floating share */
.floating-share-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #667eea;
    border-radius: 50%;
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .floating-share-toggle {
        display: flex;
    }

        .floating-share-toggle.active {
            background: #764ba2;
            transform: rotate(45deg);
        }

    .share-buttons.active {
        display: flex !important;
    }

    /* Ocultar scrollbar en posts relacionados */
    .related-posts .row::-webkit-scrollbar {
        display: none;
    }
}