/* ============================================
   EKAS - Main Stylesheet
   ============================================ */

/* ฟอนต์ Prompt และ Sarabun จะโหลดผ่าน <link> tag ใน HTML */

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #1e3a5f;
    --primary-dark: #0f2744;
    --primary-light: #2d5a8e;
    --primary-glow: rgba(30, 58, 95, 0.3);

    /* Accent Colors */
    --accent: #4f8cdb;
    --accent-light: #6ba3e8;
    --accent-dark: #3a75c4;

    /* Secondary */
    --secondary: #f0c040;
    --secondary-dark: #d4a520;

    /* Neutral */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Typography */
    --font-primary: 'Prompt', sans-serif;
    --font-secondary: 'Sarabun', sans-serif;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px rgba(79, 140, 219, 0.2);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Container */
    --container-max: 1280px;
    --container-padding: 1.5rem;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-secondary);
    color: var(--gray-700);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-top: 80px;
    /* เพิ่มพื้นที่ชดเชยสำหรับแถบเมนูที่คงที่ */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-800);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: calc(var(--container-max) - var(--container-padding) * 2);
    margin: 0 auto;
    padding: 0;
    /* Padding is handled by the parent sections or margin */
}

@media (max-width: 1280px) {
    .container {
        padding: 0 var(--container-padding);
        max-width: 100%;
    }
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: calc(var(--container-max) - var(--container-padding) * 2);
    z-index: 1100;
    /* ให้มี z-index สูงกว่าส่วนอื่นๆ */
    transition: all var(--transition-normal);
}

/* Top bar */
.top-bar {
    background: var(--primary-dark);
    padding: 0.5rem 0;
    font-size: 0.85rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.top-bar-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.top-bar-links a:hover {
    color: var(--white);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-right a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.top-bar-right a:hover {
    color: var(--white);
}

/* Main Nav */
.main-nav {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0;
    /* ย้าย position fixed ไปไว้ที่ .site-header แทน */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-normal);
    border-radius: var(--radius-lg);
}

/* เมื่อมีการเลื่อนหน้า */
.main-nav.is-sticky {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--secondary);
    /* ไม่เปลี่ยนพื้นหลังหรือขนาด เพื่อความสม่ำเสมอ */
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    padding: 0.5rem 1.5rem;
    /* เพิ่ม padding เล็กน้อยเพื่อให้ดูเหมาะสม */
}

/* ลบการลดขนาดออกเพื่อให้แสดงผลคงที่ */
.main-nav.is-sticky .container {
    min-height: 56px;
}

.main-nav.is-sticky .nav-menu>li>a {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.main-nav.is-sticky .nav-logo img {
    height: auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    flex-shrink: 0;
}

.nav-logo img {
    height: 100%;
    width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
    z-index: 2;
}

.logo-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.logo-wrapper.no-image img {
    display: none;
}

.logo-wrapper.no-image .logo-fallback {
    display: flex;
}

.nav-logo span {
    color: var(--white);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-menu>li {
    position: relative;
}

.nav-menu>li>a {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.25rem;
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-menu>li>a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 70%;
    height: 3px;
    background: var(--secondary);
    border-radius: 3px 3px 0 0;
    transition: transform var(--transition-normal);
}

.nav-menu>li:hover>a,
.nav-menu>li.active>a {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu>li:hover>a::after,
.nav-menu>li.active>a::after {
    transform: translateX(-50%) scaleX(1);
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: all var(--transition-normal);
}

/* ปุ่มเข้าสู่ระบบหลังบ้าน */
.nav-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--primary-dark) !important;
    border-radius: var(--radius-xl);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 10px rgba(240, 192, 64, 0.3);
    white-space: nowrap;
}

.nav-admin-btn:hover {
    background: linear-gradient(135deg, #ffe066, var(--secondary));
    color: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(240, 192, 64, 0.5);
}

.nav-admin-btn i {
    font-size: 0.8rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #d614cf 100%);
    min-height: 350px;
    padding: 2rem 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    max-width: calc(var(--container-max) - var(--container-padding) * 2);
    margin: 0 auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   PAGE BANNER & CONTENT LAYOUT
   ============================================ */
.page-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 4rem 1.5rem;
    text-align: center;
    color: var(--white);
    max-width: calc(var(--container-max) - var(--container-padding) * 2);
    margin: 1.5rem auto 0;
    /* Add top margin for spacing from header */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.page-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--white);
    font-family: var(--font-primary);
    font-weight: 700;
}

.page-banner .breadcrumb {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.page-banner .breadcrumb a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition-fast);
}

.page-banner .breadcrumb a:hover {
    color: var(--secondary);
}

.page-content {
    padding: 4rem 0;
    background: var(--white);
    max-width: var(--container-max);
    margin: 0 auto;
}


.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="30" r="1.5" fill="rgba(255,255,255,0.05)"/><circle cx="80" cy="20" r="2" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="70" r="1" fill="rgba(255,255,255,0.04)"/></svg>');
    background-size: 100px 100px;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    padding: 2rem 0;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-text h1 {
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 0.85rem 2rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(240, 192, 64, 0.4);
}

.hero-btn:hover {
    background: var(--secondary-dark);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 192, 64, 0.5);
}

.hero-image {
    flex: 0 0 380px;
    position: relative;
}

.hero-image img {
    width: 100%;
    height: auto;
    animation: heroFloat 4s ease-in-out infinite;
}

@keyframes heroFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Decorative circles */
.hero-section .deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.hero-section .deco-circle-1 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -100px;
}

.hero-section .deco-circle-2 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: 10%;
}

.hero-section .deco-circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: -50px;
}

/* ============================================
   SLIDER SECTION
   ============================================ */
.slider-section {
    padding: 3rem 0;
    background: var(--white);
}

.slider-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slider-slide {
    min-width: 100%;
    position: relative;
}

.slider-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: #f8fafc;
}

.slider-slide .slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--white);
}

.slider-slide .slider-overlay h3 {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.slider-slide .slider-overlay p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
    transition: all var(--transition-normal);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.slider-btn:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn-prev {
    left: 1rem;
}

.slider-btn-next {
    right: 1rem;
}

.slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.slider-dot.active {
    background: var(--white);
    width: 32px;
    border-radius: 12px;
}

/* ============================================
   NEWS SECTION
   ============================================ */
.news-section {
    padding: 4rem 0;
    background: var(--gray-50);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header .section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-xl);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--gray-500);
    font-size: 1rem;
}

.section-header .section-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    margin: 1rem auto 0;
    border-radius: 4px;
}

/* News Tabs */
.news-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.news-tab {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all var(--transition-normal);
}

.news-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.news-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-image .news-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--accent);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.news-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-date {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.news-card-title {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-title a {
    color: inherit;
}

.news-card-title a:hover {
    color: var(--accent);
}

.news-card-excerpt {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-100);
}

.news-card-footer a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.news-card-footer a:hover {
    gap: 0.6rem;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-xl);
    font-family: var(--font-primary);
    font-weight: 500;
    transition: all var(--transition-normal);
}

.view-all-btn:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */
.projects-section {
    padding: 4rem 0;
    background: var(--white);
}

.project-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.project-header h2 {
    font-size: 1.8rem;
    color: var(--primary);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.project-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    opacity: 0.85;
    /* ลดความทึบลงเล็กน้อย */
    transition: opacity var(--transition-normal);
    z-index: 1;
}

.project-card:nth-child(1)::before {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
}

.project-card:nth-child(2)::before {
    background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
}

.project-card:nth-child(3)::before {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.project-card:nth-child(4)::before {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.project-card:nth-child(5)::before {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.project-card:nth-child(6)::before {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
}

.project-card img {
    position: absolute;
    top: 45%;
    /* ขยับขึ้นเล็กน้อยเพื่อให้มีพื้นที่สำหรับข้อความด้านล่าง */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    object-fit: contain;
    transition: transform var(--transition-normal);
}

.project-card:hover img {
    transform: translate(-50%, -50%) scale(1.05);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-card:hover::before {
    opacity: 0.8;
}

.project-card-body {
    position: relative;
    z-index: 2;
    padding: 1.25rem;
    width: 100%;
}

.project-card-body h4 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0a1929 100%);
    color: rgba(255, 255, 255, 0.8);
    padding-top: 3rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.footer-brand .logo-wrapper {
    width: 90px;
    height: 90px;
}

.footer-brand img {
    object-fit: contain;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.footer-brand .logo-fallback {
    background: #fff;
    color: var(--primary);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.footer-brand-info h3 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.footer-brand-info p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
}

.footer-column h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-contact-item i {
    color: var(--accent-light);
    margin-top: 3px;
    font-size: 0.9rem;
}

.footer-contact-item span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.footer-social a:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-image {
        flex: 0 0 280px;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu>li>a {
        padding: 0.75rem 1.5rem;
    }

    .nav-admin-btn span {
        display: none;
    }

    .nav-admin-btn {
        padding: 0.5rem 0.7rem;
    }

    .hero-text h1 {
        font-size: 1.5rem;
    }

    .hero-image {
        flex: 0 0 200px;
    }

    .slider-slide img {
        height: 250px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-main {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 1.3rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Placeholder image backgrounds
   ============================================ */
.placeholder-img {
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
    display: flex;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-image {
        flex: 0 0 280px;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu>li>a {
        padding: 0.75rem 1.5rem;
    }

    .nav-admin-btn span {
        display: none;
    }

    .nav-admin-btn {
        padding: 0.5rem 0.7rem;
    }

    .site-header {
        max-width: calc(100% - var(--container-padding) * 2);
    }

    .main-nav {
        border-radius: var(--radius-md);
    }

    .hero-section {
        min-height: auto;
        padding: 1.5rem 0;
        margin-left: var(--container-padding);
        margin-right: var(--container-padding);
        border-radius: var(--radius-md);
    }

    .hero-text h1 {
        font-size: 1.5rem;
    }

    .hero-image {
        flex: 0 0 200px;
    }

    .slider-slide img {
        height: 250px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-main {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 1.3rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Placeholder image backgrounds
   ============================================ */
.placeholder-img {
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 2rem;
}


/* Visitor Counter Style - อยู่ที่มุมซ้ายล่างของหน้าเว็บ ไม่เลื่อนตาม */
.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-family: 'Prompt', sans-serif;
    margin: 20px;
    z-index: 99;
    transition: all 0.3s ease;
}

.visitor-counter:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.1);
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.counter-divider {
    width: 1px;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
}

.visitor-counter i {
    color: #3b82f6;
    font-size: 1.1rem;
}

.visitor-counter span.label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.visitor-counter span.count {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 700;
    background: #eff6ff;
    padding: 2px 10px;
    border-radius: 20px;
    color: #3b82f6;
}

@media (max-width: 768px) {
    .visitor-counter {
        bottom: 10px;
        left: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        border-radius: 15px;
        padding: 10px 15px;
    }

    .counter-divider {
        display: none;
    }
}