/*
็Home Page
*/

/* Hero Section */
.hero-section {
    height: 720px;
    /* เพิ่มความสูงจาก 500px เป็น 720px */
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-red));
    position: relative;
    color: var(--white);
    overflow: hidden;
    margin-top: 0;
    /* ลบ margin-top เพื่อให้อยู่ใต้ Main Navigation ทันที */
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: 100%;
    padding: 0 20px;
}

.hero-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
}

.hero-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.hero-dot {
    width: 12px;
    height: 12px;
    background: var(--white);
    border-radius: 50%;
    opacity: 0.7;
}

.hero-dot.active {
    opacity: 1;
    background: var(--gold);
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 90px;
    width: 70px;
    height: 70px;
    background: var(--dark-blue);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 9999;
}

.scroll-top-btn:hover {
    background: var(--primary-red);
    transform: translateY(-3px);
}

/* Student Showcase Section */
.student-showcase {
    background: var(--light-gray);
    width: 100%;
}

.showcase-container {
    width: 100%;
    text-align: center;
}

.showcase-grid {
    display: flex;
    width: 100%;
}

.showcase-item {
    flex: 1;
    text-align: center;
    padding: 0;
    color: var(--white);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.showcase-item.gold {
    background: var(--gold);
    color: var(--dark-gray);
}

.showcase-item.blue {
    background: var(--dark-blue);
}

.showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* รูปภาพจะครอบคลุมพื้นที่ทั้งหมด */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.showcase-item .showcase-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--white);
}

.showcase-item h3 {
    font-size: 18px;
    margin: 0;
    padding: 15px 20px;
    width: 100%;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    font-weight: 500;
}

/* สีพื้นหลังของข้อความตามแต่ละ item */
.showcase-item.gold h3 {
    background: var(--gold);
    color: var(--dark-gray);
}

.showcase-item.blue h3 {
    background: var(--dark-blue);
    color: var(--white);
}

/* School Vision Section */
.school-vision {
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.vision-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.vision-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 100%;
    max-height: 100%;
}

.vision-container {
    position: relative;
    z-index: 3;
    /* เพิ่ม z-index ให้สูงกว่า background */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.vision-container h2 {
    font-size: 36px;
}

.vision-container p {
    font-size: 18px;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Video Section */
.video-section {
    padding: 0;
    /* ลบ padding ทั้งหมด */
    background: var(--light-gray);
}

.video-container {
    width: 100%;
    /* เปลี่ยนเป็น 100% */
    margin: 0;
    /* ลบ margin */
    text-align: center;
}

.video-placeholder {
    width: 100%;
    max-width: 800px;
    height: 400px;
    background: var(--dark-blue);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.video-placeholder:hover {
    transform: scale(1.02);
}

.video-embed {
    width: 100%;
    height: 720px;
    /* กำหนดความสูง 720px */
    max-width: 1920px;
    /* กำหนดความกว้างสูงสุด 1920px */
    margin: 0 auto;
}

.video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.play-button {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--dark-blue);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* News & Events Section */
.news-events {
    background: var(--white);
}

.news-container {
    width: 100%;
    text-align: center;
}

.news-container h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--dark-gray);
}

.news-grid {
    display: flex;
    width: 100%;
    gap: 0;
}

.news-item {
    overflow: hidden;
    color: var(--white);
    transition: transform 0.3s;
    flex: 1;
    position: relative;
}

.news-item:hover {
    transform: translateY(-5px);
}

.see-more {
    position: absolute;
    top: 14px;
    right:12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 15px 18px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}


.news-image {
    width: 100%;
    height: 400px;
    background: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    position: relative;
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 1.2rem;
    z-index: 2;
    min-height: 90px;
    display: flex;
    align-items: flex-start;
}

.news-caption p {
    margin: 0;
    color: white;
    text-align: left;
    font-size: 15px;
    line-height: 1.5;
}

/* Accreditation Section */
:root {
    --gap: 60px;
    /* ช่องไฟระหว่างโลโก้ */
    --side-pad: 48px;
    /* เว้นขอบซ้าย-ขวา */
    --speed: 25s;
    /* ความเร็วเลื่อน (น้อยลง = เร็วขึ้น) */
}

/* item width = แบ่งพื้นที่จอให้พอดีกับจำนวนที่แสดงจริง (<=6) */
.marquee-window {
    /* --visible ถูกส่งมาจาก PHP = min(count, 6) */
    --item-w: calc((100vw - 2*var(--side-pad) - (var(--visible) - 1)*var(--gap)) / var(--visible));

    width: 100%;
    /* ใช้ % แทน vw */
    padding-inline: var(--side-pad);
    box-sizing: border-box;
    /* รวม padding เข้ากับความกว้าง */
    margin: 0 auto;
    overflow: hidden;
    /* กันไว้เผื่อมีรูปเกิน */
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee var(--speed) linear infinite;
    will-change: transform;
}

.accreditation:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-set {
    display: flex;
    gap: var(--gap);
}

.logo-item {
    flex: 0 0 var(--item-w);
    /* ฟิตให้พอดีกับจำนวนที่เห็นจริง */
    display: flex;
    align-items: center;
    justify-content: center;
}

.accreditation-logo {
    max-height: 90px;
    /* ปรับตามดีไซน์ */
    width: auto;
    height: auto;
    display: block;
}

/* มี 2 ชุดเท่ากัน ⇒ เลื่อนไป -50% แล้ววนต่อเนื่องไม่มีช่วงขาว */
@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}

.logo-item {
    /* width: 120px; */
    height: 240px;
    /* background: var(--white); */
    /* border-radius: 10px; */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    /* color: var(--dark-gray); */
    /* box-shadow: 0 2px 10px rgba(0,0,0,0.1); */
    overflow: hidden;
}

.accreditation-logo {
    /* max-width: 100%; */
    height: 120px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.accreditation-logo:hover {
    transform: scale(1.1);
}

/* Map & Contact Section */
.map-contact {
    background: var(--white);
    position: relative;
}

.map-container {
    position: relative;
    width: 100%;
}

.google-maps-embed {
    width: 100%;
    height: 500px;
}

.google-maps-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Contact Panel (Floating) */
.contact-panel {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 350px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 25px;
    z-index: 10;
}

.contact-panel-header {
    margin-bottom: 20px;
    text-align: center;
}

.contact-panel-header h2 {
    font-size: 24px;
    color: var(--primary-red);
    margin-bottom: 8px;
    font-weight: bold;
}

.school-subtitle {
    font-size: 14px;
    color: var(--secondary-red);
    margin: 0;
}

.contact-panel-content {
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.contact-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.contact-item i {
    color: var(--primary-red);
    font-size: 16px;
    margin-top: 2px;
    min-width: 16px;
}

.contact-item span {
    color: var(--dark-gray);
    font-size: 14px;
    line-height: 1.4;
}

.contact-item.address span {
    font-size: 13px;
}

.contact-panel-actions {
    text-align: center;
}

.google-maps-btn {
    background: var(--dark-blue);
    color: var(--white);
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.google-maps-btn:hover {
    background: var(--primary-red);
    transform: translateY(-2px);
}

/* Footer CSS ย้ายไป style.css แล้ว - เหลือเฉพาะส่วนที่เฉพาะเจาะจงของหน้า home */

/* Responsive Design */
@media (max-width: 1024px) {
    .showcase-grid {
        gap: 20px;
    }

    .news-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .showcase-grid {
        flex-direction: column;
    }

    .news-grid {
        flex-direction: column;
        gap: 0;
    }

    .news-item {
        width: 100%;
        margin-bottom: 0;
    }

    .news-image {
        height: 300px;
    }

    .contact-panel {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    .hero-section {
        height: 400px;
    }

    .hero-content h2 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 24px;
    }

    .showcase-item {
        padding: 30px 15px;
        min-height: 250px;
    }

    .hero-section {
        height: 350px;
    }

    .news-image {
        height: 250px;
    }

    .news-caption {
        padding: 1rem;
        min-height: 100px;
    }

    .news-caption p {
        font-size: 14px;
    }

    .google-maps-embed {
        height: 400px;
    }

    .contact-panel {
        margin: 15px;
        max-width: calc(100% - 30px);
        padding: 20px;
    }

    .contact-panel-header h2 {
        font-size: 20px;
    }

    .contact-item {
        font-size: 13px;
    }
}