@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

:root {
    --brand-primary: #1D233F; /* Royal Blue */
    --brand-secondary: #191E3E; /* Royal Blue2 */
    --brand-accent: #B2946D; /* Gold */
    --brand-bg: #ffffff;
}

/* ===============================
   Base
=============================== */
/* ===== เส้นกริดพื้นหลังจางๆ (เหมือนหน้าสมุด) ===== */
body, .bg-paper {
    background-color: var(--brand-bg);
    background-image:
            linear-gradient(to right, rgba(29, 35, 65, 0.08) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(29, 35, 65, 0.08) 1px, transparent 1px);
    background-size: 30px 30px; /* ปรับขนาดช่องกริด */
    color: #333;
    font-family: 'Kanit', sans-serif;
    letter-spacing: 0.2px;
}

/* ===============================
   Navbar (B)
=============================== */
.navbar {
    border-bottom: 2px solid var(--brand-accent);
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(29, 35, 65, 0.05);
}

.navbar { position: sticky; top: 0; z-index: 1050; }
.navbar .collapse.show { z-index: 1050; }

.navbar-brand {
    color: #FFFFFF !important;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.navbar .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    transition: color 0.2s ease, border-color 0.2s;
    padding: 0.75rem 1rem;
    border-bottom: 3px solid transparent;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {

    border-bottom: 3px solid var(--brand-accent);
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(29, 35, 65, 0.12);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(255, 180, 96, 0.15);
    color: var(--brand-primary);
}

/* ===============================
   Buttons
=============================== */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    font-weight: 500;
}
.btn-primary:hover {
    background-color: #121733;
    border-color: #121733;
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    font-weight: 500;
}
.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    color: #fff;
}

/* ===============================
   Hero Section
=============================== */
.hero {
    /*background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);*/
    background-color: var(--brand-primary);
    background-image:
            linear-gradient(to right, rgba(25, 30, 62, 1) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(25, 30, 62, 1) 1px, transparent 1px);
    background-size: 40px 40px; /* ปรับขนาดช่องกริด */
    color: #fff;
}
.hero h1,
.hero .lead {
    color: #fff;
}
.hero .btn-light {
    color: var(--brand-primary);
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
    font-weight: 600;
}
.hero .btn-light:hover {
    background-color: #e5a24f;
    border-color: #e5a24f;
}
.hero .btn-outline-light {
    color: var(--brand-accent);
    border-color: var(--brand-accent);
}
.hero .btn-outline-light:hover {
    background-color: var(--brand-accent);
    color: var(--brand-primary);
}

/* แอนิเมชันเส้นทองค่อย ๆ ขยายจากซ้ายไปขวา */
.headline-underline {
    display: inline-block;
    position: relative;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.headline-underline::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 5px;
    background-color: var(--brand-accent);
    border-radius: 2px;
    animation: underlineGrow 1.2s ease-out forwards;
}

/* Keyframes: เส้นค่อย ๆ ขยายจากซ้าย → ขวา */
@keyframes underlineGrow {
    0% {
        width: 0%;
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

.gold {
    color: var(--brand-accent) !important;
}

/* ===============================
   Section Title
=============================== */
.section-title {
    border-left: 6px solid var(--brand-accent);
    padding-left: 12px;
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ===============================
   Cards (A)
=============================== */
.card {
    border: none;
    box-shadow: 0 3px 10px rgba(29, 35, 65, 0.10);
    border-radius: 10px;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(29, 35, 65, 0.18);
}

/* --- บริการยอดนิยม --- */
.service-card {
    border: 1px solid rgba(29, 35, 65, 0.06);
    border-radius: 14px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
    background: #fff;
}
.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(29, 35, 65, 0.12);
    border-color: rgba(29, 35, 65, 0.12);
}
/* ===== เส้นทองหัวข้อการ์ด “บริการยอดนิยม” ===== */
.service-card .service-title {
    position: relative;
    display: inline-block;
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: .5rem;
}

/* สถานะเริ่มต้น — เส้นยังไม่โผล่ */
.service-card .service-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0%;
    height: 3px;
    background: var(--brand-accent);
    border-radius: 2px;
    transition: width 0.35s ease-in-out; /* เวลาและความนุ่มของแอนิเมชัน */
}

/* ตอน hover — เส้นทองขยายเต็มคำ */
.service-card:hover .service-title::after {
    width: 100%;
}
.service-icon {
    width: 52px; height: 52px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--brand-primary);
    border: 2px solid var(--brand-accent);
    margin-bottom: .75rem;
}
.service-link {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--brand-primary);
    font-weight: 500;
    text-decoration: none;
}
.service-link:hover { color: var(--brand-accent); }
.service-link svg { transition: transform .18s ease; }
.service-link:hover svg { transform: translateX(3px); }
.service-card ul {
    padding-left: 1.1rem; margin-bottom: .25rem;
}
.service-card li { margin-bottom: .25rem; }
.service-badge {
    background: rgba(255, 180, 96, .18);
    color: var(--brand-primary);
    border: 1px solid var(--brand-accent);
    border-radius: 999px;
    padding: .15rem .6rem;
    font-size: .8rem;
    font-weight: 600;
}

/* ===============================
   หน้า “สินค้าและบริการ” (D)
=============================== */
.service-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(29, 35, 65, 0.08);
    margin-bottom: 2rem;
}
.service-section h3 {
    color: var(--brand-primary);
    font-weight: 600;
    border-left: 5px solid var(--brand-accent);
    padding-left: 10px;
    margin-bottom: 1rem;
}
.service-section ul {
    padding-left: 1.2rem;
    list-style-type: disc;
}
.service-section li {
    margin-bottom: 0.35rem;
}

/* ===============================
   Footer (C)
=============================== */
footer {
    background-color: #f9fbff;
    border-top: 6px solid var(--brand-accent);
    padding: 2rem 0;
}
footer h5,
footer h6 {
    color: var(--brand-primary);
    font-weight: 600;
}
footer a {
    color: var(--brand-primary);
    text-decoration: none;
}
footer a:hover {
    color: var(--brand-accent);
}
.footer-contact p {
    margin-bottom: .3rem;
}
.footer-social a {
    display: inline-flex;
    width: 32px; height: 32px;
    align-items: center; justify-content: center;
    border-radius: 50%;
    background-color: var(--brand-primary);
    color: #fff;
    margin-right: 8px;
    transition: background-color .2s;
}
.footer-social a:hover {
    background-color: var(--brand-accent);
}

/* ===============================
   Misc
=============================== */
a {
    color: var(--brand-primary);
    text-decoration: none;
}
a:hover {
    color: var(--brand-accent);
}
.object-fit-cover {
    object-fit: cover;
}
.contact-info p i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

/* Lightbox (Portfolio) */
.portfolio-thumb { cursor: zoom-in; }

#lightboxModal .modal-content.bg-dark { background-color: #000; }
#lightboxModal .modal-title {
    color: #fff;
    display: inline-block;
    border-bottom: 3px solid var(--brand-accent);
    padding-bottom: .25rem;
}
#lightboxModal .modal-body img {
    max-height: 80vh;
    object-fit: contain;
    background: #000;
}
#lightboxPrev, #lightboxNext {
    border-color: rgba(255,255,255,0.6);
}
#lightboxPrev:hover, #lightboxNext:hover {
    background-color: var(--brand-accent);
    color: var(--brand-primary);
    border-color: var(--brand-accent);
}
/* Lightbox Counter + Caption */
#lightboxCounter {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
}

#lightboxModal .modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

#lightboxCaption {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

/* Lightbox: fade-in/out & spinner */
#lightboxModal .modal-body { background:#000; min-height: 40vh; }
#lightboxImage {
    max-height: 80vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity .35s ease;
    will-change: opacity;
}
#lightboxImage.is-visible { opacity: 1; }

/* ตัวหมุนโหลด */
#lightboxSpinner {
    position:absolute; inset:0;
    display:none; align-items:center; justify-content:center;
}
#lightboxSpinner.active { display:flex; }

/* ปรับ offset เวลาคลิกลิงก์ anchor (กันหัวข้อถูก navbar บัง) */
.service-section {
    scroll-margin-top: 100px; /* ปรับตามความสูง navbar ของคุณ */
}

/* Home: ผลงานที่ผ่านมา (Preview) */
.portfolio-preview .portfolio-overlay {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity .2s ease;
}
.portfolio-preview:hover .portfolio-overlay { opacity: 1; }


/* สำหรับ Desktop ให้ไม่แสดง */
@media (min-width: 992px) {
    .navbar-nav .nav-link::before {
        content: "";
    }
}

/* ====== Mobile slide-in menu (Royal Blue) ====== */
@media (max-width: 991.98px) {
    :root { --nav-height: 56px; }

    /* แผงเมนู (ปกติ + show) */
    .navbar .collapse {
        position: fixed;
        top: var(--nav-height);
        right: 0;
        width: 80%;
        height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        background: var(--brand-primary); /* 🔵 Royal Blue */
        color: #fff;
        transform: translateX(100%);
        transition: transform .3s ease;
        box-shadow: -8px 0 24px rgba(0,0,0,.25);
        padding: 16px 18px;
        z-index: 1051;
        border-left: 2px solid var(--brand-accent);
    }
    .navbar .collapse.show {
        transform: translateX(0);
    }

    /* ตอนกำลัง collapse (กันกระพริบ) */
    .navbar .collapsing {
        position: fixed !important;
        top: var(--nav-height);
        right: 0;
        width: 80%;
        height: calc(100vh - var(--nav-height)) !important;
        overflow-y: auto;
        background: var(--brand-primary);
        color: #fff;
        transform: translateX(100%);
        transition: none !important;
        box-shadow: -8px 0 24px rgba(0,0,0,.25);
        padding: 16px 18px;
        z-index: 1051;
        border-left: 2px solid var(--brand-accent);
    }

    /* ลิงก์ในเมนูมือถือ */
    .navbar .nav-link {
        display: block;
        padding: 10px 8px;
        color: #fff !important;
        font-size: 1.05rem;
        font-weight: 500;
        border-radius: 6px;
        transition: background-color .2s ease, color .2s ease;
    }

    /* hover + active */
    .navbar .nav-link:hover,
    .navbar .nav-link.active {
        background-color: var(--brand-accent);
        color: var(--brand-primary) !important;
    }

    /* ลูกศรนำหน้า */
    .navbar-nav .nav-link::before {
        content: "> ";
        color: var(--brand-accent);
        font-weight: 600;
    }

    /* ฉากหลังมืด */
    #navOverlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
        z-index: 1050;
    }
    #navOverlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Navbar สูงสุด */
.navbar { position: sticky; top: 0; z-index: 1052; }