/* ==========================================================================
   INNOVEDEX OFFICIAL STYLE SHEET
   Theme: Modern Corporate Blue (Fixed Grid Layout)
   Palette Ref: #011f4b, #03396c, #005b96, #6497b1, #b3cde0
   ========================================================================== */

/* 1. GLOBAL VARIABLES & RESET */
:root {
    /* --- Color Palette --- */
    --bg-body: #e4ecf2;
    /* Pale Blue Background */
    --bg-tile: #ffffff;
    /* Pure White Tile */

    --text-main: #011f4b;
    /* Deep Navy (Main Text) */
    --text-light: #ffffff;
    /* White Text (Hero/Dark bg) */
    --text-muted: #6497b1;
    /* Soft Blue (Secondary Text) */

    --accent-primary: #005b96;
    /* Ocean Blue (Highlights/Buttons) */
    --accent-dark: #03396c;
    /* Dark Blue (Headings) */

    /* --- Layout & Effects --- */
    --gap: 1.5rem;
    /* Grid Gap */
    --radius: 24px;
    /* Tile Border Radius */
    --shadow-soft: 0 10px 30px -10px rgba(1, 31, 75, 0.15);
    --shadow-hover: 0 20px 40px -10px rgba(1, 31, 75, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    background-image: linear-gradient(180deg, #ffffff 0%, #eef6fa 100%);
    color: var(--text-main);
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    padding: 2rem;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* 2. MAIN BENTO GRID SYSTEM */
.bento-grid {
    display: grid;
    max-width: 1300px;
    margin: 0 auto;
    gap: var(--gap);
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: dense;
}

/* 3. BASE TILE STYLING */
.tile {
    background: var(--bg-tile);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tile:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 91, 150, 0.2);
}

/* ==========================================================================
   4. HERO BANNER SECTION
   ========================================================================== */
.hero-banner {
    grid-column: span 4;
    position: relative;
    min-height: 550px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    border: none;
    padding: 0;

    background-image: url('img/composition/head.jpg');
    background-size: cover;
    background-position: center 60%;
    color: var(--text-light);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(1, 31, 75, 0) 30%,
            rgba(1, 31, 75, 0.5) 70%,
            rgba(1, 31, 75, 0.95) 100%);
    z-index: 1;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-left: 3rem;
    padding-right: 3rem;
    padding-bottom: 2rem;
    max-width: 1200px;
}

.logo-card {
    background: rgba(255, 255, 255);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 4px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    flex-shrink: 0;
}

.main-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.text-content {
    flex: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-banner h1 {
    font-size: 3rem;
    margin: 0;
    line-height: 1;
    color: #ffffff;
    margin-bottom: 0.3rem;
}

.hero-banner .tagline {
    font-size: 1.3rem;
    font-weight: 500;
    color: #b3cde0;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.hero-banner .description {
    font-size: 1rem;
    max-width: 700px;
    color: #e2e8f0;
    opacity: 0.9;
    line-height: 1.5;
}

/* ==========================================================================
   5. ARCHIVE SECTION (FIXED: Grid Layout)
   ========================================================================== */
.archive-container {
    grid-column: span 4;
    background: #ffffff;
}

.archive-grid {
    /* ใช้ CSS Grid แทน Flexbox เพื่อให้ขนาดปุ่มเท่ากัน */
    display: grid;
    /* auto-fill: สร้างคอลัมน์เพิ่มเรื่อยๆ ตามความกว้างหน้าจอ */
    /* minmax(220px, 1fr): ปุ่มกว้างอย่างน้อย 220px ถ้าเหลือที่ให้ขยายได้ */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.archive-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--text-main);
    /* Dark Blue */
    color: #ffffff;
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    /* บังคับความสูงให้เท่ากันสวยงาม */
    height: 100%;
    min-height: 60px;
}

.archive-btn:hover {
    background-color: var(--accent-primary);
    /* Ocean Blue */
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0, 91, 150, 0.3);
}

/* ==========================================================================
   6. CONTENT TILES
   ========================================================================== */

h2 {
    font-size: 1.6rem;
    color: var(--accent-dark);
    margin-bottom: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vision {
    grid-column: span 2;
}

.mission {
    grid-column: span 2;
}

.founders-container {
    grid-column: span 4;
}

.vision p,
.mission-intro {
    color: #334e68;
    font-size: 1.05rem;
}

.mission-intro {
    border-bottom: 1px solid #e1eaf2;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.mission-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.mission-list li {
    font-size: 0.9rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-primary);
    background: linear-gradient(to right, #f8fbfe, transparent);
    padding: 0.6rem 1rem;
    border-radius: 0 8px 8px 0;
}

.mission-list strong {
    color: var(--accent-dark);
    margin-right: 5px;
}

/* Founders Grid */
.founders-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.founder-card {
    text-align: center;
    margin: 0;
}

.founder-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(1, 31, 75, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.founder-card:hover img {
    transform: scale(1.03);
}

.founder-card figcaption {
    font-weight: 600;
    color: var(--accent-dark);
    font-size: 0.95rem;
}

/* ==========================================================================
   7. PARTNERS & SPONSORS
   ========================================================================== */
.partners-container,
.sponsors-container {
    grid-column: span 4;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 2rem;
}

.logo-item {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    padding: 10px;
    background: white;
    border-radius: 12px;
}

.logo-img {
    max-height: 100%;
    max-width: 220px;
    width: auto;
    object-fit: contain;
    filter: none;
    /* Full Color */
    opacity: 1;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-item:hover .logo-img {
    transform: scale(1.1);
}

.footer {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-main);
    opacity: 0.6;
    font-size: 0.85rem;
}

/* ==========================================================================
   8. RESPONSIVE DESIGN (Fixes + Archive)
   ========================================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-banner,
    .archive-container,
    .founders-container,
    .partners-container,
    .sponsors-container {
        grid-column: span 2;
    }

    .vision,
    .mission {
        grid-column: span 1;
    }

    .founders-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .logo-card {
        width: 110px;
        height: 110px;
    }

    .hero-banner h1 {
        font-size: 2.5rem;
    }
}

/* MOBILE (max-width: 640px) */
@media (max-width: 640px) {
    body {
        padding: 1rem;
        overflow-x: hidden;
    }

    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .tile,
    .hero-banner,
    .archive-container,
    .vision,
    .mission,
    .founders-container,
    .partners-container,
    .sponsors-container {
        grid-column: auto;
        width: 100%;
        padding: 1.5rem;
    }

    /* Hero Fixes */
    .hero-banner {
        min-height: 480px;
        background-position: center bottom;
    }

    .hero-content-wrapper {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        padding-bottom: 2rem;
        gap: 1rem;
    }

    .logo-card {
        width: 90px;
        height: 90px;
        padding: 12px;
        margin-bottom: 0;
    }

    .hero-banner h1 {
        font-size: 2.2rem;
    }

    .hero-banner .description {
        font-size: 0.95rem;
    }

    /* Archive Mobile Fix */
    .archive-grid {
        grid-template-columns: 1fr;
        /* บนมือถือให้เหลือ 1 คอลัมน์เต็มๆ */
    }

    /* Founders Fixes */
    .founders-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Partners/Sponsors Fixes */
    .logo-grid {
        gap: 1rem;
        padding: 0.5rem;
        justify-content: space-around;
    }

    .logo-item {
        height: 80px;
        width: 45%;
    }

    .logo-img {
        max-width: 100%;
    }
}

/* ==========================================================================
    INNOVEDEX 2026 : CUSTOM STYLESHEET
    Structure:
    1. Global & Utilities
    2. Hero Section
    3. Track Selection (Registration)
    4. Missions & Categories
    5. Prizes Section
    6. Timeline Section (Schedule)
    7. Contact Section
    8. Responsive Design (Mobile)
    ========================================================================== */

/* --- 1. GLOBAL & UTILITIES --- */
:root {
    --color-comp: #005b96;
    /* สีหลัก Track แข่งขัน */
    --color-train: #27ae60;
    /* สีหลัก Track อบรม */
    --color-final: #d35400;
    /* สีหลัก รอบ Final */
}

/* --- 2. HERO SECTION --- */
.hero-2026 {
    background-image: url('img/composition/2026-banner.jpg');
    background-size: cover;
    background-position: center;
    align-items: center;
    text-align: center;
    min-height: 450px;
}

.hero-2026 h1 {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    color: #b3cde0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* --- 3. TRACK SELECTION (REGISTER) --- */
.track-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* แบ่งครึ่งเท่ากัน */
    gap: 1.5rem;
    margin-top: 1rem;
}

.track-card {
    padding: 2rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.track-card:hover {
    transform: translateY(-5px);
}

/* Track A: Competition */
.track-comp {
    background: #ffffff;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 91, 150, 0.1);
}

.track-comp h3 {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

/* Track B: Training */
.track-train {
    background: linear-gradient(135deg, #e9f7ef 0%, #ffffff 100%);
    border: 2px solid var(--color-train);
}

.track-train h3 {
    color: var(--color-train);
    font-size: 1.5rem;
}

/* Buttons */
.btn-register {
    display: block;
    width: 100%;
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 1.5rem;
    transition: all 0.3s;
}

.btn-blue {
    background: var(--accent-primary);
    color: white;
}

.btn-blue:hover {
    background: var(--accent-dark);
    box-shadow: 0 5px 15px rgba(0, 91, 150, 0.3);
}

.btn-green {
    background: var(--color-train);
    color: white;
}

.btn-green:hover {
    background: #1e8449;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

/* --- 4. MISSIONS & CATEGORIES --- */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.mission-box {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border-left: 6px solid var(--accent-primary);
    box-shadow: var(--shadow-soft);
}

/* --- 5. PRIZE SECTION --- */
.prize-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.prize-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e1eaf2;
}

.prize-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 2px solid #f0f4f8;
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prize-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.prize-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f9f9f9;
}

.prize-table tr:last-child td {
    border-bottom: none;
}

.money {
    font-weight: 700;
    color: var(--accent-primary);
    text-align: right;
}

/* --- 6. TIMELINE SECTION --- */
.timeline-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tl-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #cbd5e1;
}

.tl-item.active {
    border-left-color: var(--accent-primary);
    background: #f8fbfe;
}

.tl-item.final {
    border-left-color: var(--color-final);
    background: #fdf2e9;
}

.tl-date {
    font-weight: 700;
    width: 100px;
    color: #555;
    flex-shrink: 0;
}

.tl-info {
    flex: 1;
}

.tl-info strong {
    display: block;
    color: var(--text-main);
}

.tl-info span {
    font-size: 0.85rem;
    color: #888;
}

/* Registration Period Badge (Timeline Insert) */
.reg-period {
    display: inline-block;
    font-size: 0.85rem;
    color: #2c3e50;
    background-color: #f1f8ff;
    border: 1px solid #d0e3f0;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    margin-top: 0.5rem;
    font-weight: 500;
}

.reg-period i {
    color: var(--accent-primary);
    margin-right: 5px;
}

/* Final Round Highlights */
.tl-item.final .reg-period {
    background-color: #fff5eb;
    border-color: #f5c6cb;
    color: var(--color-final);
}

.tl-item.final .reg-period i {
    color: var(--color-final);
}

/* --- 7. CONTACT SECTION --- */
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.contact-item {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: #f8fbfe;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: white;
    border-color: #e1eaf2;
}

.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

/* Brand Colors for Icons */
.icon-fb {
    background: #1877F2;
}

.icon-line {
    background: #00B900;
}

.icon-email {
    background: #EA4335;
}

.icon-discord {
    background: #5865F2;
}

.contact-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.contact-text p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* --- 8. RESPONSIVE DESIGN (MOBILE) --- */
@media (max-width: 768px) {

    /* Stack Grids Vertically */
    .track-container,
    .prize-section,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust Hero Font */
    .hero-2026 h1 {
        font-size: 2rem;
    }

    /* Ensure Contact Items Fill Width */
    .contact-item {
        width: 100%;
        min-width: 0;
    }

    /* Adjust Timeline for small screens (Optional) */
    .tl-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tl-date {
        width: 100%;
        border-bottom: 1px dashed #eee;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
}