/* ========================================
   最新活動頁面 (Events / Promotions)
   對齊 Figma 設計稿 — 白色明亮主題
   ======================================== */

/* ---- Hero Banner（全寬背景 + 居中覆蓋） ---- */
.events-hero {
  margin-top: var(--header-height);
  position: relative;
  width: 100%;
  height: 660px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.events-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: opacity 0.35s ease;
}

.events-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.events-hero-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.events-hero-en {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffeebf;
  letter-spacing: 2px;
}

.events-hero-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 56px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 4px 0 2px;
}

.events-hero-subtitle {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 12px;
}

/* ---- Countdown Container & Layout ---- */
.events-countdown-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 24px;
  margin-bottom: 12px;
}

.events-countdown {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 22px 36px 40px; /* 底部留白讓按鈕壓在邊線上 */
  width: fit-content;
  min-width: 300px;
  max-width: 90vw;
  box-sizing: border-box;
}

.countdown-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}

.countdown-number {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.countdown-label {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 2.5px;
  text-align: center;
  margin-top: 8px;
}

.countdown-sep {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 32px;
  font-weight: 400;
  color: #fff;
  line-height: 1;
  margin: 0 6px;
  transform: translateY(-8px); /* 向上微調以對齊數字中心 */
}

/* ---- Hero CTA Button ---- */
.events-hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 40px;
  background: #fff;
  color: #e25b2a; /* 橘紅色字型 */
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* 當倒數計時啟用時，按鈕絕對定位並壓在邊框底部 */
.events-countdown .events-hero-cta {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  margin-bottom: 0;
}

/* 沒有倒數時的獨立 CTA 樣式 */
.events-hero-cta.no-countdown {
  margin-top: 24px;
}

.events-hero-cta:hover {
  background: #e25b2a;
  color: #fff;
  box-shadow: 0 6px 15px rgba(226, 91, 42, 0.4);
}

/* ---- Hero Banner（行動裝置專屬） ---- */
.events-hero-mobile {
  display: none;
}

.events-hero-mobile-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 375 / 190;
  overflow: hidden;
}

.events-hero-mobile-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
  object-position: center;
}

.events-hero-mobile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.events-hero-mobile-center {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 16px 10px;
  gap: 4px;
}

.events-hero-mobile-en {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #ffeebf;
  letter-spacing: 1px;
  line-height: 1.2;
}

.events-hero-mobile-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

.events-hero-mobile-subtitle {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #fff;
  line-height: 1.3;
  margin: 0;
  max-width: 280px;
}

.events-countdown-container--mobile {
  margin: 10px 0 0;
  width: 100%;
}

.events-countdown--mobile {
  position: relative;
  width: fit-content;
  min-width: 220px;
  max-width: calc(100% - 32px);
  padding: 10px 24px 22px;
  gap: 6px;
  border-color: rgba(255, 255, 255, 0.8);
}

.events-countdown--mobile .countdown-number {
  font-size: 18px;
}

.events-countdown--mobile .countdown-label {
  font-size: 8px;
  letter-spacing: 1px;
  margin-top: 2px;
}

.events-countdown--mobile .countdown-sep {
  font-size: 14px;
  margin: 0 2px;
  transform: translateY(-4px);
}

.events-hero-cta--mobile {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 100px;
  height: 28px;
  font-size: 12px;
  margin: 0;
}

.events-hero-cta--mobile.no-countdown {
  position: static;
  transform: none;
  margin-top: 6px;
}

/* ---- Listing Section（白色背景）---- */
.events-listing {
  background: #fff;
  padding: 50px 0 60px;
}

.events-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 50px;
}

/* ---- Tabs（方形矩形按鈕）---- */
.events-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.events-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 40px;
  padding: 11px 18px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--tab-color, #e25b2a);
  background: #fff;
  border: 1px solid var(--tab-color, #e25b2a);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .events-tab:hover {
    background: var(--tab-color, #e25b2a);
    color: #fff;
  }
}

.events-tab.active {
  background: var(--tab-color, #e25b2a);
  color: #fff;
}

/* ---- Section Title ---- */
.events-section-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.events-section-title {
  align-self: stretch;
  color: #111;
  text-align: center;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.events-section-title-line {
  width: 200px;
  height: 0;
  flex-shrink: 0;
  background-color: transparent;
  border: none;
  border-top: 2px solid var(--active-tab-color, #E25B2A);
  transition: border-color 0.3s ease;
}

/* ---- Event Cards Grid ---- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 29px;
  margin-bottom: 50px;
}

.event-card {
  background: #f5f5f5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.event-card.hidden {
  display: none;
}

.event-card.page-hidden {
  display: none;
}

/* ---- Card Image ---- */
.event-card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.event-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.event-card:hover .event-card-image img {
  transform: scale(1.05);
}

.event-card-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Badge（左上角分類標籤）*/
.event-card-badge {
  position: absolute;
  top: 0;
  left: 0;
  padding: 7px 21px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  white-space: nowrap;
  z-index: 2;
}

.event-card-badge.cat-sale {
  background: #d9534f;
}

.event-card-badge.cat-new {
  background: #d9534f;
}

.event-card-badge.cat-exclusive {
  background: #4caf50;
}

.event-card-badge.cat-free {
  background: #4caf50;
}

/* 倒數標籤（右上角）*/
.event-card-countdown {
  position: absolute;
  top: 0;
  right: 0;
  padding: 7px 23px;
  background: #000;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #fff;
  white-space: nowrap;
  z-index: 2;
}

/* ---- Card Body ---- */
.event-card-body {
  padding: 21px 21px 27px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.event-card-date {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #888;
}

.event-card-title {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #000;
  line-height: 1.3;
}

.event-card-title a {
  color: inherit;
  text-decoration: none;
}

.event-card-price {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #E25B2A;
  line-height: 1.2;
}

.event-card-price del {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #999;
}

.event-card-price ins {
  text-decoration: none;
}

.event-card-desc {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-bottom: 4px;
}

/* ---- Card Button（統一金色方形）---- */
.event-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 38px;
  background: #E25B2A;
  color: #fff;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  margin-top: auto;
  transition: all 0.3s ease;
}

.event-card-btn:hover {
  background: #cf4f22;
  color: #fff;
  opacity: 1;
}

/* ---- Pagination（圓形 + 膠囊 Next）---- */
.events-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
  border: none;
}

.events-pagination .page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: 100px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--pg-text, #602d16);
  background: #fff;
  border: 1px solid var(--pg-outline, #602d16);
  cursor: pointer;
  transition: all 0.3s ease;
}

.events-pagination .page-num:hover {
  color: var(--pg-active, #602d16);
  border-color: var(--pg-active, #602d16);
}

.events-pagination .page-num.active {
  color: #fff;
  background: var(--pg-active, #602d16);
  border-color: var(--pg-active, #602d16);
}

.events-pagination .page-next {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 28px;
  padding: 0 16px;
  border-radius: 100px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--pg-text, #602d16);
  background: #fff;
  border: 1px solid var(--pg-outline, #602d16);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.events-pagination .page-next:hover {
  color: var(--pg-active, #602d16);
  border-color: var(--pg-active, #602d16);
  opacity: 1;
}

/* ---- 隱藏頁尾預設訂閱區塊（僅此頁面） ---- */
.page-template-page-events .footer-newsletter {
  display: none !important;
}

.page-template-page-events .site-footer > .footer-divider:nth-of-type(2) {
  display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .events-hero-title {
    font-size: 40px;
  }

  .events-hero-subtitle {
    font-size: 18px;
  }

  .events-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .events-container {
    padding: 0 30px;
  }

  .events-tabs {
    flex-wrap: wrap;
    gap: 12px;
  }

  .events-tab {
    width: auto;
    padding: 10px 18px;
  }

  .events-countdown:not(.events-countdown--mobile) {
    padding: 20px 32px 38px;
    min-width: 280px;
  }

  .countdown-number {
    font-size: 34px;
  }
}

@media (max-width: 768px) {
  .events-hero {
    display: none !important;
  }

  .events-hero-mobile {
    display: block;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: var(--header-height);
    overflow: hidden;
  }

  .events-hero-mobile-inner {
    width: 100%;
    aspect-ratio: 375 / 190;
  }

  .events-countdown--mobile {
    width: fit-content;
    min-width: 220px;
    padding: 10px 24px 22px;
    gap: 6px;
  }

  .events-tabs {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 8px;
    margin-bottom: 24px;
  }

  .events-tab {
    flex: 0 0 calc((100% - 16px) / 3);
    width: calc((100% - 16px) / 3);
    max-width: calc((100% - 16px) / 3);
    height: 36px;
    padding: 0 6px;
    font-size: 13px;
    box-sizing: border-box;
  }

  .events-section-title-wrap {
    gap: 8px;
    margin-bottom: 24px;
  }

  .events-section-title {
    align-self: stretch;
    color: #111;
    text-align: center;
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    line-height: 22px;
  }

  .events-section-title-line {
    width: 110.854px;
    height: 0;
    flex-shrink: 0;
    border-top: 1.109px solid var(--active-tab-color, #E25B2A);
  }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 32px;
  }

  .events-container {
    padding: 0 20px;
  }

  .events-listing {
    padding: 32px 0 40px;
  }

  .event-card {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    border-radius: 0;
    max-width: 335px;
    margin: 0 auto;
    width: 100%;
  }

  .event-card:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  }

  .event-card-image {
    height: 210px;
    background: #f0f0f0;
  }

  .event-card-image img {
    object-fit: cover;
  }

  .event-card:hover .event-card-image img {
    transform: none;
  }

  .event-card-badge {
    padding: 7px 16px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    background: #d9534f;
  }

  .event-card-badge.cat-sale,
  .event-card-badge.cat-new,
  .event-card-badge.cat-exclusive,
  .event-card-badge.cat-free {
    background: #d9534f;
  }

  .event-card-countdown {
    padding: 7px 16px;
    font-size: 10px;
    line-height: 1.2;
    background: #000;
  }

  .event-card-body {
    padding: 16px 18px 22px;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
    background: #f5f5f5;
  }

  .event-card-date {
    width: 100%;
    font-size: 12px;
    line-height: 1.4;
    color: #888;
    text-align: left;
  }

  .event-card-title {
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: #000;
    text-align: left;
    margin: 0;
  }

  .event-card-desc {
    width: 100%;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    margin: 0 0 12px;
    text-align: left;
  }

  .event-card-btn {
    align-self: center;
    width: 68%;
    min-width: 148px;
    max-width: 200px;
    height: 38px;
    margin: 4px auto 0;
    background: #e25b2a;
    border-radius: 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
  }

  .event-card-btn:hover {
    background: #cf4f22;
    color: #fff;
  }

  .events-pagination {
    gap: 8px;
    margin-top: 8px;
  }

  .events-pagination .page-num {
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .events-pagination .page-next {
    min-width: 52px;
    height: 24px;
    padding: 0 14px;
    font-size: 11px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .events-hero {
    height: 660px;
  }
}

@media (max-width: 640px) {
  .events-hero-title {
    font-size: 30px;
  }

  .events-hero-subtitle {
    font-size: 16px;
  }

  .events-countdown:not(.events-countdown--mobile) {
    padding: 18px 28px 34px;
    gap: 10px;
    min-width: 260px;
  }

  .countdown-number {
    font-size: 28px;
  }

  .countdown-sep {
    font-size: 24px;
    transform: translateY(-6px);
  }

  .countdown-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-top: 6px;
  }

  .events-countdown .events-hero-cta {
    width: 140px;
    height: 32px;
    font-size: 14px;
  }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .events-container {
    padding: 0 16px;
  }

  .events-listing {
    padding: 35px 0 45px;
  }

  .events-hero-cta {
    width: 140px;
    height: 30px;
    font-size: 14px;
  }
}
