/* ============================================================
   共用元件:Header / Footer / Dropdown / Footer Contact
   ============================================================ */

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
  overflow: visible;
}

.nav {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  line-height: 0;
}

.brand img {
  height: 52px;
  width: auto;
  max-width: min(280px, 50vw);
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 14px;
  font-weight: 600;
  color: #2f2b29;
}

.nav-links span.sep {
  width: 1px;
  height: 16px;
  background: #b9b0aa;
  display: inline-block;
}

.nav-links > span.sep:last-child {
  display: none;
}

/* ---------- Nav Dropdown ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.nav-dropdown__main {
  font-weight: 600;
  font-size: 14px;
  color: #2f2b29;
}

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

.nav-dropdown__btn {
  border: none;
  background: transparent;
  padding: 6px 4px;
  margin: 0;
  cursor: pointer;
  color: #2f2b29;
  line-height: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-dropdown__btn:hover {
  color: var(--accent);
  background: rgba(138, 90, 40, .08);
}

.nav-dropdown__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 148px;
  margin: 0;
  padding: 10px 0 8px;
  list-style: none;
  background: #fff;
  border: 1px solid #e0d8cf;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .12);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s;
}

.nav-dropdown__menu a {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #2f2b29;
  white-space: nowrap;
}

.nav-dropdown__menu a:hover {
  background: #f7f4ef;
  color: var(--accent);
}

.nav-dropdown__menu a[aria-current="page"] {
  background: #f0e8dc;
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown__menu,
  .nav-dropdown:focus-within .nav-dropdown__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.nav-dropdown.is-open .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---------- Mobile Hamburger / Drawer ---------- */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  background: #2f2b29;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

.nav-close {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #2f2b29;
  cursor: pointer;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

.nav-close:hover {
  background: rgba(0, 0, 0, .06);
}

.nav-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, .45);
  z-index: 90;
  opacity: 0;
  transition: opacity .25s ease;
}

/* ---------- Footer ---------- */
footer {
  background: #4a433f;
  color: #f5f0e8;
  padding: 72px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1.25fr) auto minmax(150px, 0.8fr);
  column-gap: clamp(20px, 2.8vw, 36px);
  row-gap: 35px;
  margin-bottom: 40px;
  align-items: start;
}

.footer-nav-bundle {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  column-gap: clamp(8px, 1.1vw, 14px);
  align-items: start;
}

.footer-col--contact {
  min-width: 0;
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 28px);
  max-width: 420px;
}

.footer-lotus {
  flex-shrink: 0;
  color: #e5ddd2;
  opacity: 0.92;
  line-height: 0;
}

.footer-lotus svg {
  width: clamp(56px, 8vw, 88px);
  height: auto;
  display: block;
}

.footer-branding__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.footer-branding__logo {
  display: block;
  max-height: 100px;
  width: auto;
  max-width: min(320px, 100%);
  object-fit: contain;
  object-position: left center;
}

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #faf6f0;
  font-family: var(--font-body);
  letter-spacing: 0.06em;
}

/* wp_nav_menu(items_wrap='%3$s') 會留下裸 <li> → 拿掉預設 bullet */
.footer-col ul,
.footer-col li {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col a,
.footer-col__plain {
  display: block;
  color: #ebe4da;
  font-size: 14px;
  font-weight: 400;
  padding: 5px 0;
  font-family: var(--font-body);
}

.footer-col a:hover {
  color: #fff;
}

.footer-col a.footer-contact-row,
.footer-col .footer-contact-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  color: #ebe4da;
  font-size: 14px;
  font-family: var(--font-body);
  text-align: left;
}

.footer-col a.footer-contact-row {
  width: 100%;
  box-sizing: border-box;
}

.footer-col a.footer-contact-row:hover,
.footer-col .footer-contact-row:hover {
  color: #fff;
}

.footer-contact-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  display: grid;
  place-items: center;
  color: #f0ebe3;
}

.footer-contact-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.copyright {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 11px;
  color: #b8b0a6;
  letter-spacing: 0.12em;
  font-family: var(--font-body);
}

.copyright__sep {
  margin: 0 0.35em;
  opacity: 0.65;
}

/* ---------- Footer 響應式 ---------- */
@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-branding {
    max-width: none;
    justify-content: center;
    text-align: center;
  }

  .footer-branding__main {
    align-items: center;
  }

  .footer-branding__logo {
    object-position: center;
  }

  .footer-nav-bundle {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 12px;
    width: 100%;
  }

  .footer-col--contact {
    min-width: 0;
  }
}

/* ---------- Mobile Nav 響應式 (≤767px) ---------- */
@media (max-width: 767px) {
  .nav {
    min-height: 64px;
  }

  .brand img {
    height: 40px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-close {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: min(82vw, 320px);
    height: 100vh;
    height: 100dvh;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 64px 28px 36px;
    box-shadow: -16px 0 36px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    z-index: 100;
    overflow-y: auto;
  }

  .nav-links > a,
  .nav-links .nav-dropdown {
    width: 100%;
    padding: 14px 4px;
    font-size: 16px;
    border-bottom: 1px solid #eee5d8;
  }

  .nav-links > a:last-child {
    border-bottom: none;
  }

  .nav-links span.sep {
    display: none;
  }

  /* 行動裝置 dropdown:箭頭 toggle,選單 inline 展開 */
  .nav-dropdown__row {
    justify-content: space-between;
    width: 100%;
  }

  .nav-dropdown__btn {
    padding: 8px 6px;
  }

  .nav-dropdown__menu {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    margin: 6px 0 0;
    padding: 4px 0;
    background: #faf6f0;
    border: none;
    box-shadow: none;
    border-radius: 8px;
    display: none;
  }

  .nav-dropdown.is-open .nav-dropdown__menu {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-dropdown__menu a {
    padding: 10px 16px;
    font-weight: 500;
  }

  /* 開啟狀態:drawer 滑入,backdrop 顯示,bar 變成 X */
  .topbar.is-mobile-open .nav-links {
    transform: translateX(0);
  }

  .topbar.is-mobile-open .nav-backdrop {
    display: block;
    opacity: 1;
  }

  body.is-mobile-nav-open {
    overflow: hidden;
  }
}

