/**
 * Gia An JSC - News & Category Layout Styles
 * Integrating authentic site header (stone background banner) with modern category layout
 */

:root {
    --red-brand: #a61919;
    --red-hover: #c0262d;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 1. AUTHENTIC GIA AN JSC HEADER & PAGE TITLE BANNER */
body.giaan-archive-body .page-title-bar {
    display: block !important;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background-size: cover;
    height: 500px !important;
    min-height: 500px !important;
    margin-bottom: 0 !important;
}

body.giaan-archive-body .page-title-bar:before {
    position: absolute;
    width: 100%;
    height: 100%;
    display: block;
    content: "";
    background: rgba(0, 0, 0, 0);
    z-index: -1;
    background-image: url(https://giaanjsc.com/wp-content/uploads/2020/06/bannerheader.png);
    background-size: cover;
    background-position: center top;
}

body.giaan-archive-body .page-title-bar .wrap {
    height: 500px !important;
    min-height: 500px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

body.giaan-archive-body .page-title-bar .wrap .page-title {
    color: #ffffff !important;
    font-family: var(--font-heading) !important;
    font-size: 64px !important;
    font-weight: 400 !important;
    line-height: 76.8px !important;
    text-align: center;
    margin: 0 0 12.8px 0 !important;
    padding: 80px 0 0 0 !important;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.giaan-archive-body .page-title-bar .breadcrumb {
    display: none !important;
}

/* 2. OVERRIDE CONTENT PADDING & CREATE BOXED OVERLAPPING CONTAINER (MATCHING /khach-hang/ 100%) */
body.giaan-archive-body .site-content-contain {
    margin: 0 !important;
    padding: 0 !important;
}

body.giaan-archive-body .site-content {
    padding-top: 0 !important;
    padding-bottom: 60px !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
    max-width: 1350px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: transparent !important;
}

.giaan-news-main-wrap {
    max-width: 1290px;
    width: 100%;
    margin: -80px auto 0 auto;
    background-color: #ffffff;
    background-image: url("https://giaanjsc.com/wp-content/uploads/2019/06/pattern.jpg");
    background-repeat: repeat;
    background-position: 0% 0%;
    -webkit-clip-path: polygon(50px 0, 100% 0, 100% 100%, 0 100%, 0 50px);
    clip-path: polygon(50px 0, 100% 0, 100% 100%, 0 100%, 0 50px);
    position: relative;
    z-index: 2;
    padding: 50px 50px 70px 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.giaan-section-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* 3. CATEGORY TABS & SEARCH BAR (FROM MOCKUP) */
.giaan-category-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
    padding-left: 0;
    margin-bottom: 36px;
}

.giaan-category-tabs {
    display: flex;
    gap: 32px;
}

.giaan-category-tab-item {
    padding: 12px 4px 14px 4px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    position: relative;
    cursor: pointer;
    display: inline-block;
    transition: color 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.giaan-category-tab-item:hover {
    color: var(--red-brand);
}

.giaan-category-tab-item.active {
    color: var(--red-brand);
    border-bottom-color: var(--red-brand);
}

/* Tab Quick Search */
.giaan-tab-search {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 8px;
}

.giaan-tab-search form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.giaan-tab-search input {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    font-size: 13px;
    width: 180px;
    color: #334155;
    padding: 2px 0;
    box-shadow: none !important;
}

.giaan-tab-search input::placeholder {
    color: #94a3b8;
}

.giaan-tab-search button {
    background: none !important;
    border: none !important;
    padding: 0 0 0 8px !important;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.giaan-tab-search button:hover {
    color: var(--red-brand);
}

/* 4. MAIN LAYOUT GRID */
.giaan-main-layout {
    width: 100%;
}

.giaan-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 36px;
    align-items: start;
}

/* POST CARDS GRID */
.giaan-post-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.giaan-post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.giaan-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.giaan-card-thumb-wrap {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #0f172a;
}

.giaan-card-thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.giaan-post-card:hover .giaan-card-thumb-wrap img {
    transform: scale(1.05);
}

.giaan-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--red-brand);
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    text-decoration: none;
    line-height: 1.4;
}

.giaan-card-badge:hover {
    background: var(--red-hover);
}

.giaan-card-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.giaan-card-meta {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    gap: 14px;
    margin-bottom: 10px;
}

.giaan-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.giaan-card-meta i {
    color: #94a3b8;
}

.giaan-card-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    color: #0f172a;
    margin-bottom: 12px;
}

.giaan-card-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s;
}

.giaan-card-title a:hover {
    color: var(--red-brand);
}

.giaan-card-excerpt {
    font-size: 14px;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 18px;
    flex-grow: 1;
}

.giaan-card-footer-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--red-brand);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s, color 0.2s;
    margin-top: auto;
}

.giaan-card-footer-link:hover {
    color: var(--red-hover);
    gap: 10px;
}

/* 5. SIDEBAR */
.giaan-sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.giaan-widget-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.giaan-widget-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.giaan-widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--red-brand);
}

/* Popular Posts list */
.giaan-popular-list {
    list-style: none !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 !important;
    margin: 0 !important;
}

.giaan-popular-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.giaan-popular-num {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--red-brand);
    line-height: 1;
    min-width: 28px;
}

.giaan-popular-info a {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.giaan-popular-info a:hover {
    color: var(--red-brand);
}

.giaan-popular-info span {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* Categories Widget */
.giaan-category-list {
    list-style: none !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    padding: 0 !important;
    margin: 0 !important;
}

.giaan-category-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
}

.giaan-category-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.giaan-category-item a {
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.giaan-category-item a:hover {
    color: var(--red-brand);
}

.giaan-category-count {
    color: #94a3b8;
}

/* CTA Consult Box */
.giaan-cta-consult-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 28px 24px;
    color: #ffffff;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.giaan-cta-consult-box h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.giaan-cta-consult-box p {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 18px;
    line-height: 1.55;
}

.giaan-cta-phone-btn {
    background: var(--red-brand);
    color: #ffffff !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.giaan-cta-phone-btn:hover {
    background: var(--red-hover);
    transform: translateY(-2px);
    color: #ffffff !important;
}

/* 6. PAGINATION */
.giaan-pagination-wrap {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 36px;
}

.giaan-pagination-wrap .page-numbers,
.giaan-page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.giaan-pagination-wrap .page-numbers:hover,
.giaan-page-num:hover {
    border-color: var(--red-brand);
    color: var(--red-brand);
}

.giaan-pagination-wrap .page-numbers.current,
.giaan-page-num.active {
    background: var(--red-brand);
    color: #ffffff !important;
    border-color: var(--red-brand);
}

.giaan-pagination-wrap .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* Empty state */
.giaan-no-posts {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 15px;
}

/* 7. RESPONSIVE BREAKPOINTS */
@media (max-width: 991px) {
    body.giaan-archive-body .page-title-bar {
        height: 380px !important;
        min-height: 380px !important;
    }

    body.giaan-archive-body .page-title-bar .wrap {
        height: 380px !important;
        min-height: 380px !important;
    }

    body.giaan-archive-body .page-title-bar .wrap .page-title {
        font-size: 38px !important;
        padding-top: 40px !important;
    }

    body.giaan-archive-body .site-content {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .giaan-news-main-wrap {
        margin-top: -60px;
        -webkit-clip-path: polygon(40px 0, 100% 0, 100% 100%, 0 100%, 0 40px);
        clip-path: polygon(40px 0, 100% 0, 100% 100%, 0 100%, 0 40px);
        padding: 35px 25px 50px 25px;
    }

    .giaan-layout-grid {
        grid-template-columns: 1fr;
    }

    .giaan-category-tabs-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .giaan-tab-search {
        width: 100%;
    }

    .giaan-tab-search form {
        width: 100%;
    }

    .giaan-tab-search input {
        width: 100%;
    }
}

@media (max-width: 576px) {
    body.giaan-archive-body .page-title-bar {
        height: 300px !important;
        min-height: 300px !important;
    }

    body.giaan-archive-body .page-title-bar .wrap {
        height: 300px !important;
        min-height: 300px !important;
    }

    body.giaan-archive-body .page-title-bar .wrap .page-title {
        font-size: 28px !important;
        padding-top: 20px !important;
    }

    .giaan-news-main-wrap {
        margin-top: -40px;
        padding: 25px 15px 40px 15px;
        -webkit-clip-path: polygon(30px 0, 100% 0, 100% 100%, 0 100%, 0 30px);
        clip-path: polygon(30px 0, 100% 0, 100% 100%, 0 100%, 0 30px);
    }

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

    .giaan-category-tabs {
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        gap: 20px;
    }
}

