:root {
    --primary-color: #2E7D32;
    --accent-color: #81C784;
    --dark-neutral: #1B2E1E;
    --light-neutral: #F4F7F5;
    --border-color: #E2EAF0;
    --success-bg: #E8F5E9;
    --success-text: #2E7D32;
    --warning-bg: #FFF3E0;
    --warning-text: #E65100;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

body {
    background-color: #FAFCFA;
    color: var(--dark-neutral);
    line-height: 1.6;
}


body.lang-mode-th [data-en] {
    display: none !important;
}

body.lang-mode-en [data-th] {
    display: none !important;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.projects-hero-banner {
    background: linear-gradient(135deg, var(--dark-neutral) 0%, var(--primary-color) 100%);
    color: #FFFFFF;
    padding-top: 155px !important;
    padding-bottom: 85px !important;
    text-align: center;
    position: relative;
}

.projects-hero-banner .sub-badge {
    background-color: var(--accent-color);
    color: var(--dark-neutral);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 15px;
}

.projects-hero-banner h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.projects-hero-banner p {
    color: #E0E6E2;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

.projects-content-section {
    padding: 60px 0;
}

.projects-intro-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 55px;
    text-align: center;
    width: 100% !important;
}

.projects-intro-card h2 {
    font-size: 1.7rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.4;
}

.projects-intro-card p {
    font-size: 1.05rem;
    color: #4A5568;
    line-height: 1.85;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}


.table-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-neutral);
    margin-bottom: 25px;
    text-align: center;
}

.projects-table-responsive {
    width: 100%;
    overflow-x: auto;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.projects-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 1rem;
}

.projects-data-table th {
    background-color: var(--dark-neutral);
    color: #FFFFFF;
    padding: 18px 24px;
    font-weight: 600;
    font-size: 1.05rem;
}

.projects-data-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    color: #4A5568;
    vertical-align: middle;
    line-height: 1.65;
}

.projects-data-table tr:last-child td {
    border-bottom: none;
}

.projects-data-table tr:hover td {
    background-color: #FAFCFA;
}

.highlight-cell {
    font-weight: 600;
    color: var(--primary-color) !important;
    width: 25%;
}


.status-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.status-badge.success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.status-badge.warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.status-text {
    font-size: 0.95rem;
    color: #4A5568;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}


@media (max-width: 992px) {
    .projects-hero-banner h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .projects-hero-banner h1 {
        font-size: 1.8rem;
    }

    .highlight-cell {
        width: 100%;
        display: block;
        padding-bottom: 4px;
    }

    .projects-data-table td {
        display: block;
        width: 100%;
        padding: 12px 24px;
    }

    .projects-data-table th {
        display: none;
    }
    .projects-data-table tr {
        border-bottom: 2px solid var(--border-color);
        display: block;
        padding: 10px 0;
    }

    .status-badge {
        display: block;
        width: max-content;
        margin-bottom: 6px;
    }

    .status-text {
        display: block;
        margin-left: 0;
    }
}

.lang-switcher {
    font-size: 0.9rem;
    font-weight: 600;
    color: #A0AEC0;
}

.lang-btn {
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.2s;
}

body.lang-mode-th #lang-th-btn {
    color: #2E7D32 !important;
    text-decoration: underline;
}

body.lang-mode-en #lang-en-btn {
    color: #2E7D32 !important;
    text-decoration: underline;
}


.projects-continuous-row {
    display: flex;
    gap: 16px;
    margin: 35px 0 50px 0;
    padding-bottom: 15px;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.projects-continuous-row::-webkit-scrollbar {
    height: 6px;
}

.projects-continuous-row::-webkit-scrollbar-thumb {
    background: rgba(46, 125, 50, 0.3);
    border-radius: 10px;
}

.continuous-photo-item {
    flex: 0 0 calc(25% - 12px);
    min-width: 260px;
    scroll-snap-align: start;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f4f7f5;
}

.continuous-photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.continuous-photo-item:hover img {
    transform: scale(1.03);
}


.photo-minimal-label {
    padding: 12px 14px;
    background-color: #112d20;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}


@media (max-width: 991px) {
    .continuous-photo-item {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .continuous-photo-item {
        flex: 0 0 calc(85% - 8px);
    }
}

.continuous-photo-item img {
    cursor: zoom-in;
}


.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 26, 19, 0.92);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeInAnimation 0.25s ease-out;
}


.lightbox-displayed-img {
    max-width: 85%;
    max-height: 75%;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    animation: zoomInAnimation 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}


.lightbox-close-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #ffffff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: 0.2s;
}

.lightbox-close-btn:hover {
    color: #81C784;
    transform: scale(1.1);
}


.lightbox-caption-bar {
    margin-top: 20px;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: center;
    padding: 0 20px;
    letter-spacing: 0.3px;
}


@keyframes fadeInAnimation {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomInAnimation {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


@media (max-width: 768px) {
    .lightbox-displayed-img {
        max-width: 95%;
    }

    .lightbox-close-btn {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}


.projects-matrix-pagination-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.gallery-grid-card {
    width: 100%;
    animation: fadeInPage 0.4s ease-out;
}

.grid-photo-box {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(17, 45, 32, 0.05);
    background-color: #f4f7f5;
}

.grid-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}

.grid-photo-box:hover img {
    transform: scale(1.04);
}

.grid-photo-label {
    padding: 10px 12px;
    background-color: #112d20;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 500;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}


.gallery-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 45px 0 60px 0;
    padding-top: 20px;
    border-top: 1px solid rgba(17, 45, 32, 0.08);
}

.btn-pagination-arrow {
    width: 38px;
    height: 38px;
    border: 1px solid #E2E6E3;
    background-color: #ffffff;
    color: #112D20;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-pagination-arrow:hover:not(:disabled) {
    background-color: #2E7D32;
    color: #ffffff;
    border-color: #2E7D32;
}

.btn-pagination-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-numbers-box {
    display: flex;
    gap: 8px;
}

.page-number-btn {
    padding: 8px 14px;
    border: 1px solid #E2E6E3;
    background-color: #ffffff;
    color: #112D20;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-number-btn.active {
    background-color: #2E7D32;
    color: #ffffff;
    border-color: #2E7D32;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@media (max-width: 991px) {
    .projects-matrix-pagination-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-matrix-pagination-grid {
        grid-template-columns: 1fr;
    }

    .grid-photo-box {
        height: 200px;
    }
}


.gallery-grid-card {
    border-radius: 12px !important;
    overflow: hidden !important;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}


.grid-photo-box {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

.grid-photo-box img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}


.photo-text-bar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: rgba(0, 0, 0, 0.65) !important;
    color: #ffffff !important;
    padding: 10px 12px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    z-index: 2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-radius: 0 !important;
}


.photo-text-bar span {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
}

#lightboxCaptionText span {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    width: 100% !important;
}


#lightboxCaptionText {
    width: 100%;
    max-width: 650px;
    margin: 15px auto 0 auto;
    background: rgba(18, 18, 18, 0.85) !important;
    color: #ffffff !important;
    padding: 18px 24px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
}
/* ==========================================================================
   FIX GALLERY IMAGES HEIGHT & RATIO (บังคับรูปภาพทุกแถวให้สูงเท่ากันเป๊ะ 100%)
   ========================================================================== */
/* ⚡ ล็อกความสูงของการ์ดแกลเลอรีหลักบนคอมพิวเตอร์ ไม่ให้ขอบลอย */
.gallery-grid-card {
    width: 100% !important;
    height: 220px !important;    /* ล็อกความสูงการ์ดให้เท่ากันแถวหน้ากระดาน */
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* ล็อกความสูงของกล่องรูปภาพด้านในให้ขยายเต็มเฟรม */
.grid-photo-box {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

/* สั่งให้ตัวรูปภาพดั้งเดิมครอบตัดจัดสัดส่วน ไม่ให้ภาพบี้หรือเบี้ยว */
.grid-photo-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* ⚡ ครอบตัดตรงกลางภาพให้อัตโนมัติ สัดส่วนไม่เพี้ยน */
}

/* ==========================================================================
   📱 MOBILE STYLES (แยกปรับสัดส่วนความสูงบนจอมือถือ < 768px ให้สมดุล)
   ========================================================================== */
@media (max-width: 768px) {
    .gallery-grid-card {
        height: 190px !important; /* ปรับลดความสูงลงเล็กน้อยเพื่อให้เข้ากับจอโทรศัพท์มือถือ */
    }
}
