/* === 全站基本設定 === */
:root {
  --header-h: 64px;
  --brand-main: #C9B4E8;      /* 淡紫 */
  --brand-main-dark: #B99DE0; /* hover 紫 */
  --brand-line: #e7dff6;      /* 淺紫底線 */
  --brand-text: #3a3a3a;      /* 深灰文字 */
  --brand-bg: #ffffff;
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }
}

html {
  height: 100%;
  margin: 0;
  font-family: "Noto Sans TC", "Inter", sans-serif;
  background: var(--brand-bg);
  color: var(--brand-text);

  /* iOS 避免字體自動放大造成版面跳動 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;

  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  height: 100%;
  margin: 0;
  font-family: inherit;
  background: var(--brand-bg);
  color: var(--brand-text);

  /* 讓主內容不被 fixed header 壓住 */
  padding-top: var(--header-h);

  /* 防止某元素超出造成左右滑 */
  overflow-x: hidden;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* footer */
.site-footer {
  background-color: #f9f7ff;
  padding: 30px 20px;
  text-align: center;
  font-size: 14px;
  color: #4a4a4a;
}

/* === Header 導覽列 === */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1500;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--brand-line);
  width: 100%;
  padding: 10px 20px;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  width: 100%;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: #000;
  margin: 0;
}

.logo a {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
}

nav { position: relative; }

.menu {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.menu li a {
  text-decoration: none;
  color: var(--brand-text);
  font-family: "Noto Serif TC", serif;
  font-weight: 600;
  transition: color 0.25s ease;
}

.menu li a:hover { color: var(--brand-main-dark); }

/* =========================================================
   ✅ 漢堡按鈕（無圓圈 + 真置中 + 可變 X）
   重點：固定寬高 + display:flex 置中 + 用 ::before 避免 baseline 下沉
   ========================================================= */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;

  /* ✅ 真正置中 */
  display: flex;
  align-items: center;
  justify-content: center;

  /* ✅ 避免文字 baseline 影響 */
  line-height: 0;
}

/* 預設顯示 ☰ */
.menu-toggle::before {
  content: "☰";
  font-size: 26px;
  line-height: 1;             /* 只給 pseudo element 自己的 line-height */
  color: var(--brand-text);
  display: block;

  /* ✅ 視覺微調：再往上 1px（你覺得完全正中可改 0） */
  transform: translateY(-1px);
}

/* 打開選單時顯示 X（使用 aria-expanded） */
.menu-toggle[aria-expanded="true"]::before {
  content: "✕";
  font-size: 24px;
  transform: translateY(-1px);
}

/* 手機 RWD 選單 */
@media (max-width: 768px) {
  .menu-toggle { display: flex; } /* ✅ 手機才顯示漢堡 */

  .header { padding: 10px 16px; }
  .logo { font-size: 1.4rem; }

  .menu {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.97);
    padding: 24px;

    display: none;
    flex-direction: column;
    gap: 14px;

    overflow-y: auto;
    z-index: 1100;
  }

  .menu.open { display: flex; }

  body.nav-open {
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .container { padding: 0 16px 32px; }
}

/* === 按鈕 (品牌統一版) === */
.more-center {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.more-button,
.form-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 12px 24px;
  border-radius: 999px;

  font-family: "Noto Sans TC","Inter",sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;

  text-decoration: none;
  text-align: center;

  border: none;
  background: linear-gradient(90deg, var(--brand-main), var(--brand-main-dark));
  color: #ffffff;

  box-shadow: 0 6px 16px rgba(130,112,173,0.26);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.more-button:hover,
.form-button:hover {
  background: linear-gradient(90deg, var(--brand-main-dark), #AF91DD);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(130,112,173,0.33);
}

.more-button:active,
.form-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(130,112,173,0.22);
}

@media (max-width: 768px) {
  .more-center {
    flex-direction: column;
    align-items: center;
  }
  .more-button,
  .form-button {
    width: 100%;
    max-width: 260px;
  }
}

/* === 內容區塊標題 === */
.section {
  margin-bottom: 50px;
  scroll-margin-top: calc(var(--header-h) + 12px);
  color: var(--brand-text);
}

.section h2 {
  font-family: "Noto Serif TC", serif;
  font-size: 1.6rem;
  border-bottom: 2px solid var(--brand-main);
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.section p {
  line-height: 1.85;
  letter-spacing: 0.2px;
  color: #4a4a4a;
}

/* === 課程卡片 === */
.course-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.course-card {
  display: block;
  width: 280px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  text-decoration: none;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: transform .2s ease, box-shadow .2s ease;
}

.course-card img {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.course-card h3 {
  margin-top: 10px;
  font-family: "Noto Serif TC", serif;
  font-size: 1.2rem;
  color: var(--brand-text);
}

.course-card p {
  color: #666;
  margin-bottom: 0;
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* === 師資照片（圓形） === */
.teacher-photo-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.teacher-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ===== Hero 區塊 ===== */
.hero {
  padding-top: 40px;
  padding-bottom: 40px;
  text-align: center;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  font-family: "Noto Serif TC", "Playfair Display", serif;
  font-size: 1.6rem;
  margin: 0 0 10px;
  color: #333;
}

.hero-subtitle {
  font-size: 1rem;
  color: #555;
  margin: 0 0 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-b {
  background: linear-gradient(180deg, #f9f7ff 0%, #ffffff 70%);
}

.hero-logo-wrap {
  position: relative;
  width: 220px;
  max-width: 65vw;
  margin: 0 auto 18px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-wrap::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffffff 0, #f3e9ff 40%, #e4d5ff 80%);
  filter: blur(2px);
  z-index: -1;
}

.hero-logo {
  width: 180px;
  max-width: 55vw;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .hero {
    padding-top: 30px;
    padding-bottom: 32px;
  }
  .hero-title {
    font-size: 1.35rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
}

/* === Lightbox === */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

/* =========================
   學員成果：橫向輪播（含箭頭/計數/等高）
   ========================= */

.gallery-wrap {
  position: relative;
  margin-top: 16px;
}

/* ✅ 只給輪播用，避免被你其他 .gallery 設定影響 */
.gallery--carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 52px;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;

  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gallery--carousel::-webkit-scrollbar { display: none; }

.gallery--carousel .lightbox-link {
  flex: 0 0 240px;
  border-radius: 14px;
  overflow: hidden;
  scroll-snap-align: start;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.gallery--carousel img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;

  width: 38px;
  height: 38px;
  border-radius: 999px;

  border: 1px solid var(--brand-main);
  background: rgba(255,255,255,0.92);
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
  transition: transform .15s ease, opacity .2s ease, box-shadow .2s ease;
}

.gallery-arrow:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 10px 22px rgba(0,0,0,0.16);
}

.gallery-arrow.left { left: 8px; }
.gallery-arrow.right { right: 8px; }

.gallery-arrow.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.gallery-counter {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

@media (max-width: 768px) {
  .gallery--carousel { padding: 6px 44px; }
  .gallery--carousel .lightbox-link { flex: 0 0 80%; }
  .gallery--carousel img { height: 160px; }
}

/* Footer */
.footer-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Social icons */
.social-icons a img {
  width: 26px;
  margin: 0 6px;
  transition: transform .2s ease;
}

.social-icons a img:hover {
  transform: scale(1.1);
}

/* =========================
   更多課程頁（class.html）手機版修正（你原本的）
   ========================= */
@media (max-width: 768px) {
  .container { max-width: 100%; padding: 0 16px 32px; }
  .course-grid { flex-direction: column; align-items: center; }
  .course-card { width: 100%; max-width: 420px; }
  .course-card img { height: 180px; }
}

/* =========================
   class.html（更多課程頁）4+4 排版
   桌機：4欄
   手機：2欄（畫面內 2x2 = 4張）
   ========================= */
.course-grid--class {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.course-grid--class .course-card {
  width: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.course-grid--class .course-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
}

.course-grid--class .course-card h3 {
  margin: 10px 0 6px;
  font-size: 1rem;
  line-height: 1.35;
}

.course-grid--class .course-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #666;
}

@media (max-width: 768px) {
  .course-grid--class {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .course-grid--class .course-card img { height: 120px; }
  .course-grid--class .course-card { padding: 12px; }
}
/* =========================
   ✅ 桌機強制：不顯示漢堡、顯示橫向選單
   （避免視窗縮放/寬度判斷造成桌機也出現漢堡）
   ========================= */
@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }

  .menu {
    display: flex !important;
    position: static !important;
    padding: 0 !important;
    background: transparent !important;
    flex-direction: row !important;
    gap: 20px !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.nav-open {
    position: static !important;
    height: auto !important;
    overflow: auto !important;
  }
}
    /* ====== class.html 專用（其餘沿用 style.css） ====== */
    .page-hero { text-align:center; margin: 18px 0 10px; }
    .page-hero h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; margin: 0 0 6px; }

    .filters { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin: 10px 0 18px; }
    .filter-btn { border:1px solid #ddd; background:#fff; padding:8px 12px; border-radius:999px; font-size:.92rem; cursor:pointer; }
    .filter-btn.active { border-color:#333; }

    /* ✅ 你要的：桌機 4 欄；手機 2 欄（每頁顯示 4 = 2x2） */
    .course-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:14px; }
    @media (min-width: 1024px){ .course-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); gap:18px; } }

    /* ✅ 避免 style.css 的 width:280px 影響（提高優先權） */
    .course-grid .course-card{
      width: auto !important;
      display:block;
      border-radius:14px;
      overflow:hidden;
      text-decoration:none;
      background:#fff;
      box-shadow:0 6px 18px rgba(0,0,0,.06);
      transition:transform .18s ease, box-shadow .18s ease;
    }
    .course-grid .course-card:hover{ transform: translateY(-2px); box-shadow:0 10px 24px rgba(0,0,0,.10); }

    .course-grid .course-card img{
      width:100%;
      height:150px;
      object-fit:cover;/* 保持圖片比例且覆蓋 */
      display:block;/* 避免被 style.css 影響 */
    }

    .course-grid .course-card h3{ margin:10px 12px 4px; font-size:1rem; line-height:1.35; }
    .course-grid .course-card p{ margin:0 12px 12px; font-size:.92rem; color:#555; line-height:1.5; }

    .badge { display:inline-block; margin:0 12px 12px; font-size:.8rem; color:#444; background:#f3f3f3; padding:4px 8px; border-radius:8px; }

    /* 分頁控制 */
    .pagination { display:flex; gap:10px; align-items:center; justify-content:center; margin:14px 0 4px; flex-wrap:wrap; }
    .page-button { border:1px solid #ddd; background:#fff; padding:8px 12px; border-radius:10px; cursor:pointer; min-width:90px; }
    .page-button:disabled { opacity:.45; cursor:not-allowed; }
    .page-info { font-size:.95rem; color:#444; }

/* === 線上預約導覽按鈕 === */
.menu li a.booking-link {
  background-color: var(--brand-main);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--brand-main);
  font-weight: 600;
  transition: all 0.25s ease;
  display: inline-block;
}

.menu li a.booking-link:hover {
  background-color: var(--brand-main-dark);
  border-color: var(--brand-main-dark);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(201, 180, 232, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .menu li a.booking-link {
    text-align: center;
    margin-top: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    display: block;
  }
}

/* === 語言切換選擇器 (Language Selector) === */
.menu .lang-item {
  display: flex;
  align-items: center;
}

.lang-selector {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233a3a3a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center #f8f6fc;
  border: 1px solid var(--brand-line);
  border-radius: 18px;
  padding: 5px 28px 5px 12px;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand-text);
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
}

.lang-select:hover, .lang-select:focus {
  border-color: var(--brand-main-dark);
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(201, 180, 232, 0.3);
}

@media (max-width: 768px) {
  .menu .lang-item {
    margin-top: 10px;
    justify-content: center;
  }
  .lang-select {
    width: 100%;
    max-width: 200px;
    padding: 8px 32px 8px 16px;
    font-size: 0.95rem;
    background-position: right 14px center;
  }
}