﻿@charset "UTF-8";

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'M PLUS Rounded 1c', 'Zen Kaku Gothic New', sans-serif;
  background: #F8F5E9;
  color: #695418;
  overflow-x: hidden;
  font-size: 1.25rem;
  line-height: 1.8;
  max-width: 5500px;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Navigation Bar */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fdf5dc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  width: 60px;
  height: auto;
  cursor: pointer;
  display: block;
  transition: transform 0.3s ease;
}

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

.nav-logo a {
  font-size: 1.6rem;
  font-weight: 800;
  color: #3c6e47;
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease, transform 0.3s ease;
}

.nav-logo a:hover {
  color: #DE5A5A;
  transform: scale(1.1);
}

.nav-icon {
  cursor: pointer;
}

.nav-icon:hover {
  transform: scale(1.1);
}

/* Sidebar */
.sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  top: 0;
  right: 0;
  background-color: #2d3748;
  overflow-x: hidden;
  transition: width 0.4s ease;
  padding-top: 80px;
  z-index: 2000;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.3);
}

.sidebar a {
  padding: 1.5rem 2rem;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffffff;
  display: block;
  transition: background 0.3s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar a:hover {
  background: #4e7c50;
  color: #fff;
}

.sidebar .closebtn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}

/* Overlay (background blur) */
.overlay {
  position: fixed;
  display: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1500;
}

/* Hero Section */
.hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  background: #4e7c50;
  color: white;
  padding: 3rem 1.5rem 6rem 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
  /* text-align: center; */
  margin-top: 80px;
  min-height: 500px;
  column-gap: 3%;
}

.hero-text {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  animation: fadeIn 2s forwards;
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 200px;
}

.hero-text h1 {
  margin: 1rem 0;
  font-size: 4rem;
  animation: popUp 1.5s ease-out;
  line-height: 1.2;
}

.hero-text p {
  margin: 1rem 0;
  font-size: 1.5rem;
}

/* hi-figure */
.hi-figure {
  display: block;
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 30%;
  z-index: 0;
  max-width: 450px;
}

.hi-figure img {
  display: block;
  width: 100%;
}

/* Hero Figure */
.hero-figure {
  flex: 1 1 300px;
  display: flex;
  justify-content: center;
  margin-top: 0;
  width: 100%;
  ;
}

.hero-figure img {
  /* max-width: 620px; */
  width: 90%;
  height: auto;
  padding: 12px;
  /* animation: float 3s ease-in-out infinite; */
  padding: 0;
  margin: 0;
}

.click {
  display: flex;
}

.click img {
  max-width: 42px;
  max-height: 58px;
  margin: 20px 16px 0;
}

/* =====================
   Body - Map
   ===================== */
.body-map {
  position: relative;
  display: inline-block;
}

.body-map img {
  display: block;
  max-width: 100%;
  height: auto;
}

.hotspot {
  position: absolute;
  /* width: 130px;
  height: 130px; */
  width: 15%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  /* background: rgba(255,0,0,0.3); สีโปร่งใสไว้ debug */
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.hotspot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(222, 90, 90, 0.85);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.9), 0 0 20px rgba(222, 90, 90, 0.7);
}

.hotspot:hover::after {
  opacity: 1;
}

/* =====================
   Modal
   ===================== */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 2000;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  padding: 2vh 2vw;
  animation: fadeInBg 0.3s ease;
}

.modal.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

/* popup container */
.modal-content {
  background: #9DC08B;
  position: relative;
  border-radius: 30px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 30px 40px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform: translateY(-30px) scale(0.95);
  opacity: 0;
  animation: popupShow 0.4s ease forwards;
}

.modal-content::-webkit-scrollbar {
  display: none;
}

/* animation background */
@keyframes fadeInBg {
  from {
    background: rgba(0, 0, 0, 0);
  }

  to {
    background: rgba(0, 0, 0, 0.6);
  }
}

/* animation popup */
@keyframes popupShow {
  from {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Title */
.modal-content h1 {
  color: #F8F5E9;
  margin-bottom: 30px;
  font-weight: 700;
  text-align: center;
}

.modal-content h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  color: #695418;
}

.close {
  position: absolute;
  top: 16px;
  right: 30px;
  font-size: 5rem;
  cursor: pointer;
  color: #000;
  line-height: 1;
  font-weight: 300;
}

#modal-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 5%;
  column-gap: 7%;
}

/* =====================
   Herb Details
   ===================== */
.herb-detail {
  background: #F7FBE8;
  border-radius: 10px;
  margin: 0 auto 1rem;
  padding: 32px 80px;
  box-sizing: border-box;
  max-width: 100%;
  position: relative;
  color: #695418;
}

.herb-detail h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(18px, 3vw, 30px);
}

.herb-detail h3 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.herb-detail p {
  margin: 0.4rem 0;
  font-size: 1.25rem;
  margin-bottom: 40px;
}

.herb-detail>img {
  height: 270px;
  width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto 30px;
}


/* =====================
   Read More Button
   ===================== */
.read-more-btn {
  display: block;
  width: fit-content;
  align-items: center;
  justify-content: center;
  background: #DE5A5A;
  color: #FFFFFF;
  font-weight: bold;
  padding: 14px 10px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.3s ease;
  margin-left: auto;
  margin-right: 0;

}

.read-more-btn img {
  width: 42px;
  margin-left: 6px;
  filter: brightness(0) invert(1);
  vertical-align: middle;
}

.read-more-btn:hover {
  background: #c94c4c;
}


/* Search box */
.search-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.search-box input {
  padding: 0.6rem 1.2rem 0.6rem 3.5rem;
  border-radius: 50px;
  border: 2.4px solid #000;
  width: 100%;
  font-size: 1.2rem;
  outline: none;
  background: #fffdf8;
  color: #222;
}

.search-box input:focus {
  border-color: #2e5530;
  box-shadow: 0 0 5px rgba(78, 124, 80, 0.5);
}

.search-logo {
  position: absolute;
  top: 50%;
  left: 25px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  object-fit: contain;
}

/* About Section */
.backgrounda {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  background-image: url(../img/about-bg.png);
  background-size: contain;
  z-index: -1;
}

.imgbackg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  align-items: center;
}

.about {
  padding: 3rem 1.5rem 15rem;
  text-align: center;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeUp 1.5s ease forwards;
  animation-delay: 1.5s;
  border-radius: 12px;
  max-width: 1000px;
  margin: 3rem auto 0;
  color: #3A7D44;
}

.about-deco {
  position: absolute;
  z-index: -2;
}

.about-deco.dc1 {
  bottom: 0;
  left: 7%;
  width: 23%;
  max-width: 250px;
}

.about-deco.dc2 {
  bottom: 0;
  right: 7%;
  width: 19%;
  max-width: 200px;
}

.about-deco.dc3{
  bottom:0;
  right:0;
  max-width:180px;
  width:22%;
  z-index:-1
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 3rem;
}

.about p {
  max-width: 700px;
  margin: auto;
  margin-bottom: 3rem;
  line-height: 1.8;
  font-size: 1.25rem;
}

/* =====================
   Misconceptions Section
   ===================== */
.misconceptions {
  /* background: #4e7c50; */
  padding: 4rem 2rem;
  text-align: center;
  margin-bottom: -48px;
  background-image: url(../img/misconceptions_bg.png);
  background-repeat: repeat-y;
  background-size: 100% auto;
  background-position: top -80px center;
}

.misconceptions h2 {
  font-size: 2.4rem;
  margin-bottom: 3rem;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0px 0px 10px #3c6e47;
}

/* =====================
   Card Grid
   ===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* =====================
   Card
   ===================== */
.card {
  width: 100%;
  max-width: 460px;
  height: 740px;
  perspective: 1200px;
  margin: 0 auto;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
  transform-style: preserve-3d;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* =====================
   Card Front & Back
   ===================== */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  box-sizing: border-box;
  padding: 2rem;

  display: flex;
  flex-direction: column;
}

.card-front {
  background-color: #d7e9d7;
}

.card-back {
  transform: rotateY(180deg);
  background-color: #d7e9d7;
  display: flex;
  flex-direction: column;
}

/* =====================
   Card Decoration
   ===================== */
.card-deco {
  position: absolute;
  width: 55%;
  z-index: 0;
  /* Always behind */
  pointer-events: none;
  /* Prevent blocking clicks */
}

.card-deco.rt {
  top: 0;
  right: 0;
}

.card-deco.lb {
  bottom: 0;
  left: 0;
}

/* =====================
   Card Headings & Text
   ===================== */
.card-front h3,
.card-back h3 {
  font-size: 1.75rem;
  color: #2e5f38;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
  /* Keep above decoration images */
}

.card-front p,
.card-back p {
  line-height: 1.6;
  color: #333;
  margin-bottom: 1rem;
}

.card-front {
  font-size: 1.25rem;
}

.card-back p {
  font-size: 1.125rem;
}

.card-front .card-content,
.card-back .card-content {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.6;
  color: #333;
  position: relative;
  z-index: 1;
}

/* =====================
   Source Link
   ===================== */
.card-back .sub-item {
  margin-top: auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.card-back .sub-item a {
  color: #e74c3c;
  text-decoration: underline;
  font-weight: bold;
}

.card-back .sub-item a:hover {
  text-decoration: underline;
}

/* =====================
   Buttons
   ===================== */
.card-front .flip-btn {
  position: absolute;
  bottom: 15px;
  background: #DE5A5A;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 0.8rem 2rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  z-index: 10;
  align-items: center;
}

.card-front .flip-btn:hover {
  background: #c14949;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.card-back .flip-btn {
  position: absolute;
  bottom: 15px;
  background: #675CE0;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 0.8rem 2rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  z-index: 10;
}

.card-back .flip-btn:hover {
  background: #4f47b3;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.card-back .sub-item,
.card-back .flip-btn {
  z-index: 5;
}


/* =====================
   Source Section
   ===================== */
.sub-item {
  margin-top: 1.5rem;
  text-align: center;
}

.sub-item h3 {
  font-size: 2rem;
  color: #2e5f38;
  margin-bottom: 0.5rem;
}

.sub-item p {
  color: #333;
}

.sub-item a {
  color: #e74c3c;
  font-weight: bold;
  text-decoration: none;
}

.sub-item a:hover {
  text-decoration: underline;
}

/* =====================
   Footer
   ===================== */


.disclaimer {
  font-size: 1rem;
  opacity: 0.85;
  margin-top: 0.8rem;
}

/* =====================
   Optional: Icon Animation
   ===================== */
.card-front .herb-icon img,
.card-back .herb-icon img {
  max-width: 80px;
  transition: transform 0.3s ease;
}

/* ---------- Fix: allow Source/ReadMore and Back to be clickable ---------- */

/* Make card content non-interactive so it doesn't block clicks */
.card-front .card-content,
.card-back .card-content {
  pointer-events: none;
  /* content won't intercept clicks */
}

/* Ensure the interactive controls remain clickable and sit above content */
.card-back .sub-item,
.card-back .sub-item a,
.card-front .flip-btn,
.card-back .flip-btn {
  position: relative;
  /* make z-index take effect */
  z-index: 10;
  /* above card-content & decorations */
  pointer-events: auto;
  /* explicitly enable clicks */
  display: inline-block;
  /* ensure anchor has a reliable click area */
}


/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes popUp {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 1024px) {
  .hero {
    padding: 2rem;
    margin-top: 70px;
  }

  .hero-text h1 {
    font-size: 3rem;
  }

  .hero-figure img {
    /* max-width: 280px; */
  }

  .herb-detail {
    padding: 20px 50px;
  }
}

@media (max-width: 768px) {
  nav {
    gap: 2rem;
  }

  nav a {
    font-size: 1.1rem;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    margin-top: 60px;
  }

  .hero-figure {
    margin-top: 1.5rem;
  }

  .hero-text{
    margin-bottom: 0;
  }

  .hi-figure{
    display: none;
  }

  .hero-text h1 {
    font-size: 2.2rem;
  }

  .modal-content {
    padding: 16px 24px;
  }

  #modal-body {
    grid-template-columns: repeat(1, 1fr);
  }

  .about h2 {
    font-size: 1.8rem;
  }

  .about p {
    font-size: 1.1rem;
  }

  .card-grid {
    grid-template-columns: repeat(1, 1fr);
    padding: 0;
    gap: 1rem;
  }

  /* Card responsive adjustments */
  .card {
    max-width: 100%;
    height: auto;
    min-height: 400px;
    /* max-height: 600px; */
  }

  .card-front h3,
  .card-back h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
  }

  .card-front p,
  .card-back p {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .card-front .card-content,
  .card-back .card-content {
    font-size: 1.25rem;
    line-height: 1.4;
    padding: 1rem;
  }

  .card-front .flip-btn,
  .card-back .flip-btn {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    bottom: 10px;
  }

  .card-front .flip-btn {
    right: 10px;
  }

  .card-back .flip-btn {
    left: 10px;
  }

  .sub-item h3 {
    font-size: 1.3rem;
  }

  .sub-item p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  nav {
    flex-direction: column;
    gap: 0.8rem;
  }

  .hero {
    margin-top: 50px;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  .hero-figure img {
    /* max-width: 220px; */
  }

  .herb-detail {
    padding: 16px 18px;
  }

  .about h2 {
    font-size: 1.5rem;
  }

  .about p {
    font-size: 1rem;
  }

  /* Extra small screens - further card adjustments */
  .card {
    min-height: 350px;
    /* max-height: 500px; */
  }

  .card-front h3,
  .card-back h3 {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
  }

  .card-front p,
  .card-back p {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .card-front .card-content,
  .card-back .card-content {
    font-size: 1.25rem;
    line-height: 1.3;
    padding: 0.8rem;
  }

  .card-front .flip-btn,
  .card-back .flip-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    bottom: 8px;
  }

  .sub-item h3 {
    font-size: 1.2rem;
  }

  .sub-item p {
    font-size: 0.9rem;
  }
}

/* Footer */
#footer {
  background-color: #F8F5E9;
  padding: 40px 0 35px;
}

.footer-content {
  margin-bottom: 5px;
}

.link-button {
  color: #fff;
  background-color: #DE5A5A;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: bold;
  width: fit-content;
  font-size: 1.125rem;
  font-weight: bold;
  display: block;
  box-sizing: content-box;
}

.link-button img {
  height: 1.2em;
  vertical-align: middle;
  margin-left: 2px;
}

.wdc-logo {
  width: 45px;
}

.wdc-text {
  font-size: 1.5rem;
  font-weight: bold;
}

.copy {
  font-size: 1.125rem;
  text-align: center;
}