/* ==========================================================================
   Khung trang: thanh trên cùng, tiêu đề các khu, chân trang, thông báo lỗi.
   ========================================================================== */

/* ---------- Thanh trên cùng ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 247, 240, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}
.brand__logo { height: 40px; width: auto; }
.brand__divider { width: 1px; height: 28px; background: var(--line); }
.brand__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-lg);
  color: var(--brand-deep);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--paper-2); }
.site-nav .site-nav__cta { color: var(--gold-deep); font-weight: 600; }

@media (max-width: 860px) {
  .site-header__inner {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-top: 10px;
    padding-bottom: 6px;
  }
  .brand__logo { height: 34px; }
  .site-nav {
    margin: 0 -8px;
    /* mờ dần mép phải: gợi ý vuốt ngang để xem thêm */
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
    padding-right: 24px;
  }
  :root { --header-h: 104px; }
}

/* ---------- Khu nội dung chung ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }

.section-head { margin-bottom: clamp(28px, 4vw, 44px); max-width: 640px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: var(--t-3xl); }
.section-head h2 em { font-style: italic; font-weight: 600; color: var(--gold-deep); }
.section-head p { margin-top: 10px; color: var(--ink-soft); }
.section-head .section-head__kicker {
  margin: 0 0 6px;
  font-family: var(--f-display);
  font-style: italic;
  color: var(--gold-deep);
}

/* ---------- Chân trang ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 32px 0;
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer__brand img { height: 52px; width: auto; }
.site-footer p { color: var(--ink-soft); font-size: var(--t-sm); text-align: right; }
.site-footer p a { color: var(--gold-deep); }
.site-footer__links { display: inline-flex; align-items: center; gap: 12px; margin-top: 4px; }
/* Lối vào trang quản trị: biểu tượng bánh răng mờ, có nhưng không nổi bật */
.site-footer p .site-footer__admin {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink-soft);
  opacity: .5;
}
.site-footer p .site-footer__admin:hover,
.site-footer p .site-footer__admin:focus-visible { opacity: 1; color: var(--gold-deep); background: var(--gold-tint); }

@media (max-width: 600px) {
  .site-footer p { text-align: left; }
}

/* ---------- Lỗi tải dữ liệu ---------- */
.load-error {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: var(--radius-m);
  background: #fff;
  color: #9b1c31;
  box-shadow: 0 10px 30px rgba(27, 20, 64, .2);
  font-size: var(--t-sm);
}
