/* HERO CAROUSEL */
.hero { position: relative; top: 64px; overflow: hidden; height: min(56vw, 520px); background: var(--clr-dark-green); }
.hero__slides { display: flex; height: 100%; transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.hero__slide { min-width: 100%; height: 100%; position: relative; flex-shrink: 0; background: var(--clr-dark-green); }
.hero__slide img { height: 100%; width: 100%; overflow: hidden;}
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(40,60,30,0.45) 0%, transparent 60%); pointer-events: none; }
.hero__cta { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); background: rgba(64,89,53,0.75); backdrop-filter: blur(4px); color: var(--clr-white); padding: 10px 28px; border-radius: 999px; font-size: 1rem; font-weight: 500; border: 1px solid rgba(255,255,255,0.35); cursor: pointer; transition: background var(--transition-base); white-space: nowrap; }
.hero__cta:hover { background: rgba(64,89,53,0.95); }
.hero__nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.7); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: all var(--transition-base); }
.hero__nav-btn:hover { background: var(--clr-white); }
.hero__nav-btn--prev { left: 16px; }
.hero__nav-btn--next { right: 16px; }
.hero__dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hero__dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: background var(--transition-base), transform var(--transition-base); border: none; }
.hero__dot.active { background: var(--clr-white); transform: scale(1.3); }

/* NEWS SECTION */
.news-section { margin-top: 50px; padding: 72px 0 80px; background: var(--clr-white); }
.news-section__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; max-width: 900px; margin: 0 auto; padding: 0 24px; }
.news-section__blob-wrap { position: relative; display: flex; justify-content: center; align-items: center; }
.blob-img { width: clamp(200px, 38vw, 340px); aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-blob); background: var(--clr-light-green); }
.news-list { list-style: none; margin: 0 0 24px; display: flex; flex-direction: column; gap: 0; }
.news-item { padding: 16px 0; border-bottom: 1px solid var(--clr-light-green); cursor: pointer; transition: background var(--transition-base); }
.news-item:hover { background: var(--clr-pale); border-radius: 6px; }
.news-item__title { font-weight: 600; font-size: 1rem; margin-bottom: 6px; color: var(--clr-dark-green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;    }
.news-item__meta { font-size: 1rem; color: var(--clr-text-muted); margin-bottom: 4px; }
.news-item__desc { font-size: 1rem; color: var(--clr-text-muted); line-height: 1.6; }
.skeleton { background: linear-gradient(90deg, var(--clr-light-green) 25%, var(--clr-bg-green) 50%, var(--clr-light-green) 75%); background-size: 200% 100%; animation: skeleton-pulse 1.5s infinite; border-radius: 4px; }
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line--short { width: 40%; }
.skeleton-line--med { width: 70%; }
.skeleton-line--long { width: 90%; }
.news-error { color: var(--clr-text-muted); font-size: 1rem; padding: 24px 0; text-align: center; }

/* ABOUT PREVIEW */
.about-section { position: relative; background: var(--clr-bg-green); padding: 72px 0 80px; }
.wave-top, .wave-bottom { position: absolute; left: 0; right: 0; height: 48px; overflow: hidden; }
.wave-top { top: -1px; } .wave-bottom { bottom: -1px; }
.wave-top svg, .wave-bottom svg { width: 100%; height: 100%; }
.about-section__inner { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 48px; align-items: center; max-width: 900px; margin: 0 auto; padding: 0 24px; }
/* 替換為 video 容器樣式 */
.about-section__video {
  border-radius: 16px; 
  overflow: hidden; 
  box-shadow: 0 8px 32px rgba(64,89,53,0.15); 
  
  /* YouTube 標準比例為 16:9，完美貼合無黑邊 */
  aspect-ratio: 16/9; 
  background: var(--clr-dark-green); /* 載入前的底色 */
  position: relative;
}

/* 確保 iframe 滿版填滿容器 */
.about-section__video iframe { 
  position: absolute;
  top: 0;
  left: 0;
  width: 100%; 
  height: 100%; 
  display: block;
  border: none;
}
.about-section__meta { font-size: 1rem; color: var(--clr-text-muted); margin-bottom: 8px; }
.about-section__desc { font-size: 1rem; line-height: 1.8; color: var(--clr-text-muted); margin-bottom: 24px; }

/* ECOLOGY SECTION */
.ecology-section { padding: 80px 0; background: var(--clr-white); }
.ecology-section__header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px; max-width: 900px; margin: 0 auto 8px; padding: 0 24px; }
.ecology-grid { max-width: 900px; margin: 50px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.ecology-card { position: relative; cursor: pointer; }

.ecology-card__img-wrap {
  overflow: hidden;
  aspect-ratio: 4/3;
}

.ecology-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.ecology-card:hover .ecology-card__img-wrap img {
  transform: scale(1.5);
}
.ecology-card__label { text-align: center; padding: 10px 0; font-size: 1rem; color: var(--clr-dark-green); font-weight: 500; }
.map-section { position: relative; padding: 0; background: var(--clr-white); margin-top: 40px; max-width: 900px; margin-left: auto; margin-right: auto; }
.map-section__container { position: relative; cursor: pointer; overflow: hidden; outline: none; }
.map-section__placeholder { width: 100%; aspect-ratio: 16/7; background: linear-gradient(135deg, var(--clr-light-green), var(--clr-sand)); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--clr-text-muted); }

/* SPECIES FLIP CARD */
.species-section { padding: 80px 0 0; background: var(--clr-pale); }
.species-section__intro { max-width: 900px; margin: 0 auto 40px; padding: 0 24px; }
.species-section__intro p { font-size: 1rem; color: var(--clr-text-muted); line-height: 1.8; }
.species-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.species-card { position: relative; background: transparent !important; min-height: 320px; perspective: 1000px; outline: none; cursor: pointer; }
.card-inner { position: relative; width: 100%; height: 100%; min-height: 320px; transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1); transform-style: preserve-3d; }
@media (hover: hover) { .species-card:hover .card-inner { transform: rotateY(180deg); } }
.species-card.is-flipped .card-inner { transform: rotateY(180deg); }
.card-front, .card-back { position: absolute; top: 0; left: 0; width: 100%; height: 100%; backface-visibility: hidden; padding: 40px 24px 28px; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.card-back { transform: rotateY(180deg); justify-content: flex-start; }
.card-front > .species-card__name {position: fixed; top: 75%;}
.species-card:nth-child(1) .card-front, .species-card:nth-child(1) .card-back { background: var(--clr-mid-green); }
.species-card:nth-child(2) .card-front, .species-card:nth-child(2) .card-back { background: var(--clr-sand); }
.species-card:nth-child(3) .card-front, .species-card:nth-child(3) .card-back { background: var(--clr-slate-blue); color: var(--clr-white); }
.species-card:nth-child(4) .card-front, .species-card:nth-child(4) .card-back { background: var(--clr-mid-green); }
.species-card__silhouette { font-size: clamp(2.5rem, 6vw, 4rem); margin-bottom: 16px; filter: brightness(0); opacity: 0.8; line-height: 1; }
.species-card__silhouette img { position:relative; height: 60%; object-fit: cover; }
.species-card:nth-child(3) .species-card__silhouette { color: var(--clr-white); opacity: 1; }
.species-card__name { font-family: var(--font-heading); font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 700; color: inherit; margin-top: auto; }
.card-back p { font-size: 1rem; line-height: 1.6; margin-bottom: 20px; opacity: 0.9; }
.card-back .btn { margin-top: auto; }

/* PHOTO BANNER */
.photo-banner { height: clamp(180px, 25vw, 80px); position: relative;;}
.photo-banner img { width: 100%; height: 150%; object-fit: cover;}


/* RWD */
@media (max-width: 768px) {
  .news-section__inner, .about-section__inner { grid-template-columns: 1fr; }
  .news-section__blob-wrap { display: none; }
  .about-section__img { order: -1; }
  .ecology-grid, .species-grid { grid-template-columns: 1fr 1fr; }
  .ecology-card__img-wrap { aspect-ratio: 8/3; }
  .map-section {display: none;}
  .map-section__container {display: none;}
  .species-card {height: 160px; min-height: 0;}
  .species-card__silhouette img { position:relative; max-height: 30%; object-fit: cover; }
  .card-inner { height: 100%; min-height: 0px;}
  .card-back p { display: none; }
  .card-back .btn { font-size: 0.7rem; }
}
@media (max-width: 480px) {
  .ecology-grid { grid-template-columns: 1fr; }
  .hero { height: 65vw; }
}