html,
body {
  font-family: "Noto Sans TC", sans-serif;
  background-color: #fff8f0;
  background-image: url("/bg.jpg");
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  margin: 0;
  padding: 0;

  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  opacity: 0.9; /* 調整這個數值來控制淡化程度 */
  z-index: -1;
}

footer a {
  color: #555;
  text-decoration: none;
  margin: 0 8px;
}

footer a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  font-size: 14px;
  margin-top: 40px;
  margin-bottom: 24px;
  color: #999;
}

/* sweetAlert */
.swal-btn-gray {
  background-color: #4b5563; /* Tailwind 的 gray-600 */
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

.swal-btn-gray:hover {
  background-color: #374151; /* gray-700 */
}

.swal-btn-cancel {
  background-color: #e5e7eb; /* gray-200 */
  color: #374151; /* gray-700 */
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-left: 8px;
  transition: background-color 0.3s ease;
}

.swal-btn-cancel:hover {
  background-color: #d1d5db; /* gray-300 */
}

.timeline-line {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    #9ca3af 20%,
    #6b7280 50%,
    #9ca3af 80%,
    transparent 100%
  );
  box-shadow: 0 0 10px rgba(107, 114, 128, 0.3);
}

.timeline-dot {
  background: #6b7280;
  border: 3px solid white;
}

.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.image-zoom {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.image-zoom:hover {
  transform: scale(1.02);
}

.modal-backdrop {
  backdrop-filter: blur(8px);
}

.modal-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}
@media (max-width: 768px) {
  .timeline-card {
    width: 90vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .timeline-dot,
  .timeline-line {
    display: none !important;
  }
}

/* 清單在卡片內的預設縮排、間距 */
.rich-text ul,
.rich-text ol {
  padding-left: 1.25rem; /* 20px */
  margin: 0.25rem 0 0.5rem; /* 微調間距 */
}
.rich-text li {
  margin: 0.15rem 0;
}

/* <=768px：隱藏時間軸點線、卡片 80% 置中 */
@media (max-width: 768px) {
  .timeline-dot,
  .timeline-line {
    display: none !important;
  }
  .timeline-card {
    width: 80vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
/* 展開後的完整 HTML：第一個子元素不要有額外上邊距 */
.rich-text .full > *:first-child {
  margin-top: 0;
}

/*（可選）依展開/收起差異微調標題與內容間距：
   下面搭配 JS 在卡片上加 .is-expanded */
.timeline-card:not(.is-expanded) .header-row {
  margin-bottom: 0.5rem;
}
.timeline-card.is-expanded .header-row {
  margin-bottom: 0.875rem;
}
