/* 1. RESET & WRAPPER */
.custom-archive-wrapper a { text-decoration: none !important; color: inherit !important; }
.custom-archive-wrapper { 
    padding: 60px 0; 
    background-image: url('https://i.pinimg.com/736x/a9/28/db/a928dbe75149faa6c3c0f85ded1758da.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    /* Lưu ý: Không để overflow: hidden ở đây nếu muốn sticky hoạt động */
}

.custom-archive-wrapper::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.2); 
    z-index: 1;
}

.container { position: relative; z-index: 2; max-width: 1300px; margin: 0 auto; padding: 0 15px; }

/* 2. HIỆU ỨNG REVEAL */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 3. LAYOUT GRID */
.archive-main-grid { 
    display: flex; 
    gap: 30px; 
    align-items: flex-start; /* BẮT BUỘC để Sticky hoạt động */
}
.post-listing { flex: 1; }
.sidebar-right { flex: 0 0 340px; }

/* 4. NEWS CARD OVERLAY */
.news-columns {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

.card-item-overlay {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card-bg-thumb { width: 100%; height: 100%; position: absolute; top:0; left:0; }
.card-bg-thumb img {
    width: 100% !important; height: 100% !important;
    object-fit: cover !important; transition: transform 1.2s ease;
    opacity: 0.65;
}

.card-content-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 25px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    z-index: 2; height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end;
}

.card-date-overlay { 
    color: #fff !important; font-size: 12px !important; font-weight: 700;
    background: #c2a172; padding: 4px 12px; border-radius: 4px;
    display: inline-flex; align-items: center; gap: 6px;
}

.card-title-overlay {
    color: #fff !important; font-size: 18px !important; font-weight: 700 !important;
    line-height: 1.4; margin: 12px 0 !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.view-more-text { color: #c2a172; font-size: 11px; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid #c2a172; align-self: flex-start; }
.card-item-overlay:hover .card-bg-thumb img { transform: scale(1.1); opacity: 0.4; }

/* 5. SIDEBAR STICKY ĐÃ GỘP */
.sidebar-sticky {
    position: -webkit-sticky;
    position: sticky !important;
    top: 30px; /* Cách đỉnh 30px khi cuộn */
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
    max-height: calc(100vh - 60px);
    overflow-y: auto; /* Cuộn nội bộ nếu sidebar quá dài */
}

/* Tùy chỉnh thanh cuộn cho Sidebar */
.sidebar-sticky::-webkit-scrollbar { width: 3px; }
.sidebar-sticky::-webkit-scrollbar-thumb { background: #c2a172; border-radius: 10px; }

.sidebar-widget {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Widget Tư Vấn */
.widget-consultation {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff; text-align: center; border: none;
}

.consult-badge {
    background: #c2a172; color: #000; display: inline-block;
    padding: 4px 12px; border-radius: 50px; font-size: 11px; font-weight: 800; margin-bottom: 15px;
}

.widget-consultation h3 { color: #c2a172; font-size: 20px; margin-bottom: 12px; }
.widget-consultation p { font-size: 14px; opacity: 0.8; line-height: 1.5; }

.phone-wrapper {
    margin: 20px 0; display: flex; align-items: center; justify-content: center;
    gap: 10px; background: rgba(255,255,255,0.08); padding: 15px; border-radius: 12px;
}
.phone-number { font-size: 20px; font-weight: 800; color: #fff; }

.btn-modern-call {
    display: block; background: #c2a172; color: #0f172a !important;
    padding: 14px; border-radius: 10px; font-weight: 700; transition: 0.4s;
}
.btn-modern-call:hover { background: #fff; transform: translateY(-3px); }

/* Widget Danh Mục */
.widget-title {
    font-size: 18px; font-weight: 700; margin-bottom: 20px;
    padding-bottom: 10px; border-bottom: 2px solid #c2a172; color: #0f172a;
}
.service-list { list-style: none; padding: 0; }
.service-list li { margin-bottom: 12px; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
.service-list a { display: flex; align-items: center; gap: 10px; transition: 0.3s; color: #444 !important; }
.service-list a:hover { color: #c2a172 !important; padding-left: 8px; }

/* 6. RESPONSIVE */
@media (max-width: 1100px) {
    .news-columns { grid-template-columns: repeat(2, 1fr) !important; }
    .sidebar-right { flex: 0 0 300px; }
}

@media (max-width: 991px) {
    .archive-main-grid { flex-direction: column; }
    .sidebar-right { width: 100%; flex: none; order: 2; }
    .sidebar-sticky { position: relative !important; top: 0 !important; max-height: none; }
}

@media (max-width: 600px) {
    .news-columns { grid-template-columns: 1fr !important; }
}