/* =========================================
   Theme Information
   ========================================= */
/*
Theme Name: OBT Official Theme Modern
Theme URI: https://example.go.th
Author: IT Team
Description: ธีม WordPress สำหรับองค์การบริหารส่วนตำบล (อบต.) ดีไซน์ทันสมัย รองรับมาตรฐาน ITA, E-Service และการประชาสัมพันธ์
Version: 2.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0f766e;        
    --primary-dark: #115e59;            
    --secondary-color: #f59e0b;      
    --accent-color: #3b82f6;            
    
    /* ---------------------------------------------------------
       เปลี่ยนสีพื้นหลังเว็บไซต์ตรงนี้ (เช่น #f0f9ff ฟ้าอ่อน หรือ #f8fafc เทาอ่อน)
       --------------------------------------------------------- */
    --bg-light: #f0f9ff; 
    
    --card-bg: #ffffff;                 
    --text-color: #1e293b;              
    --text-muted: #64748b;              
    --border-color: #e2e8f0;            
    
    --primary-gradient: linear-gradient(135deg, #0f766e, #14b8a6, #0d9488, #115e59);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- บังคับเปลี่ยนสีพื้นหลังโครงสร้างหลักทั้งหมดแบบเด็ดขาด --- */
html, 
body, 
#page, 
.site, 
.site-content, 
.content-area, 
main, 
article, 
.site-main {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light) !important;
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* --- กำหนดค่าอนิเมชันพื้นฐานทั่วทั้งเว็บไซต์ --- */
* {
    transition: background-color var(--transition-normal), 
                color var(--transition-normal), 
                border-color var(--transition-normal), 
                box-shadow var(--transition-normal),
                transform var(--transition-fast);
}

/* แอนิเมชันเปิดหน้าจอ (Fade In Up สำหรับทุกหน้า) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-transition, 
body > * {
    animation: fadeInUp var(--transition-slow) forwards;
}

.card, 
.card-bg {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.card:hover, 
.card-bg:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.animated-green-gradient {
    background: var(--primary-gradient);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.glow-ball {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    animation: pulse-glow 5s infinite ease-in-out alternate;
}

.glow-ball-1 {
    top: -120px;
    left: -120px;
    width: 500px;
    height: 500px;
    background-color: #14b8a6;
    animation-duration: 4s;
}

.glow-ball-2 {
    bottom: -120px;
    right: -120px;
    width: 500px;
    height: 500px;
    background-color: var(--secondary-color);
    animation-duration: 6s;
}

.glow-ball-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background-color: #0f766e;
    opacity: 0.12;
    animation-duration: 7s;
}

@keyframes pulse-glow {
    0% { transform: scale(0.95); opacity: 0.15; }
    100% { transform: scale(1.15); opacity: 0.28; }
}

header {
    background: #ffffff;
    border-bottom: 3px solid var(--secondary-color);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-navigation {
    background: var(--primary-gradient);
    background-size: 300% 300%;
    animation: gradientShift 10s ease infinite;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.main-navigation a {
    color: #ffffff;
    padding: 12px 22px;
    display: block;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.main-navigation a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.side-menu-blocks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-menu-btn {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 14px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.side-menu-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.plus-icon {
    font-size: 1.1rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.side-menu-dropdown {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 12px 15px;
    margin: 4px 0 10px 0;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.side-menu-dropdown a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
}

.side-menu-dropdown a:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    padding-left: 16px;
}

.visitor-widget {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--secondary-color);
    margin-bottom: 25px;
}

.visitor-widget-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}

.visitor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.92rem;
    color: var(--text-color);
}

.visitor-item:last-child {
    border-bottom: none;
}

.visitor-num {
    font-weight: 600;
    color: var(--primary-color);
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 4px;
}

.online-indicator {
    display: inline-block;
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ticker-car {
    position: absolute;
    bottom: -2px;
    will-change: transform;
}

.ticker-car img {
    height: 38px;
    width: auto;
}

.ticker-car.ambulance {
    left: -120px;
    animation: driveTickerRight 15s linear infinite;
}

.ticker-car.firetruck {
    right: -120px;
    animation: driveTickerLeft 18s linear infinite;
    animation-delay: 4s; 
}

@keyframes driveTickerRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 150px)); }
}

@keyframes driveTickerLeft {
    0% { transform: translateX(0) scaleX(-1); }
    100% { transform: translateX(calc(-100vw - 150px)) scaleX(-1); }
}

.personnel-container {
    width: 100%;
    margin: 30px auto;
    padding: 0 10px;
}

.breadcrumb-nav {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb-nav a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-nav span {
    margin: 0 6px;
}

.breadcrumb-nav .current {
    color: var(--text-color);
}

.page-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 35px;
    font-weight: 700;
    position: relative;
    padding-bottom: 12px;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.personnel-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.row-top {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.row-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.row-bottom .personnel-card {
    flex: 1 1 280px;
    max-width: 300px;
}

.personnel-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;             
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;               
    justify-content: center;           
    gap: 16px;
}

.personnel-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-top-color: var(--secondary-color);
}

.card-icon {
    width: 60px;
    height: 60px;
    background-color: #f0fdf4;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    margin: 0 auto;                    
}

.personnel-card:hover .card-icon {
    background: var(--primary-gradient);
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
    color: #ffffff;
    transform: scale(1.05);
}

.personnel-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    text-align: center;               
}

/* =========================================
   Layout & Ultra-Wide Width Settings (Extended 96%)
   ========================================= */

.container {
    max-width: 96% !important;
    width: 96% !important;
    margin: 0 auto;
    padding: 0 20px;
}

.main-layout {
    display: flex;
    width: 100%;
    max-width: 96%;
    margin: 0 auto;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
}

.sidebar-left {
    width: 320px;
    flex-shrink: 0;
}

.content-center {
    flex-grow: 1;
    min-width: 0; 
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        max-width: 100%;
    }
    .sidebar-left, .content-center {
        width: 100%;
    }
    .container {
        width: 95% !important;
        max-width: 95% !important;
        padding: 0 15px;
    }
}