/* Website giảng viên: phong cách Mù Cang Chải. Dùng chung các biến màu của app.css. */

:root {
  --ls-sky-a: #F8EFCF; --ls-sky-b: #E9E2BE; --ls-sun: #F3D27A;
  --ls-far: #9BAE93; --ls-near: #7A9678;
  --ls-mist: #FBF6E3;
  --ls-t0: #DDB23A; --ls-t1: #C8952A; --ls-t2: #8DAE4B; --ls-t3: #6C9442;
  --ls-wall: rgba(70, 50, 10, 0.28);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ls-sky-a: #233225; --ls-sky-b: #39422D; --ls-sun: #C9A24B;
    --ls-far: #3E5142; --ls-near: #31463A;
    --ls-mist: #55604A;
    --ls-t0: #A98428; --ls-t1: #8A6A1F; --ls-t2: #5E7D34; --ls-t3: #466A2B;
    --ls-wall: rgba(0, 0, 0, 0.4);
  }
}

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.skip:focus { top: 8px; }
.site-wrap { max-width: 1040px; margin-inline: auto; padding-inline: 16px; }
.site-main { padding-block: 28px 64px; }

/* Đầu trang */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 3px solid var(--gold); }
.site-head-in { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; padding-block: 10px; }
.site-brand { font: 600 1.15rem var(--font-text); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; padding: 6px 12px; border-radius: 8px; }
.site-nav a:not(.btn):hover { background: var(--accent-soft); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* Hình ruộng bậc thang */
.landscape { display: block; width: 100%; height: 100%; }
.landscape .ls-sky-a { stop-color: var(--ls-sky-a); }
.landscape .ls-sky-b { stop-color: var(--ls-sky-b); }
.landscape .ls-mist-a { stop-color: var(--ls-mist); stop-opacity: 0; }
.landscape .ls-mist-b { stop-color: var(--ls-mist); stop-opacity: 0.85; }
.landscape .ls-sun { fill: var(--ls-sun); opacity: 0.85; }
.landscape .ls-far { fill: var(--ls-far); }
.landscape .ls-near { fill: var(--ls-near); }
.landscape .ls-t0 { fill: var(--ls-t0); }
.landscape .ls-t1 { fill: var(--ls-t1); }
.landscape .ls-t2 { fill: var(--ls-t2); }
.landscape .ls-t3 { fill: var(--ls-t3); }
.landscape .ls-wall { stroke: var(--ls-wall); stroke-width: 1.6; }

.lead { font: 400 1.15rem/1.6 var(--font-text); color: var(--muted); max-width: 42rem; }
.site .eyebrow { color: var(--warn); }

.site-section { margin-top: 44px; display: grid; gap: 16px; }
.site-section > h2, .site-section > .row > h2 { font-size: 1.45rem; padding-left: 12px; border-left: 4px solid var(--gold); }

/* Thẻ bài viết */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.post-list { display: grid; gap: 14px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 16px 18px; display: grid; gap: 8px; align-content: start; }
.post-card h3 { font-size: 1.15rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 0.82rem; }
.post-meta a.badge { text-decoration: none; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.88rem; }
.chip span { color: var(--muted); font-size: 0.78rem; }
.chip:hover { border-color: var(--gold); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.on span { color: inherit; opacity: 0.8; }

.list-head { display: grid; gap: 8px; margin-bottom: 18px; }
.site-search { display: flex; gap: 10px; margin-bottom: 16px; max-width: 34rem; }
.site-search input { flex: 1 1 auto; }
.site-main .chips { margin-bottom: 20px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.topic-card { display: grid; gap: 6px; align-content: start; justify-items: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 12px; color: var(--ink); text-decoration: none; }
.topic-card:hover { border-color: var(--accent); border-top-color: var(--accent); }

.exam-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background: var(--gold-soft); border-color: var(--gold); }
.exam-cta h2 { margin-bottom: 4px; }

/* Bài viết */
.article, .prose-page { max-width: 46rem; display: grid; gap: 14px; }
.article h1, .prose-page h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.crumbs { font-size: 0.85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; font-size: 0.92rem; }
.toc ol { margin: 8px 0 0; padding-left: 1.2rem; display: grid; gap: 4px; }
.toc li.l3 { margin-left: 1rem; list-style: circle; }

.prose { font-family: var(--font-text); font-size: 1.08rem; line-height: 1.8; max-width: 46rem; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-text); margin-top: 1.8em; scroll-margin-top: 80px; }
.prose h2 { font-size: 1.5rem; padding-bottom: 6px; border-bottom: 2px solid var(--gold-soft); }
.prose h3 { font-size: 1.22rem; }
.prose ul, .prose ol { padding-left: 1.4rem; display: grid; gap: 4px; }
.prose li > ul, .prose li > ol { margin-top: 4px; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; background: var(--gold-soft); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0; font-size: 1rem; }
.prose blockquote > * + * { margin-top: 0.6em; }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--accent-soft); padding: 0.1em 0.4em; border-radius: 5px; }
.prose pre { overflow-x: auto; background: var(--side); color: var(--side-ink); padding: 14px 16px; border-radius: 10px; font-size: 0.88rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; }
.prose hr { border: 0; border-top: 2px solid var(--line); margin: 2em 0; }
.prose a { text-underline-offset: 3px; }
.prose .table-wrap { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-family: var(--font-ui); }
.prose table { font-size: 0.92rem; line-height: 1.5; }
.prose th { text-transform: none; letter-spacing: 0; font-size: 0.85rem; white-space: normal; background: var(--accent-soft); color: var(--ink); }
.prose .ta-c { text-align: center; }
.prose .ta-r { text-align: right; }

.site-empty { max-width: 34rem; margin: 40px auto; display: grid; gap: 14px; justify-items: start; }
.site-foot { margin-top: 64px; color: var(--muted); font-size: 0.88rem; background: var(--gold-soft); }

@media (max-width: 560px) {
  .site-search { flex-direction: column; }
}

/* ---------- Ảnh Mù Cang Chải và bố cục cân đối ---------- */
.hero2 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; padding-block: 18px 12px; }
.hero2-text { display: grid; gap: 16px; align-content: center; }
.hero2-text h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.hero2-text .row { margin-top: 6px; }
.hero2-photos { position: relative; margin: 0 0 44px; }
.hero2-photos img { display: block; height: auto; }
.ph-main { width: 100%; border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(60, 45, 10, 0.45); }
.ph-sub { position: absolute; left: -12%; bottom: -44px; width: 54%; border-radius: 14px; border: 5px solid var(--surface); box-shadow: 0 14px 30px -12px rgba(60, 45, 10, 0.55); }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 40px; }
.quick-card { display: grid; gap: 6px; align-content: start; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 12px; color: var(--ink); text-decoration: none; }
.quick-card strong { font: 600 1.12rem var(--font-text); }
.quick-card span { color: var(--muted); font-size: 0.92rem; }
.quick-card:hover { border-color: var(--accent); border-top-color: var(--accent); }

.course-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 40px; align-items: center; margin-bottom: 36px; }
.course-head > div { display: grid; gap: 14px; }
.course-photo { margin: 0; }
.course-photo img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 14px 32px -16px rgba(60, 45, 10, 0.5); }

.foot-art { height: 110px; overflow: hidden; }
.foot-art .landscape { height: 110px; }
.foot-text { padding-block: 18px 22px; }

/* Trang đăng nhập quản trị: nền ảnh ruộng bậc thang phủ mờ */
.login { max-width: none; margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(rgba(24, 34, 16, 0.38), rgba(24, 34, 16, 0.6)), url('/img/mcc-nen.webp') center / cover no-repeat; }
.login .card { width: 100%; max-width: 400px; box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.6); }

@media (max-width: 860px) {
  .hero2 { grid-template-columns: 1fr; gap: 28px; }
  .hero2-photos { margin: 0 0 48px 6%; max-width: 560px; }
  .ph-sub { left: -6%; width: 50%; bottom: -36px; }
  .quick { grid-template-columns: 1fr; margin-top: 28px; }
  .course-head { grid-template-columns: 1fr; gap: 24px; }
  .course-photo { max-width: 420px; }
}
@media (max-width: 560px) {
  .hero2-text .btn { flex: 1 1 100%; }
}

/* Menu Môn học (không dùng JavaScript) */
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; font-weight: 500; padding: 6px 12px; border-radius: 8px; color: var(--ink); user-select: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.nav-menu summary:hover, .nav-menu[open] summary, .nav-menu[data-active] summary { background: var(--accent-soft); }
.nav-menu[data-active] summary { color: var(--accent); }
.nav-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 190px; display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.45); }
.nav-pop a { white-space: nowrap; }
@media (max-width: 560px) { .nav-pop { left: auto; right: 0; } }
.hero2-text h1.lead-title { font: 600 clamp(1.7rem, 3.6vw, 2.5rem)/1.25 var(--font-display, var(--font-text)); margin: 0 0 22px; letter-spacing: -0.01em; }
.hero2-text .row { gap: 10px; }

/* Đầu trang chủ và trang môn học: khung mờ trên nền ảnh chạy */
.hero2 { grid-template-columns: 1fr; min-height: 52vh; align-content: center; }
.hero2-text, .course-head > div { max-width: 680px; padding: 32px 36px; background: rgba(255, 252, 242, 0.82); border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(6px); box-shadow: 0 18px 40px -22px rgba(60, 45, 10, 0.5); }
.course-head { grid-template-columns: 1fr; }
@media (prefers-color-scheme: dark) { .hero2-text, .course-head > div { background: rgba(28, 38, 22, 0.82); } }
@media (max-width: 720px) { .hero2 { min-height: 0; } .hero2-text, .course-head > div { padding: 22px 20px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-main > .banner:first-child { margin-top: -28px; }
.intro { margin-top: 28px; display: grid; gap: 12px; max-width: 760px; }
.intro-lead { margin-top: 20px; max-width: 760px; }
.quick { margin-top: 28px; }
