/**
 * AKS Theme - Blog & Archive Styles
 * Path: wp-content/themes/aks/assets/css/blog.css
 */

/* ==========================================================================
   GLOBAL CONTAINER & GRID
   ========================================================================== */
.aks-blog-main {
    max-width: 1300px;
    margin: 0 auto !important;
    width: 100%;
    padding: 40px 0 80px 0 !important;
    box-sizing: border-box;
}

/* Horizontal padding below 1300px viewport */
@media (max-width: 1300px) {
    .aks-blog-main {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* ==========================================================================
   HEADER BORDER OVERRIDES (Matches Homepage Header Vibe)
   ========================================================================== */
.aks-header-wrapper,
.aks-header-row-3 {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ==========================================================================
   1. HERO COVER BANNER (Featured Image & Title)
   ========================================================================== */
.aks-blog-hero-wrapper {
    position: relative;
    width: 100%;
    margin-top: -1px !important;
    background: transparent;
    padding-top: 0;
    padding-bottom: 0;
}

.aks-blog-hero-wrapper::before {
    content: '';
    position: absolute;
    top: -5px; 
    left: 0; 
    width: 100%; 
    height: 160px; /* Extends header background down */
    background-color: #44485d;
    pointer-events: none;
    z-index: 0;
}

.aks-blog-hero-wrapper::after {
    content: '';
    position: absolute;
    top: -5px; 
    left: 5px; 
    width: calc(100% - 10px); 
    height: 160px; 
    background-image: url('../user-pattern.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    filter: invert(1) contrast(500%);
    mix-blend-mode: screen;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.aks-blog-cover-container {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: #44485d;
    overflow: hidden;
    margin-top: 0 !important;
    margin-bottom: 40px !important;
    border-radius: 16px;
    box-shadow: none;
    z-index: 2;
    padding: 0 !important;
}

.aks-blog-cover-container .wp-block-html {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.aks-blog-cover-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-image: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1600&q=80') !important;
    background-size: cover !important;
    background-position: center !important;
    transition: transform 6s cubic-bezier(0.1, 0.8, 0.2, 1) !important;
    z-index: 1 !important;
}

.aks-blog-cover-container:hover .aks-blog-cover-bg {
    transform: scale(1.04) !important;
}

.aks-blog-cover-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: 
        linear-gradient(to top, rgba(15, 17, 26, 0.85) 0%, rgba(15, 17, 26, 0.4) 60%, rgba(15, 17, 26, 0.2) 100%),
        linear-gradient(135deg, rgba(230, 36, 41, 0.15) 0%, rgba(15, 17, 26, 0.4) 100%) !important;
    z-index: 2 !important;
}

.aks-blog-cover-content {
    position: relative;
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    padding: 0 60px !important;
    box-sizing: border-box;
    z-index: 3;
    text-align: left !important;
}

.aks-blog-cover-content > * {
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left !important;
}

.aks-blog-cover-title {
    font-size: 38px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    line-height: 1.25 !important;
    margin: 0 0 12px 0 !important;
    font-family: 'Loos Normal', sans-serif !important;
}

.aks-blog-cover-subtitle {
    font-size: 15px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    margin: 0 !important;
    max-width: 600px !important;
    line-height: 1.5 !important;
}

/* ==========================================================================
   2. POSTS CARD GRID
   ========================================================================== */
.aks-blog-cards-grid.wp-block-post-template {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.aks-blog-card {
    background: #ffffff !important;
    border: 1px solid #e9ebe8 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.01) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.aks-blog-card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--aks-red-primary, #e62429) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.04) !important;
}

.aks-blog-card-image-wrapper {
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    height: 200px !important;
    overflow: hidden !important;
    position: relative !important;
    background: #f1f3f5 !important;
}

.aks-blog-card-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 5s ease !important;
}

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

.aks-blog-card-content {
    padding: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    align-items: flex-start !important;
}

/* Meta information */
.aks-blog-card-meta {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    font-size: 12px !important;
    color: #888a8f !important;
}

.aks-blog-card-category a {
    color: var(--aks-red-primary, #e62429) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-decoration: none !important;
}

.aks-blog-card-category a:hover {
    text-decoration: underline !important;
}

.aks-blog-card-meta-divider {
    color: #cbd5e1 !important;
}

.aks-blog-card-readtime {
    font-weight: 500 !important;
}

/* Post Title */
.aks-blog-card-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #44485d !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.35 !important;
    font-family: 'Loos Normal', sans-serif !important;
}

.aks-blog-card-title a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.aks-blog-card-title a:hover {
    color: var(--aks-red-primary, #e62429) !important;
}

/* Post Excerpt */
.aks-blog-card-excerpt {
    font-size: 14.5px !important;
    line-height: 1.6 !important;
    color: #5d6174 !important;
    margin: 0 0 24px 0 !important;
}

.aks-blog-card-excerpt p {
    margin: 0 !important;
}

/* Card Footer */
.aks-blog-card-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: auto !important;
    padding-top: 16px !important;
    border-top: 1px solid #f1f3f5 !important;
}

.aks-blog-card-date {
    font-size: 12.5px !important;
    color: #888a8f !important;
    font-weight: 500 !important;
}

.aks-blog-card-more {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--aks-red-primary, #e62429) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    display: inline-block !important;
}

.aks-blog-card-more:hover {
    color: #1e1e26 !important;
}

/* ==========================================================================
   3. PAGINATION
   ========================================================================== */
.aks-blog-pagination {
    margin-top: 60px !important;
    border-top: 1px solid #e9ebe8 !important;
    padding-top: 30px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
}

.aks-blog-pagination a,
.aks-blog-pagination span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 6px !important;
    border-radius: 8px !important;
    border: 1px solid #e9ebe8 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #44485d !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.aks-blog-pagination a:hover {
    border-color: var(--aks-red-primary, #e62429) !important;
    color: var(--aks-red-primary, #e62429) !important;
    background-color: rgba(230, 36, 41, 0.02) !important;
}

.aks-blog-pagination .current,
.aks-blog-pagination span[aria-current="page"] {
    background-color: var(--aks-red-primary, #e62429) !important;
    border-color: var(--aks-red-primary, #e62429) !important;
    color: #ffffff !important;
}

.aks-blog-pagination .dots {
    border: none !important;
    color: #888a8f !important;
    pointer-events: none !important;
}

/* ==========================================================================
   4. RESPONSIVENESS
   ========================================================================== */
@media (max-width: 991px) {
    .aks-blog-cards-grid.wp-block-post-template {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    .aks-blog-cover-title {
        font-size: 32px !important;
    }
}

@media (max-width: 768px) {
    .aks-blog-hero-wrapper::before,
    .aks-blog-hero-wrapper::after {
        height: 160px !important;
    }
    .aks-blog-cover-container {
        height: auto;
        min-height: 240px;
        width: calc(100% - 30px) !important;
        margin: 0 auto 30px auto !important;
        padding: 40px 20px !important;
    }
    .aks-blog-cover-content {
        padding: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
    }
    .aks-blog-cover-content > * {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }
    .aks-blog-cover-title {
        font-size: 26px !important;
    }
    .aks-blog-cover-subtitle {
        font-size: 13.5px !important;
    }
    .aks-blog-cards-grid.wp-block-post-template {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .aks-blog-pagination {
        margin-top: 40px !important;
        padding-top: 20px !important;
        flex-wrap: wrap !important;
    }
}
