/* style.css */
/* Adapted from ref_style.css with changes for Chinese and responsiveness */

/* global variables */
:root {
  --primary-10: #f2f8f9;
  --primary-9: #deeeef;
  --primary-8: #c1dee0;
  --primary-7: #96c6ca;
  --primary-6: #64a5ac;
  --primary-5: #4f959d;
  --primary-4: #3f727b;
  --primary-3: #385e66;
  --primary-2: #344f56;
  --primary-1: #2f444a;
  --grey-1: hsl(189, 61%, 35%);
  --grey-2: hsl(189, 39%, 35%);
  --grey-3: hsl(189, 34%, 35%);
  --grey-4: hsl(189, 30%, 35%);
  --grey-5: hsl(189, 22%, 49%);
  --grey-6: hsl(189, 23%, 60%);
  --grey-7: hsl(189, 27%, 70%);
  --grey-8: hsl(189, 31%, 80%);
  --grey-9: hsl(189, 33%, 90%);
  --grey-10: hsl(189, 36%, 98%);
  --primary-white: #fff;
  --ff-primary: "Noto Serif TC", serif; /* For Traditional Chinese */
  --transition: all 0.3s linear;
  --spacing: 0.25rem;
  --radius: 0.5rem;
  --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  --nav-height: 4rem;
}
/* =============================== */
/* global settings */
html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--ff-primary);
}

html {
  scroll-behavior: smooth;
}
* {
  box-sizing: border-box;
}

body {
  background: var(--primary-white);
  color: var(--grey-1);
  line-height: 1.5;
  font-size: 0.875rem;
}
ul {
  list-style-type: none;
}
a {
  text-decoration: none;
}

img:not(.logo) {
  width: 100%;
  display: block;
}
h1,
h2,
h3,
h4 {
  letter-spacing: var(--spacing);
  text-transform: capitalize;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

h1 {
  font-size: 3rem;
}
h2 {
  padding: 40px;
  font-size: 2rem;
  text-align: center;
  text-transform: uppercase;
  color: var(--primary-3);
}
h3 {
  font-size: 1.25rem;
}
h4 {
  font-size: 0.875rem;
}
p {
  margin-bottom: 1.25rem;
  color: var(--grey-5);
}
span {
  color: var(--primary-5);
}
/* ============sections========================== */
/* navbar  */

.navbar {
  background-color: var(--primary-10);
  padding: 0 2rem;
  height: var(--nav-height);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 5;
  box-shadow: var(--dark-shadow);
}

.navbar .logo {
  width: var(--nav-height);
}

.navbar-flex {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.menu-list,
.icon-list {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  a {
    color: var(--primary-4);
    font-size: 1.2rem;
  }
}

.navbar .mobile-menu-items {
  /* border: 2px solid red; */
  position: absolute;
  top: var(--nav-height);
  bottom: 0;
  left: 0;
  width: 25%;
  background: var(--primary-white);
  text-align: center;
  transition: var(--transition);
  transform: translateX(-100%);
  visibility: hidden;
  z-index: 1;
}

.navbar .mobile-menu-list {
  /* border: 2px solid blue; */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* height: 100%; */
  padding-top: var(--nav-height);
  gap: 2rem;
  font-size: 1.2rem;
  margin-block: 0;
  background: var(--primary-8);
  opacity: 0.7;
  li {
    border-bottom: 1px solid var(--primary-5);
     /* border: 2px solid yellow; */
    padding-bottom: 1rem;
    a {
      color: var(--primary-white);
    }
  }
  li:last-child {
    border-bottom: 0;
  }
}

.navbar .mobile-menu-toggle {
  cursor: pointer;
}

.navbar .mobile-menu-items.active {
  transform: translateX(300%);
  transition: 1s ease-in-out;
  visibility: visible;
}

.navbar .mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .navbar {
    .main-menu,
    .icon-menu {
      display: none;
    }
  }
  .navbar .mobile-menu {
    display: block;
    a {
      color: var(--primary-white);
    }
  }
  .navbar .mobile-menu-items.active{
    transform: translateX(300%);
    visibility: visible;
  }
}

body.menu-active .hero {
  margin-top: calc(var(--nav-height) ); 
}

/* Hero */
.hero .container {
  max-width: 1100px;
  margin: var(--nav-height) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;

  /* position: relative; */
}

.hero {
  color: var(--primary-white);
  text-align: center;
  z-index: 20;
  margin-top: var(--nav-height);
  height: 100vh;
  background-size: cover;
  background-position: center;
  p {
    font-size: 1.5rem;
    padding: 1rem;
    margin-bottom: 2.5rem;
    color: var(--primary-white);
  }
}

.hero h1 {
  padding: 1rem;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.2;
  background: var(--grey-7);
}

.hero .btn {
  text-decoration: none;
  color: var(--primary-white);
  padding: 1rem 2rem;
  background: var(--primary-5);
  border: 1px solid var(--primary-white);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0.7;
  text-transform: uppercase;
}

.hero .btn:hover {
  opacity: 0.7;
  background-color: var(--primary-3);
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
    line-height: 1.3;
  }
  .hero p {
    font-size: 1.25rem;
  }
  .hero .btn {
    font-size: 1rem;
  }
}
/* about */
.about,
.services,
.tours {
  padding-top: var(--nav-height);
  margin-bottom: 4rem;
  z-index: 20;
}

.about-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: start;
  padding: 0 2.8rem;
  gap: 1.25rem;
  position: relative;
}
.about-img {
  width: 50%;
}
@media (min-width: 800px) {
  .about-img::before {
    content: "";
    position: absolute;
    width: calc(50% - 2.8rem);
    height: 100%;
    box-sizing: border-box;
    top: -1.25rem;
    left: 1.25rem;
    border: 5px solid var(--primary-3);
    z-index: -1;
  }
}
.text {
  width: 50%;
  h3 {
    color: var(--primary-3);
  }
  .btn-about {
    padding: 0.5rem;
    background: var(--primary-5);
    color: var(--primary-white);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.75rem;
  }
  .btn-about:hover {
    background: var(--primary-8);
    color: var(--primary-4);
  }
}
@media (max-width: 576px) {
  .about-content {
    flex-direction: column;
  }
  .text {
    width: 100%;
    h3 {
      font-size: 1rem;
    }
  }
  .about-img {
    width: 100%;
  }
}
/* services */
.services {
  height: 50vh;
  background-color: var(--grey-10);
}

.services-content {
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: start;
  justify-content: center;
}

.service-title {
  display: flex;
  justify-content: space-around;
  align-items: start;
}
.service-title .fa-solid {
  font-size: 1.5rem;
  background-color: var(--primary-5);
  color: var(--primary-3);
  padding: 1rem 1rem;
  width: 4rem;
}

.service-title h3 {
  margin: 0 1rem;
  font-size: 1rem;
  width: 7rem;
  padding-left: 0.75rem;
}
.service-title p {
  font-size: 1rem;
  margin-top: 0;
  width: 12rem;
}

/* =============================================== */
@media (max-width: 1099px) and (min-width: 577px) {
  .services {
    height: 75vh;
  }
  .services-content {
    width: 100%;
  }
  .service-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    width: 100%;
  }
  .service-title p {
    padding: 0 0.5rem;
  }
}
/* ============================================ */
@media (max-width: 576px) {
  .services {
    height: 100vh;
    h2 {
      font-size: 1.5rem;
    }
  }
  .services-content {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .service-title {
    width: 100%;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    h3 {
      font-size: 1rem;
      width: 100%;
      padding: 0.5rem;
    }
    p {
      font-size: 0.75rem;
      width: 60%;
    }
  }
  .service-title .fa-solid {
    font-size: 1.75rem;
    padding: 1rem 0;
    width: 3.5rem;
  }
}
/* tours */
.tours {
  padding: 2rem;
}
.cards {
  width: 100%;
  max-width: 1100px; /* Constrain grid width, consistent with .hero .container */
  margin: 0 auto; /* Center the grid */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* Three equal columns */
  gap: 2rem;
  align-items: stretch; /* Ensure uniform height */
  justify-content: center;
}

.card {
  box-shadow: var(--dark-shadow);
  display: flex;
  flex-direction: column;
  max-width: 350px; /* Cap card width to ensure consistency */
}

.card:hover {
  transform: scale(1.03);
  transition: var(--transition);
}

.card-img img {
  height: 200px;
  object-fit: cover;
}
.card-content {
  background: var(--primary-9);
  padding: 1.5rem 2rem 0.5rem;
  min-height: 150px; /* Ensures uniform height */
  flex: 1;
  display: flex;
  flex-direction: column; /* Stack children vertically */
  justify-content: space-between; /* Push link to bottom */
  p {
    font-size: 1rem;
    color: var(--primary-7);
  }
  a {
    color: var(--primary-5);
  text-decoration: none;
  font-size: 1rem;
  text-transform: uppercase;
  align-self: flex-start; /* Align link to left */
  margin-top: auto; /* Push link to bottom */
  }
}
/* Responsive adjustments */
@media (max-width: 991px) and (min-width: 577px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Two columns */
    justify-content: center;
  }
  .card {
    max-width: 400px; /* Slightly larger for two-column layout */
  }
}

@media (max-width: 576px) {
  .cards {
    grid-template-columns: 1fr; /* One column */
  }
  .card {
    max-width: 100%; /* Full width for small screens */
  }
  .card-img img {
    height: 150px;
  }
  .card-content {
    min-height: 120px;
  }
}

.card-actions {
  display: flex;
  gap: 1rem; /* Space between links */
  align-items: center; /* Vertically align links */
  align-self: flex-start; /* Left-justify the container */
}

.details-link, .purchase-link {
  color: var(--primary-5);
  text-decoration: none;
  font-size: 1rem;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

.details-link:hover, .purchase-link:hover {
  color: var(--primary-white);
  background-color: var(--primary-3);
  transition: var(--transition);
}

.purchase-link {
  background-color: var(--primary-7);
  color: var(--primary-white);
}
/* footer */
.footer {
  height: 35vh;
  background: var(--primary-3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  a,
  p,
  span {
    color: var(--primary-white);
  }
  .icon-item {
    .fa-brands {
      font-size: 2rem;
    }
  }
}

/* WhatsApp Floating */
.whatsapp-logo {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  z-index: 100;
}
.whatsapp-logo img {
  width: 100%;
  height: 100%;
}

/* Lightbox for tour pages */
.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}
.lightbox-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
}
.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}
.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}
.gallery {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
}


/* Tours.html */
.tour-detail {
  padding-top: var(--nav-height); /* Matches navbar height (4rem) */
  margin: 20px auto;
  max-width: 1100px; /* Consistent with other sections */
  padding-left: 1rem;
  padding-right: 1rem;
  h1{font-size: 30px; text-align: center;}
  p{font-size: 20px;}
}



/* Large screens (≥ 992px): 2 columns */
@media (min-width: 992px) {
  .gallery {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .gallery-item {
    width: calc(33% - 0.5rem); /* Two columns with gap adjustment */
    max-width: 400px;
    height: auto;
    object-fit: cover;
  }
}

/* Medium screens (577px - 991px): 2 columns */
@media (min-width: 577px) and (max-width: 991px) {
  .gallery {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .gallery-item {
    width: calc(50% - 0.5rem); /* Two columns with gap adjustment */
    max-width: 400px;
    height: auto;
    object-fit: cover;
  }
}

/* Small screens (≤ 576px): 1 column */
@media (max-width: 576px) {
  .gallery {
    flex-direction: column;
  }
  .gallery-item {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
  }
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio (480/853) */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1rem auto; /* Center the video with some spacing */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Large screens (≥992px): Full width up to a max */
@media (min-width: 992px) {
  .video-container {
    max-width: 800px; /* Adjust as needed for large screens */
  }
}

/* Medium screens (577px–991px): Slightly smaller max width */
@media (min-width: 577px) and (max-width: 991px) {
  .video-container {
    max-width: 600px; /* Adjust for medium screens */
  }
}

/* Small screens (≤576px): Full width */
@media (max-width: 576px) {
  .video-container {
    max-width: 100%; /* Full width for small screens */
  }
}

/* Handle the footer */
.footer {
  height: 35vh;
  background: var(--primary-3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.footer a,
.footer p,
.footer span {
  color: var(--primary-white);
}
.footer .icon-item .fa-brands {
  font-size: 2rem;
}
.whatsapp-logo {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}
.whatsapp-logo img {
  width: 50px;
  height: 50px;
}
