/* ==================================================
   RESPONSIVE ART ADJUSTMENT
   修改以下變數可調整 home 背景與即時資訊列高度。
   不要直接修改 img 的寬高比例。
   ================================================== */
:root {
  --home-art-height: 1627px;
  --status-ticker-height: 30px;
}

/* Keep the scene fallback and Footer overlap on one paper color. Scene
   sections stay transparent so their absolute artwork remains visible. */
.home-main {
  background-color: var(--home-paper-color, #fffdf5);
}

@media (max-width: 1439px) {
  :root {
    --home-art-height: 1220px;
  }
}

@media (max-width: 1023px) {
  :root {
    --home-art-height: 915px;
    --status-ticker-height: 0px;
  }
}

@media (max-width: 767px) {
  :root {
    --home-art-height: 686px;
  }
}

.water-home-scene {
  min-height: var(--home-art-height);
}


/* Desktop-only real-time information ticker. */
.site-status-ticker {
  position: fixed;
  z-index: 1100;
  top: 0;
  left: 0;
  display: none;
  width: 100%;
  height: var(--status-ticker-height);
  overflow: hidden;
  color: #243745;
  background: #fff9df;
  transition: height 240ms ease, opacity 240ms ease;
}

@media (min-width: 1024px) {
  .site-status-ticker:not([hidden]) {
    display: block;
  }

  body.has-status-ticker .custom-header {
    top: var(--status-ticker-height);
  }
}

.site-status-ticker__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.site-status-ticker__background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.site-status-ticker__content {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  padding: 0 52px;
  place-items: center;
}

.site-status-ticker__viewport {
  width: 100%;
  height: 14px;
  overflow: hidden;
  outline-offset: 2px;
}

.site-status-ticker__track {
  transition: transform 420ms ease;
}

.site-status-ticker__item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 14px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
  text-align: center;
  white-space: nowrap;
}

.site-status-ticker__item--alert {
  color: #a52727;
  font-weight: 900;
}

.site-status-ticker__close {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 12px;
  width: 22px;
  height: 22px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #243745;
  background: rgba(255,255,255,.72);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* ==================================================
   BANNER INTERACTIVE WAVE
   Canvas stays visually above Swiper while pointer input is observed on the
   shared Banner root. This preserves Swiper drag and native page scrolling.
   ================================================== */
.site-banner {
  --banner-wave-opacity: .8;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.site-banner__carousel {
  position: relative;
  z-index: 1;
}

.site-banner__wave-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: var(--banner-wave-opacity);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-banner__wave-canvas {
    display: none;
  }
}

/* Events carousel: all selectors are isolated to the events namespace. */
.events-section {
  width: 100%;
  max-width: 1920px;
  margin-inline: auto;
  padding: clamp(64px, 8vw, 110px) clamp(20px, 8vw, 160px);
}

.events-section__title {
  margin: 0 0 clamp(34px, 4vw, 60px);
  color: #1f2937;
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 700;
  text-align: center;
}

.events-carousel {
  --events-gap: 28px;
  position: relative;
  width: min(100%, 1400px);
  margin-inline: auto;
  padding-inline: 58px;
}

.events-carousel__viewport {
  overflow: hidden;
}

.events-carousel__track {
  align-items: stretch;
}

.events-carousel__slide {
  display: flex;
  height: auto;
}

#events .events-card {
  width: 100%;
  max-width: 26.75rem;
  min-width: 0;
  min-height: 35.5rem;
  margin: 1rem auto;
  overflow: hidden;
  border-radius: 1.75rem;
  background: #fff;
  box-shadow: 0 .25rem 1.25rem rgba(0, 0, 0, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#events .events-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: inherit;
  color: inherit;
  text-decoration: none;
}

#events .events-card__link:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: -3px;
}

#events .events-card__image {
  display: block;
  width: 100%;
  height: 15rem;
  object-fit: cover;
  object-position: center;
}

#events .events-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .75rem;
  padding: 1.25rem;
}

#events .events-card__excerpt {
  margin: 0;
  color: #4b5563;
  font-size: .875rem;
  line-height: 1.5rem;
}

#events .events-card__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#events .events-card__header-date {
  color: #374151;
}

#events .events-card__tag {
  display: inline-block;
  padding: .125rem .75rem;
  border-radius: 1rem;
  color: #374151;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 50%, #fbcfe8 100%);
  font-size: .875rem;
  line-height: 1.5rem;
}

#events .events-card__title-wrapper {
  position: relative;
  width: 100%;
  height: 3rem;
  overflow: hidden;
}

#events .events-card__title {
  position: relative;
  z-index: 2;
  display: -webkit-box;
  height: 3rem;
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5rem;
  text-overflow: ellipsis;
  transition: opacity 300ms ease;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#events .events-card__title-hover-image {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

#events .events-card__date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#events .events-card__footer {
  width: 100%;
  height: 7.5rem;
  padding-top: .75rem;
  overflow-y: auto;
  border-top: 1px solid #e5e7eb;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#events .events-card__footer::-webkit-scrollbar {
  display: none;
}

#events .events-card__footer-text {
  display: block;
  margin: 0;
  overflow: visible;
  color: #4b5563;
  font-size: 1.25rem;
  line-height: 1.875rem;
}

@media (hover: hover) and (pointer: fine) {
  #events .events-card__title-wrapper:hover .events-card__title-hover-image,
  #events .events-card__link:focus-visible .events-card__title-hover-image {
    opacity: .5;
  }
}

.events-carousel .events-carousel__button {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0;
  transform: translateY(-50%);
  border: 1px solid rgba(99, 123, 136, .3);
  border-radius: 50%;
  color: #536f7d !important;
  background: rgba(255,255,255,.94);
  box-shadow: 0 5px 18px rgba(37, 62, 74, .15);
  cursor: pointer;
  place-items: center;
}

.events-carousel .events-carousel__button::after {
  font-size: 17px;
  font-weight: 900;
}

.events-carousel .events-carousel__button--prev { left: 0; }
.events-carousel .events-carousel__button--next { right: 0; }

.events-carousel__dots {
  position: static !important;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.events-carousel__dots--desktop {
  display: none;
}

@media (min-width: 1024px) {
  .events-carousel__dots--compact {
    display: none;
  }

  .events-carousel__dots--desktop {
    display: flex;
  }
}

.events-carousel__dots .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  margin: 0 !important;
  background: #7697a7;
  opacity: .38;
}

.events-carousel__dots .swiper-pagination-bullet-active {
  width: 10px !important;
  border-radius: 50% !important;
  background: #3b82a0 !important;
  opacity: 1;
}

.events-section__more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 230px;
  min-height: 58px;
  margin: 42px auto 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  background: rgba(255,255,255,.85);
  font-size: 20px;
  cursor: pointer;
    transition: all 0.3s ease; 
}
.events-section__more:hover {
  border-color: #31a9dd;
  color: #2B87BB;
}



@media (min-width: 768px) and (max-width: 1023px) {
  #events .events-card.is-expanded .events-card__title-hover-image {
    opacity: .5;
  }
}

@media (max-width: 767px) {
  .events-section {
    padding-inline: 0;
  }

  .events-carousel {
    padding-inline: 0;
  }

  .events-carousel__viewport {
    overflow: visible;
  }

  #events .events-card {
    max-width: min(26.75rem, calc(100vw - 40px));
  }

  .events-carousel__button {
    top: calc(50% - 22px);
    width: 44px;
    height: 44px;
  }

  .events-carousel__button--prev { left: 4px; }
  .events-carousel__button--next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-status-ticker__track,
  #events .events-card__title,
  #events .events-card__title-hover-image {
    transition: none;
  }
}
