﻿/* Homepage-only styles. Loaded by index.html only. */

/* Hero carousel */
.hero { position: relative; height: 620px; min-height: 620px; overflow: hidden; background: var(--ds-bg-selection); }
.hero__slides,
.hero-slide { position: absolute; inset: 0; height: 100%; }
.hero-slide { visibility: hidden; opacity: 0; transition: opacity 420ms ease, visibility 420ms ease; }
.hero-slide.is-active { visibility: visible; opacity: 1; }
.hero-slide__media { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; overflow: hidden; }
.hero-slide__picture { display: block; width: 100%; height: 100%; }
.hero-slide__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-slide__media:focus-visible { outline: 3px solid var(--ds-primary-default); outline-offset: -3px; }
.hero-slide--photo .hero-slide__media img { object-position: center; }
.hero-slide__content { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; width: 100%; height: 100%; }
.hero-slide__text { width: 37.5%; max-width: 720px; min-width: 0; margin-left: 7.5%; color: var(--ds-neutral-white); }
@media (min-width: 769px) {
  .hero-slide__content { pointer-events: none; }
  .hero-slide__text .btn { pointer-events: auto; }
}
.hero-slide h1,
.hero-slide h2 { max-width: 100%; margin: 0 0 12px; font-size: 48px; font-weight: 600; line-height: 56px; overflow-wrap: anywhere; white-space: pre-line;}
.hero-slide p { max-width: 100%; margin: 0 0 24px; font-size: 24px; font-weight: 600; line-height: 36px; overflow-wrap: anywhere; white-space: pre-line; }
.carousel-arrow { position: absolute; z-index: 3; top: 50%; width: 36px; height: 36px; padding: 0; color: var(--ds-neutral-white); font-size: 22px; line-height: 1; border: 0; border-radius: 50%; background: rgba(0,0,0,.2); cursor: pointer; transform: translateY(-50%); }
.carousel-arrow--prev { left: 24px; }
.carousel-arrow--next { right: 24px; }
.carousel-dots { position: absolute; z-index: 3; left: 50%; bottom: 24px; display: flex; gap: 16px; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.2); transform: translateX(-50%); }
.carousel-dots__item { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--ds-neutral-white); }
.carousel-dots__item.is-active { background: var(--ds-primary-default); box-shadow: 0 0 0 2px rgba(0,111,188,.3); }
.carousel-dots__item:focus-visible { outline: 2px solid var(--ds-neutral-white); outline-offset: 3px; }
.hero.is-single-slide .carousel-arrow,
.hero.is-single-slide .carousel-dots { display: none; }

/* Popular course cards */
.course-scroller { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px; }
.course-card { flex: 0 0 282px; }
.course-card__media { aspect-ratio: 282 / 158; }
.course-card__body { gap: 12px; padding: 8px 20px 20px; }
.course-card__title {
  display: -webkit-box;
  width: 100%;
  height: 56px;
  min-height: 56px;
  overflow: hidden;
  font-size: 18px;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.course-card__info { gap: 8px; width: 100%; }
.course-card p { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--ds-neutral-light); font-size: 14px; line-height: 20px; }
.course-card__category-tag { display: inline-flex; width: max-content; margin-top: 12px; padding: 4px 12px; color: var(--ds-neutral-white); font-size: 14px; font-weight: 600; border-radius: 0 14px 14px 0; background: linear-gradient(90deg, var(--ds-primary-default) 0%, #64ad6c 52%, #e3da23 100%); }

/* Category panel */
.category-panel { padding: 64px 80px; border-radius: var(--radius-panel); background: var(--surface-secondary-orange-soft); }
.category-panel__book { color: var(--ds-primary-default); }
.icon--book { width: 48px; height: 48px; background-image: url('../../assets/icons/home-book.svg'); }
.category-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; width: 100%; margin-inline: auto; gap: 24px; }
.category-card { display: flex; flex: 0 0 157px; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; border-radius: 8px; text-decoration: none; background: var(--ds-neutral-white); box-shadow: 0 0 4px rgba(0,0,0,.25); }
.category-card strong { font-size: 18px; white-space: nowrap; }
.category-card__icon { display: block; width: 72px; height: 72px; background-position: center; background-repeat: no-repeat; background-size: contain; }
.category-card__icon--1 { background-image: url('../../assets/images/category/category-01.png'); }
.category-card__icon--2 { background-image: url('../../assets/images/category/category-02.png'); }
.category-card__icon--3 { background-image: url('../../assets/images/category/category-03.png'); }
.category-card__icon--4 { background-image: url('../../assets/images/category/category-04.png'); }
.category-card__icon--5 { background-image: url('../../assets/images/category/category-05.png'); }
.category-card__icon--6 { background-image: url('../../assets/images/category/category-06.png'); }

/* Optional video module */
.video-banner { position: relative; width: 100%; height: min(56.25vw, 810px); min-height: 211px; overflow: hidden; background: var(--ds-neutral-black); isolation: isolate; }
.video-banner__frame { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; border: 0; }

/* Venue carousel */
.venue-section { position: relative; overflow: hidden; padding-block: 80px; background: var(--ds-neutral-white); }
.venue-layout { --venue-panel-left: calc(50vw - 434px); --venue-mask-width: 120px; position: relative; width: 100%; height: 465px; min-height: 465px; padding: 0; }
.venue-layout::before { position: absolute; inset: 0 0 0 var(--venue-panel-left); z-index: 0; content: ''; border-radius: 24px 0 0 24px; background: var(--ds-bg-light-blue); }
.venue-layout::after { position: absolute; top: 0; bottom: 0; left: 0; z-index: 1; width: calc(50vw - 314px); content: ''; background: var(--ds-neutral-white); }
.venue-layout__bg-mask { position: absolute; top: 0; left: var(--venue-panel-left); z-index: 2; display: block; width: var(--venue-mask-width); height: 465px; border-radius: 24px 0 0 24px; background: var(--ds-bg-light-blue); pointer-events: none; }
.venue-layout__heading { position: absolute; top: 48px; left: calc(50vw - 612px); z-index: 3; display: flex; flex-direction: column; align-items: flex-start; width: 282px; margin: 0; }
.venue-layout__heading h2 { margin: 0 0 16px; font-size: 32px; font-weight: 600; line-height: 48px; }
.venue-layout__heading .section-heading__decor { width: 48px; height: 16px; margin: 0 0 24px; object-fit: contain; }
.venue-layout__heading p { width: 282px; margin: 0; color: var(--ds-neutral-lighter); font-size: 18px; font-weight: 600; line-height: 28px; }
.venue-controls { position: absolute; bottom: 48px; left: calc(50vw - 612px); z-index: 3; display: flex; gap: 32px; }
.venue-controls__button { position: relative; display: grid; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; place-items: center; color: var(--ds-primary-default); border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.venue-controls__button-bg { position: absolute; inset: 0; width: 36px; height: 36px; pointer-events: none; }
.venue-controls__arrow { display: none; }
.venue-viewport { position: absolute; top: 112px; right: 0; bottom: 48px; left: calc(var(--venue-panel-left) + var(--venue-mask-width)); z-index: 3; min-width: 0; overflow: hidden; }
.venue-scroller { display: flex; gap: 32px; width: max-content; padding-left: 16px; overflow: visible; scrollbar-width: none; will-change: transform; transition: transform 320ms ease; }
.venue-scroller::-webkit-scrollbar { display: none; }
.venue-card { flex: 0 0 282px; width: 282px; }
.venue-card h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; line-height: 24px; white-space: nowrap; }
.venue-card > img { display: block; width: 282px; aspect-ratio: 160 / 90; object-fit: cover; object-position: bottom center; border-radius: 8px; box-shadow: 0 0 8px rgba(0,0,0,.25); }
.venue-card__content { width: 250px; margin-top: 16px; }
.venue-card strong { display: block; color: var(--ds-neutral-default); font-size: 14px; font-weight: 600; line-height: 20px; }
.venue-card p { width: 250px; margin: 10px 0 0; color: var(--ds-neutral-light); font-size: 14px; line-height: 20px; }

/* CTA and partner modules */
.cta-banner { position: relative; height: 320px; overflow: hidden; color: var(--ds-neutral-white); text-align: center; }
.cta-banner > img { width: 100%; height: 100%; object-fit: cover; }
.cta-banner__content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cta-banner h2 { margin-bottom: 8px; font-size: 32px; }
.cta-banner p { font-size: 18px; }
.partner-marquee { overflow: hidden; mask-image: linear-gradient(to right, transparent, var(--ds-neutral-black) 8%, var(--ds-neutral-black) 92%, transparent); }
.partner-marquee__track { display: flex; align-items: center; justify-content: center; gap: 48px; width: max-content; }
.partner-logo { display: flex; flex: 0 0 260px; align-items: center; justify-content: center; width: 260px; height: 100px; }
.partner-logo img { width: 100%; height: 100%; object-fit: contain; }
.partner-marquee:not(.is-overflowing) { overflow: visible; mask-image: none; }
.partner-marquee:not(.is-overflowing) .partner-marquee__track { width: auto; min-width: 100%; animation: none; }
.partner-marquee.is-overflowing .partner-marquee__track { justify-content: flex-start; animation: partner-marquee 24s linear infinite; }
@keyframes partner-marquee { to { transform: translateX(-35%); } }

@media (min-width: 769px) and (max-width: 1279px) {
  .course-scroller { max-width: 596px; margin-inline: auto; }
  .category-card { flex-basis: calc((100% - 48px) / 3); max-width: 157px; }
  .venue-section { padding-block: 64px; }
  .venue-layout { --venue-panel-left: 240px; --venue-mask-width: 80px; }
  .venue-layout::after { width: 320px; }
  .venue-layout__heading,
  .venue-controls { left: 40px; }
  .venue-layout__heading,
  .venue-layout__heading p { width: 240px; }
  .venue-card { flex-basis: 250px; width: 250px; }
  .venue-card > img { width: 250px; }
  .venue-card__content,
  .venue-card p { width: 230px; }
}

@media (max-width: 768px) {
  .course-card__title {
    height: 48px;
    min-height: 48px;
    font-size: 16px;
    line-height: 24px;
  }

  .hero { height: auto; min-height: 0; }
  .hero__slides { position: relative; inset: auto; }
  .hero-slide { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto; width: 100%; height: auto; }
  .hero-slide.is-active { position: relative; inset: auto; }
  .hero-slide__media { position: relative; inset: auto; grid-row: 1; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #eef7fb; }
  .hero-slide__media img { object-fit: cover; object-position: center; }
  .hero-slide__content { position: relative; grid-row: 2; align-items: flex-start; justify-content: center; min-height: 202px; height: auto; padding: 16px 16px 48px; text-align: center; }
  .hero-slide__text { width: 100%; margin-left: 0; color: var(--ds-neutral-default); }
  .hero-slide h1,
  .hero-slide h2 { font-size: 24px; line-height: 36px; }
  .hero-slide p { margin-bottom: 16px; font-size: 16px; line-height: 24px; }
  .hero-slide__text .btn--lg { min-width: 40px; height: 40px; min-height: 40px; font-size: 16px; line-height: 18px; font-weight:600;}
  .carousel-arrow { top: 50vw; width: 28px; height: 28px; font-size: 18px; }
  .carousel-arrow--prev { left: 16px; }
  .carousel-arrow--next { right: 16px; }
  .carousel-dots { bottom: 24px; gap: 8px; padding: 4px 8px; }
  .carousel-dots__item { width: 6px; height: 6px; }

  .course-scroller {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 16px;
    margin: -8px calc(-1 * var(--gutter)) -20px;
    padding: 8px 20px 20px;
    overflow-x: auto;
    scroll-padding-left: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .course-scroller::-webkit-scrollbar { display: none; }
  .course-scroller.is-single-card,
  .course-scroller[data-visible-count="1"] {
    width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    justify-content: center;
    overflow-x: visible;
    scroll-padding-left: 0;
    scroll-snap-type: none;
  }
  .course-card { flex: 0 0 218px; scroll-snap-align: start; box-shadow: 0 4px 15px rgba(59, 66, 70, .15); }
  .section__action { margin-top: 40px; }

  .category-panel { width: 100%; padding: 56px 20px; border-radius: 0; }
  .icon--book { width: 32px; height: 32px; background-image: url('../../assets/icons/home-book.svg'); }
  .category-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 12px; }
  .category-card { width: calc((100% - 24px) / 3); max-width: 104px; flex: 0 1 calc((100% - 24px) / 3); padding: 20px 8px; }
  .category-card strong { font-size: 16px; }

  .video-banner { height: auto; min-height: 0; aspect-ratio: 375 / 211; }
  .venue-section { padding-block: 56px; }
  .venue-layout { height: 515px; min-height: 515px; }
  .venue-layout::before { inset: 0 -124px 0 136px; border-radius: 24px; }
  .venue-layout::after,
  .venue-layout__bg-mask { display: none; }
  .venue-layout__heading { top: 40px; right: 20px; left: 20px; width: auto; }
  .venue-layout__heading h2 { margin-bottom: 8px; font-size: 24px; line-height: 36px; }
  .venue-layout__heading .section-heading__decor { width: 32px; height: 11px; margin-bottom: 24px; }
  .venue-layout__heading p { width: 100%; font-size: 16px; font-weight: 400; line-height: 24px; }
  .venue-controls { display: none; }
  .venue-viewport { top: 199px; right: 0; bottom: 0; left: 0; overflow: visible; }
  .venue-scroller { gap: 20px; width: auto; overflow-x: auto; padding-inline: 20px; scroll-padding-inline: 20px; scroll-snap-type: x mandatory; transform: none !important; transition: none; }
  .venue-card { flex: 0 0 275px; width: 275px; scroll-snap-align: start; }
  .venue-card > img { width: 275px; height: 152px; }
  .venue-card__content,
  .venue-card p { width: 243px; }
  .venue-card p { font-size: 12px; font-weight: 600; line-height: 16px; }

  .cta-banner { height: 240px; }
  .cta-banner h2 { font-size: 20px; line-height: 32px; }
  .cta-banner p { font-size: 16px; }
  .partner-section { padding-bottom: 56px; }
  .partner-marquee__track { justify-content: flex-start; gap: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .course-card__media img,
  .venue-scroller { transition-duration: 1ms; }
  .partner-marquee__track { animation: none !important; }
}

.section__action .btn__circle-arrow { width: 24px; height: 24px; flex: 0 0 24px; object-fit: contain; }
.section__action .btn--outline:hover .btn__circle-arrow { filter: brightness(0) invert(1); }
@media (max-width: 768px) {
  .section__action .btn__circle-arrow { width: 20px; height: 20px; flex-basis: 20px; }
}

/* Typography normalization — Figma Desktop (大小網 RWD), node 2616:30831. */
.course-card__promo-tag { line-height: 16px; }
.course-card__category-tag { line-height: 20px; }
.category-card strong { line-height: 28px; }
.cta-banner h2 { line-height: 48px; }
.cta-banner p { font-weight: 500; line-height: 28px; }
@media (max-width: 768px) {
  .category-card strong { line-height: 24px; }
  .cta-banner p { font-weight: 400; line-height: 24px; }
}

/* Venue heading: title and external icon share one link target. */
.venue-card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ds-primary-default);
  text-decoration: none;
}
.venue-card__link:hover { text-decoration: underline; }
.venue-card__link:focus-visible {
  outline: 2px solid var(--ds-primary-bright);
  outline-offset: 3px;
}
.venue-card__link img { width: 16px; height: 16px; flex: 0 0 16px; }

/* ===== 2026-10-01 首頁圖文介紹標題外開連結 ===== */
.venue-card h3 {
  color: var(--ds-primary-default);
}

.venue-card__title {
  display: inline-block;
  color: var(--ds-primary-default);
}

.venue-card__link {
  color: var(--ds-primary-default);
}

.venue-card strong {
  color: var(--ds-primary-default);
}

.venue-card__link-icon,
.venue-card__link img {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
}

