/* ======================
   BLOG PUBLICO - INGFRAMEX
   ====================== */

/* --- Hero Section --- */
.blog-hero {
    background: linear-gradient(135deg, rgba(91, 28, 100, 0.5), rgba(74, 23, 83, 0.5)),
                url('../images/hero-3.webp');
    background-size: cover;
    background-position: center;
    min-height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 60px;
    width: 90%;
    margin: 5.75rem auto 0;
    border-radius: 12px;
}

.blog-hero .container {
    max-width: 800px;
}

.blog-hero h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.blog-hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.7;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* --- Breadcrumb --- */
.blog-breadcrumb {
    padding: 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-breadcrumb .back-link {
    color: #5b1c64;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.blog-breadcrumb .back-link:hover {
    color: #4a1753;
}

.blog-breadcrumb .breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: #999;
}

.blog-breadcrumb .breadcrumb a {
    color: #5b1c64;
    text-decoration: none;
}

/* --- Category Filters --- */
.blog-filters {
    padding: 25px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.blog-filters .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    background: white;
    transition: all 0.25s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: #f5f0f6;
    color: #5b1c64;
    border-color: #5b1c64;
}

.filter-btn.active {
    background: #5b1c64;
    color: white;
    border-color: #5b1c64;
}

/* --- Results Counter --- */
.blog-results-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-results-bar .results-count {
    font-size: 0.9rem;
    color: #999;
}

.blog-results-bar .results-count strong {
    color: #5b1c64;
}

/* --- Blog Grid --- */
.blog-grid {
    padding: 50px 20px;
    background: #fff;
}

.blog-grid .container {
    max-width: 1200px;
    margin: 0 auto;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* --- Reading Time --- */
.blog-card-meta .reading-time {
    margin-left: auto;
    color: #b39dba;
    font-size: 0.78rem;
}

/* --- Blog Card --- */
.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(91, 28, 100, 0.1);
    border-top: 3px solid #5b1c64;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.5s ease forwards;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.15s; }
.blog-card:nth-child(5) { animation-delay: 0.25s; }
.blog-card:nth-child(6) { animation-delay: 0.35s; }
.blog-card:nth-child(7) { animation-delay: 0.2s; }
.blog-card:nth-child(8) { animation-delay: 0.3s; }
.blog-card:nth-child(9) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-top-color: #4a1753;
}

.blog-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #5b1c64;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-body {
    padding: 25px;
}

.blog-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #999;
}

.blog-card-meta i {
    color: #5b1c64;
    margin-right: 4px;
}

.blog-card-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-card-body h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-body h3 a:hover {
    color: #5b1c64;
}

.blog-card-body p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: #5b1c64;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: #4a1753;
}

.read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(5px);
}

/* --- Pagination --- */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
    padding: 20px 0;
}

.page-link {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.page-link:hover,
.page-link.active {
    background: #5b1c64;
    color: white;
    border-color: #5b1c64;
}

/* --- Empty Blog State --- */
.blog-empty {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.blog-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.blog-empty h3 {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 10px;
}

/* ===========================
   SINGLE POST PAGE
   =========================== */

/* --- Reading Progress Bar --- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #5b1c64, #6B3AA0);
    z-index: 1060;
    transition: width 0.1s linear;
}

.blog-post-single {
    padding: 40px 20px;
}

.blog-post-single .container {
    width: 80%;
    margin: 0 auto;
}

.post-featured-image {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-header {
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.15s forwards;
}

.post-header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #999;
    flex-wrap: wrap;
    align-items: center;
}

.post-meta i {
    color: #5b1c64;
    margin-right: 5px;
}

.post-meta .meta-separator {
    color: #ddd;
}

/* --- Category Badges --- */
.post-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.post-categories a {
    display: inline-block;
    padding: 4px 14px;
    background: #f5f0f6;
    color: #5b1c64;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.post-categories a:hover {
    background: #5b1c64;
    color: white;
}

/* --- Post Navigation (prev/next) --- */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.post-nav-link:hover {
    background: #f5f0f6;
    border-color: #5b1c64;
    transform: translateY(-2px);
}

.post-nav-link .nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 600;
}

.post-nav-link .nav-title {
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.post-nav-link:hover .nav-title {
    color: #5b1c64;
}

.post-nav-link.next {
    text-align: right;
}

/* --- Copy Link Button --- */
.btn-copy-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-copy-link:hover {
    background: #5b1c64;
    color: white;
    transform: translateY(-2px);
}

.btn-copy-link.copied {
    background: #16a34a;
    color: white;
}

/* --- Post Content (HTML from editor) --- */
.post-content {
    line-height: 1.8;
    color: #444;
    font-size: 1.05rem;
}

.post-content h2 {
    color: #5b1c64;
    margin: 30px 0 15px;
    font-size: 1.5rem;
}

.post-content h3 {
    color: #333;
    margin: 25px 0 12px;
    font-size: 1.25rem;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.post-content blockquote {
    border-left: 4px solid #5b1c64;
    padding: 15px 20px;
    margin: 20px 0;
    background: #f5f0f6;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.post-content ul,
.post-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

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

.post-content a {
    color: #5b1c64;
    text-decoration: underline;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-content th,
.post-content td {
    border: 1px solid #ddd;
    padding: 10px 14px;
    text-align: left;
}

.post-content th {
    background: #5b1c64;
    color: #fff;
}

/* --- Share Buttons --- */
.post-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.post-share span {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.post-share a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #5b1c64;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.post-share a:hover {
    background: #4a1753;
    transform: translateY(-2px);
}

/* --- Related Posts --- */
.related-posts {
    padding: 60px 20px;
    background: #f8f9fa;
}

.related-posts .container {
    max-width: 1200px;
    margin: 0 auto;
}

.related-posts h2 {
    text-align: center;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 40px;
    font-weight: 300;
}

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

@media (max-width: 991px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-image {
        height: 200px;
    }

    .blog-hero {
        min-height: 35vh;
        padding: 80px 20px 50px;
    }

    .blog-hero h1 {
        font-size: 1.6rem;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .blog-filters {
        padding: 20px 15px;
    }

    .blog-breadcrumb {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-nav-link.next {
        text-align: left;
    }

    .blog-post-single .container {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        padding: 35px 15px;
    }

    .blog-card-body {
        padding: 20px;
    }

    .post-header h1 {
        font-size: 1.4rem;
    }

    .post-share {
        flex-wrap: wrap;
    }

    .blog-pagination {
        flex-wrap: wrap;
    }
}
