/**
 * Blog Home Hub Styles
 * Template: blog-home-page.php
 * Inspired by Ahrefs blog layout
 *
 * @package TravelerChildTheme
 * @since 2.1.0
 * @created 2025-11-20
 */

@import url('tokens.css');

/* =============================================================================
   Typography & Base Styles (Scoped to #primary.site-main)
   ========================================================================== */

#primary.site-main.blog-hub-template {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-body);
    background: #ffffff;
}

/* Scoped Headings */
#primary.site-main.blog-hub-template h1,
#primary.site-main.blog-hub-template h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    letter-spacing: -0.01em;
    margin: 0;
}

#primary.site-main.blog-hub-template h1 {
    font-size: clamp(32px, 5vw, 48px);
    line-height: var(--lh-tight);
}

#primary.site-main.blog-hub-template h2 {
    font-size: clamp(24px, 3.5vw, 32px);
    line-height: var(--lh-snug);
}

/* Container */
#primary.site-main.blog-hub-template .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* =============================================================================
   Page Hero - Blog Identity
   ========================================================================== */

#primary.site-main .blog-hero {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, rgba(50, 79, 190, 0.02) 0%, rgba(255, 107, 53, 0.03) 100%);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

#primary.site-main .blog-hero .hero-content {
    max-width: 760px;
    margin: 0 auto;
}

#primary.site-main .blog-hero .blog-label {
    font-size: 13px;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    margin-bottom: 16px;
}

#primary.site-main .blog-hero h1 {
    margin-bottom: 16px;
}

#primary.site-main .blog-hero .hero-description {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-muted);
    max-width: 640px;
    margin: 0 auto;
}

/* =============================================================================
   Featured Hero Section - 1 Large + 3 Small Cards
   ========================================================================== */

#primary.site-main .featured-hero {
    padding: 60px 0;
    background: #ffffff;
}

/* Primary Featured Card (Large Left) */
#primary.site-main .featured-card-large {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#primary.site-main .featured-card-large:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

#primary.site-main .featured-card-large .card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#primary.site-main .featured-card-large .featured-image {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: var(--color-background-light);
}

#primary.site-main .featured-card-large .featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

#primary.site-main .featured-card-large:hover .featured-image img {
    transform: scale(1.05);
}

#primary.site-main .featured-card-large .card-content {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#primary.site-main .featured-card-large .card-title {
    font-size: 28px;
    font-weight: var(--weight-bold);
    line-height: 1.3;
    margin: 12px 0 16px;
    color: var(--color-heading);
}

#primary.site-main .featured-card-large .card-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-muted);
    margin-bottom: 20px;
    flex: 1;
}

#primary.site-main .featured-card-large .card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-muted);
}

#primary.site-main .featured-card-large .card-meta .separator {
    color: var(--color-border-muted);
}

/* Supporting Featured Cards (Right Column) */
#primary.site-main .featured-cards-small {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

#primary.site-main .featured-card-small {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s ease;
}

#primary.site-main .featured-card-small:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

#primary.site-main .featured-card-small .card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

#primary.site-main .featured-card-small .card-title {
    font-size: 18px;
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    margin: 10px 0 12px;
    color: var(--color-heading);
}

#primary.site-main .featured-card-small .card-date {
    font-size: 13px;
    color: var(--color-muted);
}

/* Category Pills (Used Throughout) - Compact Rounded Badge */
#primary.site-main .category-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: var(--weight-medium);
    padding: 3px 10px;
    background: rgba(50, 79, 190, 0.06);
    color: var(--color-primary);
    border: none;
    border-radius: 12px;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    white-space: nowrap;
    width: auto;
    max-width: fit-content;
}

/* =============================================================================
   Latest Posts Grid
   ========================================================================== */

#primary.site-main .latest-posts {
    padding: 80px 0;
    background: var(--color-background-light);
}

#primary.site-main .latest-posts .section-header {
    text-align: center;
    margin-bottom: 48px;
}

#primary.site-main .latest-posts .section-header h2 {
    margin-bottom: 12px;
}

#primary.site-main .latest-posts .section-header p {
    font-size: 16px;
    color: var(--color-muted);
    max-width: 640px;
    margin: 0 auto;
}

/* Post Card */
#primary.site-main .post-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#primary.site-main .post-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

#primary.site-main .post-card .card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#primary.site-main .post-card .card-thumbnail {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--color-background-light);
}

#primary.site-main .post-card .card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

#primary.site-main .post-card:hover .card-thumbnail img {
    transform: scale(1.05);
}

#primary.site-main .post-card .card-content {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Post Card Title - Clean single rule */
#primary.site-main.blog-hub-template .post-card .card-title {
    font-size: var(--fs-h4);
    font-weight: var(--weight-medium);
    font-family: var(--font-display);
    line-height: 1.3;
    margin: 6px 0 8px;
    color: var(--color-heading);
}

#primary.site-main .post-card .card-excerpt {
    font-size: var(--fs-sm) !important;
    line-height: 1.5 !important;
    color: var(--color-muted) !important;
    margin-bottom: 8px !important;

    /* Line clamp for uniform card heights */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#primary.site-main .post-card .card-date {
    font-size: var(--fs-xs) !important;
    color: var(--color-muted) !important;
}

/* =============================================================================
   Pagination
   ========================================================================== */

#primary.site-main .pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

#primary.site-main .pagination-wrapper ul.page-numbers {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

#primary.site-main .pagination-wrapper .page-numbers li {
    list-style: none;
}

#primary.site-main .pagination-wrapper .page-numbers a,
#primary.site-main .pagination-wrapper .page-numbers .current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: var(--weight-medium);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--color-body);
    text-decoration: none;
    transition: all 0.2s ease;
}

#primary.site-main .pagination-wrapper .page-numbers a:hover {
    border-color: var(--color-primary);
    background: rgba(50, 79, 190, 0.05);
    color: var(--color-primary);
}

#primary.site-main .pagination-wrapper .page-numbers .current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

#primary.site-main .pagination-wrapper .page-numbers .dots {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--color-muted);
}

/* =============================================================================
   Category Hub Sections
   ========================================================================== */

#primary.site-main .category-hub {
    padding: 80px 0;
    background: #ffffff;
}

#primary.site-main .category-hub:nth-child(odd) {
    background: var(--color-background-light);
}

#primary.site-main .category-hub .hub-header {
    margin-bottom: 48px;
}

#primary.site-main .category-hub .hub-intro {
    text-align: center;
    margin-bottom: 32px;
}

#primary.site-main .category-hub .hub-intro h2 {
    margin-bottom: 12px;
}

#primary.site-main .category-hub .hub-intro p {
    font-size: 16px;
    color: var(--color-muted);
    max-width: 640px;
    margin: 0 auto;
}

/* Category Pills Navigation */
#primary.site-main .category-hub .category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 32px;
}

#primary.site-main .category-hub .category-pill-link {
    display: inline-block;
    font-size: 13px;
    font-weight: var(--weight-medium);
    padding: 10px 20px;
    background: #ffffff;
    color: var(--color-body);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.2s ease;
}

#primary.site-main .category-hub .category-pill-link:hover {
    border-color: var(--color-primary);
    background: rgba(50, 79, 190, 0.05);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Hub Card */
#primary.site-main .hub-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    transition: all 0.2s ease;
    height: 100%;
}

#primary.site-main .hub-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

#primary.site-main .hub-card .card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Hub Card Title - Clean single rule */
#primary.site-main.blog-hub-template .hub-card .card-title {
    font-size: var(--fs-h4);
    font-weight: var(--weight-medium);
    font-family: var(--font-display);
    line-height: 1.3;
    margin: 6px 0 8px;
    color: var(--color-heading);
}

#primary.site-main .hub-card .card-date {
    font-size: var(--fs-xs) !important;
    color: var(--color-muted) !important;
}

/* =============================================================================
   Newsletter Section
   ========================================================================== */

#primary.site-main .newsletter-section {
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(50, 79, 190, 0.05) 0%, rgba(255, 107, 53, 0.06) 100%);
}

#primary.site-main .newsletter-block {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

#primary.site-main .newsletter-block h2 {
    margin-bottom: 12px;
}

#primary.site-main .newsletter-block p {
    font-size: 16px;
    color: var(--color-muted);
    margin-bottom: 32px;
}

#primary.site-main .newsletter-block .form-group {
    display: flex;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

#primary.site-main .newsletter-block .form-control {
    flex: 1;
    padding: 14px 18px;
    font-size: 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

#primary.site-main .newsletter-block .form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(50, 79, 190, 0.1);
}

#primary.site-main .newsletter-block .btn-primary {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: var(--weight-semibold);
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#primary.site-main .newsletter-block .btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* =============================================================================
   Responsive Design
   ========================================================================== */

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    #primary.site-main .blog-hero {
        padding: 40px 0 30px;
    }

    #primary.site-main .featured-hero,
    #primary.site-main .latest-posts,
    #primary.site-main .category-hub,
    #primary.site-main .newsletter-section {
        padding: 50px 0;
    }

    #primary.site-main .featured-card-large .featured-image {
        height: 300px;
    }

    #primary.site-main .featured-cards-small {
        flex-direction: row;
        gap: 16px;
    }

    #primary.site-main .featured-card-small {
        flex: 1;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    #primary.site-main.blog-hub-template .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    #primary.site-main .blog-hero {
        padding: 32px 0 24px;
    }

    #primary.site-main .blog-hero h1 {
        font-size: 32px;
    }

    #primary.site-main .blog-hero .hero-description {
        font-size: 16px;
    }

    #primary.site-main .featured-hero,
    #primary.site-main .latest-posts,
    #primary.site-main .category-hub,
    #primary.site-main .newsletter-section {
        padding: 40px 0;
    }

    #primary.site-main .featured-card-large .featured-image {
        height: 240px;
    }

    #primary.site-main .featured-card-large .card-content {
        padding: 20px;
    }

    #primary.site-main .featured-card-large .card-title {
        font-size: 22px;
    }

    #primary.site-main .featured-cards-small {
        flex-direction: column;
        gap: 16px;
    }

    #primary.site-main .post-card .card-thumbnail {
        height: 180px;
    }

    #primary.site-main .post-card .card-content {
        padding: 20px;
    }

    #primary.site-main .newsletter-block {
        padding: 32px 24px;
    }

    #primary.site-main .newsletter-block .form-group {
        flex-direction: column;
    }

    #primary.site-main .newsletter-block .btn-primary {
        width: 100%;
    }

    #primary.site-main .category-hub .category-pills {
        gap: 8px;
    }

    #primary.site-main .category-hub .category-pill-link {
        font-size: 12px;
        padding: 8px 16px;
    }

}
