/* 
   彌勒旅居 - 專屬樣式表
   風格：現代禪風 (Modern Zen) - 簡約、溫暖、沉靜
   所有樣式皆有繁體中文註解，方便初學者學習與維護
*/

/* 引入 Google Fonts: Noto Serif TC (禪意襯線體) 與 Noto Sans TC (無襯線體) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;600;700;900&display=swap');

/* 全域變數定義：調色盤與字型 */
:root {
  --bg-primary: #fdfbf7;      /* 溫潤米白色 (主要背景) */
  --bg-secondary: #f5ede2;    /* 暖沙色 (次要背景) */
  --text-primary: #2c2a29;    /* 深茶色 (主要文字，比純黑更溫和) */
  --text-secondary: #6e6761;  /* 暖灰色 (次要文字) */
  --accent: #8d7b68;          /* 沉靜木質棕 (重點色/按鈕) */
  --accent-light: #c8b6a6;    /* 淺木質色 */
  --accent-hover: #5c4e43;    /* 深木質色 (懸停狀態) */
  --white: #ffffff;           /* 純白 */
  --border-color: #e7dfd5;    /* 邊框線條顏色 */
  --shadow-subtle: 0 4px 20px rgba(141, 123, 104, 0.08); /* 柔和陰影 */
  
  /* 字型定義 */
  --font-title: 'Noto Serif TC', serif;
  --font-body: 'Noto Sans TC', sans-serif;
  
  /* 過渡動畫時間 */
  --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 基礎重設 (Reset) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* 平滑滾動 */
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

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

/* 網頁寬度容器 */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* 按鈕樣式 */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  border-radius: 0px; /* 直角設計更有禪風簡約感 */
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: var(--white);
}

/* 區塊標題 */
.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title h2 {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background-color: var(--accent);
}

.section-title p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 0.8rem;
  letter-spacing: 2px;
}

/* ==========================================
   1. 導覽列 (Navigation)
========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: var(--transition-smooth);
}

/* 當網頁滾動時，JS 會幫 navbar 加上這個 class */
.navbar.scrolled {
  background-color: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  box-shadow: var(--shadow-subtle);
  border-bottom: 1px solid var(--border-color);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 1px;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent);
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

/* 手機版選單按鈕 */
.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--text-primary);
  margin: 5px 0;
  transition: var(--transition-smooth);
}

/* ==========================================
   2. 首頁橫幅 (Hero Banner)
========================================== */
.hero {
  height: 100vh;
  background: linear-gradient(rgba(44, 42, 41, 0.4), rgba(44, 42, 41, 0.2)), 
              url('hero-bg.jpg') no-repeat center center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding-top: 80px;
}

.hero-content {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.2s forwards 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-title {
  font-family: var(--font-title);
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 8px;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-subtitle {
  font-size: 1.3rem;
  letter-spacing: 4px;
  margin-bottom: 2.5rem;
  font-weight: 300;
  color: #f0eae1;
  text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ==========================================
   3. 關於我們 (About Section)
========================================== */
.about {
  padding: 8rem 0;
  background-color: var(--bg-primary);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 5rem;
  align-items: center;
}

.about-img-wrapper {
  position: relative;
}

.about-img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  border-radius: 0px;
}

.about-img-deco {
  position: absolute;
  top: 20px;
  left: -20px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--accent-light);
  z-index: -1;
}

.about-text h3 {
  font-family: var(--font-title);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  text-align: justify;
}

.about-quote {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
}

/* ==========================================
   4. 客房展示 (Rooms Section)
========================================== */
.rooms {
  padding: 8rem 0;
  background-color: var(--bg-secondary);
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 3rem;
}

.room-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.room-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-subtle);
}

.room-img-box {
  position: relative;
  overflow: hidden;
  height: 250px;
}

.room-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.room-card:hover .room-img-box img {
  transform: scale(1.08);
}

.room-tag {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: rgba(141, 123, 104, 0.9);
  color: var(--white);
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-family: var(--font-title);
  letter-spacing: 1px;
}

.room-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.room-info h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.room-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.room-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.room-price {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 600;
}

.room-price span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: normal;
}

/* ==========================================
   5. 特色體驗 (Experience Section)
========================================== */
.experience {
  padding: 8rem 0;
  background-color: var(--bg-primary);
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

.exp-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 5rem;
  align-items: center;
}

.exp-item:nth-child(even) {
  grid-template-columns: 1fr 1.2fr;
}

.exp-item:nth-child(even) .exp-img-box {
  order: 2;
}

.exp-item:nth-child(even) .exp-text-box {
  order: 1;
}

.exp-img-box {
  height: 380px;
  overflow: hidden;
}

.exp-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exp-text-box h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.exp-text-box h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 1.5px;
  background-color: var(--accent);
}

.exp-text-box p {
  color: var(--text-secondary);
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ==========================================
   6. 聯絡預約 (Contact Section)
========================================== */
.contact {
  padding: 8rem 0;
  background-color: var(--bg-secondary);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 5rem;
}

.contact-info-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-info-details {
  margin-top: 2rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1rem;
}

.info-icon {
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 2px;
}

.info-text h4 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.info-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.contact-form-box {
  background-color: var(--bg-primary);
  padding: 3rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-family: var(--font-body);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--accent);
  background-color: var(--white);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ==========================================
   7. 頁尾 (Footer)
========================================== */
.footer {
  background-color: var(--text-primary);
  color: #dcd7cf;
  padding: 4rem 0 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-logo h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--white);
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.footer-logo p {
  font-size: 0.85rem;
  line-height: 1.8;
}

.footer-links h4, .footer-hours h4 {
  font-family: var(--font-title);
  color: var(--white);
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 0.8rem;
}

.footer-links a:hover {
  color: var(--white);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #4a4541;
  font-size: 0.8rem;
  color: #9c948c;
}

/* ==========================================
   8. 互動彈窗 (Room Detail Modal)
========================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(44, 42, 41, 0.6);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background-color: var(--bg-primary);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: translateY(30px);
  transition: transform 0.4s ease;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-primary);
  z-index: 10;
  background: none;
  border: none;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.modal-img-box {
  height: 350px;
  width: 100%;
}

.modal-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 3rem;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.modal-price {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.modal-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.modal-amenities {
  margin-bottom: 2.5rem;
}

.modal-amenities h4 {
  font-family: var(--font-title);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.amenity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.amenity-tag {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================
   動畫效果 (Keyframes)
========================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   響應式斷點設計 (Responsive Breakpoints)
========================================== */

/* 1024px 以下平板 */
@media (max-width: 1024px) {
  html {
    font-size: 15px;
  }
  .about-grid {
    gap: 3rem;
  }
  .exp-item, .exp-item:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .exp-item:nth-child(even) .exp-img-box {
    order: 0;
  }
  .exp-item:nth-child(even) .exp-text-box {
    order: 0;
  }
  .exp-img-box {
    height: 300px;
  }
}

/* 768px 以下手機 */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .navbar {
    background-color: var(--bg-primary); /* 手機版固定背景色確保選單可讀性 */
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
  }
  
  .hamburger {
    display: block; /* 顯示手機漢堡選單 */
  }
  
  .hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1.5rem 0;
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-smooth);
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 1rem 0;
    width: 100%;
  }

  .hero-title {
    font-size: 2.8rem;
    letter-spacing: 4px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    letter-spacing: 2px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-img {
    height: 350px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .form-group-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .modal-body {
    padding: 2rem;
  }
  
  .modal-img-box {
    height: 250px;
  }
}
