/**
 * 首屏 v2 — 對齊 Figma node 132:1094（1710×896 設計稿）
 * 用於 index.html（data-hero-v2）
 */

/* v2 跳過進場 opacity:0，避免首屏白屏 */
html[data-hero-v2] #top .pub-factory__hero-metrics,
html[data-hero-v2] #top .pub-quick-book--hero {
  opacity: 1 !important;
  transform: none !important;
}

html[data-hero-v2] #top .pub-factory__intro-title-reveal__text {
  opacity: 1 !important;
}

/* ── Header：無陰影、無底部分隔線 ── */
html[data-hero-v2] .public-site__header,
html[data-hero-v2] .public-site__header--factory {
  box-shadow: none;
}

html[data-hero-v2] .public-site__header-top,
html[data-hero-v2] .public-site__header--factory .public-site__header-top {
  border-bottom: none;
  padding: 0 24px;
  gap: 16px;
}

html[data-hero-v2] .public-site__brand {
  gap: 12px;
}

html[data-hero-v2] .public-site__brand-logo {
  height: 38px;
}

html[data-hero-v2] .public-site__brand-service {
  font-size: 16px;
  font-weight: 500;
  color: rgba(17, 17, 17, 0.7);
  padding-left: 13px;
  border-left-color: rgba(17, 17, 17, 0.08);
}

html[data-hero-v2] .public-site__header-utils {
  gap: 20px;
}

html[data-hero-v2] .public-site__header-actions {
  gap: 8px;
}

html[data-hero-v2] .public-site__util-link {
  font-size: 14px;
  font-weight: 500;
  color: #111;
}

html[data-hero-v2] .public-site__util-btn {
  min-height: 40px;
  padding: 9.5px 21px;
  border-radius: 4px;
  border-color: rgba(17, 17, 17, 0.15);
  font-size: 14px;
  font-weight: 600;
}

html[data-hero-v2] .public-site__util-cta.btn {
  min-height: 40px;
  padding: 9.5px 21px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

/* AeSHOP 文案 */
html[data-hero-v2] .public-site__util-link[href*='aeshop'] {
  font-size: 0;
  line-height: 0;
}

html[data-hero-v2] .public-site__util-link[href*='aeshop']::after {
  content: 'AeSHOP';
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

/* ── Hero 外框：1710 稿 — 1662×806、左右 24px、內容左軌 191px ── */
.pub-factory-hero--v2 {
  position: relative;
  z-index: 2;
  --pub-hero-design-width: 1710px;
  --pub-hero-design-height: 806px;
  --pub-hero-content-rail: 191px;
  --factory-vh: 654px;
  --pub-hero-screen-gutter: 24px;
  --pub-hero-rail-gutter: max(
    16px,
    min(
      calc(var(--pub-hero-content-rail) - var(--pub-hero-screen-gutter)),
      calc((100% - 1280px) / 2)
    )
  );
  --pub-hero-book-overlap: 44px;
  --pub-hero-book-bottom: 43px;
  --pub-hero-book-block: 95px;
  --pub-hero-content-form-gap: 50px;
  --pub-hero-gap-content-book: 0;
  --pub-hero-content-nudge: 0;

  height: auto;
  margin-top: 0;
  margin-bottom: calc(-1 * var(--pub-hero-book-overlap));
  padding: 11px var(--pub-hero-screen-gutter) 29px;
  background: #fff;
  overflow: visible;
}

.pub-factory-hero--v2 .pub-factory-hero__sticky {
  height: var(--factory-vh);
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: none;
}

.pub-factory-hero--v2 .pub-factory__hero-media,
.pub-factory-hero--v2 .pub-factory__hero-slides {
  border-radius: 20px;
}

/* 底部漸層遮罩（Figma: 57%→92% 透明） */
.pub-factory-hero--v2 .pub-factory__hero-scrim {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.5) 57.346%,
    rgba(0, 0, 0, 0) 91.776%
  );
}

.pub-factory-hero--v2 .pub-factory__hero-img {
  object-position: center 42%;
  animation: none;
}

.pub-factory-hero--v2:not(.pub-factory-hero--kb-js) .pub-factory__hero-img {
  transform: scale(1);
}

/* ── 標題左／ESG 右：與預約卡左右邊同軌道 ── */
.pub-factory-hero--v2 .pub-factory__left {
  padding:
    var(--space-6)
    var(--pub-hero-rail-gutter)
    calc(var(--pub-hero-book-bottom) + var(--pub-hero-book-block) + var(--pub-hero-content-form-gap))
    var(--pub-hero-rail-gutter);
}

.pub-factory-hero--v2 .pub-factory__hero-column {
  justify-content: flex-end;
  align-items: stretch;
  padding-bottom: 0;
  margin: 0;
  width: 100%;
  max-width: none;
}

.pub-factory-hero--v2 .pub-factory__hero-stack {
  width: 100%;
}

/* 主標題底線與 ESG 數字底線同列；副標題獨立在下一列 */
.pub-factory-hero--v2 .pub-factory__hero-inner--v2 {
  --pub-hero-v2-title-line: 62.4px;
  --pub-hero-v2-metric-label-band: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: clamp(24px, 4vw, 48px);
  row-gap: 6px;
  align-items: end;
  width: 100%;
  max-width: none;
  margin: 0;
}

.pub-factory-hero--v2 .pub-factory__intro {
  display: contents;
}

.pub-factory-hero--v2 .pub-factory__intro-title {
  display: contents;
  letter-spacing: 1px;
  text-align: left;
}

.pub-factory-hero--v2 .pub-factory__intro-title-reveal:not(.pub-factory__intro-title-reveal--sub) {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  max-width: 640px;
}

.pub-factory-hero--v2 .pub-factory__intro-title-reveal--sub {
  grid-column: 1;
  grid-row: 2;
  max-width: 640px;
}

.pub-factory-hero--v2 .pub-factory__intro-title-primary {
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: clamp(36px, 2.8vw, 48px);
  font-weight: 600;
  line-height: 62.4px;
  color: #fff;
  letter-spacing: clamp(1px, 0.18vw, 3px);
}

.pub-factory-hero--v2 .pub-factory__intro-title-line {
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: clamp(16px, 1.17vw, 20px);
  font-weight: 500;
  line-height: 31.9px;
  color: rgba(255, 255, 255, 0.79);
  letter-spacing: clamp(0.5px, 0.06vw, 1px);
}

.pub-factory-hero--v2 .pub-factory__intro-title-reveal__text {
  opacity: 1;
}

.pub-factory-hero--v2 .pub-factory__intro-title-reveal__wipe {
  display: none;
}

/* ── ESG（斜線 gradient 130° + 標籤在上、數字在下） ── */
.pub-factory-hero--v2 .pub-factory__hero-metrics--v2 {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: end;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: clamp(24px, 4vw, 48px);
  margin: 0;
  padding: 0;
  border-top: none;
  max-width: none;
}

.pub-factory-hero--v2 .pub-factory__hero-metric {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0;
  min-width: 128px;
  min-height: 0;
  padding-top: var(--pub-hero-v2-metric-label-band);
}

.pub-factory-hero--v2 .pub-factory__hero-metric-label {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: 100%;
  max-width: 182px;
  margin: 0;
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.pub-factory-hero--v2 .pub-factory__hero-metric-mark {
  flex-shrink: 0;
  display: block;
  width: 12px;
  height: 13px;
  object-fit: contain;
}

.pub-factory-hero--v2 .pub-factory__hero-metric-value {
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-start;
  align-self: stretch;
  gap: 3px;
  padding: 0 14px;
  margin: 0;
}

.pub-factory-hero--v2 .pub-factory__hero-metric-value [data-hero-count] {
  font-family: 'Roboto', sans-serif;
  font-size: clamp(36px, 3.3vw, 48px);
  font-weight: 900;
  line-height: 50.4px;
  color: #fff;
  letter-spacing: 0.025em;
  font-variant-numeric: tabular-nums;
}

.pub-factory-hero--v2 .pub-factory__hero-metric-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 49px;
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: normal;
  color: #fff;
}

/* ── 預約列（與標題／ESG 同軌道、元件上下置中） ── */
.pub-factory-hero--v2 .pub-factory__hero-slide--active {
  pointer-events: none;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 {
  position: absolute;
  z-index: 20;
  pointer-events: auto;
  isolation: auto;
  left: var(--pub-hero-rail-gutter);
  right: var(--pub-hero-rail-gutter);
  width: auto;
  max-width: none;
  margin: 0;
  bottom: var(--pub-hero-book-bottom);
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  color: var(--color-text-primary);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: visible;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__grid {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px;
  min-width: 0;
  min-height: 71px;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell {
  flex: 1 1 0;
  min-width: 0;
  min-height: 71px;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  transition: background-color 0.15s ease;
}

/* 覆蓋 factory.css hero focus-within：選完不殘留底色 */
.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell:focus-within {
  background: transparent;
  box-shadow: none;
}

/* 下拉欄：桌面 hover 提示可點區，不整格反白 */
@media (hover: hover) {
  .pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell:has(.pub-quick-book__cell-select):hover {
    background: rgba(17, 17, 17, 0.03);
  }
}

/* 開啟選單中（JS data-menu-open）短暫提示 */
.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell[data-menu-open] {
  background: rgba(17, 17, 17, 0.05);
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__divider {
  flex: 0 0 1px;
  align-self: center;
  width: 1px;
  height: 43px;
  background: rgba(17, 17, 17, 0.1);
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell-label {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  color: rgba(17, 17, 17, 0.4);
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell-control,
.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper-value {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(17, 17, 17, 0.96);
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23757575' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell-select:focus {
  outline: none;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell-select:focus-visible {
  outline: 2px solid var(--color-ring, #dc2626);
  outline-offset: 2px;
  border-radius: 4px;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell--count {
  position: relative;
  z-index: 1;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper {
  position: relative;
  z-index: 2;
  align-items: center;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper-btn {
  position: relative;
  z-index: 3;
  min-width: 26px;
  min-height: 26px;
  padding: 5px 10px;
  color: rgba(17, 17, 17, 0.68);
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper-btn:focus {
  outline: none;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper-btn:focus-visible {
  outline: 2px solid var(--color-ring, #dc2626);
  outline-offset: 1px;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper-btn:hover:not(:disabled) {
  background: var(--color-bg-subtle);
  color: #111;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__stepper-value {
  min-width: 24px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #111;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__submit {
  flex: 0 0 149px;
  width: 149px;
  align-self: center;
  min-width: 120px;
  max-width: 149px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  border: none;
  background: var(--color-primary);
  color: #fafaf8;
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  outline: 1px solid transparent;
  outline-offset: -1px;
  box-shadow: none;
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__submit:hover {
  background: var(--color-primary-hover);
}

.pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__error {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--space-6));
}

.pub-factory-hero--v2 .pub-factory__hero-scroll-cue {
  display: none;
}

/* ── 1200–1709：高度與間距線性插值至 1710 稿 ── */
@media (min-width: 1200px) and (max-width: 1709px) {
  .pub-factory-hero--v2 {
    --factory-vh: clamp(
      654px,
      calc(654px + (100vw - 1200px) * 152 / 510),
      805px
    );
    --pub-hero-book-bottom: clamp(43px, calc(43px + (100vw - 1200px) * 5 / 510), 48px);
    --pub-hero-content-form-gap: clamp(50px, calc(50px + (100vw - 1200px) * 12 / 510), 62px);
    padding-top: clamp(8px, calc(8px + (100vw - 1200px) * 3 / 510), 11px);
    padding-bottom: clamp(16px, calc(16px + (100vw - 1200px) * 13 / 510), 29px);
  }
}

/* ── 1710 設計稿精準值 ── */
@media (min-width: 1710px) {
  .pub-factory-hero--v2 {
    --factory-vh: var(--pub-hero-design-height);
    --pub-hero-rail-gutter: calc(var(--pub-hero-content-rail) - var(--pub-hero-screen-gutter));
    --pub-hero-book-bottom: 48px;
    --pub-hero-book-block: 95px;
    --pub-hero-content-form-gap: 62px;
    padding: 8px var(--pub-hero-screen-gutter) 16px;
  }

  .pub-factory-hero--v2 .pub-factory__intro-title-primary {
    font-size: 48px;
    letter-spacing: 3px;
  }

  .pub-factory-hero--v2 .pub-factory__intro-title-line {
    font-size: 20px;
    letter-spacing: 1px;
  }

  .pub-factory-hero--v2 .pub-factory__hero-metric-value [data-hero-count] {
    font-size: 48px;
  }
}

/* ── RWD ── */
@media (max-width: 991px) {
  .pub-factory-hero--v2 {
    --factory-vh: 580px;
    --pub-hero-screen-gutter: 16px;
    --pub-hero-rail-gutter: 16px;
    padding: 8px var(--pub-hero-screen-gutter) 24px;
  }

  .pub-factory-hero--v2 .pub-factory-hero__sticky,
  .pub-factory-hero--v2 .pub-factory__hero-media,
  .pub-factory-hero--v2 .pub-factory__hero-slides {
    border-radius: 20px;
  }

  .pub-factory-hero--v2 .pub-factory__hero-inner--v2 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    gap: 24px;
  }

  .pub-factory-hero--v2 .pub-factory__intro {
    display: block;
    max-width: 100%;
  }

  .pub-factory-hero--v2 .pub-factory__intro-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .pub-factory-hero--v2 .pub-factory__intro-title-reveal:not(.pub-factory__intro-title-reveal--sub),
  .pub-factory-hero--v2 .pub-factory__intro-title-reveal--sub {
    grid-column: auto;
    grid-row: auto;
    align-self: auto;
    max-width: none;
  }

  .pub-factory-hero--v2 .pub-factory__hero-metrics--v2 {
    grid-column: auto;
    grid-row: auto;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
    margin-right: 0;
    gap: 16px;
  }

  .pub-factory-hero--v2 .pub-factory__hero-metric {
    padding-top: 0;
    gap: 4px;
    min-height: 80px;
  }

  .pub-factory-hero--v2 .pub-factory__hero-metric-label {
    position: static;
  }

  .pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 {
    left: var(--pub-hero-rail-gutter);
    right: var(--pub-hero-rail-gutter);
    width: auto;
    max-width: none;
    margin: 0;
  }

  .pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__grid {
    flex-wrap: wrap;
    gap: 0;
  }

  .pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__divider {
    display: none;
  }

  .pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell {
    flex: 1 1 calc(50% - 8px);
    min-height: 64px;
  }

  .pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__submit {
    flex: 1 1 100%;
    width: 100%;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    margin-top: 8px;
  }
}

@media (max-width: 575px) {
  .pub-factory-hero--v2 {
    --factory-vh: 500px;
    --pub-hero-screen-gutter: 16px;
    --pub-hero-rail-gutter: 16px;
    --pub-hero-book-block: 180px;
  }

  .pub-factory-hero--v2 .pub-factory__hero-metric-label {
    white-space: normal;
    font-size: 12px;
  }

  .pub-factory-hero--v2 .pub-quick-book.pub-quick-book--hero-v2 .pub-quick-book__cell {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pub-factory-hero--v2 .pub-factory__intro-title-reveal__text {
    opacity: 1;
  }

  .pub-factory-hero--v2 .pub-factory__intro-title-reveal__wipe {
    display: none;
  }
}
