/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 3rem;

  /*========== Colors ==========*/
  --hue: 174;
  --sat: 63%;
  --first-color: hsl(var(--hue), var(--sat), 40%);
  --first-color-alt: hsl(var(--hue), var(--sat), 36%);
  --title-color: hsl(var(--hue), 12%, 15%);
  --text-color: hsl(var(--hue), 8%, 35%);
  --body-color: hsl(var(--hue), 100%, 99%);
  --container-color: #f3d8d8;

  /*========== Font and typography ==========*/
  --body-font: 'Open Sans', sans-serif;
  --h1-font-size: 1.5rem;
  --normal-font-size: .938rem;
  --tiny-font-size: .625rem;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

@media screen and (min-width: 968px) {
  :root {
    --h1-font-size: 2.25rem;
    --normal-font-size: 1rem;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: var(--header-height) 0 0 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.section {
  padding: 4.5rem 0 2rem;
}

.section__title {
  font-size: var(--h1-font-size);
  color: var(--title-color);
  text-align: center;
  margin-bottom: 1.5rem;
}

.section__height {
  height: 100vh;
}

/*=============== LAYOUT ===============*/
.container {
  max-width: 968px;
  margin-left: 1rem;
  margin-right: 1rem;
}

/*=============== HEADER ===============*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #ffffff;
  z-index: var(--z-fixed);
  transition: .4s;
}

/*=============== NAV ===============*/
.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__img {
  width: 188px;
  border-radius: 20%;
}

.nav__logo {
  color: var(--title-color);
  font-weight: 600;
}

@media screen and (max-width: 767px) {
  .nav__menu {
    position: fixed;
    bottom: 0;
    left: 0.5rem;         /* เว้นระยะจากด้านซ้าย */
    right: 0.5rem;
    background-color: var(--container-color);
    box-shadow: 0 -1px 12px hsla(var(--hue), var(--sat), 15%, 0.15);
    /* width: 100%; */
    height: 4.5rem;
    padding: 0 1rem;
    display: grid;
    align-content: center;
    border-radius: 1.25rem 1.25rem 0 0;
    transition: .4s;
  }
}

.nav__list, 
.nav__link {
  display: flex;
}

.nav__link {
  flex-direction: column;
  align-items: center;
  row-gap: 4px;
  color: #71192e;
  font-weight: 600;
}

.nav__list {
  justify-content: space-around;
}

.nav__name {
  font-size: var(--tiny-font-size);
  /* display: none;*/ /* Minimalist design, hidden labels */
}

.nav__icon {
  font-size: 1.5rem;
}

/*Active link*/
.active-link {
  position: relative;
  color: #f2f2f2;
  transition: .3s;
}

.active-link {
  position: relative;
  color: #f2f2f2;
  background-color: #71192e;     /* ถมพื้นหลังสีแดงสด (หรือเปลี่ยนได้ตามต้องการ) */
  border-radius: 0.5rem;         /* ขอบมน */
  padding: 0.2rem 0.6rem;          /* ช่องว่างภายใน */
  transition: all 0.3s ease;     /* เพิ่มความนุ่มนวลในการเปลี่ยนแปลง */
}


/* Minimalist design, active link */
/* .active-link::before{
  content: '';
  position: absolute;
  bottom: -.5rem;
  width: 4px;
  height: 4px;
  background-color: var(--first-color);
  border-radius: 50%;
} */

/* Change background header */
.scroll-header {
  box-shadow: 0 1px 12px hsla(var(--hue), var(--sat), 15%, 0.15);
}

/*=============== MEDIA QUERIES ===============*/
/* For small devices */
/* Remove if you choose, the minimalist design */
@media screen and (max-width: 320px) {
  .nav__name {
    display: none;
  }
}

/* For medium devices */
@media screen and (min-width: 576px) {
  .nav__list {
    justify-content: center;
    column-gap: 3rem;
  }
}

@media screen and (min-width: 767px) {
  body {
    margin: 0;
  }
  .section {
    padding: 7rem 0 2rem;
  }
  .nav {
    height: calc(var(--header-height) + 1.5rem); /* 4.5rem */
  }
  .nav__img {
    display: none;
  }
  .nav__icon {
    display: none;
  }
  .nav__name {
    font-size: var(--normal-font-size);
    /* display: block; */ /* Minimalist design, visible labels */
  }
  .nav__link:hover {
    color: #c47676;
  }

  /* First design, remove if you choose the minimalist design */
  .active-link::before {
    display: none !important;
  }

  /* Minimalist design */
  /* .active-link::before{
      bottom: -.75rem;
  } */
}

/* For large devices */
@media screen and (min-width: 1024px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ตั้งค่าสำหรับ nav__dropdown */
.nav__dropdown {
  position: relative;
}

/* สไตล์เมนู dropdown */
.nav__dropdown-menu {
  display: none;
  flex-direction: column;
  background-color: var(--container-color);
  border-radius: 0.5rem;
  padding: 0.5rem 0;
  min-width: 150px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease; /* เพิ่มการแอนิเมชัน */
}

.nav__dropdown.open .nav__dropdown-menu {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* ตั้งค่าสำหรับลิงก์ในเมนู */
.nav__dropdown-link {
  padding: 1rem 1.5rem; /* เพิ่มระยะห่างด้านใน */
  color: #71192e;
  font-weight: 500;
  text-transform: capitalize; /* ทำให้ข้อความตัวแรกเป็นตัวพิมพ์ใหญ่ */
  transition: background-color 0.3s ease, color 0.3s ease; /* เพิ่มการแอนิเมชัน */
  margin-bottom: 0.5rem; /* เพิ่มระยะห่างระหว่างรายการ */
}

/* เพิ่มระยะห่างระหว่างบรรทัดในแต่ละรายการ <li> */
.nav__dropdown-menu li {
  margin-bottom: 0.9rem; /* เพิ่มระยะห่างระหว่างรายการ */
  margin-top: 0.9rem; /* เพิ่มระยะห่างระหว่างรายการ */
}

/* สไตล์เมนูเมื่อ hover */
.nav__dropdown-link:hover {
  background-color: #71192e;
  color: #ffffff;
  border-radius: 0.25rem; /* เพิ่มขอบโค้ง */
}

/* สำหรับมือถือให้เมนูย่อยขึ้นแบบปกติ (relative) */
@media screen and (max-width: 768px) {
  .nav__dropdown-menu {
    bottom: 100%;
    top: auto !important;
    transform: translateY(-10px); /* ขยับขึ้น */
    opacity: 1;
  }
}

/* ปรับปรุงการแสดงผลเมนู dropdown บนเดสก์ท็อป */
.nav__dropdown-menu li {
  list-style: none;
}
