/**
 * DECOFI Theme (NSSV3) — Khối Ấn Phẩm & Báo Cáo Thường Niên (global.new_files_id)
 * Concept: Architectural Editorial Publication Cards + Chamfer Geometry
 * Brand Tokens: --c-primary (#ce2027) | --c-secondary (#14539a) | Fahkwang Font
 */

.decofi-publications-section {
    position: relative;
    margin: 72px 0 80px;
    background-color: #ffffff;
}

.decofi-pub-showcase {
    position: relative;
}

/* Gỡ bỏ hoàn toàn lớp phủ gradient cũ của .block_new_files:after */
.block_new_files.decofi-pub-showcase::after {
    display: none !important;
    content: none !important;
}

/* ==========================================================================
   1. HEADER BAR: TIÊU ĐỀ RÃNH KIẾN TRÚC & NÚT XEM TẤT CẢ
   ========================================================================== */
.decofi-pub-showcase .pub-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 32px;
}

.decofi-pub-showcase .pub-section-title {
    flex: 1;
    min-width: 240px;
    margin: 0 !important;
    text-transform: uppercase;
}

.decofi-pub-showcase .pub-header-action {
    flex-shrink: 0;
}

/* ==========================================================================
   2. LƯỚI 3 CỘT ẤN PHẨM KIẾN TRÚC (.pub-grid)
   ========================================================================== */
.decofi-pub-showcase .pub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

@media (min-width: 640px) {
    .decofi-pub-showcase .pub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .decofi-pub-showcase .pub-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 32px;
    }
}

/* ==========================================================================
   3. THẺ ẤN PHẨM TẠP CHÍ KIẾN TRÚC VÁT GÓC (.pub-card)
   ========================================================================== */
.decofi-pub-showcase .pub-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #ffffff;
    border: 1.5px solid var(--c-border, #d9d9d9);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Đường viền vát góc dưới bên phải chuẩn DECOFI */
.decofi-pub-showcase .pub-card::after {
    content: "";
    position: absolute;
    bottom: 17px;
    right: -2px;
    width: 28px;
    height: 1.5px;
    background-color: var(--c-border, #d9d9d9);
    transform-origin: 100% 100%;
    transform: rotate(-45deg);
    pointer-events: none;
    z-index: 4;
    transition: background-color 0.35s ease;
}

.decofi-pub-showcase .pub-card:hover {
    border-color: var(--c-secondary, #14539a);
    box-shadow: 0 18px 40px rgba(20, 83, 154, 0.14);
    transform: translateY(-6px);
}

.decofi-pub-showcase .pub-card:hover::after {
    background-color: var(--c-secondary, #14539a);
}

.decofi-pub-showcase .pub-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none !important;
    color: inherit;
}

/* ==========================================================================
   4. SÂN KHẤU TRƯNG BÀY BÌA SÁCH TỶ LỆ 3:4 (.pub-cover-stage)
   ========================================================================== */
.decofi-pub-showcase .pub-cover-stage {
    position: relative;
    padding: 28px 36px 24px;
    background-color: #f4f5f7;
    background-image:
        radial-gradient(circle at 50% 35%, #ffffff 0%, #eef0f4 75%),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 39px,
            rgba(20, 83, 154, 0.03) 39px,
            rgba(20, 83, 154, 0.03) 40px
        );
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Khung bìa tạp chí/báo cáo tỷ lệ 3:4 có hiệu ứng gáy sách bên trái */
.decofi-pub-showcase .pub-book-frame {
    position: relative;
    width: 100%;
    max-width: 240px;
    aspect-ratio: 3 / 4;
    background-color: #ffffff;
    box-shadow:
        -6px 8px 18px rgba(15, 23, 42, 0.16),
        0 2px 6px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

/* Nếp gấp gáy sách (Book Spine Highlight) dọc mép trái bìa */
.decofi-pub-showcase .pub-book-frame::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 10px;
    z-index: 2;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.22) 0%,
        rgba(255, 255, 255, 0.38) 35%,
        rgba(0, 0, 0, 0.08) 75%,
        transparent 100%
    );
    pointer-events: none;
}

.decofi-pub-showcase .pub-card:hover .pub-book-frame {
    transform: translateY(-4px) scale(1.025);
    box-shadow:
        -10px 16px 28px rgba(15, 23, 42, 0.24),
        0 4px 10px rgba(20, 83, 154, 0.12);
}

.decofi-pub-showcase .pub-book-frame img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
}

/* Nhãn Năm phát hành (2022, 2021, 2020) vát góc ở góc trên bên trái */
.decofi-pub-showcase .pub-year-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    padding: 4px 12px;
    background-color: var(--c-secondary, #14539a);
    border-left: 3px solid var(--c-primary, #ce2027);
    color: #ffffff;
    font-family: var(--font-main, 'Fahkwang', sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(20, 83, 154, 0.22);
}

/* Huy hiệu PDF nổi lên ở góc dưới bên phải khi hover */
.decofi-pub-showcase .pub-cover-overlay {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 5;
    pointer-events: none;
}

.decofi-pub-showcase .pub-pdf-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background-color: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.decofi-pub-showcase .pub-pdf-pill i {
    color: #ff4d54;
    font-size: 12px;
}

.decofi-pub-showcase .pub-card:hover .pub-pdf-pill {
    background-color: var(--c-primary, #ce2027);
    transform: translateY(-2px);
}

.decofi-pub-showcase .pub-card:hover .pub-pdf-pill i {
    color: #ffffff;
}

/* ==========================================================================
   5. THÂN THẺ THÔNG TIN ẤN PHẨM (.pub-card-body)
   ========================================================================== */
.decofi-pub-showcase .pub-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 22px;
    background-color: #ffffff;
}

.decofi-pub-showcase .pub-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.decofi-pub-showcase .pub-doc-type {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--c-primary, #ce2027);
}

.decofi-pub-showcase .pub-doc-index {
    font-family: var(--font-main, 'Fahkwang', sans-serif);
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.8px;
}

.decofi-pub-showcase .pub-doc-title {
    margin: 0 0 16px;
    font-family: var(--font-main, 'Fahkwang', sans-serif);
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.42;
    text-transform: uppercase;
    color: var(--c-secondary, #14539a);
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.decofi-pub-showcase .pub-card:hover .pub-doc-title {
    color: var(--c-primary, #ce2027);
}

.decofi-pub-showcase .pub-card-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.decofi-pub-showcase .pub-cta-text {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: #334155;
    transition: color 0.3s ease;
}

.decofi-pub-showcase .pub-card:hover .pub-cta-text {
    color: var(--c-secondary, #14539a);
}

.decofi-pub-showcase .pub-cta-arrow {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    color: var(--c-secondary, #14539a);
    font-size: 13px;
    clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
    transition: all 0.3s ease;
}

.decofi-pub-showcase .pub-card:hover .pub-cta-arrow {
    background-color: var(--c-secondary, #14539a);
    color: #ffffff;
    transform: translateX(3px);
}

/* ==========================================================================
   6. RESPONSIVE MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .decofi-publications-section {
        margin: 48px 0 56px;
    }

    .decofi-pub-showcase .pub-header-bar {
        margin-bottom: 24px;
    }

    .decofi-pub-showcase .pub-cover-stage {
        padding: 22px 28px 20px;
    }

    .decofi-pub-showcase .pub-book-frame {
        max-width: 200px;
    }

    .decofi-pub-showcase .pub-card-body {
        padding: 18px 18px 20px;
    }

    .decofi-pub-showcase .pub-doc-title {
        font-size: 15px;
    }
}
