/* ============================================================
   shared.css — 全站共用樣式
   簡實制所 Lessary Studio
   ============================================================ */

/* ── CSS 變數 ── */
:root {
  --primary:     #2A324B;
  --accent:      #89DE7C;
  --accent-dark: #5CB850;
  --bg:          #F3F3F3;
  --white:       #FFFFFF;
  --text-muted:  #6B7280;
  --text-middle: #484d56;
  --text-light:  #767B91;
  --nav-h:       64px;
  --line-green:  #06C755;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--primary);
  overflow-x: hidden;
}

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  background: rgba(243,243,243,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(42,50,75,0.08);
  transition: box-shadow .3s;
}
.nav.scrolled { box-shadow: 0 2px 20px rgba(42,50,75,0.10); }

.nav-inner {
  max-width: 1200px; margin: 0 auto;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
}

/* Logo */
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--primary); flex-shrink: 0;
}
.logo-mark { width: 32px; height: 32px; display: flex; align-items: center; }
.logo-mark img { width: 100%; height: auto; display: block; }
.logo-text {
  font-size: 14px; font-weight: 700; letter-spacing: .05em;
  color: var(--primary); white-space: nowrap;
}

/* Nav links (desktop ul) */
.nav-links {
  display: flex; align-items: center;
  gap: 8px; list-style: none; margin: 0; padding: 0;
}
.nav-links li a {
  font-size: 13.5px; font-weight: 500; color: var(--primary);
  text-decoration: none; letter-spacing: .04em; opacity: .72;
  padding: 6px 14px; border-radius: 30px;
  transition: opacity .2s, background .2s;
}
.nav-links li a:hover { opacity: 1; background: rgba(42,50,75,0.06); }
.nav-links li a.active { opacity: 1; color: var(--accent-dark); font-weight: 700; }
.nav-links li a.nav-cta {
  background: var(--primary); color: var(--white); opacity: 1;
  padding: 8px 20px; border-radius: 30px; font-weight: 700;
  transition: background .2s, transform .2s;
}
.nav-links li a.nav-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: 8px;
  z-index: 201;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--primary); border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease;
  transform-origin: center;
}

/* Hamburger open state */
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV (≤ 1024px) ── */
@media (max-width: 1024px) {
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px 0 16px;
    background: rgba(243,243,243,0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(42,50,75,0.10);
    box-shadow: 0 8px 32px rgba(42,50,75,0.12);
  }
  .nav-links.is-open { display: flex; }

  .nav-links li a {
    display: block; padding: 14px 32px;
    border-radius: 0; font-size: 15px;
    border-bottom: 1px solid rgba(42,50,75,0.05);
  }
  .nav-links li:last-child a { border-bottom: none; }

  .nav-links li.desktop-only { display: none; }

  /* has-sub 行 — 左右分欄 */
  .nav-links li.has-sub {
    display: flex; flex-wrap: wrap;
    align-items: stretch;
    border-bottom: 1px solid rgba(42,50,75,0.05);
  }
  .nav-links li.has-sub > a {
    flex: 1; border-bottom: none;
    padding: 14px 0 14px 32px;
  }
  /* 右邊 toggle 按鈕 */
  .sub-toggle {
    width: 44px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-left: 1px solid rgba(42,50,75,0.07);
    cursor: pointer; color: var(--primary);
    font-size: 24px; opacity: .5;
    transition: opacity .2s, background .2s;
  }
  .sub-toggle:hover { opacity: 1; background: rgba(42,50,75,0.04); }
  .sub-toggle .toggle-arrow { display: inline-block; transition: transform .3s; }
  .nav-links li.has-sub.is-open .toggle-arrow { transform: rotate(180deg); }

  /* nav-sub 垂直展開 */
  .nav-sub {
    display: none; list-style: none; padding: 0;
    width: 100%; background: rgba(42,50,75,0.03);
  }
  .nav-sub.is-open { display: block; }
  .nav-sub li a {
    padding: 11px 32px 11px 52px;
    font-size: 13.5px; color: var(--text-muted);
    border-bottom: 1px solid rgba(42,50,75,0.04);
  }
  .nav-sub li:last-child a { border-bottom: none; }
  .nav-sub li a:hover { color: var(--accent-dark); }

  .nav-links li a.nav-cta {
    margin: 12px 24px 4px; border-radius: 10px;
    text-align: center; padding: 14px 20px; border-bottom: none;
  }

  /* 桌機專屬箭頭隱藏 */
  .desktop-arrow { display: none !important; }
}

/* ── DESKTOP NAV (≥ 1025px) ── */
@media (min-width: 1025px) {
  .hamburger  { display: none !important; }
  .nav-links  { display: flex !important; }
  .sub-toggle { display: none !important; }
  .nav-links li.desktop-only { display: none !important; }

  /* has-sub — position 讓子選單能絕對定位 */
  .nav-links li.has-sub { position: relative; }

  /* 服務內容連結加箭頭 */
  .nav-links li.has-sub > a {
    display: inline-flex; align-items: center; gap: 4px;
  }
  .desktop-arrow {
    font-size: 24px; opacity: .5; display: inline-block;
    transition: transform .25s;
  }
  .nav-links li.has-sub:hover > a .desktop-arrow,
  .nav-links li.has-sub.is-open > a .desktop-arrow {
    transform: rotate(180deg);
  }

  /* 橋接層：防止滑鼠移到選單時選單消失 */
  .nav-links li.has-sub::after {
    content: '';
    position: absolute;
    top: 100%; left: 0; right: 0;
    height: 10px;
    background: transparent;
  }

  /* 下拉選單本體 */
  .nav-sub {
    display: none;
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    min-width: 152px;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(42,50,75,0.14);
    border: 1px solid rgba(42,50,75,0.07);
    list-style: none;
    padding: 10px 0 8px;  /* padding-top 10px 對齊橋接層高度 */
    z-index: 200;
    margin-top: 8px;
  }
  /* hover 或 is-open 都顯示 */
  .nav-links li.has-sub:hover .nav-sub,
  .nav-links li.has-sub.is-open .nav-sub { display: block; }

  .nav-sub li a {
    display: block; padding: 10px 20px;
    font-size: 13px; font-weight: 500;
    color: var(--primary); opacity: .8;
    text-decoration: none; white-space: nowrap;
    border-radius: 0; background: none;
    transition: background .2s, color .2s, opacity .2s;
  }
  .nav-sub li a:hover {
    background: rgba(137,222,124,0.1);
    color: var(--accent-dark); opacity: 1;
  }
  .nav-sub li a.active {
    color: var(--accent-dark); font-weight: 700; opacity: 1;
  }
}

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: calc(var(--nav-h) + 28px) 80px 0;
  font-size: 12px; color: var(--text-light);
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb a { color: var(--text-light); text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb span { opacity: .4; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--primary); color: var(--white);
  padding: 14px 32px; border-radius: 40px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  display: inline-block; transition: background .25s, transform .25s;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn-primary-line{border: var(--white)solid 1px;}
.btn-primary-line:hover{border: none;}

.btn-secondary {
  background: transparent; color: var(--primary);
  padding: 14px 28px; border-radius: 40px;
  border: 1.5px solid var(--primary);
  font-size: 14px; font-weight: 500; text-decoration: none;
  display: inline-block; transition: border-color .2s, color .2s, transform .2s;
}
.btn-secondary:hover { border-color: var(--accent-dark); color: var(--accent-dark); transform: translateY(-2px); }

.btn-accent {
  background: var(--accent); color: var(--primary);
  padding: 14px 32px; border-radius: 40px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  display: inline-block; transition: background .25s, transform .25s;
}
.btn-accent:hover { background: var(--accent-dark); color: var(--white); transform: translateY(-2px); }

.btn-ghost {
  background: transparent; color: var(--primary);
  padding: 13px 24px; border-radius: 40px;
  border: 1.5px solid currentColor;
  font-size: 14px; font-weight: 500; text-decoration: none;
  display: inline-block; transition: color .2s, transform .2s;
}
.btn-ghost:hover { color: var(--accent-dark); transform: translateY(-2px); }

.btn-ghost-light {
  background: transparent; color: rgba(255,255,255,0.7);
  padding: 13px 24px; border-radius: 40px;
  border: 1.5px solid rgba(255,255,255,0.25);
  font-size: 14px; font-weight: 500; text-decoration: none;
  display: inline-block; transition: all .2s;
}
.btn-ghost-light:hover { color: var(--white); border-color: rgba(255,255,255,0.6); transform: translateY(-2px); }

/* ── SECTION 共用 ── */
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: 12px;
}
.section-title {
  font-size: clamp(26px, 3vw, 38px); font-weight: 900;
  color: var(--primary); margin-bottom: 20px; line-height: 1.3;
}
.sec-label {
  font-size: 11px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: 10px;
}
.sec-title {
  font-size: clamp(24px, 3vw, 36px); font-weight: 900; margin-bottom: 40px;
}

/* ── FOOTER ── */
footer {
  background: var(--primary); color: var(--white);
  padding: 60px 80px;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px;
}
.footer-brand .logo { font-size: 16px; font-weight: 700; letter-spacing: .08em; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; opacity: .5; line-height: 1.8; max-width: 260px; }
.footer-col h4 {
  font-size: 11px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; opacity: .4; margin-bottom: 16px;
}
.footer-col a {
  display: block; font-size: 13px; opacity: .7;
  text-decoration: none; color: var(--white);
  margin-bottom: 8px; transition: opacity .2s;
}
.footer-col a:hover { opacity: 1; }
.footer-bottom {
  background: var(--primary); text-align: center;
  padding: 20px; border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-bottom p { font-size: 12px; color: rgba(255,255,255,0.35); }

/* ── CTA BAND ── */
.cta-band { background: var(--accent); padding: 80px; text-align: center; }
.cta-band h2 { font-size: clamp(24px, 3vw, 38px); font-weight: 900; color: var(--primary); margin-bottom: 12px; }
.cta-band p { font-size: 15px; color: var(--primary); opacity: .7; margin-bottom: 32px; }

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── PORTFOLIO 共用 ── */
.port-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; flex-wrap: wrap; gap: 16px; }
.port-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.port-item {
  border-radius: 16px; overflow: hidden; aspect-ratio: 4/3;
  position: relative; cursor: pointer;
  box-shadow: 0 8px 28px rgba(42,50,75,0.1);
}
.port-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.port-item:hover img { transform: scale(1.06); }
.port-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(42,50,75,0.7) 0%, transparent 55%);
  opacity: 0; transition: opacity .3s;
  display: flex; align-items: flex-end; padding: 20px;
}
.port-item:hover .port-overlay { opacity: 1; }
.port-label { font-size: 13px; font-weight: 700; color: var(--white); letter-spacing: .04em; }
.port-extra { display: none; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.port-extra.open { display: grid; }
.port-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--accent-dark);
  background: none; border: 1.5px solid var(--accent-dark);
  padding: 9px 20px; border-radius: 30px; cursor: pointer;
  transition: background .2s, color .2s; margin-top: 28px;
}
.port-toggle:hover { background: var(--accent-dark); color: var(--white); }
.port-toggle .arrow { transition: transform .3s; display: inline-block; }
.port-toggle.open .arrow { transform: rotate(180deg); }

/* ── PROCESS 共用 ── */
.process-section { background: var(--primary); padding: 80px; color: var(--white); }
.process-section .sec-label { color: var(--accent); }
.process-section .sec-title { color: var(--primary); }
.process-steps {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0; margin-top: 56px; position: relative;
}
.process-steps::before {
  content: ''; position: absolute;
  top: 20px; left: 10%; right: 10%;
  height: 1px; background: rgba(137,222,124,0.2); z-index: 0;
}
.proc-step {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  position: relative; z-index: 1; padding: 0 8px;
}
.ps-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(137,222,124,0.12); border: 1px solid var(--accent);
  color: var(--accent); font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; transition: background .25s, transform .25s;
}
.proc-step:hover .ps-num { background: var(--accent); color: var(--primary); transform: scale(1.1); }
.ps-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ps-desc { font-size: 11.5px; opacity: .55; line-height: 1.6; }

/* ── RESPONSIVE 共用 ── */
@media (max-width: 900px) {
  .nav-inner { padding: 0 20px; }
  .breadcrumb { padding-left: 20px; padding-right: 20px; }
  footer { grid-template-columns: 1fr; gap: 32px; padding: 48px 32px; }
  .cta-band { padding: 60px 28px; }
  .port-grid,
  .port-extra { grid-template-columns: 1fr 1fr; }
  .process-steps { grid-template-columns: 1fr 1fr; gap: 28px; }
  .process-steps::before { display: none; }
}

/*-- CTA -*/

.dh-btns-center {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center; /* 讓區塊內的按鈕水平置中 */
  margin: 0 auto;         /* 讓整個按鈕區塊在其父層（例如網頁）中水平置中 */
}

