/* shared.css — common nav, menu overlay, and footer for all pages */

/* 只右側預留捲軸空間：Mac 接滑鼠時系統捲軸變寬也不會讓頁面內容橫向位移。
   不用 both-edges——左側也留 gutter 會讓 full-bleed 的 hero/CTA 大圖左緣多一條 15px 白帶 */
html { scrollbar-gutter: stable; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Top spacing below fixed nav */
.page-wrap { padding-top: 80px !important; }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 26px 36px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 160px; pointer-events: none; z-index: -1;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
}
.nav.nav-hidden { transform: translateY(-100%); }
.nav-hamburger {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; padding: 4px;
}
.nav-hamburger span { display: block; width: 26px; height: 1.5px; background: #fff; transition: 0.3s; }
.nav-brand {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 11px; font-weight: 300; color: #fff;
}
.nav-brand a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.nav-brand span { font-family: 'Cormorant Garamond', serif; font-weight: 500; letter-spacing: 3px; padding-left: 3px; }
.nav-brand img { height: 44px; width: auto; filter: invert(1); }
.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 32px; }
.nav-right a { font-family: 'Jost', sans-serif; font-size: 14.3px; letter-spacing: 3px; font-weight: 300; color: #fff; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
body:has(.menu-overlay.open) .nav-right { opacity: 0; pointer-events: none; }
/* 導覽連結 hover 翻牌：英文往上翻走、中文從背面翻出來 */
.nav-flip { display: inline-block; perspective: 240px; }
.nav-flip-inner {
  position: relative;
  display: block;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-flip:hover .nav-flip-inner { transform: rotateX(180deg); }
.nav-flip-front, .nav-flip-back {
  display: block;
  backface-visibility: hidden;
  white-space: nowrap;
}
.nav-flip-back {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%) rotateX(180deg);
  letter-spacing: 1px;
}
/* 桌機版：常駐水平選單，隱藏漢堡；手機版：維持原本漢堡選單，隱藏水平選單 */
@media (min-width: 769px) {
  .nav-hamburger { display: none; }
  .nav { grid-template-columns: auto 1fr auto; }
  .nav-brand { justify-self: start; text-align: left; align-items: flex-start; margin-left: 42px; }
}
@media (max-width: 768px) {
  .nav-right { display: none; }
}

/* ── PAGE HERO ── */
.page-hero {
  position: relative; height: 88vh; overflow: hidden; background: #111;
}
.page-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.page-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0) 35%,
    rgba(0,0,0,0.6) 100%
  );
}
.page-hero-title {
  position: absolute; bottom: 60px; left: 52px;
  color: #fff; margin: 0; line-height: 1.2;
}
.page-hero-en {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(20px, 3.2vw, 42px);
  font-weight: 500; letter-spacing: 4px; text-transform: uppercase;
}
.page-hero-zh {
  display: block;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 300; letter-spacing: 5px;
  color: rgba(255,255,255,0.6); margin-top: 10px;
}

/* ── CONTACT CTA ── */
.contact-cta {
  position: relative;
  padding: 251px 0 443px;
  display: flex; flex-direction: column; align-items: center;
  overflow: hidden; text-align: center;
  background: #f5f3f0;
  gap: 8px;
}
.cta-glyphs {
  display: flex; align-items: center; justify-content: center;
  gap: 28px;
  opacity: 0; transform: scale(1.08);
  transition: opacity 2.2s cubic-bezier(0.16,1,0.3,1), transform 2.6s cubic-bezier(0.16,1,0.3,1);
}
.contact-cta.in-view .cta-glyphs { opacity: 1; transform: scale(1); }
.cta-hero-img {
  display: block;
  width: min(88vw, 860px);
  height: auto;
}
.contact-cta-inner {
  position: relative; z-index: 1; padding: 0 24px;
  margin-top: 8px;
  opacity: 0; transform: translateY(28px);
  transition: opacity 1.6s ease 0.4s, transform 1.6s cubic-bezier(0.16,1,0.3,1) 0.4s;
}
.contact-cta.in-view .contact-cta-inner { opacity: 1; transform: none; }
@keyframes cta-text-float {
  0%, 100% { opacity: 0.82; transform: translateY(7px); }
  50% { opacity: 1; transform: translateY(0); }
}
.cta-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 3.5vw, 45px); font-weight: 400;
  color: #1a1a1a; letter-spacing: 1px; margin-bottom: 16px;
  text-shadow: 2px 4px 2px rgba(0,0,0,0.2), 5px 12px 18px rgba(0,0,0,0.32);
  animation: cta-text-float 4.5s ease-in-out infinite;
  animation-delay: 0s;
}
.cta-sub {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 23.4px; font-weight: 300; line-height: 1.7;
  color: rgba(26,26,26,0.65); margin-bottom: 40px; letter-spacing: 1px;
  text-shadow: 1px 3px 1px rgba(0,0,0,0.16), 3px 8px 12px rgba(0,0,0,0.24);
  animation: cta-text-float 4.5s ease-in-out infinite;
  animation-delay: 0.3s;
}
.cta-btn {
  display: inline-block;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 14.4px; letter-spacing: 5px; font-weight: 300;
  color: rgba(26,26,26,0.7); text-transform: uppercase;
  text-decoration: none; position: relative; padding-bottom: 4px;
  text-shadow: 1px 3px 1px rgba(0,0,0,0.16), 3px 8px 12px rgba(0,0,0,0.24);
  animation: cta-text-float 4.5s ease-in-out infinite;
  animation-delay: 0.6s;
}
.cta-btn::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 1px; background: rgba(26,26,26,0.7);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.cta-btn:hover { color: #1a1a1a; }
.cta-btn:hover::after { transform: scaleX(1); }

/* ── INFO SECTION ── */
.info-section { background: #f5f3f0; padding: 80px 60px 0; }
.info-top {
  display: grid; grid-template-columns: 3fr 2fr;
  gap: 48px; padding-bottom: 72px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.info-right { display: flex; flex-direction: column; gap: 36px; }
.info-map-wrap {
  position: relative; width: 100%; height: 260px; overflow: hidden;
}
.info-map-wrap a {
  position: absolute; inset: 0; z-index: 2; cursor: pointer;
}
.info-map-wrap iframe {
  width: 100%; height: 100%; border: 0; display: block;
  filter: grayscale(100%) contrast(1.05);
  pointer-events: none;
}
.info-col .info-col-title {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 13px; letter-spacing: 3px; font-weight: 700;
  color: #0d0d0d; text-transform: uppercase; margin-bottom: 20px;
}
.info-col p, .info-col a:not(.s-icon) {
  display: block; font-family: 'Noto Sans TC', sans-serif;
  font-size: 13px; font-weight: 300; line-height: 2.1; color: #666; letter-spacing: 0.5px;
}
.info-col a:not(.s-icon) { position: relative; display: inline-block; padding-bottom: 1px; text-decoration: none; }
.info-col a:not(.s-icon)::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 1px; background: #666;
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.info-col a:not(.s-icon):hover { color: #1a1a1a; }
.info-col a:not(.s-icon):hover::after { transform: scaleX(1); }
.social-icons { display: flex; gap: 10px; margin-top: 4px; }
.s-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,0.1); color: #555;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 13px; font-weight: 400; letter-spacing: 0;
  text-decoration: none; transition: background 0.3s, color 0.3s;
}
.s-icon svg { width: 17px; height: 17px; }
.s-icon:hover { background: rgba(0,0,0,0.2); color: #1a1a1a; }

/* ── ANIMATED FOOTER ── */
#footerContact { background: #f5f3f0; border-top: 1px solid rgba(0,0,0,0.07); }
#footerHers {
  position: relative;
  overflow: hidden;
  contain: paint;
  background: #f5f3f0;
  border-top: 1px solid rgba(0,0,0,0.07);
}
#footerHers .fp-inner {
  background: #f5f3f0;
  transform: translateY(-100%);
  will-change: transform;
}

@supports (animation-timeline: view()) {
  @keyframes hers-slide-in {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
  }
  #footerHers { view-timeline: --hers-reveal block; }
  #footerHers .fp-inner {
    transform: none;
    animation: hers-slide-in linear both;
    animation-timeline: --hers-reveal;
    animation-range: entry 0% entry 100%;
  }
}

.fp-contact-row {
  padding: 48px 48px;
  display: flex; gap: 40px; align-items: flex-start;
  max-width: 1000px;
}
.fp-contact-row .info-col { flex: 1; min-width: 0; }
.fp-contact-row .info-col:nth-child(3) { margin-left: 40px; } /* FORM 欄跟 ADDRESS 拉遠一點 */

.hers-giant {
  background: #f5f3f0; padding: 32px 48px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end; gap: 0 40px;
}
.hers-logo-wrap {
  grid-column: 1; padding-bottom: 24px;
  display: flex; flex-direction: row; align-items: center; gap: 16px;
}
.hers-logo-wrap img { height: 40px; width: auto; flex-shrink: 0; }
.hers-tagline {
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 400;
  font-style: italic; line-height: 1.5; color: #1a1a1a;
}
.hers-wordmark {
  grid-column: 3; align-self: end;
  font-family: 'Playfair Display', serif;
  font-size: 47px; font-weight: 400; /* 跟左下角 logo 圖高度（40px）對齊 */
  line-height: 1; color: #1a1a1a; letter-spacing: -0.9px; /* line-height/letter-spacing 原本是為 220px 那版調的，縮小後跟著等比例調整，overflow:hidden 移除避免裁到字 */
  min-width: max-content; /* 避免 grid 欄位在空間不夠時把文字尾端（S）擠壓裁掉 */
}
.hw-inner { display: block; }

.footer-copy {
  background: #f5f3f0; padding: 16px 60px 36px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 10px; letter-spacing: 2px; color: rgba(0,0,0,0.22);
  display: flex; align-items: center; flex-wrap: wrap;
}
.footer-divider { opacity: 0.4; }
.footer-policy {
  color: rgba(0,0,0,0.35); text-decoration: none;
  transition: color 0.3s; margin-left: 30px;
}
.footer-policy:hover { color: rgba(0,0,0,0.65); }

/* ── MENU OVERLAY ── */
.menu-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: #8a6040;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.5s ease; overflow: hidden;
}
.menu-overlay.open { opacity: 1; pointer-events: all; }
.menu-deco { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.menu-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; padding: 26px 36px;
}
.menu-close {
  position: relative; width: 30px; height: 30px;
  background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0;
}
.menu-close span {
  display: block; position: absolute; width: 26px; height: 1.5px;
  background: rgba(255,255,255,0.8); top: 50%; left: 50%; transform-origin: center;
}
.menu-close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.menu-close span:last-child  { transform: translate(-50%, -50%) rotate(-45deg); }
.menu-topbar-right {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 11px; letter-spacing: 4px; font-weight: 300;
  color: rgba(255,255,255,0.6); text-transform: uppercase;
}
.menu-topbar-right a { color: inherit; text-decoration: none; }
.menu-links {
  list-style: none; display: flex; flex-direction: row;
  gap: clamp(20px, 4vw, 60px); flex-wrap: wrap; justify-content: center;
  position: relative; z-index: 1;
}
.menu-links li { margin: 0; }
.menu-break { display: none; }
.menu-links a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; padding-bottom: 4px; text-decoration: none; transition: opacity 0.2s;
}
.menu-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 1px; background: rgba(255,255,255,0.5);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.menu-links a:hover::after { transform: scaleX(1); }
.ml-en {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(16px, 2.2vw, 26px); font-style: normal; font-weight: 300;
  color: rgba(255,255,255,0.9); letter-spacing: 5px; text-transform: uppercase;
}
.ml-zh {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 10px; letter-spacing: 3px; font-weight: 300;
  color: rgba(255,255,255,0.45); font-style: normal;
}
.menu-footer {
  position: absolute; bottom: 36px; z-index: 1;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 10px; letter-spacing: 3px; color: rgba(255,255,255,0.3);
}

/* Responsive */
@media (max-width: 480px) {
  .nav { padding: 20px 20px; }
  .page-hero { height: 60vh; }
  .page-hero-title { bottom: 36px; left: 28px; }
  .contact-cta { padding: 115px 0 141px; }
  .cta-sub { font-size: 14px; }
  .info-section { padding: 60px 24px 0; }
  .info-top { grid-template-columns: 1fr; gap: 32px; }
  .info-tagline { grid-column: 1 / -1; }
  /* Footer → single column */
  .fp-contact-row {
    padding: 32px 24px;
    flex-wrap: wrap; gap: 28px;
  }
  .fp-contact-row .info-col { flex: 0 0 calc(50% - 14px); }
  .fp-contact-row .info-col:nth-child(3) { margin-left: 0; } /* 手機版是 2x2 排列，不用拉遠 */
  .hers-giant {
    padding: 28px 24px 20px;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 0;
  }
  .hers-logo-wrap { grid-column: 1; padding-bottom: 0; }
  .hers-wordmark {
    grid-column: 2;
    font-size: 38px;
    align-self: end;
  }
  /* Richard 回報手機版頁尾「Copyright...」跟「隱私權政策」擠不下會換行。實測整段文字
     用預設 letter-spacing/margin 量出來要 402px，390px 寬的手機扣掉左右 padding 只剩
     342px，本來就放不下。改成縮小字距（2px→0.5px）+ 縮小分隔間距（30px→10px）+
     兩側留白也收窄一點（24px→16px），實測後可以在一行內放完，不用再靠 flex-wrap
     硬擠成兩行 */
  .footer-copy {
    padding: 14px 16px 32px;
    flex-wrap: nowrap;
    white-space: nowrap;
    letter-spacing: .5px;
  }
  .footer-policy { margin-left: 10px; }
  .menu-links { gap: 14px; }
  .menu-break { display: block; flex-basis: 100%; height: 0; }
  .ml-en { font-size: 13px; letter-spacing: 3px; }
}

/* ── RESPONSIVE 768px ── */
@media (max-width: 768px) {
  .info-section { padding: 60px 24px 0; }
  .info-top { grid-template-columns: 1fr; gap: 32px; }
}

/* ── PAGE TRANSITION ── */
.page-transition {
  position: fixed; inset: 0; z-index: 9999;
  background: #f0ede8;
  display: flex; align-items: center; justify-content: center;
  pointer-events: all;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.page-transition.is-out { opacity: 0; pointer-events: none; }
.page-transition-hers {
  font-family: 'Playfair Display', serif;
  font-size: clamp(80px, 14vw, 200px);
  font-weight: 400; color: #1a1a1a;
  letter-spacing: -3px; opacity: 0.1; user-select: none;
}
