:root {
    --brown: #4A3728;
    --header-bg: #2C211A;
    --card-shadow: rgba(0,0,0,0.1);
    --gradient-bg: linear-gradient(135deg, #F0EAD6 0%, #E6E1D1 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    font-family: 'Kanit';
    text-decoration: none;
    transition: .2s linear;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
    overflow-x: hidden;
    filter: grayscale(50%);
}

/* Header */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4rem;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-container.scrolled {
    background-color: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.logo {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    margin: 0;
    padding: 0;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 0;
    position: static;
    transform: none;
    }

.navbar a {
    font-family: 'Kanit', sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    padding: 0 1.6rem;
    height: 72px;
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
    background: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    overflow: visible;
}

.navbar a::before {
    display: none;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.6rem;
    right: 1.6rem;
    height: 2px;
    background: #C17F47;
    border-radius: 1px 1px 0 0;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.navbar a:hover {
    color: rgba(255, 255, 255, 0.9);
    background: none;
    transform: none;
    box-shadow: none;
}

.navbar a:hover::after {
    transform: scaleX(1);
}

.navbar a.active {
    color: #ffffff;
    font-weight: 500;
    background: none;
}

.navbar a.active::after {
    transform: scaleX(1);
}

/* Hero Slider */
.slider {
    position: relative;
    width: 100%;
    height: 90vh;
    overflow: hidden;
    margin-top: 0;
    background-color: #1a1410;
}

.slider img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slider img.active {
    opacity: 1;
}

/* gradient overlay */
.slider::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(18,11,7,0.15) 0%,
        rgba(18,11,7,0.0) 40%,
        rgba(18,11,7,0.5) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Nav buttons */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.slider-nav:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.7);
    transform: translateY(-50%);
    box-shadow: none;
}

.slider-nav.prev { left: 1.5rem; }
.slider-nav.next { right: 1.5rem; }

/* Indicators */
.indicators {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.indicator {
    display: block;
    height: 2px;
    width: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}

.indicator.active {
    background: rgba(255,255,255,0.9);
    width: 36px;
}

/* Section Heading */
.section-heading {
    padding: 3.5rem 3rem 0;
    background: #F5F0E8;
    text-align: center;
}
.section-heading p {
    font-size: 1.1rem;
    color: rgba(74,55,40,0.4);
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}
.section-heading h2 {
    font-size: 1.8rem;
    font-weight: 500;
    color: #2C211A;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0;
}
.section-heading h2::before,
.section-heading h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: rgba(193,127,71,0.5);
    flex-shrink: 0;
}

/* Cards Section */
.cards-wrapper {
    background: #F5F0E8;
    padding: 1.5rem 3rem 3rem;
}
.cards-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.25rem 0 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cards-container::-webkit-scrollbar {
    display: none;
}
.card {
    flex: 0 0 280px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(74,55,40,0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    position: relative;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(44,33,26,0.1);
    border-color: rgba(193,127,71,0.3);
}
.card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.card:hover img {
    transform: scale(1.04);
}
.card-content {
    padding: 1.1rem 1.3rem 1.3rem;
}
.card h3 {
    font-size: 1.4rem;
    font-weight: 500;
    color: #2C211A;
    line-height: 1.5;
    margin-bottom: 0.4rem;
    transition: color 0.2s ease;
}
.card:hover h3 {
    color: #C17F47;
}
.card p {
    font-size: 1.2rem;
    color: rgba(74,55,40,0.45);
    font-weight: 300;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-bottom-line {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #C17F47, #2C211A);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.card:hover .card-bottom-line {
    transform: scaleX(1);
}
.scroll-btn {
    display: none;
}

/* YouTube Section */
.youtube-section {
    background: #F5F0E8;
    padding: 3rem;
    text-align: center;
    position: relative;
}
.youtube-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(193,127,71,0.35), transparent);
}
.youtube-section h3 {
    font-size: 1.6rem;
    font-weight: 500;
    color: #2C211A;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
}
.youtube-section h3::before,
.youtube-section h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: rgba(193,127,71,0.5);
    flex-shrink: 0;
}
.youtube-container iframe {
    width: 100%;
    max-width: 800px;
    height: 450px;
    border-radius: 6px;
    border: none;
    display: block;
    margin: 0 auto;
}

/* Calendar Section */
.calendar-section {
    background: #F5F0E8;
    padding: 3rem;
    text-align: center;
    position: relative;
}
.calendar-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(193,127,71,0.35), transparent);
}
.calendar-section h3 {
    font-size: 1.6rem;
    font-weight: 500;
    color: #2C211A;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    text-shadow: none;
}
.calendar-section h3::before,
.calendar-section h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: rgba(193,127,71,0.5);
    flex-shrink: 0;
}

/* ลบ ::after เดิมของ h3 */
.calendar-section h3::after {
    width: 50px;
    height: 2px;
    background: rgba(193,127,71,0.5);
    margin: 0;
    border-radius: 0;
}

.calendar-container iframe {
    width: 100%;
    max-width: 1000px;
    height: 650px;
    border-radius: 6px;
    border: none;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(44,33,26,0.08);
}

/* Footer */
footer {
    font-family: 'Kanit', sans-serif;
}

.footer-container {
    background: #2C211A;
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, transparent, rgba(193,127,71,0.5), transparent) 1;
    position: relative;
    overflow: hidden;
}

.footer-inner {
    padding: 2.5rem 3.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
}

.footer-col-title {
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    font-weight: 500;
    margin-bottom: 1.2rem;
}

.footer-logo {
    width: 160px;
    height: auto;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.footer-text {
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255,255,255,0.35);
    line-height: 1.8;
}

.footer-socials {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}

.footer-socials a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    transition: border-color 0.2s, background 0.2s;
}

.footer-socials a:hover {
    border-color: rgba(193,127,71,0.5);
    background: rgba(193,127,71,0.08);
}

.footer-socials img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.footer-socials a:hover img {
    opacity: 0.9;
}

.view-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1.2rem;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.3);
    font-weight: 300;
    border-top: none;
    padding-top: 0;
}

.view-counter i {
    color: #C17F47 !important;
    opacity: 0.7;
}

.view-counter span {
    color: #C17F47 !important;
    font-weight: 500;
    font-size: 1.3rem;
}

.footer-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.footer-nav-links a {
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.2s;
    letter-spacing: 0.02em;
}

.footer-nav-links a:last-child {
    border-bottom: none;
}

.footer-nav-links a:hover {
    color: rgba(255,255,255,0.8);
}

.footer-map {
    width: 100%;
    height: 200px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 0.75;
    transition: opacity 0.2s;
}

.footer-map:hover {
    opacity: 1;
}

.footer-map iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.footer-bottom {
    padding: 1rem 3.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 1.1rem;
    color: rgba(255,255,255,0.18);
    font-weight: 300;
    letter-spacing: 0.06em;
    text-align: center;
}

/* Desktop — ซ่อน hamburger */
.hamburger-menu {
    display: none;
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 2rem;
        height: 64px;
        background-color: var(--header-bg);
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .logo {
        height: 38px;
    }

    .navbar {
        position: absolute;
        top: 64px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 64px);
        background-color: var(--header-bg);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 2.5rem 3rem;
        gap: 0;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
        transform: none;
        position: fixed;
    }

    .navbar.active {
        left: 0;
    }

    .navbar a {
        font-size: 1.6rem;
        width: 100%;
        height: auto;
        padding: 1.4rem 0;
        color: rgba(255, 255, 255, 0.55);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        white-space: normal;
    }

    .navbar a::after {
        display: none;
    }

    .navbar a.active {
        color: #C17F47;
    }

    .hamburger-menu {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        background: transparent;
        border: none;
        padding: 6px;
        z-index: 1001;
    }

    .hamburger-menu .bar {
        display: block;
        height: 2px;
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 2px;
        transition: 0.3s ease;
    }

    .hamburger-menu .bar:nth-child(1) { width: 22px; }
    .hamburger-menu .bar:nth-child(2) { width: 22px; }
    .hamburger-menu .bar:nth-child(3) { width: 14px; }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
        width: 22px;
    }

    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
        width: 22px;
    }
     /* ── HERO SLIDER (หน้าแรก) ── */
    .slider {
        height: 60vh;
    }
    .slider-nav {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    .slider-nav.prev { left: 0.8rem; }
    .slider-nav.next { right: 0.8rem; }
    .indicator { width: 14px; }
    .indicator.active { width: 24px; }

    /* ── SECTION HEADING ── */
    .section-heading {
        padding: 2.5rem 2rem 0;
    }
    .section-heading h2 {
        font-size: 1.6rem;
    }
    .section-heading h2::before,
    .section-heading h2::after {
        width: 30px;
    }

    /* ── CARDS (หน้าแรก) ── */
    .cards-wrapper {
        padding: 1.2rem 1.5rem 2rem;
    }
    .card {
        flex: 0 0 200px;
    }
    .card img {
        height: 120px;
    }
    .card h3 { font-size: 1.3rem; }
    .card p { font-size: 1.1rem; }

    /* ── YOUTUBE ── */
    .youtube-section {
        padding: 2.5rem 1.5rem;
    }
    .youtube-section h3 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    .youtube-section h3::before,
    .youtube-section h3::after {
        width: 30px;
    }
    .youtube-container iframe {
        height: 220px;
    }

    /* ── CALENDAR ── */
    .calendar-section {
        padding: 2.5rem 1.5rem;
    }
    .calendar-section h3 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    .calendar-section h3::before,
    .calendar-section h3::after {
        width: 30px;
    }
    .calendar-container iframe {
        height: 400px;
    }

    /* ── PAGE TITLE (projects + activity-video) ── */
    .page-title,
    .page-header {
        height: 280px;
        padding-top: 64px;
    }
    .page-title h1,
    .page-header h1 {
        font-size: 2.8rem;
    }
    .page-title p,
    .page-header p {
        font-size: 1.2rem;
    }
    .page-title-accent {
        left: 1.5rem;
    }

    /* ── PROJECTS CARDS ── */
    .projects-section {
        padding: 2.5rem 0;
    }
    .quarter-section {
        padding: 2rem 1.5rem 0;
    }
    .quarter-header h2 {
        font-size: 1.5rem;
    }
    .project-card {
        flex: 0 0 180px;
    }
    .project-images {
        height: 120px;
    }
    .project-content h3 { font-size: 1.3rem; }
    .project-content p { font-size: 1.1rem; }
    .quarter-divider {
        margin: 0 1.5rem;
    }

    /* ── VIDEO CARDS ── */
    .video-gallery {
        padding: 2rem 1.5rem;
    }
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .video-thumbnail {
        height: 200px;
    }
    .play-button {
        width: 34px;
        height: 34px;
    }
    .video-title {
        font-size: 1.4rem;
    }
    .load-more-btn {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }

    /* ── MODAL ── */
    .modal-content {
        margin: 20% auto;
        width: 92%;
    }
    .modal-video {
        padding: 1.2rem;
    }
    .modal-video h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        padding: 0 1rem;
    }
    .modal-video iframe {
        height: 200px;
        border-radius: 4px;
    }

    /* ── FOOTER ── */
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        padding: 2rem;
    }
    .footer-map {
        display: none;
    }
    .footer-logo {
        width: 120px;
    }
    .footer-col-title {
        font-size: 0.9rem;
    }
    .footer-nav-links a {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }
    .footer-bottom {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}