/**
 * public.css — เว็บสาธารณะ
 * โทนสีฟ้า + ชมพู (ไม่พาสเทล) แยก section ไม่ผสม gradient
 */
:root {
    --blue: #1E88C9;
    --blue-light: #E3F2FA;
    --blue-dark: #1565A0;
    --blue-deep: #0F4C75;
    --pink: #D9417A;
    --pink-light: #FAE8F0;
    --pink-dark: #B02860;
    --ink: #1A2332;
    --muted: #5C6B7A;
    --bg: #F3F7FA;
    --white: #fff;
    --border: #D4DEE8;
    --shadow: 0 12px 36px rgba(15, 76, 117, 0.1);
    --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: "Segoe UI", "Sarabun", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--blue-dark); }

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--blue-light);
    box-shadow: 0 4px 20px rgba(15, 76, 117, 0.06);
}

.navbar { padding: 0.7rem 0; }

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    max-width: 430px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}

.navbar-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 8px 20px rgba(30, 136, 201, 0.3);
}

.navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink) !important;
    border-radius: 10px;
    padding: 0.5rem 0.75rem !important;
    transition: background 0.15s, color 0.15s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: var(--blue-light);
    color: var(--blue-dark) !important;
}

.btn-admin {
    background: var(--blue-dark);
    color: #fff;
    font-weight: 700;
    border: 0;
    border-radius: 12px;
    padding: 0.55rem 1rem;
    box-shadow: 0 6px 18px rgba(21, 101, 160, 0.25);
}

.btn-admin:hover {
    background: var(--blue-deep);
    color: #fff;
}

/* ── Hero ── */
.home-hero {
    padding: 2rem 0 2.5rem;
    background: var(--blue-light);
}

.home-hero-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 2rem;
    padding: clamp(1.5rem, 3vw, 2.75rem);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.hero-kicker::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pink);
}

.home-hero h1 {
    margin: 0;
    max-width: 620px;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--blue-deep);
    letter-spacing: -0.02em;
}

.home-hero h1 span {
    color: var(--pink-dark);
}

.home-hero p {
    max-width: 560px;
    margin: 0.9rem 0 1.3rem;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.65;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.home-hero-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.hero-btn-primary {
    background: var(--blue-dark);
    color: #fff;
    border: 1px solid var(--blue-dark);
}

.hero-btn-primary:hover { background: var(--blue-deep); color: #fff; }

.hero-btn-secondary {
    background: var(--white);
    color: var(--pink-dark);
    border: 1.5px solid var(--pink);
}

.hero-btn-secondary:hover {
    background: var(--pink-light);
    color: var(--pink-dark);
}

.home-hero-visual {
    position: relative;
    min-height: 260px;
    display: grid;
    place-items: center;
}

.hero-main-icon {
    position: relative;
    z-index: 2;
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    border-radius: 32px;
    background: var(--blue);
    color: #fff;
    font-size: 2.8rem;
    box-shadow: 0 16px 40px rgba(30, 136, 201, 0.35);
}

.hero-orbit {
    position: absolute;
    border: 1px dashed rgba(21, 101, 160, 0.25);
    border-radius: 50%;
}

.hero-orbit-one { width: 210px; height: 210px; }
.hero-orbit-two { width: 270px; height: 270px; border-color: rgba(217, 65, 122, 0.2); }

.hero-float-card {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(15, 76, 117, 0.1);
}

.hero-float-card i { font-size: 0.95rem; }
.hero-float-card-a { top: 20px; right: 0; color: var(--pink-dark); }
.hero-float-card-b { left: 0; bottom: 35px; color: var(--blue-dark); }
.hero-float-card-c { right: 0; bottom: 10px; color: var(--blue); }

/* ── Sections (แยกฟ้า / ชมพู) ── */
.section { padding: 3.5rem 0; }

.section-blue { background: var(--blue-light); }
.section-pink { background: var(--pink-light); }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.section-heading h1,
.section-heading h2 {
    margin: 0.35rem 0 0;
    font-size: clamp(1.4rem, 2.4vw, 1.95rem);
    font-weight: 800;
    line-height: 1.3;
    color: var(--ink);
}

.section-heading > a {
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--blue-dark);
    white-space: nowrap;
}

.section-blue .section-heading > a { color: var(--blue-dark); }
.section-pink .section-heading > a { color: var(--pink-dark); }

.eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pink-dark);
}

.section-blue .eyebrow { color: var(--blue-dark); }
.section-pink .eyebrow { color: var(--pink-dark); }

/* ── Cards ── */
.content-card,
.person-card,
.document-card,
.info-panel,
.contact-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.content-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 44px rgba(15, 76, 117, 0.14);
}

.content-card > img,
.card-placeholder {
    width: 100%;
    height: 210px;
    object-fit: cover;
}

.card-placeholder {
    display: grid;
    place-items: center;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-size: 2.5rem;
}

.section-blue .card-placeholder,
.section-pink .card-placeholder {
    background: var(--white);
}

.section-blue .card-placeholder { color: var(--blue-dark); }
.section-pink .card-placeholder { color: var(--pink-dark); }

.card-body { padding: 1.25rem; }

.card-body h2,
.card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
}

.card-body h2 a,
.card-body h3 a {
    text-decoration: none;
    color: var(--ink);
}

.card-body p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0;
}

.meta {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pink-dark);
    margin-bottom: 0.4rem;
}

.section-blue .meta { color: var(--blue-dark); }

/* ── Innovation tabs ── */
.innovation-tabs .nav-link {
    background: var(--white) !important;
    color: var(--ink) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    margin: 0.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.55rem 0.95rem !important;
}

.innovation-tabs .nav-link.active {
    background: var(--pink) !important;
    border-color: var(--pink) !important;
    color: #fff !important;
}

/* ── Gallery ── */
.gallery-card {
    display: block;
    position: relative;
    height: 240px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gallery-card img,
.gallery-card .card-placeholder {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.gallery-card span {
    position: absolute;
    inset: auto 0 0;
    padding: 2.5rem 1rem 0.85rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    background: linear-gradient(transparent, rgba(26, 35, 50, 0.85));
}

/* ── Page / Detail hero ── */
.page-hero {
    padding: 3.5rem 0;
    background: var(--blue-light);
    text-align: center;
}

.detail-hero {
    padding: 3.5rem 0;
    background: var(--pink-light);
    text-align: left;
}

.page-hero .eyebrow { color: var(--blue-dark); }
.detail-hero .eyebrow,
.detail-hero .meta { color: var(--pink-dark); }

.page-hero h1,
.detail-hero h1 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    max-width: 900px;
    margin: 0.5rem auto;
}

.page-hero p,
.detail-hero .lead {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 720px;
    margin: 0.5rem auto;
}

.back-link {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.page-hero .back-link { color: var(--blue-dark); }
.detail-hero .back-link { color: var(--pink-dark); }

/* ── Detail / misc ── */
.detail-container { max-width: 920px; }

.detail-cover {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.detail-content {
    font-size: 1rem;
    line-height: 1.75;
}

.detail-content img { max-width: 100%; }

.action-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
    background: var(--blue-light);
    border: 1px solid rgba(21, 101, 160, 0.15);
    border-radius: var(--radius);
}

.badge-soft {
    background: var(--pink-light);
    color: var(--pink-dark);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.doc-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 14px;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.document-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
}

.person-card { text-align: center; }
.person-card > img,
.person-placeholder {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.person-placeholder {
    display: grid;
    place-items: center;
    font-size: 5rem;
    background: var(--blue-light);
    color: var(--blue-dark);
}

.position { color: var(--pink-dark); font-weight: 600; font-size: 0.9rem; }

.stat-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.stat-link i { font-size: 1.75rem; color: var(--blue); }
.stat-link strong { font-size: 1.65rem; }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--white);
    border: 1px dashed rgba(21, 101, 160, 0.25);
    border-radius: var(--radius);
    color: var(--muted);
}

.section-blue .empty-state,
.section-pink .empty-state {
    background: rgba(255, 255, 255, 0.9);
}

.pastel-text { color: var(--blue-dark); }

/* ── Footer ── */
.site-footer {
    padding: 2.5rem 0 1rem;
    background: var(--blue-deep);
    color: #fff;
}

.site-footer a { color: #7DD3FC; }
.site-footer a:hover { color: #fff; }

.footer-social { text-decoration: none; }

/* ── Forms & buttons ── */
.form-control,
.form-select {
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    border-color: var(--border);
}

.btn {
    border-radius: 10px;
    font-weight: 700;
}

.btn-primary {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-deep);
    border-color: var(--blue-deep);
    color: #fff;
}

.btn-outline-primary {
    color: var(--blue-dark);
    border-color: var(--blue-dark);
}

.btn-outline-primary:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: #fff;
}

/* ── Carousel fallback ── */
.hero-carousel .carousel-item {
    height: min(520px, 55vw);
    min-height: 280px;
    background: var(--blue-light);
}

.carousel-caption h1 {
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    font-weight: 800;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .home-hero-shell {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .home-hero p { margin-left: auto; margin-right: auto; }
    .home-hero-actions { justify-content: center; }
    .section-heading { flex-direction: column; align-items: start; }
    .section { padding: 2.75rem 0; }
}

@media (max-width: 575.98px) {
    body { font-size: 14px; }

    .home-hero h1 { font-size: 1.5rem; }
    .home-hero-visual { min-height: 200px; }
    .hero-main-icon { width: 90px; height: 90px; font-size: 2.2rem; }
    .home-hero-actions .btn { width: 100%; justify-content: center; }
    .navbar-brand { max-width: 280px; font-size: 0.82rem; }
    .gallery-card { height: 200px; }
}
