/* ==================================================
   孤島植賞：多圖滑動版
   支援 4:6 與 9:16 圖片，完整顯示、不裁切
   ================================================== */

/* 導覽列目前頁面 */
.site-header nav a.active {
  color: var(--orange);
  border-bottom: 2px solid var(--orange);
}

/* 孤島植賞頁首 */
.appreciation-hero {
  background: var(--rock);
  color: var(--white);
  border-bottom: 9px solid var(--orange);
}

.appreciation-hero > p:not(.label) {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

/* 工具列與分類篩選 */
.appreciation-toolbar {
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-group button {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid var(--rock);
  background: transparent;
  color: var(--rock);
  font-family: "Khand", "GenSekiGothicTC", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.filter-group button.active,
.filter-group button:hover,
.filter-group button:focus-visible {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--rock);
}

/* 植賞卡片網格 */
.appreciation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 4vw, 42px);
  margin-top: 28px;
}

.appreciation-card {
  min-width: 0;
  overflow: hidden;
  background: var(--white);
  border-top: 5px solid var(--orange);
  box-shadow: 0 16px 42px rgba(38, 44, 49, 0.10);
}

/*
  固定一致的展示框。
  圖片可混用 4:6 與 9:16。
  object-fit: contain 會完整顯示圖片、不裁切、不變形。
*/
.appreciation-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--rock);
  outline: none;
  touch-action: pan-y;
  user-select: none;
}

.appreciation-gallery:focus-visible {
  box-shadow: inset 0 0 0 3px var(--orange);
}

.appreciation-track,
.appreciation-slide {
  position: absolute;
  inset: 0;
}

.appreciation-slide {
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
  transition:
    opacity 0.28s ease,
    transform 0.32s ease,
    visibility 0.28s;
}

.appreciation-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.appreciation-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--rock);
  -webkit-user-drag: none;
}

/* 圖片載入失敗提示 */
.appreciation-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(255, 255, 255, 0.58);
  font-family: "Khand", sans-serif;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

/* 圖片左上角分類標籤 */
.appreciation-category {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  padding: 6px 11px;
  background: var(--orange);
  color: var(--rock);
  font-family: "Khand", "GenSekiGothicTC", sans-serif;
  font-weight: 700;
}

/* 上一張、下一張按鈕 */
.gallery-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(38, 44, 49, 0.66);
  color: var(--white);
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--rock);
}

/* 右下角圖片張數 */
.gallery-status {
  position: absolute;
  z-index: 5;
  right: 13px;
  bottom: 13px;
  padding: 5px 9px;
  background: rgba(38, 44, 49, 0.78);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

/* 圖片切換圓點容器 */
.gallery-dots {
  position: absolute;
  z-index: 5;
  bottom: 15px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
}

/* 未選取：白色空心小正圓 */
.gallery-dot {
  flex: 0 0 9px;
  width: 9px !important;
  min-width: 9px !important;
  max-width: 9px !important;
  height: 9px !important;
  min-height: 9px !important;
  max-height: 9px !important;
  margin: 0;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50% !important;
  background: transparent;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* 目前圖片：橙色實心小正圓 */
.gallery-dot.active {
  flex-basis: 10px;
  width: 10px !important;
  min-width: 10px !important;
  max-width: 10px !important;
  height: 10px !important;
  min-height: 10px !important;
  max-height: 10px !important;
  border-color: var(--orange);
  background: var(--orange);
  transform: none;
}

.gallery-dot:hover,
.gallery-dot:focus-visible {
  border-color: var(--orange);
  background: rgba(255, 133, 16, 0.55);
  outline: none;
}

/* 卡片文字內容 */
.appreciation-body {
  padding: clamp(21px, 4vw, 30px);
}

.appreciation-body > small {
  color: var(--red);
  font-family: "Khand", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.appreciation-body h2 {
  margin: 5px 0 11px;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.22;
}

.appreciation-body > p {
  min-height: 52px;
  color: #5e666a;
}

/* 培育與紀錄資訊 */
.appreciation-meta {
  margin: 18px 0;
  border-top: 1px solid #dddddd;
  border-bottom: 1px solid #dddddd;
}

.appreciation-meta > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 10px 0;
}

.appreciation-meta > div + div {
  border-top: 1px solid #eeeeee;
}

.appreciation-meta dt {
  color: var(--red);
  font-weight: 700;
}

.appreciation-meta dd {
  margin: 0;
}

/* Instagram 連結 */
.appreciation-body > a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--green);
  font-family: "Khand", "GenSekiGothicTC", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.appreciation-body > a:hover,
.appreciation-body > a:focus-visible {
  color: var(--orange);
}

/* 空分類提示 */
.appreciation-empty {
  grid-column: 1 / -1;
  padding: 52px 20px;
  border: 1px dashed #aaaaaa;
  background: var(--white);
  color: #687176;
  text-align: center;
}

/* 平板與手機 */
@media (max-width: 820px) {
  .appreciation-toolbar {
    display: block;
  }

  .filter-group {
    margin-top: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 7px;
  }

  .filter-group button {
    flex: 0 0 auto;
  }

  .appreciation-grid {
    grid-template-columns: 1fr;
  }

  .appreciation-gallery {
    aspect-ratio: 3 / 4;
  }

  /* 圓點移到圖片最底部，並在手機稍微縮小 */
  .gallery-dots {
    bottom: 4px;
    gap: 7px;
  }

  .gallery-dot {
    flex: 0 0 8px;
    width: 8px !important;
    min-width: 8px !important;
    max-width: 8px !important;
    height: 8px !important;
    min-height: 8px !important;
    max-height: 8px !important;
  }

  .gallery-dot.active {
    flex-basis: 9px;
    width: 9px !important;
    min-width: 9px !important;
    max-width: 9px !important;
    height: 9px !important;
    min-height: 9px !important;
    max-height: 9px !important;
  }

  /* 手機已有圓點提示，隱藏張數以減少遮擋 */
  .gallery-status {
    display: none;
  }
}

@media (max-width: 520px) {
  .appreciation-grid {
    gap: 20px;
  }

  .gallery-arrow {
    width: 38px;
    min-width: 38px;
    height: 48px;
    min-height: 48px;
  }

  .gallery-prev {
    left: 8px;
  }

  .gallery-next {
    right: 8px;
  }

  .appreciation-body > p {
    min-height: 0;
  }
}

/* 減少動畫偏好 */
@media (prefers-reduced-motion: reduce) {
  .appreciation-slide {
    transition: none;
  }
}
/* 隱藏照片左上角的分類標籤 */
.appreciation-category {
  display: none;
}
