/* =========================================
   1. General & Variables
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500&display=swap');

:root {
    --primary-color: #ff9f6f;    /* ส้มพาสเทล */
    --secondary-color: #e67e22;  /* ส้มเข้ม */
    --text-color: #5d6d7e; 
    --bg-color: #f9f9f9;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* =========================================
   2. Layout & Components
   ========================================= */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section {
    padding: 10px 0;
    margin-bottom: 10px;
}

.content-section.bg-white {
    background-color: var(--white);
    padding: 30px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin: 40px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 500;
    color: #333;
}

.title-line {
    width: 60px; height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-header.left-align { text-align: left; }
.section-header.left-align .title-line { margin: 10px 0 0 0; }

/* =========================================
   3. Buttons (ปุ่มต่างๆ)
   ========================================= */
.btn-add-activity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 25px;
    background: linear-gradient(135deg, #ffaf7b 0%, #ff8c61 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(255, 140, 97, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-add-activity:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 140, 97, 0.5);
    background: linear-gradient(135deg, #ffbe94 0%, #ff9f7a 100%);
}

/* =========================================
   4. Banner & Marquee
   ========================================= */
.banner {
    width: 100%; height: 700px;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.slide { width: 100%; height: 100%; object-fit: cover; position: absolute; opacity: 0; transition: opacity 1s; }
.slide.active { opacity: 1; }

.vision-marquee {
    max-width: 1200px; margin: 30px auto; background: var(--white);
    padding: 15px 0; border-radius: 50px; font-size: 24px;
    border: 1px solid #eee; box-shadow: var(--shadow);
    overflow: hidden; white-space: nowrap;
}

.vision-text { 
    display: inline-block; padding-left: 100%; 
    animation: marquee 25s linear infinite; color: var(--secondary-color); font-weight: 500; 
}

@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* =========================================
   5. Carousel & Activity Cards
   ========================================= */
.carousel { overflow: hidden; margin: 0 auto; padding: 25px 0; }
.carousel-track {
    display: flex;
    width: max-content;
    animation: scroll var(--speed, 80s) linear infinite; 
    align-items: center;
}

.img-card {
    margin-right: 20px; padding: 8px; background: #fff;
    border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex; flex-shrink: 0; height: fit-content;
}

.img-card img {
    height: 350px; width: auto; object-fit: contain;
    border-radius: 8px; display: block; cursor: zoom-in;
}

@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* =========================================
   6. PDF Grid
   ========================================= */
.pdf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.pdf-item {
    display: flex; align-items: center; padding: 20px;
    background: #fff; border: 1px solid #eee; border-radius: 12px;
    text-decoration: none; transition: all 0.3s ease;
}
.pdf-item:hover {
    border-color: var(--primary-color); transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 159, 111, 0.2);
}
.icon-box { font-size: 30px; color: #ff6b6b; margin-right: 15px; }
.text-box { display: flex; flex-direction: column; overflow: hidden; }
.file-name { font-size: 14px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.download-text { font-size: 12px; color: #aaa; margin-top: 4px; }

/* =========================================
   7. QR Code & Link List
   ========================================= */
.two-column-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.content-box { background: var(--white); padding: 30px; border-radius: 20px; box-shadow: var(--shadow); margin: 40px 0; }

.qr-container { display: flex; justify-content: space-around; gap: 20px; margin-top: 20px; }
.qr-card { text-align: center; }
.qr-card img { width: 140px; border-radius: 10px; margin-bottom: 10px; border: 1px solid #eee; }
.qr-card p { font-size: 14px; color: #666; }

.link-list { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.link-list a {
    display: flex; align-items: center; padding: 15px 20px;
    background: #fdfdfd; border: 1px solid #eee; border-radius: 10px;
    color: #555; font-weight: 500; transition: 0.3s; text-decoration: none;
}
.link-list a i { width: 35px; text-align: center; margin-right: 15px; color: var(--primary-color); font-size: 18px; }
.link-list a:hover {
    background: var(--primary-color); color: #fff; border-color: var(--primary-color);
    padding-left: 25px;
}
.link-list a:hover i { color: #fff; }

/* =========================================
   8. Calendar & Lightbox
   ========================================= */
.calendar-wrapper { background: #fff; padding: 15px; border-radius: 20px; box-shadow: var(--shadow); }
.calendar-wrapper iframe { border-radius: 15px; }

.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10002; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox img { max-width: 90%; max-height: 90vh; border-radius: 8px; transform: scale(0.9); transition: transform 0.3s ease; }
.lightbox.active img { transform: scale(1); }
.lightbox-close {
    position: absolute; top: 30px; right: 30px; color: #fff; font-size: 35px;
    cursor: pointer; background: rgba(255, 255, 255, 0.1); width: 50px; height: 50px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* =========================================
   9. Mobile Responsive
   ========================================= */
@media (max-width: 768px) {
    .banner { height: 250px; border-radius: 0; }
    .img-card img { height: 200px; }
    .two-column-grid, .pdf-grid { grid-template-columns: 1fr; }
    .vision-marquee { width: 95%; font-size: 14px; }
    .calendar-wrapper iframe { height: 400px; }
    .section-header h2 { font-size: 22px; }
}