/* ============================================================================
   PUBLIC.CSS — khung chung cho các trang công khai không có sidebar (blog, 404…):
   reset nhẹ, nút, thanh điều hướng cố định và chân trang. Dùng cùng academic.css.
   ========================================================================== */
/* Bộ chữ riêng cho các trang giới thiệu (không áp dụng cho trang trong app):
   Spectral cho tiêu đề, Be Vietnam Pro cho thân bài — dấu tiếng Việt chuẩn hơn Fraunces/Newsreader. */
@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');
:root {
  --serif-display: 'Spectral', Georgia, 'Times New Roman', serif;
  --serif-body: 'Be Vietnam Pro', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); overflow-x: hidden; font-family: var(--serif-body); }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: min(1140px, 92vw); margin: 0 auto; }
h1, h2, h3, h4 { font-family: var(--serif-display); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }

.btn-solid, .btn-ghost { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.02rem; padding: 14px 24px; border-radius: var(--r); border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s, color .15s; cursor: pointer; font-family: var(--serif-body); }
.btn-solid { background: var(--oxblood); color: #fdf6ec; border-color: var(--oxblood-deep); }
.btn-solid:hover { background: var(--oxblood-deep); color: #fff; transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--gold-tint); border-color: var(--gold); transform: translateY(-1px); }

/* ---------- NAV ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 18px 0; border-bottom: 1px solid transparent; transition: background .3s, box-shadow .3s, padding .3s, border-color .3s; }
.nav.scrolled { background: rgba(251,246,234,.92); backdrop-filter: blur(10px); border-bottom-color: var(--rule); padding: 11px 0; }
/* Trang chủ để nav trong suốt trên ảnh hero — phủ một lớp giấy mờ dần để chữ luôn đọc được. */
.nav:not(.scrolled):not(.solid)::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(245,236,217,.95) 0%, rgba(245,236,217,.82) 52%, rgba(245,236,217,0) 100%); }
.nav .wrap { position: relative; }
.nav .wrap { display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand img { width: 46px; height: 46px; }
.brand .t { font-family: var(--serif-display); font-weight: 600; font-size: 1.2rem; color: var(--ink); display: block; line-height: 1.05; white-space: nowrap; }
.brand .k { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-deep); display: block; margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav-links a { font-size: .94rem; color: var(--ink-soft); text-decoration: none; position: relative; padding: 4px 0; white-space: nowrap; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0; background: var(--gold); transition: width .25s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--oxblood); }
.nav-links a[aria-current]::after, .nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.lang-mini { position: relative; }
.lang-mini select { appearance: none; -webkit-appearance: none; cursor: pointer; font-family: var(--serif-body); font-size: .82rem; font-weight: 600; color: var(--ink-soft); background: transparent; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 6px 26px 6px 12px; outline: none; }
.lang-mini i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: .65rem; color: var(--gold-deep); pointer-events: none; }
.btn-ink { font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--ink-soft); padding: 9px 6px; white-space: nowrap; }
.btn-ink:hover { color: var(--oxblood); }
.btn-seal { font-weight: 600; font-size: .95rem; text-decoration: none; background: var(--oxblood); color: #fdf6ec; border: 1px solid var(--oxblood-deep); padding: 10px 20px; border-radius: 999px; white-space: nowrap; transition: all .2s; }
.btn-seal:hover { background: var(--oxblood-deep); color: #fff; transform: translateY(-1px); box-shadow: var(--sh-2); }
.nav-burger { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px; }
.mobile-menu { display: none; }
/* Trang công khai luôn có nền giấy dưới nav khi không phải hero -> nav mờ nhẹ ngay từ đầu */
.nav.solid { background: rgba(251,246,234,.92); backdrop-filter: blur(10px); border-bottom-color: var(--rule); }

/* ---------- FOOTER ---------- */
.foot { background: linear-gradient(180deg, var(--spine), var(--spine-2)); color: var(--parchment-dim); padding: 56px 0 28px; border-top: 1px solid var(--gold-deep); }
.foot .top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 36px; border-bottom: 1px solid rgba(232,220,192,.14); }
.foot .brand .t { color: var(--parchment); }
.foot .blurb { font-size: .95rem; line-height: 1.7; margin-top: 16px; max-width: 34ch; }
.foot h4 { font-family: var(--serif-display); font-weight: 500; font-size: 1rem; color: var(--gold); margin-bottom: 14px; }
.foot ul { list-style: none; }
.foot li { margin-bottom: 10px; }
.foot a:not(.brand) { color: var(--parchment-dim); text-decoration: none; }
.foot a:not(.brand):hover { color: var(--parchment); }
.foot .bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; font-size: .85rem; }
.foot .credit a { color: var(--gold); text-decoration: none; font-weight: 600; }
.foot .credit a:hover { color: var(--gold-tint); text-decoration: underline; }

@media (max-width: 1180px) {
  .nav .wrap { gap: 14px; }
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; margin-left: auto; }
  .mobile-menu { display: block; max-height: 0; overflow: hidden; background: var(--paper-raised); transition: max-height .35s ease; }
  .mobile-menu.open { max-height: 480px; box-shadow: var(--sh-2); border-bottom: 1px solid var(--rule-strong); }
  .mobile-menu a { display: block; padding: 15px 6vw; font-size: 1.02rem; color: var(--ink); text-decoration: none; border-top: 1px solid var(--rule); }
  .mm-auth { display: flex; gap: 12px; padding: 16px 6vw 20px; border-top: 1px solid var(--rule); }
  .mm-auth a { flex: 1; text-align: center; padding: 12px; border-radius: var(--r); border: 0; }
  .mm-auth .mm-login { border: 1px solid var(--rule-strong); color: var(--oxblood); }
  .mm-auth .mm-reg { background: var(--oxblood); color: #fdf6ec; }
  .nav.scrolled, .nav.solid { background: rgba(251,246,234,.96); }
}
@media (max-width: 860px) {
  .foot .top { grid-template-columns: 1fr 1fr; }
  .foot .brand-col { grid-column: 1 / -1; }
}
@media (max-width: 540px) { .brand .k { display: none; } }

/* ---------- Khối dùng chung cho trang công khai ---------- */
.sec-head { max-width: 640px; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); line-height: 1.12; }
.sec-head p { margin-top: 12px; font-size: 1.08rem; line-height: 1.65; color: var(--ink-soft); max-width: 56ch; }
.sec-head .more { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; color: var(--oxblood); text-decoration: none; }
.sec-head .more:hover { text-decoration: underline; }
.contour {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='140' viewBox='0 0 260 140'%3E%3Cg fill='none' stroke='%237a1f2b' stroke-width='1'%3E%3Cpath d='M-10 80c35-34 70-34 105 0s70 34 105 0 50-24 70-12'/%3E%3Cpath d='M-10 102c35-30 70-30 105 0s70 30 105 0 50-20 70-9'/%3E%3Cpath d='M-10 58c35-36 70-36 105 0s70 36 105 0 50-26 70-14'/%3E%3Cpath d='M-10 36c35-32 70-32 105 0s70 32 105 0 50-22 70-11'/%3E%3Cpath d='M-10 124c35-26 70-26 105 0s70 26 105 0 50-16 70-7'/%3E%3Cpath d='M-10 14c35-28 70-28 105 0s70 28 105 0 50-18 70-8'/%3E%3C/g%3E%3C/svg%3E");
}

/* Đầu trang con: đường dẫn + tiêu đề + dẫn nhập */
.page-head { padding: 124px 0 30px; }
.page-head .crumbs { font-size: .9rem; color: var(--ink-faint); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .crumbs a { color: var(--ink-soft); text-decoration: none; }
.page-head .crumbs a:hover { color: var(--oxblood); }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.08; max-width: 18ch; text-wrap: balance; }
.page-head .lead { margin-top: 16px; font-size: 1.12rem; line-height: 1.65; color: var(--ink-soft); max-width: 58ch; }
.page-head .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Khối kêu gọi cuối trang */
.closing { padding: 80px 0 100px; text-align: center; }
.closing h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
.closing p { margin: 12px auto 26px; color: var(--ink-soft); max-width: 50ch; font-size: 1.08rem; line-height: 1.65; }
.closing .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Hiện dần khi cuộn (chỉ những khối được đánh dấu data-rv) */
.js [data-rv] { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js [data-rv="left"] { transform: translateX(-30px); }
.js [data-rv="right"] { transform: translateX(30px); }
.js [data-rv="clip"] { opacity: 1; transform: none; position: relative; transition: none; }
.js [data-rv="clip"]::after { content: ""; position: absolute; inset: 0; background: var(--paper); border-radius: var(--r-lg); transform-origin: right center; transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
.js [data-rv="clip"].in::after { transform: scaleX(0); }
.js [data-rv].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-rv] { opacity: 1; transform: none; transition: none; }
  .js [data-rv="clip"]::after { display: none; }
  html { scroll-behavior: auto; }
}
