/* ===== โรงเรียนโนนสุวรรณพิทยาคม — สไตล์หน้าเว็บสาธารณะ ===== */
:root {
  --primary: #d7141a;
  --primary-dark: color-mix(in srgb, var(--primary) 82%, #000);
  --accent: #f5b800;
  --ink: #1d1d24;
  --text: #3a3a44;
  --muted: #6b6b78;
  --line: #ececf1;
  --bg: #ffffff;
  --bg-soft: #f7f7fa;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 20, 40, .07);
  --shadow-lg: 0 14px 40px rgba(20, 20, 40, .12);
  --head-font: 'Prompt', 'Sarabun', system-ui, sans-serif;
  --body-font: 'Sarabun', 'Prompt', system-ui, sans-serif;
  --tone-red-bg: #fdeeee;   --tone-red: #e0262c;
  --tone-yellow-bg: #fff7e0; --tone-yellow: #f2a900;
  --tone-blue-bg: #eaf3fd;  --tone-blue: #1f74d6;
  --tone-pink-bg: #fdecef;  --tone-pink: #e2334a;
  --tone-green-bg: #e9f8ef; --tone-green: #18a058;
  --tone-purple-bg: #f2edfd; --tone-purple: #7a4ce0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body-font); color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--head-font); color: var(--ink); line-height: 1.3; margin: 0 0 .5em; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
[data-lucide], svg.lucide { width: 1.1em; height: 1.1em; stroke-width: 2; flex: none; vertical-align: -0.15em; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; border: 0; cursor: pointer; font-family: var(--head-font); font-weight: 600; font-size: 1rem; padding: .62em 1.15em; border-radius: 10px; transition: .18s ease; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-lg { font-size: 1.12rem; padding: .8em 1.6em; border-radius: 999px; }
.btn-block { width: 100%; }

/* ---------- Admin bar ---------- */
.adminbar { background: #1d1d24; color: #ddd; font-size: .86rem; }
.adminbar-inner { display: flex; gap: 18px; align-items: center; min-height: 34px; flex-wrap: wrap; }
.adminbar a, .adminbar span { display: inline-flex; gap: 6px; align-items: center; }
.adminbar a:hover { color: #fff; }
.adminbar-user { margin-left: auto; opacity: .8; }

/* ---------- Header ---------- */
.site-header { background: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 var(--line), 0 4px 18px rgba(0,0,0,.04); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 100px; }
.brand { display: flex; align-items: center; gap: 16px; flex: none; }
.brand-logo { width: 86px; height: 86px; object-fit: contain; }
.brand-divider { width: 1px; height: 64px; background: #d9d9e0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--head-font); font-size: 1.55rem; font-weight: 700; color: var(--ink); }
.brand-en { font-family: var(--head-font); font-size: 1.05rem; color: #444; font-weight: 500; }
.brand-text small { color: var(--muted); font-size: .9rem; }
.main-nav { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.nav-list { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; flex: 0 1 auto; min-width: 0; }
/* เมนูยาวเกินจะย่อเป็น "…" — ชี้เมาส์แล้วแสดงเต็ม โดยเมนูข้างเคียงย่อแทน */
.nav-item { position: relative; flex: 0 1 auto; min-width: 2.6em; }
.nav-item.nav-short, .nav-item:hover, .nav-item:focus-within, .nav-item.open { flex-shrink: 0; }
.nav-link { display: flex; align-items: center; gap: 4px; max-width: 100%; font-family: var(--head-font); font-weight: 500; font-size: .95rem; white-space: nowrap; color: var(--ink); padding: 9px 11px; border-radius: 8px; position: relative; transition: background .15s, color .15s; }
.nav-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-link .chev { width: 15px; height: 15px; flex: none; transition: transform .2s; }
.search-box { flex: none; }
.nav-item.active > .nav-link { color: var(--primary); font-weight: 600; }
.nav-item.active:not(.has-sub) > .nav-link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -2px; height: 3px; border-radius: 3px; background: var(--primary); }
.nav-item.has-sub:hover > .nav-link, .nav-item.has-sub.open > .nav-link, .nav-item.highlight > .nav-link { background: var(--primary); color: #fff; }
.nav-item.has-sub:hover > .nav-link .chev, .nav-item.has-sub.open > .nav-link .chev { transform: rotate(180deg); }
.nav-item:not(.has-sub):not(.active) > .nav-link:hover { color: var(--primary); }
.dropdown { list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s ease; z-index: 60; }
.dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-item:hover > .dropdown, .nav-item.open > .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-size: .95rem; color: var(--ink); font-family: var(--head-font); }
.dropdown a:hover { background: var(--tone-red-bg); color: var(--primary); }
.dropdown [data-lucide], .dropdown svg { width: 18px; height: 18px; color: #333; }
.dropdown a:hover svg { color: var(--primary); }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; width: 170px; transition: width .2s; }
.search-box:focus-within { width: 220px; border-color: color-mix(in srgb, var(--primary) 50%, #fff); background: #fff; }
.search-box input { border: 0; outline: 0; background: transparent; font: inherit; width: 100%; color: var(--ink); }
.btn-login { border-radius: 10px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 24px; height: 24px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: #fbf6f2; }
.hero-track { position: relative; min-height: 430px; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; display: flex; align-items: center; }
.hero-slide.is-active { opacity: 1; position: relative; min-height: 430px; z-index: 1; }
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: center right; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.9) 28%, rgba(255,255,255,.35) 46%, rgba(255,255,255,0) 60%); }
.hero-content { position: relative; z-index: 2; padding: 48px 0 70px; }
.hero-text { max-width: 560px; }
.hero h1 { margin: 0 0 18px; font-weight: 800; letter-spacing: -.01em; }
.hero-title { display: block; color: var(--primary); font-size: clamp(2.4rem, 5.4vw, 4.4rem); line-height: 1.15; }
.hero-subtitle { position: relative; display: inline-block; color: var(--ink); font-size: clamp(1.8rem, 4.2vw, 3.4rem); line-height: 1.25; padding-bottom: 8px; }
.swoosh { position: absolute; right: 0; bottom: -8px; width: 52%; height: 18px; }
.swoosh path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.hero-text p { font-size: 1.12rem; color: #444; margin: 0 0 26px; max-width: 520px; }
.hero-dots { position: absolute; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; background: rgba(255,255,255,.85); padding: 6px 10px; border-radius: 999px; }
.hero-dots button { width: 12px; height: 12px; border-radius: 50%; border: 0; background: #c9c9d1; cursor: pointer; padding: 0; transition: .2s; }
.hero-dots button.is-active { background: var(--primary); }
.hero-curve { position: absolute; z-index: 2; pointer-events: none; }
.hero-curve-left { left: -60px; bottom: -70px; width: 260px; height: 110px; border-radius: 50%; background: var(--accent); transform: rotate(-8deg); }
.hero-curve-right { right: -90px; bottom: -40px; width: 300px; height: 200px; border-radius: 50%; border-top: 26px solid var(--primary); transform: rotate(-25deg); }

/* ---------- Quick links ---------- */
.quicklinks { padding: 30px 0 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.quick-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--tone-bg); border: 1px solid color-mix(in srgb, var(--tone) 12%, transparent); transition: .2s; }
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.quick-icon { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--tone); flex: none; box-shadow: 0 4px 12px color-mix(in srgb, var(--tone) 18%, transparent); }
.quick-icon svg { width: 32px; height: 32px; }
.quick-text { display: flex; flex-direction: column; min-width: 0; }
.quick-text strong { font-family: var(--head-font); font-size: 1.22rem; color: var(--ink); font-weight: 700; }
.quick-text small { color: #555; font-size: .86rem; line-height: 1.4; }
.quick-chev { margin-left: auto; color: var(--ink); }
.tone-red { --tone: var(--tone-red); --tone-bg: var(--tone-red-bg); }
.tone-yellow { --tone: var(--tone-yellow); --tone-bg: var(--tone-yellow-bg); }
.tone-blue { --tone: var(--tone-blue); --tone-bg: var(--tone-blue-bg); }
.tone-pink { --tone: var(--tone-pink); --tone-bg: var(--tone-pink-bg); }
.tone-green { --tone: var(--tone-green); --tone-bg: var(--tone-green-bg); }
.tone-purple { --tone: var(--tone-purple); --tone-bg: var(--tone-purple-bg); }

/* ---------- Sections / News ---------- */
.section { padding: 40px 0 56px; }
.section-alt { background: var(--bg-soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; margin: 0; padding-left: 20px; position: relative; }
.section-title::before { content: ""; position: absolute; left: 0; top: 12%; bottom: 12%; width: 7px; border-radius: 4px; background: var(--primary); }
.section-more { color: var(--primary); font-family: var(--head-font); font-weight: 600; font-size: 1.1rem; display: inline-flex; align-items: center; gap: 6px; }
.section-more:hover { gap: 10px; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card { display: grid; grid-template-columns: 48% 1fr; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.03); transition: .2s; position: relative; }
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.news-thumb { border-radius: 10px; overflow: hidden; aspect-ratio: 6 / 5; background: var(--bg-soft); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .news-thumb img { transform: scale(1.04); }
.thumb-empty { display: grid; place-items: center; height: 100%; color: #bbb; }
.news-body { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 4px 40px 0; min-width: 0; }
.badge { display: inline-block; font-family: var(--head-font); font-weight: 600; font-size: .82rem; padding: 3px 14px; border-radius: 999px; color: #fff; background: var(--primary); margin-bottom: 10px; }
.badge-red { background: var(--tone-red); }
.badge-blue { background: var(--tone-blue); }
.badge-yellow { background: #ffd34d; color: #3b2a00; }
.badge-green { background: var(--tone-green); }
.badge-purple { background: var(--tone-purple); }
.badge-gray { background: #8a8a96; }
.news-date { display: flex; align-items: center; gap: 8px; color: #555; font-size: .92rem; margin-bottom: 8px; }
.news-title { font-size: 1.1rem; font-weight: 500; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.news-title a:hover { color: var(--primary); }
.circle-arrow { position: absolute; right: 14px; bottom: 14px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tone-red-bg); color: var(--primary); transition: .2s; }
.news-card:hover .circle-arrow { background: var(--primary); color: #fff; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- Page banner / article ---------- */
.page-banner { background: linear-gradient(120deg, var(--tone-red-bg), #fff 60%, var(--tone-yellow-bg)); padding: 34px 0 30px; border-bottom: 1px solid var(--line); }
.page-banner h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 6px 0 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .92rem; color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs svg { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); font-family: var(--head-font); font-size: .95rem; background: #fff; }
.chip.is-active, .chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.pager a { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; }
.pager a.is-active, .pager a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.narrow { max-width: 900px; }
.article-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.article-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: .94rem; margin-bottom: 20px; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 24px; }
.prose { font-size: 1.08rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose img { border-radius: 10px; margin: 16px auto; height: auto; }
.prose a { color: var(--primary); text-decoration: underline; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose iframe { max-width: 100%; border: 0; border-radius: 10px; }
.prose iframe.ql-video { width: 100%; aspect-ratio: 16/9; height: auto; }
.prose blockquote { border-left: 4px solid var(--primary); margin: 1em 0; padding: .5em 1em; background: var(--bg-soft); border-radius: 0 10px 10px 0; }
.prose .ql-align-center { text-align: center; } .prose .ql-align-right { text-align: right; } .prose .ql-align-justify { text-align: justify; }
.prose table { border-collapse: collapse; width: 100%; } .prose td, .prose th { border: 1px solid var(--line); padding: 8px; }
.share { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; color: var(--muted); }
.share a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-soft); color: var(--ink); }
.share a:hover { background: var(--primary); color: #fff; }
.sidebar { position: sticky; top: 120px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.side-title { font-size: 1.15rem; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.side-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.side-item:last-child { border-bottom: 0; }
.side-item img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.side-item strong { display: block; font-weight: 600; font-size: .95rem; line-height: 1.4; }
.side-item small { color: var(--muted); }
.side-item:hover strong { color: var(--primary); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-family: var(--head-font); }
.side-nav a:hover, .side-nav a.is-active { background: var(--tone-red-bg); color: var(--primary); }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px 0; }
.contact-card { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--bg-soft); }
.contact-card > svg { width: 28px; height: 28px; color: var(--primary); }
.contact-card p { margin: 4px 0 0; }
.map { width: 100%; height: 380px; border: 0; border-radius: var(--radius); }
.search-big { display: flex; align-items: center; gap: 10px; margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 18px; max-width: 640px; }
.search-big input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 1.05rem; }
.search-big .btn { border-radius: 999px; }
.page-results { display: grid; gap: 10px; margin: 16px 0 26px; }
.page-result { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.page-result strong { display: block; }
.page-result small { color: var(--muted); }
.page-result:hover { border-color: var(--primary); }

/* ---------- Login / alerts ---------- */
.login-wrap { min-height: 60vh; display: grid; place-items: center; padding: 50px 16px; background: linear-gradient(160deg, var(--tone-red-bg), #fff 50%, var(--tone-yellow-bg)); }
.login-card { width: min(420px, 100%); background: #fff; padding: 34px; border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.login-logo { width: 84px; margin: 0 auto; }
.login-card h1 { text-align: center; margin: 0; font-size: 1.6rem; }
.login-card .muted { text-align: center; margin: 0 0 6px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.login-card input { font: inherit; padding: 11px 14px; border-radius: 10px; border: 1px solid #d8d8e0; }
.login-card input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
.error-code { font-family: var(--head-font); font-size: 4.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: .95rem; }
.alert-error { background: var(--tone-red-bg); color: #a3121a; }
.alert-warn { background: var(--tone-yellow-bg); color: #7a5600; margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer { background: #1f1f27; color: #c9c9d3; margin-top: 30px; position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--primary) 0 70%, var(--accent) 70%); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 48px 0 32px; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-logo { width: 72px; background: #fff; border-radius: 50%; padding: 6px; }
.site-footer strong { color: #fff; font-family: var(--head-font); font-size: 1.15rem; }
.site-footer h4 { color: #fff; font-size: 1.1rem; }
.site-footer .muted { color: #9a9aa6; }
.footer-contact, .footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-contact li, .footer-links a { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact svg { color: var(--accent); margin-top: 4px; }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #2c2c36; }
.socials a:hover { background: var(--primary); color: #fff; }
.footer-bottom { border-top: 1px solid #2f2f39; padding: 16px 0; font-size: .9rem; color: #9a9aa6; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .brand-text strong { font-size: 1.3rem; }
  .brand-logo { width: 70px; height: 70px; }
  .search-box { width: 130px; }
  .news-card { grid-template-columns: 1fr; }
  .news-thumb { aspect-ratio: 16 / 10; }
}
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 100px); overflow: auto; }
  .main-nav.open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-item { min-width: 0; }
  .nav-link { width: 100%; justify-content: space-between; padding: 12px; font-size: 1rem; white-space: normal; }
  .nav-text { overflow: visible; }
  .nav-item.active:not(.has-sub) > .nav-link::after { display: none; }
  .nav-item.active > .nav-link { background: var(--tone-red-bg); }
  .nav-item.has-sub:hover > .nav-link { background: none; color: var(--ink); }
  .nav-item.has-sub.open > .nav-link { background: var(--primary); color: #fff; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; display: none; padding: 4px 0 4px 12px; }
  .nav-item:hover > .dropdown { display: none; }
  .nav-item.open > .dropdown { display: block; }
  .search-box, .search-box:focus-within { width: 100%; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .header-inner { min-height: 76px; gap: 10px; }
  .brand { gap: 10px; min-width: 0; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-divider, .brand-text small { display: none; }
  .brand-text strong { font-size: 1.05rem; }
  .brand-en { font-size: .82rem; }
  .main-nav { max-height: calc(100vh - 76px); }
  .hero-track, .hero-slide.is-active { min-height: 520px; }
  .hero-slide { align-items: flex-end; }
  .hero-media { background-position: 70% center; }
  .hero-media::after { background: linear-gradient(0deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.92) 45%, rgba(255,255,255,0) 75%); }
  .hero-content { padding: 30px 0 64px; }
  .hero-text p { font-size: 1rem; }
  .quick-grid, .news-grid { grid-template-columns: 1fr; }
  .news-card { grid-template-columns: 42% 1fr; }
  .news-thumb { aspect-ratio: 1; }
  .news-title { font-size: 1rem; -webkit-line-clamp: 3; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section-more { font-size: 1rem; }
}

/* ---------- Gallery (Google Drive) ---------- */
.album-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.album-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.03); transition: .25s; }
.album-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.album-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-soft); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.album-card:hover .album-cover img { transform: scale(1.06); }
.album-cover::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.45)); pointer-events: none; }
.album-count { position: absolute; z-index: 1; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .85rem; font-weight: 600; backdrop-filter: blur(4px); }
.album-info { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.album-info strong { font-family: var(--head-font); font-weight: 600; color: var(--ink); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.album-card:hover .album-info strong { color: var(--primary); }
.album-info small { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.gallery-desc { font-size: 1.08rem; max-width: 820px; margin: 0 0 24px; }
.gallery-drive { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; }
.masonry { columns: 4 240px; column-gap: 14px; }
.masonry-item { position: relative; display: block; margin: 0 0 14px; break-inside: avoid; border-radius: 12px; overflow: hidden; background: var(--bg-soft); cursor: zoom-in; }
.masonry-item img { width: 100%; height: auto; transition: transform .5s ease, filter .3s; }
.masonry-item:hover img { transform: scale(1.04); filter: brightness(.88); }
.masonry-zoom { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); color: var(--ink); opacity: 0; transform: scale(.8); transition: .2s; }
.masonry-item:hover .masonry-zoom, .masonry-item:focus-visible .masonry-zoom { opacity: 1; transform: none; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(10,10,14,.94); display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
.lb.open { opacity: 1; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #ddd; font-size: .95rem; }
.lb-count { font-variant-numeric: tabular-nums; }
.lb-caption { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #aaa; }
.lb-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; transition: .15s; flex: none; }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 70px 20px; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); transition: opacity .2s; user-select: none; -webkit-user-drag: none; }
.lb-stage img { width: auto; height: auto; min-height: min(60vh, 100%); }
.lb-stage img.loading { filter: blur(2px); opacity: .85; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-thumbs { display: flex; gap: 6px; padding: 0 16px 14px; overflow-x: auto; scrollbar-width: thin; justify-content: safe center; }
.lb-thumbs button { flex: none; width: 64px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; opacity: .5; cursor: pointer; background: #222; }
.lb-thumbs button.on { border-color: var(--accent); opacity: 1; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
body.lb-lock { overflow: hidden; }

/* ---------- Facebook ---------- */
.fb-plugin-wrap { display: grid; grid-template-columns: minmax(0, 500px) 1fr; gap: 32px; align-items: center; }
.fb-plugin { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.fb-plugin iframe { display: block; width: 100%; height: 720px; border: 0; }
.fb-aside { padding: 32px; border-radius: 20px; background: linear-gradient(140deg, #eaf2fe, #fff 70%); border: 1px solid #dbe7fb; }
.fb-aside-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: #1877f2; color: #fff; margin-bottom: 16px; }
.fb-aside-icon svg { width: 34px; height: 34px; }
.fb-aside .btn-primary { background: #1877f2; box-shadow: 0 6px 16px rgba(24,119,242,.3); }
/* โพสต์ Facebook ในรูปแบบการ์ดข่าวของเว็บ */
.fb-news .news-thumb { position: relative; display: block; }
.fb-news .news-body { padding-bottom: 4px; }
.badge-fb { background: #1877f2; display: inline-flex; align-items: center; gap: 5px; }
.badge-fb svg { width: 13px; height: 13px; }
.fb-title { -webkit-line-clamp: 3; font-weight: 600; }
.fb-excerpt { margin: 6px 0 0; color: #555; font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-readmore { margin-top: auto; padding-top: 10px; color: var(--primary); font-family: var(--head-font); font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; gap: 4px; transition: gap .2s; }
.fb-readmore svg { width: 16px; height: 16px; }
.fb-news:hover .fb-readmore { gap: 8px; }
.fb-more-img { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; font-weight: 600; }
.fb-more-img svg { width: 14px; height: 14px; }
.fb-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52px !important; height: 52px !important; color: #fff; filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)); }
.fb-thumb-empty { background: #eaf2fe; color: #1877f2; }
.fb-thumb-empty svg { width: 40px; height: 40px; }
.fb-follow { text-align: center; margin-top: 28px; }
/* หน้าอ่านโพสต์ Facebook เต็ม */
.fb-photos { display: grid; gap: 6px; margin: 18px 0 22px; border-radius: var(--radius); overflow: hidden; }
.fb-photos .masonry-item { margin: 0; border-radius: 0; box-shadow: none; }
.fb-photos a { position: relative; display: block; overflow: hidden; background: var(--bg-soft); }
.fb-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.fb-photos a:hover img { transform: scale(1.03); }
.fb-photos-1 a { max-height: 640px; }
.fb-photos-1 img { object-fit: contain; max-height: 640px; }
.fb-photos-2 { grid-template-columns: 1fr 1fr; }
.fb-photos-2 a { aspect-ratio: 1; }
.fb-photos-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.fb-photos-3 a:first-child { grid-row: span 2; }
.fb-photos-4 { grid-template-columns: 1fr 1fr; }
.fb-photos-4 a { aspect-ratio: 4 / 3; }
.fb-photos em { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; font-style: normal; font-size: 2rem; font-weight: 700; font-family: var(--head-font); }
.fb-full-text { white-space: pre-line; }
.fb-post-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.fb-post-actions .hint { color: var(--muted); font-size: .92rem; }
.btn-fb { background: #1877f2; box-shadow: 0 6px 16px rgba(24,119,242,.3); }

@media (max-width: 1080px) {
  .album-grid { grid-template-columns: repeat(3, 1fr); }

  .fb-plugin-wrap { grid-template-columns: 1fr; }
  .fb-plugin { max-width: 500px; width: 100%; margin-inline: auto; }
  .fb-aside { order: -1; }
}
@media (max-width: 640px) {
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .album-info { padding: 10px 12px 12px; }
  .album-info strong { font-size: .95rem; }
  .masonry { columns: 2; column-gap: 8px; }
  .masonry-item { margin-bottom: 8px; border-radius: 8px; }

  .fb-plugin iframe { height: 600px; }
  .lb-stage { padding: 0 0 12px; }
  .lb-prev, .lb-next { display: none; }
  .lb-thumbs { display: none; }
}
