/* ==========================================================================
   KEYSHU BLOG PAGE UNIQUE STYLES
   Colors matched to brand: Primary: #03B0B1
   ========================================================================== */

/* Main Container Layout */
.blog-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Breadcrumb Navigation */
.blog-breadcrumb {
    padding: 24px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.blog-breadcrumb a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.blog-breadcrumb i {
    font-size: 10px;
    color: var(--icon-color);
}

.blog-breadcrumb .active-crumb {
    color: var(--primary-color);
    font-weight: 700;
}

/* ==========================================================================
   TOP HERO LAYOUT (Split 2-Columns)
   ========================================================================== */
.blog-hero-grid {
    display: grid;
    grid-template-columns: 55fr 45fr; /* Left column: ~55% width, Right column: ~45% width */
    grid-template-rows: auto auto;
    grid-template-areas:
        "main-image sidebar"
        "main-content sidebar";
    gap: 32px;
    margin-bottom: 48px;
}

/* Left side: Major Featured Post Image Wrapper */
.hero-main-img-wrap {
    grid-area: main-image;
    width: 100%;
    aspect-ratio: 16/9; /* Fallback aspect ratio */
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* Desktop Only: Configure strictly 16:9 images with spaced horizontal layout */
@media (min-width: 1025px) {
    .blog-hero-grid {
        grid-template-rows: auto auto !important; /* Let heights calculate naturally */
        align-items: stretch !important;
    }
    .hero-main-img-wrap {
        height: auto !important;
        aspect-ratio: 16/9 !important; /* Strictly 16:9 aspect-ratio */
    }
    .hero-posts-sidebar {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
    }
    .hero-side-img-wrap {
        width: 210px !important; /* Increased width on desktop */
        aspect-ratio: 16/9 !important; /* Strictly 16:9 aspect-ratio (height scales up proportionally to 118px) */
    }
}

.hero-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-main-img-wrap:hover .hero-main-img {
    transform: scale(1.03);
}

/* Left side: Major Featured Post Content Wrapper */
.hero-main-content {
    grid-area: main-content;
    padding: 12px 0 0 0;
}

.hero-main-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 12px;
}

.hero-main-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-main-title a:hover {
    color: var(--primary-color);
}

.hero-main-desc {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right side: Stack of 3 Articles */
.hero-posts-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: space-between;
    height: 100%;
}

.hero-side-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e2e8f0;
}

.hero-side-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hero-side-img-wrap {
    width: 130px; /* Increased default width */
    aspect-ratio: 16/9; /* Enforced strictly to 16:9 (height scales up proportionally) */
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.hero-side-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hero-side-card:hover .hero-side-img-wrap img {
    transform: scale(1.05);
}

.hero-side-content {
    flex-grow: 1;
}

.hero-side-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
}

.hero-side-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-side-title a:hover {
    color: var(--primary-color);
}

.hero-side-desc {
    font-size: 12px;
    color: var(--text-color);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   HEADING & SEARCH BLOCK
   ========================================================================= */
.blog-search-navigation {
    margin-bottom: 36px;
}

.blog-section-heading {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin-top: 16px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.blog-search-box-wrap {
    width: 100%;
    max-width: 100%;
    margin-bottom: 24px;
}

.search-label {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    display: block;
}

.search-input-field-wrap {
    position: relative;
    width: 100%;
}

.blog-search-input {
    width: 100%;
    height: 46px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 46px 0 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.blog-search-input:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(3, 176, 177, 0.1);
    outline: none;
}

.search-field-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

/* Filter Tags (Horizontal Scrollable Carousel) */
.blog-filter-tags-wrap {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.blog-filter-tags-wrap::-webkit-scrollbar {
    height: 5px;
}

.blog-filter-tags-wrap::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.blog-filter-tags-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.blog-filter-tags {
    display: flex;
    gap: 12px;
    white-space: nowrap;
}

.filter-tag-btn {
    background: #e6f7f7;
    color: var(--primary-color);
    border: none;
    padding: 10px 22px;
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-tag-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.filter-tag-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(3, 176, 177, 0.25);
}

/* ==========================================================================
   4-COLUMN GRID ARTICLES SECTION
   ========================================================================== */
.blog-grid-articles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    margin-bottom: 48px;
}

.article-grid-card {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.article-card-img-wrap {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.article-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-grid-card:hover .article-card-img {
    transform: scale(1.05);
}

.article-card-body {
    padding: 4px 0;
}

.article-card-title {
    font-size: 14px;
    font-weight: 750;
    line-height: 1.45;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.article-card-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px; /* Lock height for grid alignment */
}

.article-card-title a:hover {
    color: var(--primary-color);
}

.article-card-desc {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   PAGINATION SECTION
   ========================================================================= */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0 64px 0;
}

.page-num, .page-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.page-num {
    background: #f1f5f9;
    color: #475569;
}

.page-num:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.page-num.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(3, 176, 177, 0.25);
}

.page-arrow {
    border: 1px solid var(--primary-color);
    background: #ffffff;
    color: var(--primary-color);
}

.page-arrow:hover {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(3, 176, 177, 0.25);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Tablet Viewports */
@media (max-width: 1024px) {
    .blog-container {
        padding: 0 24px;
    }
    
    .blog-hero-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px;
    }
    
    .hero-main-img-wrap {
        order: 1 !important;
        aspect-ratio: 16/9 !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .hero-main-content {
        order: 2 !important;
        padding: 0 !important;
    }
    
    .hero-posts-sidebar {
        order: 3 !important;
        gap: 24px;
        height: auto !important;
    }
    
    .blog-grid-articles {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Mobile Viewports */
@media (max-width: 768px) {
    .blog-container {
        padding: 0 16px;
    }
    
    .blog-breadcrumb {
        padding: 16px 0;
        font-size: 11px;
    }
    
    .hero-main-title {
        font-size: 18px;
    }
    
    .hero-main-desc {
        font-size: 13px;
    }
    
    .hero-side-card {
        gap: 12px;
        padding-bottom: 16px;
    }
    
    .hero-side-img-wrap {
        width: 130px; /* Increased width on mobile */
    }
    
    .hero-side-title {
        font-size: 13px;
    }
    
    .hero-side-desc {
        font-size: 11px;
    }
    
    .blog-section-heading {
        font-size: 18px;
        margin-top: 12px;
        margin-bottom: 16px;
    }
    
    .blog-search-navigation {
        padding-bottom: 0 !important;
    }
    
    .blog-search-input {
        height: 42px;
        font-size: 13px;
    }
    
    .filter-tag-btn {
        padding: 8px 18px;
        font-size: 13px;
    }
    
    .blog-grid-articles {
        grid-template-columns: 1fr !important;
        gap: 28px;
    }
    
    .article-card-title {
        font-size: 13px;
    }
    
    .article-card-title a {
        height: 38px;
    }
    
    .article-card-desc {
        font-size: 12px;
    }
    
    .page-num, .page-arrow {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* ==========================================================================
   LAYOUT REORDERING (MOBILE & DESKTOP)
   ========================================================================== */
.blog-container {
    display: flex !important;
    flex-direction: column !important;
}

.blog-breadcrumb {
    order: 1 !important;
}

.blog-search-navigation {
    order: 2 !important;
    margin-bottom: 24px !important; /* Spacing below search/menu on mobile */
}

.blog-hero-grid {
    order: 3 !important;
    margin-bottom: 32px !important; /* Spacing below hero grid on mobile */
}

.blog-heading-wrapper {
    order: 4 !important;
}

.blog-grid-articles {
    order: 5 !important;
}

.blog-pagination {
    order: 6 !important;
}

@media (min-width: 1025px) {
    .blog-breadcrumb {
        padding-bottom: 12px !important; /* Slightly tighter spacing before search */
    }

    .blog-search-navigation {
        margin-bottom: 40px !important; /* Space between search/menu and hero grid */
    }

    .blog-hero-grid {
        margin-bottom: 48px !important;
    }
}
