/* Wrap the FAQ section in the center of the page and add spacing from the edges */
.main-content {
    display: flex;
    justify-content: center;
    padding: 60px 20px; 
    background-color: #f9f9f9; 
    min-height: calc(100vh - 200px); 
}

/* =========================================
         container for the FAQ box
========================================= */
.faq-container {
    width: 100%;
    max-width: 800px; 
    background-color: #ffffff; 
    padding: 40px; 
    border: 2px solid #8B0000; 
    border-radius: 16px; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Slightly style the title inside */
.faq-title {
    color: #8B0000;
    text-align: center; 
    margin-bottom: 20px;
}

/* =========================
   GLOBAL & BODY
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  background-color: #fff;
}

/* =========================
   HEADER
========================= */
.header-top {
  background: #8B0000;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 80px;
  position: relative;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

.logo {
  height: 100px;
  width: auto;
  transform: translateY(10px);
}

.header-title {
  font-family: 'Inria Serif', serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.header-right {
  position: absolute;
  top: 15px;
  right: 40px;
  font-size: 14px;
  text-align: right;
}

/* =========================
   NAVIGATION
========================= */
nav {
  background: linear-gradient(90deg, #5c0000, #8B0000, #5c0000);
  padding: 22px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  gap: 90px;
  flex-wrap: wrap;
}

nav ul li {
  color: white;
  cursor: pointer;
  position: relative;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 1px;
  transition: 0.3s ease;
}

nav ul li a {
  text-decoration: none; 
  color: white;          
}

nav ul li:hover {
  color: #ffe5e5;
}

nav ul li::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0%;
  height: 2px;
  background: #ffffff;
  transition: 0.3s;
}

nav ul li:hover::after {
  width: 100%;
}

/* =========================
   DROPDOWN MENU
========================= */
.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: 45px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 12px 0;
  min-width: 260px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

/* รองรับทั้ง <a> และ <div> ใน dropdown */
.dropdown-content a,
.dropdown-content div {
  color: #111111 !important;   
  padding: 14px 22px;
  text-decoration: none;        
  display: block;
  text-align: left;            
  font-size: 14px;
  font-weight: 600;             
  letter-spacing: 0.3px;      
  border-left: 4px solid transparent;
  transition: all 0.25s ease;
  cursor: pointer;
}

.dropdown-content a:hover,
.dropdown-content div:hover {
  background-color: #f3f3f3;    
  color: #990000 !important;
  border-left: 4px solid #8B0000;
  padding-left: 28px;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* =========================
   FAQ COMPONENT
========================= */
/* สร้าง Wrapper แยกเพื่อไม่ให้ flex ไปกระทบ Header */
.faq-wrapper {
  display: flex;
  justify-content: center;
  padding: 60px 40px;
  background-color: #fff;
}

.faq-container {
  width: 100%;
  max-width: 600px;
}

.faq-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.faq-divider {
  border: none;
  border-top: 1px solid #888;
  margin: 0;
}

.faq-item {
  border-bottom: 1px solid #888;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center; 
  font-size: 16px;
  color: #333;
  cursor: pointer;
  text-align: left;
  font-weight: bold;
}

.faq-icon {
  font-size: 24px;
  font-weight: 300;
  color: #555;
  line-height: 1;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-answer p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  padding-right: 20px;
}

.faq-answer a {
  color: #1a73e8;
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
}

.faq-item.active .faq-answer {
  max-height: 200px; 
}

.footer {
    background: url("myphoto/building.png") center/cover no-repeat;
    position: relative;
    color: white;
    margin-top: 20px;
}

/* overlay dark */
.footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65); 
}

.footer-overlay {
    position: relative;
    z-index: 1;
    padding: 10px 10px 10px;
    text-align: center;
}

/* logo */
.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.footer-logos img {
    height: 80px;
    object-fit: contain;
}


/* copyright */
.footer p {
    font-size: 18px;
    opacity: 0.9;
}

/* =========================
   RESPONSIVE - MOBILE
========================= */
@media (max-width: 768px) {

  .header-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px 20px;
    gap: 15px;
  }

  .header-left {
    flex-direction: column;
    gap: 15px;
  }

  .logo {
    height: 80px;
    transform: none;
  }

  .header-title h1 {
    font-size: 18px;
  }

  .header-right {
    position: static;
    margin-top: 10px;
    text-align: center;
  }

  nav {
    padding: 15px 0;
  }

  nav ul {
    flex-direction: column;
    gap: 18px;
  }

  nav ul li {
    font-size: 16px;
  }

  .hero {
    height: 220px;
  }

  .hero h2 {
    font-size: 28px;
  }

  .container {
    width: 92%;
    margin: 40px auto;
  }

  .content-box {
    padding: 25px;
  }

  .footer-logo {
    width: 150px;
  }
/* 1. จัดตำแหน่งกล่องให้อยู่ตรงกลาง ไม่ลอย และซ่อนไว้ก่อน */
  .dropdown-content {
    position: static !important;
    transform: none !important;
    width: 90%;
    margin: 10px auto 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: none;
    padding: 10px 0;
    
    /* บังคับซ่อน เพื่อให้ JS เป็นตัวสั่งเปิดแทน */
    display: none !important; 
    opacity: 1;
    visibility: visible;
  }

  /* 2. เมื่อมีคลาส .active (ที่ JS เติมให้ตอนกด) ค่อยแสดงกล่องออกมา */
  .dropdown.active .dropdown-content {
    display: block !important;
  }
    
  /* ซ่อน outline สีฟ้าๆ ที่อาจจะขึ้นมาตอนกดในบางเบราว์เซอร์ */
  .dropdown {
    outline: none;
  }
}


/* =========================
   RESPONSIVE - SMALL MOBILE
========================= */
@media (max-width: 480px) {

  .hero h2 {
    font-size: 22px;
  }

  .section-title {
    font-size: 18px;
    padding: 10px 18px;
  }

  .content-box {
    font-size: 14px;
    line-height: 1.6;
  }
}