/*
Theme Name: School Custom Theme
Description: ธีมเว็บไซต์โรงเรียน สร้างขึ้นมาใหม่
Author: ภิญโญ แสงสกุล
Version: 5.2 (Added Announcements, Downloads, Portfolios)
*/
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #004b87;
    --primary-light: #007bff;
    --secondary: #ff9800;
    --bg-color: #f4f7f9;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 35px rgba(0, 75, 135, 0.12);
    --radius: 16px;
}

* { box-sizing: border-box; }
body { font-family: 'Prompt', sans-serif; margin: 0; background: var(--bg-color); color: var(--text-dark); overflow-x: hidden; }

/* Header & Menu */
.site-header { background: var(--white); box-shadow: 0 2px 15px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.main-menu { max-width: 95%; margin: 0 auto; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.main-menu ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; }
.main-menu ul li a { text-decoration: none; color: var(--text-dark); font-weight: 500; padding: 8px 16px; border-radius: 8px; transition: all 0.3s; }
.main-menu ul li a:hover { background: rgba(0, 75, 135, 0.05); color: var(--primary); }

/* Hero Banner */
.hero-banner { width: 100%; display: flex; justify-content: center; background: var(--white); }
.hero-banner img { width: 100%; height: auto; display: block; }

/* Main Container */
.container { max-width: 95%; margin: 0 auto; padding: 50px 20px; }

/* Layout */
.home-layout { display: flex; gap: 40px; align-items: flex-start; }
.main-content { flex: 7.8; min-width: 0; }
.sidebar-right { flex: 2.2; min-width: 260px; position: sticky; top: 100px; }

/* =========================================
   WOW Tabs System
   ========================================= */
.tabs-wrapper { margin-bottom: 45px; display: flex; justify-content: flex-start; }
.tabs-nav {
    display: inline-flex; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(15px); 
    padding: 10px; border-radius: 60px; box-shadow: 0 10px 40px rgba(0, 75, 135, 0.08), inset 0 0 0 1px rgba(255,255,255,0.8);
    gap: 15px; flex-wrap: wrap;
}
.tab-btn {
    background: transparent; border: none; padding: 14px 32px; border-radius: 50px;
    font-family: 'Prompt', sans-serif; font-size: 1.1em; font-weight: 600; color: #555;
    cursor: pointer; transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden;
}
.tab-btn svg { width: 22px; height: 22px; fill: currentColor; transition: transform 0.4s ease; }
.tab-btn:hover { color: var(--primary); background: var(--white); box-shadow: 0 5px 15px rgba(0,0,0,0.05); transform: translateY(-2px); }
.tab-btn:hover svg { transform: scale(1.15) rotate(-10deg); }
.tab-btn.active {
    color: var(--white); background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.35); transform: translateY(-4px);
}
.tab-btn.active svg { transform: scale(1.2); animation: popIcon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIcon { 0% { transform: scale(1); } 50% { transform: scale(1.4) rotate(5deg); } 100% { transform: scale(1.2) rotate(0); } }

/* Tab Content */
.tab-content { display: none; }
.tab-content.active { display: block; animation: wowFadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes wowFadeInUp { from { opacity: 0; transform: translateY(40px) scale(0.95); filter: blur(4px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }

/* News Grid */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.news-card { 
    background: var(--white); border-radius: var(--radius); overflow: hidden; 
    box-shadow: var(--shadow-soft); transition: all 0.4s ease; border: 1px solid rgba(0,0,0,0.03);
    display: flex; flex-direction: column; height: 100%;
}
.news-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.news-img-wrapper { overflow: hidden; width: 100%; height: 220px; background: #e9ecef; }
.news-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.news-card:hover .news-img { transform: scale(1.08); }
.news-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.news-date { font-size: 0.85em; color: var(--secondary); font-weight: 600; margin-bottom: 8px; }
.news-title { font-size: 1.15em; font-weight: 600; margin: 0 0 10px; line-height: 1.4; }
.news-title a { color: var(--text-dark); text-decoration: none; transition: color 0.3s; }
.news-title a:hover { color: var(--primary); }
.news-excerpt { font-size: 0.95em; color: var(--text-light); line-height: 1.6; margin-bottom: 15px; flex-grow: 1; }

/* Button */
.btn-wrap { text-align: center; margin-top: 50px; margin-bottom: 60px; }
.btn-primary { 
    display: inline-block; padding: 14px 40px; background: var(--primary); color: var(--white); 
    text-decoration: none; border-radius: 50px; font-weight: 500; font-size: 1.1em; 
    transition: all 0.3s; box-shadow: 0 4px 15px rgba(0, 75, 135, 0.2);
}
.btn-primary:hover { background: #003366; transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0, 75, 135, 0.3); }

/* =========================================
   Director Widget
   ========================================= */
.director-widget {
    background: var(--white); 
    padding: 25px 15px;
    border-radius: var(--radius);
    text-align: center; 
    box-shadow: var(--shadow-soft); 
    border-top: 5px solid var(--primary);
}
.director-widget-title { font-size: 1.4em; font-weight: 700; color: var(--primary); margin: 0 0 20px 0; }
.director-widget img {
    width: 100%; height: 320px; object-fit: cover; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); margin-bottom: 25px; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.director-widget img:hover { transform: scale(1.05) rotate(1deg); }
.director-name { font-size: 1.25em; font-weight: 600; color: var(--text-dark); margin: 0 0 5px 0; }
.director-position { font-size: 0.95em; color: var(--text-light); margin: 0; }

/* =========================================
   Additional Sections (Announcements, Downloads, Portfolios)
   ========================================= */
.additional-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
    padding-top: 40px;
    border-top: 2px dashed rgba(0,0,0,0.1);
}
.list-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.03);
}
.list-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}
.list-section-title svg {
    width: 24px;
    height: 24px;
    fill: var(--secondary);
}
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.item-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.item-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.item-list li a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1em;
    transition: color 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.item-list li a:hover {
    color: var(--primary);
}
.item-list li a::before {
    content: "•";
    color: var(--secondary);
    font-size: 1.5em;
    line-height: 1;
    margin-top: -2px;
}
.item-date {
    display: block;
    font-size: 0.85em;
    color: var(--text-light);
    margin-top: 5px;
    margin-left: 18px;
}

/* Mobile */
@media (max-width: 992px) {
    .home-layout { flex-direction: column; }
    .sidebar-right { width: 100%; position: static; margin-top: 20px; }
    .tabs-nav { width: 100%; justify-content: center; }
    .tab-btn { flex: 1; justify-content: center; text-align: center; padding: 12px 15px; font-size: 1em; }
    .director-widget img { height: auto; aspect-ratio: 3/4; max-width: 320px; }
}