/* ==========================================================================
   CARITAS ĐÀ LẠT - PHONG CÁCH GIÁO PHẬN ĐÀ LẠT (giaophandalat.com)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Lora:ital,wght@0,500;0,600;0,700;1,400;1,500&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Bảng màu chính thức đồng bộ Giáo Phận Đà Lạt */
  --color-primary: #027954;
  --color-primary-dark: #01563b;
  --color-primary-light: #e6f4ef;
  --color-background-light: #f1f3f2;
  --color-accent-gold: #d48817;
  --color-accent-amber: #f59e0b;
  --color-accent-red: #b91c1c;
  --color-text-main: #1e293b;
  --color-text-muted: #64748b;
  --radius-default: 0.5rem;
}

body {
  background-color: var(--color-background-light);
  color: var(--color-text-main);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.005em;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .font-serif {
  font-family: 'Lora', 'Merriweather', Georgia, serif;
  letter-spacing: -0.005em;
  line-height: 1.35;
}

/* Các lớp tiện ích màu sắc */
.text-primary { color: var(--color-primary) !important; }
.bg-primary { background-color: var(--color-primary) !important; }
.bg-primary-dark { background-color: var(--color-primary-dark) !important; }
.border-primary { border-color: var(--color-primary) !important; }

/* --------------------------------------------------------------------------
   BANNER HEADER (Đồng bộ .banner-wrapper của giaophandalat.com)
   -------------------------------------------------------------------------- */
.banner-wrapper {
  width: 100%;
  background-color: var(--color-primary);
  display: block;
  overflow: hidden;
  margin-bottom: 0;
  line-height: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.banner-image {
  width: 100%;
  height: auto;
  max-height: 240px;
  display: block;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 640px) {
  .banner-image {
    max-height: 140px;
  }
}

/* --------------------------------------------------------------------------
   BỐ CỤC CHÍNH (Đồng bộ .main-container của giaophandalat.com)
   -------------------------------------------------------------------------- */
.main-container {
  max-width: 80rem;
  margin-inline: auto;
  padding: 1.5rem 1rem 3rem 1rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 64rem) {
  .main-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Thẻ khối trang chủ (home-section) */
.home-section {
  background-color: #ffffff;
  border-radius: var(--radius-default);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* Thẻ khối thanh bên (sidebar-section) */
.sidebar-section {
  background-color: #ffffff;
  border-radius: var(--radius-default);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
}

/* Tiêu đề sidebar chuẩn Giáo Phận Đà Lạt */
.sidebar-title {
  margin: -1.25rem -1.25rem 1rem -1.25rem;
  background-color: var(--color-primary);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.925rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top-left-radius: var(--radius-default);
  border-top-right-radius: var(--radius-default);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Thanh tiêu đề chuyên mục chính */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.section-title-badge {
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: 0.375rem 0.375rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.03em;
}

.section-more-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.section-more-link:hover {
  color: var(--color-primary-dark);
  transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   HERO TIÊU ĐIỂM & HÌNH ẢNH
   -------------------------------------------------------------------------- */
.hero-slider {
  position: relative;
  border-radius: var(--radius-default);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.hero-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 50%, rgba(0, 0, 0, 0) 100%);
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1.5rem;
  z-index: 10;
}

.hero-overlay h2 {
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1.4;
  margin-top: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

@media (min-width: 768px) {
  .hero-overlay h2 {
    font-size: 1.65rem;
  }
}

/* Thumbnail danh sách bài viết */
.thumb {
  width: 128px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 0.375rem;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.thumb:hover {
  opacity: 0.88;
  transform: scale(1.02);
}

.thumb-carousel {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 0.375rem;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.thumb-carousel:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Post card hover transition */
.card-post {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-post:hover {
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   MENU ĐIỀU HƯỚNG ĐA CẤP (MULTI-LEVEL DROPDOWN)
   -------------------------------------------------------------------------- */
nav.bg-primary {
  background-color: var(--color-primary) !important;
}

.nav-link {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

/* Menu điều hướng không bị rớt dòng (Single line menu items) */
.nav-link, .nav-item-link {
  white-space: nowrap !important;
  word-break: keep-all !important;
  flex-shrink: 0 !important;
}

.nav-link span, .nav-item-link span {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Dropdown cấp 1 */
.dropdown-level-1 {
  background-color: var(--color-primary);
  width: 17rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border-top: 3px solid var(--color-accent-gold);
  padding: 0.25rem 0;
  z-index: 50;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: var(--color-primary-dark);
  color: #fef08a;
  padding-left: 1.25rem;
}

/* Dropdown cấp 2 (Flyout ngang sang phải) */
.dropdown-level-2 {
  background-color: var(--color-primary);
  width: 17rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--color-accent-gold);
  padding: 0.25rem 0;
  z-index: 60;
}

/* --------------------------------------------------------------------------
   FOOTER CHUẨN GIÁO PHẬN ĐÀ LẠT
   -------------------------------------------------------------------------- */
footer {
  background-color: var(--color-primary);
  color: #ffffff;
  border-top: 4px solid var(--color-accent-gold);
  margin-top: auto;
}

footer a {
  color: #e2e8f0;
  transition: color 0.2s ease, transform 0.2s ease;
}

footer a:hover {
  color: #fef08a;
}

/* --------------------------------------------------------------------------
   CHI TIẾT BÀI VIẾT (PROSE & TYPOGRAPHY)
   -------------------------------------------------------------------------- */
.prose-article {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.85;
  letter-spacing: 0.01em;
  color: #334155;
}

.prose-article p {
  margin-bottom: 1.25rem;
  text-align: justify;
}

.prose-article img {
  border-radius: var(--radius-default);
  margin: 1.5rem auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-width: 100%;
  height: auto;
}

.prose-article h2 {
  color: var(--color-primary-dark);
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  font-size: 1.45rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--color-primary);
  padding-left: 0.75rem;
}

.prose-article h3 {
  color: #1e293b;
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose-article blockquote {
  border-left: 4px solid var(--color-accent-gold);
  background-color: #fefce8;
  padding: 1rem 1.25rem;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: #854d0e;
  margin: 1.5rem 0;
}

/* Thanh tiến trình đọc bài */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent-gold));
  z-index: 999;
  transition: width 0.1s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ==========================================================================
   TỐI ƯU HÓA THANH ĐIỀU HƯỚNG - TUYỆT ĐỐI KHÔNG RỚT CHỮ XUỐNG HÀNG
   ========================================================================== */
.nav-link,
.nav-item-link,
.navbar-nav a,
.navbar-nav button,
header nav a,
header nav button {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  flex-shrink: 0 !important;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

