/* ========================================
   KTĐBCL - BASE STYLE
   Drupal 10 custom theme
   ======================================== */

/* ========== GOOGLE FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

/* ========== CSS VARIABLES ========== */
:root {
  --crimson: #9B1C2E;
  --crimson-dark: #6E1220;
  --crimson-light: #C0334A;
  --gold: #C9A84C;
  --gold-light: #E8C97A;
  --cream: #FDF8F0;
  --white: #FFFFFF;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-lg: 14px;
    /* thêm 2 dòng này */
  --site-container: 1280px;
  --site-padding: 20px;
}

/* ========== RESET ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--cream);
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.65;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
}

ul {
  list-style: none;
}

/* ========== MAIN LAYOUT ========== */
.main-wrap {
  width: 100%;
  max-width: var(--site-container);
  margin: 32px auto;
  padding: 0 var(--site-padding);
}

/* Trang có sidebar */
.main-wrap.has-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
}

/* Trang không có sidebar: Giới thiệu, Cơ cấu tổ chức, Liên hệ, node thường */
.main-wrap.no-sidebar {
  display: block;
}

.main-wrap.no-sidebar main {
  width: 100%;
  max-width: 100%;
}

/* Giữ tương thích nếu chỗ nào còn dùng class cũ */
.main-wrap.main-wrap--full {
  display: block;
}

.main-wrap.main-wrap--full main {
  width: 100%;
  max-width: 100%;
}

main {
  min-width: 0;
}
/* ========== SIDEBAR ========== */
.sidebar,
.region-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.region-sidebar-right .block__title {
  display: none;
}

/* ========== WIDGET ========== */
.widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
}

.widget-header {
  background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
  padding: 13px 18px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-body {
  padding: 16px;
}

/* ========== STATS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  background: var(--cream);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--crimson);
}

.stat-label {
  font-size: 11.5px;
  color: var(--gray-600);
  margin-top: 2px;
}

/* ========== QUICK LINKS SIDEBAR ========== */
.quick-link-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: var(--gray-800);
  font-size: 13.5px;
  font-weight: 500;
}

.quick-link-item:hover {
  background: rgba(155,28,46,0.06);
  color: var(--crimson);
}

.quick-link-item .arrow {
  margin-left: auto;
  color: var(--gray-400);
  font-size: 12px;
}

/* ========== SECTION HEADERS ========== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--crimson);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: block;
  width: 5px;
  height: 22px;
  background: linear-gradient(to bottom, var(--gold), var(--crimson));
  border-radius: 3px;
}

.view-all {
  font-size: 13px;
  color: var(--crimson);
  text-decoration: none;
  font-weight: 600;
  border: 1.5px solid var(--crimson);
  padding: 5px 14px;
  border-radius: 20px;
  transition: all 0.2s;
}

.view-all:hover {
  background: var(--crimson);
  color: white;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  font-family: inherit;
  position: relative;
  transition: color 0.2s;
}

.tab-btn.active {
  color: var(--crimson);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--crimson);
}

.tab-btn:hover {
  color: var(--crimson);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ========== DRUPAL MESSAGES ========== */
.messages--status {
  background: rgba(22,163,74,0.1);
  border-left: 4px solid #16a34a;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 6px;
}

.messages--error {
  background: rgba(155,28,46,0.08);
  border-left: 4px solid var(--crimson);
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 6px;
}

.messages--warning {
  background: rgba(234,179,8,0.1);
  border-left: 4px solid #ca8a04;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 6px;
}

/* ========== RESPONSIVE BASE ========== */
@media (max-width: 900px) {
  .main-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Full width cho trang /tin-tuc */
body.path-tin-tuc .layout-main,
body.path-tin-tuc .main-layout,
body.path-tin-tuc .main-container,
body.path-tin-tuc .page-main,
body.path-tin-tuc .content-sidebar-layout {
  display: block !important;
  grid-template-columns: 1fr !important;
}

body.path-tin-tuc .sidebar,
body.path-tin-tuc .sidebar-right,
body.path-tin-tuc .sidebar-second,
body.path-tin-tuc .region-sidebar-second,
body.path-tin-tuc .region-sidebar-phai {
  display: none !important;
}

body.path-tin-tuc .main-content,
body.path-tin-tuc .layout-content,
body.path-tin-tuc .region-content,
body.path-tin-tuc main {
  width: 100% !important;
  max-width: 100% !important;
}
/* =========================================================
   MOBILE - ẨN SIDEBAR PHẢI
   Áp dụng cho màn hình điện thoại / tablet nhỏ
========================================================= */

@media (max-width: 992px) {
  .main-wrap.has-sidebar {
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .main-wrap.has-sidebar > main {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .main-wrap.has-sidebar > aside.sidebar {
    display: none !important;
  }
}
