/* ==========================================================================
   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%;
    }
}