:root {
  --miaoli-cream: #faefdb;
  --miaoli-green: #a0d96b;
  --miaoli-purple: #c7c6f4;
  --miaoli-yellow: #f7df62;
  --miaoli-red: #ed7377;
  --miaoli-ink: #261d19;
  --content-width: 85%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--miaoli-cream);
  color: var(--miaoli-ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

.page-container {
  max-width: 1600px;
  margin-inline: auto;
}


/* =========================================================
   頁首主視覺
   ========================================================= */
.miaoli-hero { width: 100%; }

.miaoli-hero-image {
  display: block;
  width: 100%;
  height: auto;
}


/* =========================================================
   首頁影片區
   ========================================================= */
.feature-section {
  padding-top: clamp(2rem, 4vw, 3.5rem);
  text-align: center;
}

.feature-section .section-heading {
  margin-bottom: 0;
}

.feature-video {
  width: 90%;
  margin-inline: auto;
  overflow: hidden;
  border-radius: clamp(12px, 2vw, 24px);
  background: #000;
  box-shadow: 0 12px 30px rgb(54 39 25 / 12%);
  margin-top: 15px;
}

.feature-video iframe,
.modal-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.highlights-section { 
	padding-bottom: clamp(2.5rem, 5vw, 4.5rem); 
}


/* =========================================================
   18 鄉鎮市影片卡片
   ========================================================= */
.township-section {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5rem);
  background-color: var(--miaoli-cream);
  background-image: url("../images/m-bg.jpg");
  background-size: auto;
  background-position: center top;
  background-repeat: repeat-x;
}

.tainan-page .township-section {
  background-image: url("../images/t-bg.jpg");
}

.township-section .page-container {
  width: 85%;
}

.section-heading {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
}

.township-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 20px;
}

.township-col { min-width: 0; }

.township-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.township-photo-wrap {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #45614a;
}

.township-photo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  transition: transform .35s ease;
}

.township-card:hover .township-photo,
.township-card:focus-within .township-photo {
  transform: scale(1.08);
}

.township-english {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: .1rem .5rem;
  color: #fff;
  font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, "serif";
  font-size: clamp(2rem, 1.25vw, 1.25rem);
  font-weight: 700;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.8);
}

.township-button-row {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  padding-top: .7rem;
}

.video-choice {
  min-width: 0;
  padding: .5rem .2rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .2s ease;
  border: 1px solid #ddc02b;
}

.video-choice:hover,
.video-choice:focus-visible { filter: brightness(.92); }

.video-choice:focus-visible { outline: 3px solid #222; outline-offset: -3px; }

.video-choice.highlight { background: var(--miaoli-yellow); color: #000; }
.video-choice.chinese { background: var(--miaoli-yellow); color: #000; }
.video-choice.english { background: var(--miaoli-yellow); color: #000; }
.township-button-row .video-choice.chinese { padding-inline: .75rem; }

.video-choice-english {
  display: block;
  margin-top: .15rem;
  font-size: .82em;
  line-height: 1.1;
}



/* =========================================================
   活動橫幅、頁尾與回頂端按鈕
   ========================================================= */
.footer-banner { padding-top: clamp(2.5rem, 5vw, 4rem); }

.footer-banner img {
  display: block;
  width: 85%;
  height: auto;
  margin-inline: auto;
}

.miaoli-signup {
  display: flex;
  min-height: 92px;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  background: #00cc00;
}

.signup-button {
  padding: .65rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: #00743a;
  color: #fff;
  font-size: clamp(1rem, 1.4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
}


.tainan-signup {
  background: #dd5519;
}

.tainan-signup .signup-button {
  background: #af4210;
}



.signup-button span { margin-left: .3em; font-weight: 600; }

/* =========================================================
   影片彈跳視窗
   ========================================================= */
.video-modal {
  width: 70vw;
  max-width: 1200px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #15110f;
  color: #fff;
  box-shadow: 0 24px 80px rgb(0 0 0 / 45%);
}

.video-modal::backdrop { background: rgb(0 0 0 / 72%); }

.modal-header {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 1rem;
}

.modal-title { margin: 0; font-size: 1.1rem; font-weight: 600; }

.modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-video { background: #000; }


/* =========================================================
   RWD
   ========================================================= */
@media (max-width: 991.98px) {
  :root { --content-width: 90%; }

  .feature-video { width: 100%; }
  .video-modal { width: 94vw; }
  .modal-header { min-height: 48px; }
  .miaoli-signup { min-height: 82px; }
  .township-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .township-english { font-size: 2.5rem; }
  .video-choice { padding: .6rem .1rem; }
}

@media (max-width: 767.98px) {
  .feature-video {
    width: calc(100% - 1.5rem);
  }
}

@media (max-width: 479.98px) {
  .township-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
