/* ==================================================
   Factory Page CSS
   只控制內地廠房正文區域
   Hero 統一交給 assets/css/components/page-hero.css
================================================== */

body.factory-page {
  background: #ffffff;
}

/* Hero 外層由 assets/css/components/page-hero.css 統一控制，本頁 CSS 不覆蓋 Hero */

/* ========== 置中介紹區 ========== */

.factory-intro-top {
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 5px 48px 28px;
}

.factory-intro-top__title {
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: #142033;
  margin: 0 0 12px;
}

.factory-intro-top__text {
  max-width: 900px;
  margin: 0 auto;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 17px;
  line-height: 2;
  color: #333333;
}

/* ========== Factory Intro 二欄區 ========== */

.factory-intro {
  background: #ffffff;
  padding: 44px 48px 88px;
}

.factory-intro__inner {
  width: min(1280px, calc(100% - 96px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  gap: 64px;
  align-items: start;
}

.factory-intro__left,
.factory-intro__right {
  min-width: 0;
}

/* 單行小標題：中文｜英文 */
.factory-section-kicker {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 28px;
}

.factory-section-kicker-zh {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  color: #db8a00;
  white-space: nowrap;
}

.factory-section-kicker-sep {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 400;
  color: #db8a00;
  line-height: 1.3;
}

.factory-section-kicker-en {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(16px, 1.4vw, 21px);
  font-weight: 600;
  line-height: 1.3;
  color: #142033;
}

.factory-source-visual {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  justify-self: end;
  align-self: start;
  margin: 0;
  transition: transform 0.35s ease;
}

.factory-source-visual__backdrop {
  position: absolute;
  right: -34px;
  bottom: -34px;
  width: 88%;
  height: 88%;
  background: linear-gradient(328deg, #5A5A5AC7 0%, #41414100 100%);
  z-index: 1;
  transition: transform 0.35s ease, opacity 0.35s ease;
  will-change: transform;
}

.factory-source-visual__image-wrap {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f5f5f5;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  will-change: transform;
}

.factory-source-visual__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
  will-change: transform;
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .factory-source-visual:hover {
    transform: translateY(-6px);
  }

  .factory-source-visual:hover .factory-source-visual__image-wrap {
    transform: translate(-4px, -4px);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.18);
  }

  .factory-source-visual:hover .factory-source-visual__image {
    transform: scale(1.035);
  }

  .factory-source-visual:hover .factory-source-visual__backdrop {
    transform: translate(10px, 10px);
    opacity: 0.92;
  }
}

/* 三個小卡片 */
.factory-point-list {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.factory-point-card {
  background: #f7f7f7;
  border-left: 4px solid #e8b20a;
  padding: 18px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.factory-point-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: #142033;
  margin: 0 0 6px;
}

.factory-point-card__icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 16px;
}

.factory-point-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  color: #142033;
}

/* ========== Alternating Factory Timeline ========== */

.factory-timeline {
  position: relative;
  isolation: isolate;
  background-image: url("/assets/images/Bg/Bg03.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #ffffff;
  padding: 56px 48px 104px;
  overflow: hidden;
}

.factory-timeline::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(24, 43, 81, 0.42);
  z-index: 0;
  pointer-events: none;
}

.factory-timeline__head {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 96px));
  margin: 0 auto 54px;
  text-align: center;
}

.factory-timeline__head h2 {
  font-family: "Noto Serif TC", serif;
  font-size: 26px;
  color: #e8b20a;
  margin: 0 0 8px;
}

.factory-timeline__head p {
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.36em;
  color: #e8b20a;
}

.factory-timeline__line {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 96px));
  margin: 0 auto;
}

.factory-timeline__line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.38);
  transform: translateX(-50%);
  z-index: 1;
}

.factory-timeline-progress {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: var(--factory-timeline-progress, 0px);
  transform: translateX(-50%);
  background: linear-gradient(180deg, #f2bd00 0%, #db8a00 100%);
  box-shadow: 0 0 16px rgba(242, 189, 0, 0.45);
  z-index: 2;
  pointer-events: none;
  border-radius: 2px;
}

.factory-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
  gap: 0;
  align-items: center;
  margin: 0 0 88px;
}

.factory-timeline-item:last-child {
  margin-bottom: 0;
}

.factory-timeline-dot {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #f2bd00;
  box-shadow: 0 0 0 5px rgba(242, 189, 0, 0.28);
  z-index: 4;
  display: grid;
  place-items: center;
  color: #142033;
}

.factory-timeline-dot svg {
  display: block;
  width: 18px;
  height: 18px;
}

.factory-timeline-card {
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  background: #ffffff;
  color: #142033;
  border-radius: 6px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.factory-timeline-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .factory-timeline-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 56px rgba(0, 0, 0, 0.42);
  }

  .factory-timeline-card:hover img {
    transform: scale(1.035);
  }
}

.factory-timeline-card__body {
  text-align: center;
  padding: 24px 30px 32px;
}

.factory-timeline-card__body h3 {
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
  color: #142033;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}

.factory-timeline-card__body p {
  font-family: "Noto Sans TC", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
  color: rgba(20, 32, 51, 0.68);
  margin: 0 auto;
  max-width: 620px;
}

.factory-timeline-label {
  color: #ffffff;
}

.factory-timeline-label strong {
  display: block;
  font-family: "Noto Serif TC", serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #e8b20a;
  margin: 0 0 8px;
}

.factory-timeline-label span {
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: #ffffff;
}

/* 左卡右字 */
.factory-timeline-item--left .factory-timeline-card {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.factory-timeline-item--left .factory-timeline-label {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  padding-left: 36px;
  text-align: left;
}

/* 右卡左字 */
.factory-timeline-item--right .factory-timeline-card {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
}

.factory-timeline-item--right .factory-timeline-label {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  padding-right: 36px;
  text-align: right;
}

/* ========== CTA ========== */

.factory-cta {
  background: #ffffff;
  padding: 76px 48px;
}

.factory-cta__inner {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.factory-cta__title {
  font-family: "Noto Serif TC", serif;
  font-size: 34px;
  color: #142033;
  margin: 0 0 16px;
}

.factory-cta__text {
  margin: 0 auto 28px;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.9;
  color: #333333;
}

.factory-cta__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.factory-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 0;
  font-weight: 700;
  text-decoration: none;
}

.factory-btn--primary {
  background: #e8b20a;
  color: #111111;
}

.factory-btn--outline {
  background: #222222;
  color: #ffffff;
}

/* ========== Desktop wide cards ========== */

@media (min-width: 1024px) {
  .factory-timeline__line {
    width: calc(100% - 96px);
    max-width: none;
  }

  .factory-timeline-item {
    grid-template-columns: calc(50% - 48px) 96px calc(50% - 48px);
  }

  .factory-timeline-card {
    width: 100%;
    max-width: none;
  }

  .factory-timeline-card img {
    aspect-ratio: 16 / 7;
  }

  .factory-timeline-item--left .factory-timeline-card {
    justify-self: stretch;
  }

  .factory-timeline-item--right .factory-timeline-card {
    justify-self: stretch;
  }
}

/* ========== Responsive ========== */

@media (max-width: 1100px) {
  .factory-intro__inner {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .factory-source-visual {
    justify-self: center;
    width: min(100%, 480px);
  }

  .factory-timeline__head,
  .factory-timeline__line {
    width: min(100%, calc(100% - 64px));
  }

  .factory-timeline-card {
    max-width: 460px;
  }
}

@media (max-width: 767px) {
  .factory-intro-top {
    padding: 5px 18px 18px;
  }

  .factory-intro-top__title {
    font-size: 22px;
  }

  .factory-intro-top__text {
    font-size: 15px;
    line-height: 1.85;
    max-width: 100%;
  }

  .factory-intro {
    padding: 36px 18px 60px;
  }

  .factory-intro__inner {
    width: 100%;
    gap: 34px;
  }

  .factory-section-kicker-zh {
    font-size: 20px;
  }

  .factory-section-kicker-sep {
    font-size: 18px;
  }

  .factory-section-kicker-en {
    font-size: 15px;
  }

  .factory-source-visual {
    width: calc(100vw - 76px);
  }

  .factory-source-visual__backdrop {
    right: -22px;
    bottom: -22px;
  }

  .factory-point-card {
    padding: 16px 18px;
  }

  .factory-point-card__title {
    font-size: 16px;
  }

  .factory-point-card p {
    font-size: 15px;
    line-height: 1.8;
  }

  .factory-timeline {
    background-attachment: scroll;
    padding: 28px 18px 72px;
  }

  .factory-timeline__head,
  .factory-timeline__line {
    width: 100%;
  }

  .factory-timeline__head {
    margin-bottom: 38px;
  }

  .factory-timeline__head p {
    font-size: 13px;
    letter-spacing: 0.22em;
  }

  .factory-timeline__line {
    --factory-mobile-line-x: 19px;
  }

  .factory-timeline__line::before {
    left: var(--factory-mobile-line-x) !important;
    transform: translateX(-50%) !important;
  }

  .factory-timeline-progress {
    left: var(--factory-mobile-line-x) !important;
    transform: translateX(-50%) !important;
  }

  .factory-timeline-item,
  .factory-timeline-item--left,
  .factory-timeline-item--right {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    margin-bottom: 46px;
  }

  .factory-timeline-dot {
    grid-column: 1;
    grid-row: 1 / span 2;
    justify-self: center;
    align-self: start;
    margin-top: 10px;
    width: 26px;
    height: 26px;
    border-width: 4px;
    box-shadow: 0 0 0 4px rgba(232, 178, 10, 0.28);
  }

  .factory-timeline-item--left .factory-timeline-label,
  .factory-timeline-item--right .factory-timeline-label,
  .factory-timeline-label {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    padding: 0 0 14px;
    text-align: left;
  }

  .factory-timeline-item--left .factory-timeline-card,
  .factory-timeline-item--right .factory-timeline-card,
  .factory-timeline-card {
    grid-column: 2;
    grid-row: 2;
    justify-self: stretch;
    max-width: none;
  }

  .factory-timeline-label strong {
    font-size: 22px;
  }

  .factory-timeline-label span {
    font-size: 14px;
  }

  .factory-timeline-card__body {
    padding: 18px 18px 22px;
  }

  .factory-timeline-card__body h3 {
    font-size: 20px;
  }

  .factory-timeline-card__body p {
    font-size: 15px;
    line-height: 1.8;
  }

  .factory-cta {
    padding: 56px 18px;
  }

  .factory-cta__title {
    font-size: 26px;
  }
}