/* ===================================================================
   เว็บ "วิทยาลัยพยาบาลคุณธรรม" (/moral/) — ธีมดอกบัวทอง บนเขียวเข้ม
   แยกจากเว็บหลัก (ใช้ฟอนต์ที่โฮสต์ในเว็บเดียวกัน) · สร้างหน้าด้วย scripts/build-moral.js
   =================================================================== */
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Regular.woff2') format('woff2');  font-weight: 400; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Medium.woff2') format('woff2');   font-weight: 500; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Bold.woff2') format('woff2');     font-weight: 700 900; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-Regular.woff2') format('woff2');  font-weight: 100 400; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-Medium.woff2') format('woff2');   font-weight: 500; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-Bold.woff2') format('woff2');     font-weight: 700 900; font-display: swap; }

:root {
  --g950: #082621; --g900: #0D3B35; --g800: #124A42; --g700: #1A5F54; --g100: #DCEBE8; --g050: #F0F6F5;
  --gold: #C59B27; --gold-l: #E7C566; --gold-d: #8A6A12; --gold-bg: #FBF3D8;
  --bg: #F8F5EC; --card: #FFFFFF; --ink: #16211F; --ink2: #3C4B48; --ink3: #66756F; --line: #E4DFCF;
  --shadow: 0 8px 28px rgba(8, 38, 33, 0.10); --shadow-s: 0 2px 8px rgba(8, 38, 33, 0.08);
  --r: 16px; --r-s: 10px;
  --font-d: 'Prompt', sans-serif; --font-b: 'Sarabun', sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0A1B18; --card: #112A26; --ink: #EAF2EF; --ink2: #BFD0CB; --ink3: #8EA39D; --line: #1F403A;
  --g050: #0F2420; --g100: #1B3C36; --gold-bg: #2A2410; --gold-d: #E7C566;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45); --shadow-s: 0 2px 8px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-b); font-size: 1.0625rem; line-height: 1.75; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--g700); }
:root[data-theme="dark"] a { color: var(--gold-l); }
h1, h2, h3 { font-family: var(--font-d); line-height: 1.35; color: var(--g900); margin: 0 0 0.5em; }
:root[data-theme="dark"] h1, :root[data-theme="dark"] h2, :root[data-theme="dark"] h3 { color: #F4EDD3; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(900px, 100% - 40px); }
.center { text-align: center; margin-top: 28px; }
.muted { color: var(--ink3); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold-l); color: #000; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- แถบบน ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(8, 38, 33, 0.96); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(231, 197, 102, 0.25); }
.topbar-in { width: min(1240px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff !important; min-width: 0; }
.brand img { border-radius: 50%; background: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-family: var(--font-d); font-size: 1.08rem; font-weight: 600; color: #FFF6D8; }
.brand-text small { font-size: 0.78rem; color: rgba(239, 227, 194, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mainnav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.mainnav a { font-family: var(--font-d); font-size: 0.95rem; font-weight: 500; color: #E9F0EE !important; text-decoration: none; padding: 8px 14px; border-radius: 999px; transition: background 0.15s; }
.mainnav a:hover { background: rgba(255, 255, 255, 0.1); }
.mainnav a[aria-current="page"] { background: rgba(231, 197, 102, 0.18); color: var(--gold-l) !important; }
.mainnav a.back { margin-left: 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(231, 197, 102, 0.55); color: var(--gold-l) !important; }
.mainnav a.back svg { width: 15px; height: 15px; }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: #fff; cursor: pointer; }
.menu-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- ฮีโร่ ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1100px 520px at 85% 10%, #1D6A5D 0%, rgba(29,106,93,0) 60%), linear-gradient(135deg, #0D3B35 0%, #082621 70%); }
.hero-bg { position: absolute; inset: 0; background: url('/moral/img/hero.jpg') center/cover; opacity: 0.16; mix-blend-mode: luminosity; }
.hero-in { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; align-items: center; padding: 72px 0 80px; }
.eyebrow { font-family: var(--font-d); color: var(--gold-l); letter-spacing: 0.02em; margin-bottom: 8px; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.4vw, 4rem); font-weight: 700; margin: 0 0 6px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.hero h1, :root[data-theme="dark"] .hero h1 { color: #fff; }
.hero-sub { font-family: var(--font-d); font-size: 1.2rem; color: #DDEBE8; margin-bottom: 22px; }
.motto { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 30px; }
.motto li { font-family: var(--font-d); font-weight: 600; color: #2B2000; background: linear-gradient(180deg, #F2D98B, #D9AE3D); padding: 8px 22px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: grid; place-items: center; }
.hero-art .lotus { width: min(380px, 80%); filter: drop-shadow(0 10px 36px rgba(231, 197, 102, 0.35)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .hero-art .lotus { animation: none; } html { scroll-behavior: auto; } }

.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-d); font-weight: 500; text-decoration: none; padding: 12px 24px; border-radius: 999px; border: 1px solid transparent; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); }
.btn.gold { background: linear-gradient(180deg, #F2D98B, #D9AE3D); color: #2B2000 !important; box-shadow: 0 6px 18px rgba(197, 155, 39, 0.4); }
.btn.ghost { color: #fff !important; border-color: rgba(255, 255, 255, 0.45); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn.teal { background: var(--g800); color: #fff !important; box-shadow: var(--shadow-s); }
:root[data-theme="dark"] .btn.teal { background: var(--gold); color: #1c1500 !important; }

/* ---------- แถบสถิติ ---------- */
.band { background: var(--g900); color: #fff; border-top: 3px solid var(--gold); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 28px 0; text-align: center; }
.stats strong { display: block; font-family: var(--font-d); font-size: 2.2rem; font-weight: 700; color: var(--gold-l); line-height: 1.2; }
.stats span { font-size: 0.95rem; color: #CFE0DC; }

/* ---------- ส่วนเนื้อหา ---------- */
.section { padding: 64px 0; }
.section.tinted { background: linear-gradient(180deg, var(--g050), transparent); }
.sec-head { text-align: center; margin-bottom: 36px; }
.kicker { font-family: var(--font-d); color: var(--gold-d); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 4px; }
.sec-head h2, .award-copy h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 10px; }
.rule { width: 72px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-l)); margin: 0 auto; }
.h-sub { font-size: 1.5rem; margin: 40px 0 18px; padding-left: 14px; border-left: 5px solid var(--gold); }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.value { display: flex; flex-direction: column; gap: 4px; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--vc, var(--gold)); border-radius: var(--r); padding: 28px 26px 22px; box-shadow: var(--shadow-s); color: var(--ink) !important; transition: transform 0.2s, box-shadow 0.2s; }
.value:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.value h3 { font-size: 1.5rem; margin: 6px 0 4px; }
.value p { color: var(--ink2); flex: 1; }
.value .more { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-d); font-weight: 500; color: var(--g700); }
:root[data-theme="dark"] .value .more { color: var(--gold-l); }
.value .more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.value-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--vc, var(--gold)); }
.value-ico svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.v1 { --vc: #2F7D5B; } .v2 { --vc: #B5812A; } .v3 { --vc: #C2503E; }

/* ---------- รางวัล ---------- */
.award { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: center; }
.award-imgs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }
.award-imgs.wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.award-imgs .frame:only-child { grid-column: 1 / -1; }
.frame { display: block; padding: 8px; background: linear-gradient(135deg, #F2D98B, #C59B27); border-radius: 12px; border: 0; cursor: zoom-in; box-shadow: var(--shadow); transition: transform 0.2s; }
.frame:hover { transform: translateY(-3px) rotate(-0.4deg); }
.frame img { width: 100%; border-radius: 6px; background: #fff; }

/* ---------- การ์ดกิจกรรม ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-s); display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 16/10; background: var(--g050); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img.none { display: grid; place-items: center; background: linear-gradient(135deg, #0D3B35, #082621); }
.card-img.none .lotus { width: 55%; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-date { font-family: var(--font-d); font-size: 0.85rem; color: var(--gold-d); font-weight: 500; margin-bottom: 4px; }
.card-body h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card-body p { color: var(--ink2); font-size: 0.98rem; margin-bottom: 10px; }
.card-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0 !important; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-d); font-size: 0.86rem; font-weight: 500; text-decoration: none; padding: 6px 14px; border-radius: 999px; background: var(--gold-bg); color: var(--gold-d) !important; border: 1px solid rgba(197, 155, 39, 0.4); transition: background 0.15s; }
.chip-link:hover { background: #F6E7B0; }
:root[data-theme="dark"] .chip-link:hover { background: #3a3114; }
.chip-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature { display: flex; align-items: center; gap: 18px; padding: 14px 22px; margin-bottom: 28px; background: var(--g900); color: #fff !important; text-decoration: none; border-radius: var(--r); border-left: 6px solid var(--gold); box-shadow: var(--shadow-s); }
.feature img { width: 120px; border-radius: 8px; flex: none; }
.feature span { display: flex; flex-direction: column; font-family: var(--font-d); }
.feature small { color: var(--gold-l); }
.feature svg { width: 18px; height: 18px; display: inline; fill: none; stroke: var(--gold-l); stroke-width: 2; margin-left: 8px; }

/* ---------- หน้าย่อย ---------- */
.page-hero { background: linear-gradient(135deg, #0D3B35, #082621); color: #fff; padding: 44px 0 40px; border-bottom: 3px solid var(--gold); position: relative; overflow: hidden; }
.page-hero::after { content: ''; position: absolute; right: -60px; top: -40px; width: 320px; height: 320px; background: radial-gradient(circle, rgba(231, 197, 102, 0.22), transparent 65%); }
.page-hero h1 { color: #fff !important; font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 6px 0 8px; position: relative; }
.page-hero .lead { color: #CFE0DC; max-width: 780px; font-size: 1.1rem; margin: 0; position: relative; }
.crumbs { font-size: 0.88rem; color: #B7CBC6; }
.crumbs a { color: var(--gold-l) !important; text-decoration: none; }
.crumbs span { margin: 0 6px; }

.pledge { text-align: center; padding: 32px 24px; border-radius: var(--r); background: linear-gradient(135deg, #0D3B35, #082621); color: #fff; box-shadow: var(--shadow); margin-bottom: 32px; }
.pledge .lotus { width: 110px; margin: 0 auto 6px; }
.pledge p { font-family: var(--font-d); font-size: clamp(1.3rem, 3vw, 1.9rem); color: var(--gold-l); font-weight: 600; margin: 0; }
.pledge small { color: #CFE0DC; }
.docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.doc { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 18px; box-shadow: var(--shadow-s); }
.doc-no { font-family: var(--font-d); font-weight: 700; color: var(--gold); font-size: 1.1rem; flex: none; }
.doc-ico svg { width: 26px; height: 26px; fill: none; stroke: var(--g700); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
:root[data-theme="dark"] .doc-ico svg { stroke: var(--gold-l); }
.doc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.doc-t small { color: var(--ink3); }

.intro-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 36px; }
.deeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.deed { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-s); }
.deed-img { display: block; width: 100%; padding: 0; border: 0; background: var(--g050); cursor: zoom-in; aspect-ratio: 1/1; overflow: hidden; }
.deed-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.deed:hover .deed-img img { transform: scale(1.05); }
.deed figcaption { padding: 12px 16px 16px; display: flex; flex-direction: column; line-height: 1.5; }
.deed figcaption strong { font-family: var(--font-d); font-weight: 600; color: var(--g900); }
:root[data-theme="dark"] .deed figcaption strong { color: #F4EDD3; }
.deed figcaption span { color: var(--ink2); font-size: 0.95rem; }

/* ---------- จิตอาสา ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.tab { flex: 1 1 220px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer; font: inherit; color: var(--ink); transition: border-color 0.15s, background 0.15s; }
.tab span { font-family: var(--font-d); font-weight: 600; }
.tab small { color: var(--ink3); }
.tab:hover { border-color: var(--gold); }
.tab[aria-selected="true"] { background: var(--g900); color: #fff; border-color: var(--g900); box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.55); }
.tab[aria-selected="true"] small { color: var(--gold-l); }
.day { margin-bottom: 30px; }
.day h3 { font-size: 1.12rem; display: flex; align-items: baseline; gap: 12px; padding: 10px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--r-s); margin-bottom: 14px; }
.day h3 small { margin-left: auto; font-family: var(--font-b); font-weight: 400; color: var(--ink3); font-size: 0.85rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.shot { padding: 0; border: 0; background: var(--g050); border-radius: 10px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4/3; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.shot:hover img { transform: scale(1.06); }

/* ---------- ท้ายเว็บ ---------- */
.footer { background: var(--g950); color: #CFE0DC; border-top: 3px solid var(--gold); margin-top: 20px; }
.footer-in { width: min(1160px, 100% - 40px); margin-inline: auto; display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 32px; padding: 44px 0 28px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand .lotus { width: 86px; flex: none; }
.footer-brand p { margin: 0; font-family: var(--font-d); color: var(--gold-l); line-height: 1.5; }
.footer address { font-style: normal; font-size: 0.96rem; line-height: 1.8; }
.footer a { color: var(--gold-l); }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.copy { text-align: center; font-size: 0.84rem; color: #8FA9A3; margin: 0; padding: 14px 0 22px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* ---------- ดูภาพขยาย ---------- */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(4, 16, 14, 0.94); display: grid; place-items: center; padding: 20px 64px; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lb img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; background: #000; }
.lb figcaption { color: #E9F0EE; font-size: 0.95rem; text-align: center; max-width: 80ch; }
.lb button { position: absolute; border: 0; cursor: pointer; background: rgba(255, 255, 255, 0.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1; display: grid; place-items: center; transition: background 0.15s; }
.lb button:hover { background: rgba(231, 197, 102, 0.5); }
.lb-x { top: 14px; right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- มือถือ ---------- */
@media (max-width: 920px) {
  .hero-in { grid-template-columns: 1fr; padding: 48px 0 56px; text-align: left; }
  .hero-art { order: -1; justify-content: flex-start; }
  .hero-art .lotus { width: 160px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .values { grid-template-columns: 1fr; }
  .award { grid-template-columns: 1fr; }
  .footer-in { grid-template-columns: 1fr; }
  .menu-btn { display: grid; place-items: center; }
  .mainnav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: #082621; padding: 12px 16px 18px; border-bottom: 3px solid var(--gold); }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 12px 14px; border-radius: 10px; }
  .mainnav a.back { margin: 8px 0 0; justify-content: center; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .section { padding: 44px 0; }
  .brand-text small { display: none; }
  .lb { padding: 16px 10px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
  .lb-prev { left: 20px; } .lb-next { right: 20px; }
  .cards { grid-template-columns: 1fr; }
  .feature { flex-direction: column; align-items: flex-start; }
  .doc { flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
