/* ===== BASE ===== */
* { box-sizing: border-box; }
body {
    font-family: 'Roboto', 'Noto Sans Thai', sans-serif;
    color: #54595F;
    background: #fff;
    font-size: 17px;
    margin: 0; padding: 0;
}

/* ===== SPINNER ===== */
#spinner {
    opacity: 0; visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}
#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible; opacity: 1;
}

/* ============================================================
   HEADER
   Desktop layout:
   ┌──────────┬──────────────────────────────────────────────┐
   │          │  Title text (one line)                       │
   │  LOGO    ├──────────────────────────────────────────────┤
   │          │  nav1 │ nav2 │ nav3 │ nav4 │ nav5 │ nav6 │ 7│
   └──────────┴──────────────────────────────────────────────┘
   ============================================================ */

#site-header {
    background: #fff;
    z-index: 1050;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Outer flex row — centered */
.sh-desktop {
    align-items: stretch;
    background: #fff;
    justify-content: center;
    max-width: 1320px;
    margin: 0 auto;
}

/* Logo column */
.sh-logo-col {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    flex-shrink: 0;
    text-decoration: none;
}
.sh-logo {
    height: 90px;
    width: auto;
    display: block;
}

/* Right column — two rows stacked */
.sh-right-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 10px 0 0;
}

/* Title row */
.sh-title-row {
    font-size: 18px;
    font-weight: 700;
    color: #1C2335;
    padding: 0 0 10px 6px;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* Nav row */
.sh-nav-row {
    display: flex;
    align-items: center;
    padding: 4px 0 4px 2px;
    gap: 0;
    border-top: 1px solid #e8e8e8;
}
.hn-link {
    font-size: 15px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    padding: 8px 14px;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    border-bottom: 2px solid transparent;
    line-height: 1;
    border-radius: 4px 4px 0 0;
}
.hn-link:hover  { color: #3FB1B9; background: #f5fbfc; }
.hn-link.active { color: #1C2335; font-weight: 700; border-bottom-color: #1C2335; background: transparent; }

/* Mobile */
.sh-mobile {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.sh-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #1C2335 !important;
    border-radius: 6px;
    padding: 6px 12px;
    background: #fff;
    color: #1C2335;
}
.sh-menu-btn:focus { box-shadow: none !important; }
.sh-menu-btn .sh-menu-icon-open,
.sh-menu-btn .sh-menu-icon-close { font-size: 16px; }
.sh-menu-label { font-size: 13px; font-weight: 600; letter-spacing: 0.03em; }
.sh-mobile .hn-link {
    font-size: 15px;
    padding: 8px 4px;
    border-bottom: none;
    display: block;
}

/* ===== HERO ===== */
/* Push jumbo below sticky header */
#hero-section {
    margin-top: 16px;
}
#hero-section img.hero-img {
    width: 100%;
    display: block;
    height: auto;
}

.hero-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    line-height: 1.7;
    margin: 0;
}

/* Sub-page hero — gradient bg, white text */
#sub-hero {
    margin-top: 16px;
    background: linear-gradient(180deg, #3FB1B9 0%, #D3FFF6 100%);
    padding: 48px 0;
}
#sub-hero h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.45);
}

/* ===== SECTIONS ===== */
.section-pad { padding: 44px 0; }

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ddd;
}
.section-content {
    font-size: 17px;
    line-height: 1.9;
    color: #555;
}

/* ===== GRADIENT SECTION (ข้อมูลโครงการ) ===== */
.section-gradient {
    background: linear-gradient(180deg, #1C2335 0%, #2E3D5C 100%);
}

/* ===== FIXED PARALLAX BG SECTION ===== */
.section-fixed-bg {
    position: relative;
    height: 300px;
    background-image: url('/img/project_pic_05.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}
.fixed-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
/* disable fixed attachment on mobile (causes bugs) */
@media (max-width: 1024px) {
    .section-fixed-bg { background-attachment: scroll; }
}

/* ===== CIRCLE IMAGE ===== */
.circle-img-wrap {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    padding: 13px;
    background: conic-gradient(from 315deg, #f5eaac, #C1AA63, #8B6914, #4e3a0e, #8B6914, #C1AA63, #f5eaac);
    box-shadow: 0 0 0 8px #333B48, 0 6px 24px rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.circle-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* ===== PAGE CARDS ===== */
.page-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.25s;
    height: 100%;
}
.page-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.page-card > img { width: 100%; height: 170px; object-fit: cover; display: block; }
.page-card-body { padding: 14px; }
.page-card-body h3 { font-size: 17px; font-weight: 700; color: #222; margin-bottom: 6px; }
.page-card-body p  { font-size: 15px; color: #666; margin-bottom: 10px; line-height: 1.6; }

/* ===== NEWS CARDS ===== */
.news-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    transition: box-shadow 0.25s;
}
.news-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.news-card > a > img,
.news-card > img { width: 100%; height: 190px; object-fit: cover; display: block; }
.news-card > a { display: block; overflow: hidden; }
.news-card > a > img { transition: transform 0.3s ease; }
.news-card > a:hover > img { transform: scale(1.04); }
.news-card-body { padding: 14px; }
.news-card-body h4 { font-size: 16px; font-weight: 600; color: #333; line-height: 1.6; margin-bottom: 10px; }

/* ===== NEWS DETAIL CONTENT ===== */
.news-content { line-height: 1.9; font-size: 17px; color: #444; }
.news-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    margin: 20px 0;
    cursor: zoom-in;
    border: none;
    box-shadow: none;
    max-width: 100%;
}
.news-content p { margin-bottom: 1.2em; }
.news-content h3, .news-content h4 { margin-top: 1.5em; margin-bottom: .6em; color: #1C2335; }

/* ===== BUTTONS ===== */
.btn-read-more {
    display: inline-block;
    background: #2C3456;
    color: #fff;
    padding: 6px 20px;
    border-radius: 10px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #2C3456;
    transition: background 0.2s, color 0.2s;
}
.btn-read-more:hover { background: #fff; color: #2C3456; }

/* ===== PAGINATION ===== */
.pagination .page-link { color: #2C3456; border-color: #fff; background: #fff; }
.pagination .page-item.active .page-link { background: #2C3456; border-color: #2C3456; color: #fff; }

/* ===== FOOTER LOGOS ===== */
#footer-logos {
    background: #fff;
    padding: 32px 0 12px;
    border-top: 1px solid #e0e0e0;
}
#footer-logos .logo-item { text-align: center; padding: 8px; }
#footer-logos .logo-item img { max-height: 60px; max-width: 110px; object-fit: contain; margin-bottom: 5px; }
#footer-logos .logo-item p  { font-size: 11px; color: #555; margin: 0; line-height: 1.4; }

/* ===== COPYRIGHT ===== */
#footer-copy { background: #3a3a3a; color: #ccc; text-align: center; padding: 12px; font-size: 13px; }

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed; display: none;
    right: 24px; bottom: 24px; z-index: 99;
    background: #3FB1B9; border-radius: 50%;
    width: 40px; height: 40px;
    color: #fff; font-size: 17px;
    text-decoration: none; text-align: center; line-height: 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background 0.2s;
}
.back-to-top:hover { background: #2d9aa1; color: #fff; }

/* ===== CONTENT PAGES ===== */
.content-section h2 {
    font-size: 20px; font-weight: 700; color: #222;
    border-left: 4px solid #3FB1B9;
    padding-left: 10px; margin: 24px 0 10px;
}
.content-section p { font-size: 17px; line-height: 1.9; color: #444; text-indent: 2em; }
.content-section img {
    border-radius: 4px;
    border: 8px solid #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    max-width: 85%;
    display: block;
    margin: 0 auto;
}

.info-box {
    background: #f0fbfc; border: 1px solid #b2e4e8;
    border-radius: 6px; padding: 14px 16px; margin-bottom: 12px; height: 100%;
}
.info-box h3 { font-size: 16px; font-weight: 700; color: #2d9aa1; margin-bottom: 4px; }
.info-box p  { font-size: 15px; color: #555; margin: 0; line-height: 1.7; text-indent: 0; }

/* ===== DASHBOARD STAT CARDS ===== */
.dash-stat-card {
    background: #f4f6f9;
    border-radius: 10px;
    padding: 20px 16px 18px;
    text-align: center;
    border-top: 3px solid #a89550;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    height: 100%;
}
.dash-stat-icon { font-size: 20px; color: #a89550; margin-bottom: 10px; }
.dash-stat-value { font-size: 34px; font-weight: 700; color: #2c3550; line-height: 1; letter-spacing: -0.5px; }
.dash-stat-unit  { font-size: 13px; color: #a89550; margin-top: 4px; font-weight: 500; }
.dash-stat-label { font-size: 12px; color: #888; margin-top: 8px; letter-spacing: 0.03em; }

/* ===== CONTACT ===== */
.contact-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 20px; }
.contact-card-logo { width: 90px; height: 90px; object-fit: contain; border-radius: 4px; background: #f8f8f8; padding: 6px; border: 1px solid #e8e8e8; }
.contact-card-name { font-size: 16px; font-weight: 700; color: #222; margin-bottom: 8px; line-height: 1.5; }
.contact-card p  { font-size: 15px; color: #555; margin: 2px 0; line-height: 1.6; }

/* ===== MEDIA CARDS ===== */
.media-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 4px; overflow: hidden; text-align: center; height: 100%; transition: box-shadow 0.25s; }
.media-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.media-card > img { width: 100%; height: 155px; object-fit: cover; display: block; }
.media-card-body { padding: 12px; }
.media-file-list { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; }
.media-file-list li { border-top: 1px solid #eee; padding: 10px 0; }
.media-file-list li:first-child { border-top: 1px solid #eee; }
.media-file-list a { font-size: 15px; font-weight: 600; color: #444; text-decoration: none; display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.media-file-list a:hover { color: #1C2335; }
.media-file-list i { color: #c0392b; font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.media-file-list i.fa-circle-play { color: #1C2335; }
.media-card-body h4 { font-size: 16px; font-weight: 700; color: #222; margin-bottom: 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1399px) {
    .sh-title-row { font-size: 17px; }
    .hn-link      { padding: 5px 10px; font-size: 16px; }
}
@media (max-width: 1199px) {
    .sh-title-row { font-size: 14px; }
    .hn-link      { padding: 5px 7px; font-size: 14px; }
}

/* Tablet & mobile */
@media (max-width: 991px) {
    #hero-section img.hero-img { height: 260px; }
    #sub-hero img.hero-img     { height: auto; }
    .hero-title { font-size: 14px; }
    .circle-img-wrap { width: 200px; height: 200px; }
}

@media (max-width: 767px) {
    #hero-section img.hero-img { height: 200px; }
    #sub-hero img.hero-img     { height: auto; }
    .section-pad { padding: 28px 0; }
    .section-title { font-size: 17px; }
    .hero-title { font-size: 13px; }
    .circle-img-wrap { width: 160px; height: 160px; }
    .sub-hero-overlay h1 { font-size: 17px; }
}

@media (max-width: 575px) {
    #hero-section img.hero-img { height: 160px; }
    #sub-hero img.hero-img     { height: auto; }
    .section-pad { padding: 20px 0; }
    .page-card > img  { height: 140px; }
    .news-card > img  { height: 160px; }
    .media-card > img { height: 130px; }
}
