/* ===== PR Website – ธีมฝั่งผู้เยี่ยมชม ===== */
:root { --primary: #1e3a8a; --accent: #f59e0b; }
body { font-family: 'Sarabun', sans-serif; background: #f5f7fb; color: #1f2937; }
h1, h2, h3, h4, h5, h6, .navbar, .btn, .badge, .section-title { font-family: 'Prompt', sans-serif; }
a { color: var(--primary); }

.topbar { background: #0f172a; color: #cbd5e1; }
.topbar a { color: #cbd5e1; text-decoration: none; }
.topbar a:hover { color: #fff; }

.main-nav { background: var(--primary); }
.main-nav .nav-link { font-weight: 500; }
.main-nav .nav-link.active, .main-nav .nav-link:hover { color: var(--accent) !important; }
.brand-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; font-size: 1.3rem; }
.brand-sub { font-size: .7rem; opacity: .75; font-weight: 400; }

/* แถบประกาศวิ่ง */
.ticker { background: #fff; border-bottom: 1px solid #e5e7eb; font-size: .95rem; }
.ticker-label { background: #dc2626; color: #fff; padding: .45rem .9rem; font-family: 'Prompt'; white-space: nowrap; }
.ticker-wrap { overflow: hidden; flex: 1; }
.ticker-move { display: inline-flex; gap: 3rem; white-space: nowrap; padding-left: 100%; animation: ticker 30s linear infinite; }
.ticker-move:hover { animation-play-state: paused; }
.ticker-move a { text-decoration: none; color: #111827; }
.ticker-move a::before { content: '●'; color: #dc2626; margin-right: .5rem; font-size: .6rem; vertical-align: middle; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* Hero / สไลด์ */
.hero-slide { height: 420px; background: linear-gradient(135deg, var(--primary), #0ea5e9); background-size: cover; background-position: center; position: relative; }
.hero-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,.1)); }
.hero-caption { position: absolute; z-index: 2; left: 0; right: 0; top: 50%; transform: translateY(-50%); color: #fff; }
.hero-caption h2 { font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 600; }
@media (max-width: 576px) { .hero-slide { height: 280px; } }

.section-title { font-weight: 600; position: relative; padding-left: 14px; margin-bottom: 1.25rem; }
.section-title::before { content: ''; position: absolute; left: 0; top: 10%; bottom: 10%; width: 5px; border-radius: 3px; background: var(--accent); }

/* การ์ดข่าว */
.news-card { border: 0; border-radius: 14px; overflow: hidden; transition: transform .2s, box-shadow .2s; height: 100%; }
.news-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15,23,42,.12); }
.news-card .card-img-top { height: 200px; width: 100%; }
.news-card .card-title a { color: #111827; text-decoration: none; }
.news-card .card-title a:hover { color: var(--primary); }
.object-fit-cover { object-fit: cover; }
.placeholder-cover { display: grid; place-items: center; font-size: 3rem; color: rgba(255,255,255,.8);
  background: linear-gradient(135deg, var(--c, #1e3a8a), color-mix(in srgb, var(--c, #1e3a8a) 55%, #fff)); }
.badge-cat { font-weight: 500; }
.meta { font-size: .85rem; color: #6b7280; }

/* รายการประกาศ */
.announce-list .list-group-item { border-left: 4px solid transparent; }
.announce-list .list-group-item:hover { border-left-color: #dc2626; background: #fff7f7; }
.date-box { min-width: 58px; text-align: center; border-radius: 10px; background: var(--primary); color: #fff; padding: .3rem; font-family: 'Prompt'; line-height: 1.1; }
.date-box .d { font-size: 1.35rem; font-weight: 600; }
.date-box .m { font-size: .75rem; }

/* แกลเลอรี */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery-grid a { display: block; aspect-ratio: 4/3; overflow: hidden; border-radius: 10px; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-grid a:hover img { transform: scale(1.07); }

/* บริษัท */
.company-card { border: 0; border-radius: 14px; height: 100%; transition: box-shadow .2s; }
.company-card:hover { box-shadow: 0 10px 24px rgba(15,23,42,.1); }
.company-logo { width: 84px; height: 84px; border-radius: 16px; object-fit: contain; background: #fff; border: 1px solid #e5e7eb; }
.company-logo.ph { display: grid; place-items: center; font-size: 2rem; color: #fff; background: var(--primary); border: 0; font-family: 'Prompt'; }

.content-body img { max-width: 100%; height: auto; border-radius: 8px; }
.content-body iframe { max-width: 100%; }
.page-header { background: linear-gradient(135deg, var(--primary), #0ea5e9); color: #fff; padding: 2.5rem 0; margin-bottom: 2rem; }
.page-header .breadcrumb a, .page-header .breadcrumb-item.active, .page-header .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.85); }

.stat-box { background: #fff; border-radius: 14px; padding: 1.25rem; text-align: center; }
.stat-box .num { font-size: 2rem; font-weight: 600; color: var(--primary); font-family: 'Prompt'; }

.site-footer { background: #0f172a; color: #e2e8f0; }
.site-footer a { color: #cbd5e1; text-decoration: none; line-height: 2; }
.site-footer a:hover { color: var(--accent); }

.back-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent);
  color: #111; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: .3s; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.back-top.show { opacity: 1; pointer-events: auto; }

/* เอกสารแนบ PDF / Word */
.doc-icon { width: 52px; height: 58px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.doc-icon span { font-size: .6rem; font-family: 'Prompt'; margin-top: 3px; letter-spacing: .5px; }
.doc-icon.pdf { background: #dc2626; }
.doc-icon.word { background: #2563eb; }

/* ===== เมนูย่อยเปิดเมื่อเอาเมาส์ชี้ (hover) — เฉพาะจอกว้าง ≥ 992px ===== */
@media (min-width: 992px) {
  .main-nav .dropdown-menu {
    display: block; top: 100%; margin-top: 0;
    opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    border: 0; border-radius: 12px; box-shadow: 0 14px 34px rgba(15,23,42,.18); padding: .5rem;
  }
  .main-nav .dropdown-menu-end { right: 0; left: auto; }
  /* สะพานล่องหน กันเมนูหายตอนเลื่อนเมาส์ผ่านช่องว่าง */
  .main-nav .dropdown-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
  .main-nav .dropdown:hover > .dropdown-menu,
  .main-nav .dropdown:focus-within > .dropdown-menu { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  .main-nav .dropdown:hover > .dropdown-toggle { color: var(--accent) !important; }
  .main-nav .dropdown-toggle::after { transition: transform .18s; }
  .main-nav .dropdown:hover > .dropdown-toggle::after { transform: rotate(180deg); }
  .main-nav .dropdown-item { border-radius: 8px; padding: .5rem .9rem; }
  .main-nav .dropdown-item:hover { background: #eef2ff; color: var(--primary); }
}
.doc-icon.excel { background: #16a34a; }
.doc-icon.ppt { background: #ea580c; }
.doc-icon.zip { background: #64748b; }
.doc-icon.drive { background: #0f9d58; }
.doc-icon.onedrive { background: #0078d4; }
.doc-icon.link { background: #7c3aed; }
.doc-icon span { letter-spacing: 0; font-size: .55rem; max-width: 50px; overflow: hidden; }
/* กับดักบอทในฟอร์ม (ซ่อนนอกจอ) */
.hp-field { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* เนื้อหาจากตัวแก้ไข (Quill / HTML) */
.content-body table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.content-body table:not([class]) td, .content-body table:not([class]) th { border: 1px solid #dee2e6; padding: .5rem .75rem; }
.content-body table:not([class]) th { background: #f1f5f9; }
.content-body .ql-align-center { text-align: center; } .content-body .ql-align-right { text-align: right; } .content-body .ql-align-justify { text-align: justify; }
.content-body iframe.ql-video { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 8px; }
.content-body video { max-width: 100%; border-radius: 8px; }
