/* =========================================================
 🧼 1. Reset & Base
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

/* =========================================================
 📐 2. Layout & Container
========================================================= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* =========================================================
 🧭 3. Navbar & Dropdown Menu (Final Global Version)
========================================================= */
header {
  background: #fff;
  color: #333;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid #ddd;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 95%;
  max-width: 1600px;
  margin: auto;
  position: relative; 
}

.logo {
  flex: 0 0 auto;
}

.logo img {
  height: 55px;
  display: block;
}

nav#primary-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

header ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

header ul li {
  margin-left: 25px;
  position: relative;
}

header ul li a {
  color: #333;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  transition: 0.3s;
}

header ul li a:hover {
  color: #003399;
}

/* Facebook Icon Style */
.fb-icon {
  font-size: 1.8rem;
  color: #1877F2;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.fb-icon:hover {
  transform: scale(1.15);
}

/* Dropdown Menu Styles */
.dropdown-content {
  display: none;
  position: absolute;
  background: #fff;
  padding: 10px;
  top: 35px;
  left: 0;
  list-style: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 6px;
  min-width: 160px;
  z-index: 200;
}

.dropdown-content li {
  margin: 5px 0;
}

.dropdown-content li a {
  color: #333;
  font-weight: normal;
  font-size: 14px;
  display: block;
  padding: 6px 10px;
}

.dropdown-content li a:hover {
  background: #f0f0f0;
  border-radius: 4px;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* =========================================================
 📱 Responsive Navbar (Mobile Hamburger)
========================================================= */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 30px;
  cursor: pointer;
  padding: 0px 10px;
  border-radius: 6px;
  color: #020b92;             
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .menu-toggle {
    display: inline-block;
  }

  nav#primary-nav {
    display: none; /* ซ่อนไว้รอคลาส active จาก layout.js */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 20px 0;
  }

  nav#primary-nav.active {
    display: flex;
  }

  header ul {
    flex-direction: column;
    width: 100%;
  }

  header ul li {
    margin: 10px 0;
    width: 100%;
    text-align: center;
    margin-left: 0;
  }

  .dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    background: #f9f9f9;
    margin-top: 4px;
  }

  .dropdown.open .dropdown-content {
    display: block;
  }
}

/* =========================================================
 🖼️ 4. Hero Section (ปรับปรุงขนาดตัวอักษรใหญ่เต็มตา)
========================================================= */
.hero {
  background-image: url('../photo/BanerTUYF.png');
  background-size: cover; 
  background-position: center center;
  background-repeat: no-repeat;
  width: 100%;
  aspect-ratio: 16 / 7;   
  max-height: 800px;      
  min-height: 500px;      
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px; 
  position: relative;
  color: white;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  padding: 0 15px;
}

.hero-content h1 {
  /* ปรับขนาดตัวอักษรให้ใหญ่ขึ้นมาก */
  font-size: clamp(45px, 7.5vw, 90px); 
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.1;
  letter-spacing: -2px;
  text-transform: uppercase;
  text-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.hero-content p {
  /* ปรับคำบรรยายให้ใหญ่ขึ้นตาม */
  font-size: clamp(20px, 2.5vw, 25px);
  margin-bottom: 35px;
  font-weight: 500;
  color: #f0f0f0;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.btn-hero {
  display: inline-block;
  background: #003399;
  color: #fff;
  padding: 18px 45px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 20px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 20px rgba(0,51,153,0.4);
}

.btn-hero:hover {
  background: #ffffff;
  color: #003399;
  transform: translateY(-5px) scale(1.05);
}

@media (max-width: 768px) {
  .hero {
    aspect-ratio: 4 / 3; 
    min-height: 450px;   
    padding: 30px 15px;
  }
}

/* =========================================================
 🏫 5. About Section (Responsive)
========================================================= */
.about.container {
  width: 95% !important;
  max-width: 1600px !important;
  margin: 0 auto;
}

.about-box {
  display: flex;
  align-items: stretch;
  gap: 30px;
  margin: 60px auto;
  width: 95%;
  max-width: 1600px;
}

.about-img, .about-info { flex: 1; }

.about-img img {
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.about-info {
  background: #003399;
  color: white;
  padding: 40px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.about-info h2 { margin-bottom: 18px; font-size: 26px; }

.about-info p { margin-bottom: 15px; font-size: 16px; line-height: 1.7; }

.about-info .btn.secondary {
  display: inline-block;
  background: #ffffff;
  color: #003399;
  font-weight: bold;
  padding: 12px 26px;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .about-box { flex-direction: column; margin: 40px auto; }
  .about-info { padding: 25px; }
}

/* =========================================================
 🪄 6. Tabs Section (Responsive)
========================================================= */
.tabs { margin: 60px auto; width: 95%; max-width: 1500px; }

.tab-nav {
  display: flex;
  list-style: none;
  border-bottom: 2px solid #eee;
  flex-wrap: wrap; 
}

.tab-nav li {
  padding: 14px 28px;
  margin-right: 5px;
  background: #f8f9fa;
  cursor: pointer;
  font-weight: bold;
  border-radius: 8px 8px 0 0;
  transition: 0.3s;
}

.tab-nav li.active { background: #003399; color: #fff; }

.tab-nav li.highlight { background: #ff6600; color: #fff; }

.tab-box {
  border: 1px solid #ddd;
  border-radius: 0 0 10px 10px;
  padding: 30px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s ease-in-out; }

@keyframes fadeIn { from {opacity: 0; transform: translateY(5px);} to {opacity: 1; transform: translateY(0);} }

@media (max-width: 768px) {
  .tab-nav { flex-direction: column; gap: 8px; border-bottom: none; }
  .tab-nav li { width: 100%; border-radius: 8px; text-align: center; }
  .tab-box { padding: 20px; }
}

/* =========================================================
 🧑‍🎓 7. Students Section (Carousel)
========================================================= */
.students { margin: 70px auto; text-align: center; width: 95%; max-width: 1600px; position: relative; }

.students h2 { margin-bottom: 30px; font-size: 28px; }

.student-carousel { overflow: hidden; position: relative; }

.student-track { display: flex; transition: transform 0.5s ease-in-out; gap: 15px; }

.student-card {
  flex: 0 0 calc(25% - 15px);
  max-width: calc(25% - 15px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: 0.3s;
}

.student-card:hover { transform: translateY(-8px); }

.student-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.student-card p { margin-top: 15px; font-weight: bold; font-size: 18px; padding: 0 10px; }

.student-card a { display: inline-block; margin: 10px 0 20px; color: #003399; text-decoration: none; font-weight: bold; }

/* Navigation Buttons */
.student-btn {
  position: absolute;
  top: 55%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  padding: 10px 15px;
  z-index: 10;
  transition: 0.3s;
}

.student-btn:hover { background: rgba(0, 0, 0, 0.8); }
.student-btn.prev { left: 10px; }
.student-btn.next { right: 10px; }
.student-btn:disabled { opacity: 0.3; cursor: not-allowed; }

@media (max-width: 1024px) { .student-card { flex: 0 0 calc(50% - 15px); max-width: 50%; } }
@media (max-width: 768px) { .student-card { flex: 0 0 100%; max-width: 100%; } }

/* =========================================================
 🏃 8. Activities Section (Carousel)
========================================================= */
.activities { margin: 70px auto; width: 95%; max-width: 1600px; text-align: center; position: relative; }

.activities-carousel { overflow: hidden; padding: 15px 0; }

.activities-track { display: flex; transition: transform 0.5s ease-in-out; gap: 20px; }

.activity-card {
  flex: 0 0 calc((100% - 60px) / 4);
  max-width: calc((100% - 60px) / 4);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.activity-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.activity-info { padding: 15px; text-align: left; }
.activity-info .title { font-weight: bold; font-size: 16px; color: #003399; margin-bottom: 8px; display: block; }

.activity-btn {
  position: absolute;
  top: 55%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
}

.activity-btn.prev { left: -10px; }
.activity-btn.next { right: -10px; }

@media (max-width: 1200px) { .activity-card { flex: 0 0 calc((100% - 40px) / 3); max-width: 33%; } }
@media (max-width: 900px) { .activity-card { flex: 0 0 calc((100% - 20px) / 2); max-width: 50%; } .activity-btn.prev { left: 0; } .activity-btn.next { right: 0; } }
@media (max-width: 600px) { .activity-card { flex: 0 0 100%; max-width: 100%; } }

/* =========================================================
 🦶 9. Footer
========================================================= */
footer { margin-top: 60px; font-size: 14px; }

.footer-top { background: linear-gradient(to right, #1e73d9 60%, #333 60%); color: #fff; }

.footer-inner {
  width: 95%;
  max-width: 1600px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 50px 20px;
}

.footer-left { flex: 2; }
.footer-right { flex: 1; }

.footer-right ul { list-style: none; margin-bottom: 15px; }
.footer-right ul li { margin-bottom: 10px; }
.footer-right ul li a { color: #fff; text-decoration: none; }
.footer-right ul li a:hover { text-decoration: underline; }

.footer-bottom { background: #003399; color: #fff; padding: 15px 0; }
.footer-bottom .footer-inner { padding: 0 20px; align-items: center; }
.footer-links a { margin-left: 20px; color: #fff; text-decoration: none; }

@media (max-width: 992px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-top { background: #1e73d9; } /* เปลี่ยนพื้นหลังเป็นสีเดียวในมือถือ */
  .footer-right ul { padding: 0; }
}

/* =========================================================
 🗺️ 10. Map & Contact Section
========================================================= */
.map-section { margin: 60px auto; text-align: center; width: 95%; max-width: 1600px; }

.map-section img {
  width: 100%; height: auto; border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Contact Page Specific Grid */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  margin: 40px auto;
}

.map-wrapper {
  width: 100%;
  height: 450px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

@media (max-width: 900px) {
  .contact-container { grid-template-columns: 1fr; }
  .map-wrapper { height: 350px; }
}