/* ==========================================================
   homepage.css — Homepage pattern styles
   Loaded only on the front page (is_front_page()).
   ========================================================== */

/* ── Hero buttons ─────────────────────────────────────────── */
.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: #fdfbf8;
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d2a27;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.hero-btn-primary:hover {
  transform: scale(1.05);
}

.hero-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.2s ease;
}

.hero-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  display: flex;
}

/* ── Hero section ────────────────────────────────────────── */
.hero-section .wp-block-cover__inner-container {
  width: 100%;
  text-align: center;
}

/* ── Bounce animation ────────────────────────────────────── */
@keyframes bounce {
  0%, 100% { transform: translateY(-4px); opacity: 0.8; }
  50%       { transform: translateY(4px);  opacity: 1;   }
}

.animate-bounce {
  animation: bounce 1.5s ease-in-out infinite;
}

/* ── Section browse link ──────────────────────────────────── */
.section-browse-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #5a3e2a;
  text-decoration: none;
  transition: color 0.2s;
}

.section-browse-link:hover {
  color: #c49a3c;
}

/* ── Card hover effects ──────────────────────────────────── */
.card-hover {
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  cursor: pointer;
}

.card-hover:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
  border-color: rgba(196, 154, 60, 0.45) !important;
  transform: translateY(-2px);
}

/* ── Button styles ───────────────────────────────────────── */
.btn-primary .wp-block-button__link {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary .wp-block-button__link:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(196, 154, 60, 0.45);
}

.btn-outline .wp-block-button__link {
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-outline .wp-block-button__link:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* ── Image zoom on hover ─────────────────────────────────── */
.image-zoom {
  overflow: hidden !important;
}

.image-zoom img,
.image-zoom .wp-block-cover__image-background {
  transition: transform 0.5s ease;
}

.image-zoom:hover img,
.image-zoom:hover .wp-block-cover__image-background {
  transform: scale(1.05);
}

/* ── Sacred teachings cards ───────────────────────────────── */
.teaching-card {
  display: block;
  border: 1px solid #e4e0da;
  border-radius: 10px;
  padding: 1.5rem;
  background: #fdfbf8;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
  height: 100%;
  box-sizing: border-box;
}

.teaching-card:hover {
  border-color: rgba(196, 154, 60, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.teaching-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.teaching-icon-circle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #eeebe6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a3e2a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.teaching-card-meta {
  display: flex;
  flex-direction: column;
}

.teaching-card-id {
  font-size: 0.75rem;
  font-weight: 500;
  color: #716c67;
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
}

.teaching-card-author {
  font-size: 1rem;
  font-weight: 600;
  color: #2d2a27;
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
}

.teaching-card-excerpt {
  font-size: 1rem;
  line-height: 1.65;
  color: #716c67;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #5a3e2a;
  opacity: 0;
  transition: opacity 0.2s;
}

.teaching-card:hover .read-more-link {
  opacity: 1;
}

.teaching-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .teaching-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Chief documents & 隨選經典 cards ────────────────────── */
.chief-doc-featured {
  display: block;
  background-color: var(--wp--preset--color--card);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
  padding: 2.5rem;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

a.chief-doc-featured:hover {
  border-color: rgba(196, 154, 60, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.chief-doc-quote-mark {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 5rem;
  font-weight: 700;
  line-height: 0.8;
  color: var(--wp--preset--color--accent);
  margin: 0 0 0.5rem;
}

.chief-doc-title {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--wp--preset--color--foreground);
  margin: 0 0 1rem;
}

.chief-doc-title,
.chief-doc-compact-title {
  color: var(--wp--preset--color--foreground);
}

.chief-doc-excerpt {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--wp--preset--color--muted);
  margin: 0 0 1.5rem;
}

.chief-doc-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wp--preset--color--accent);
  text-decoration: none;
}

.chief-doc-link:hover {
  text-decoration: underline;
}

.chief-doc-compact {
  display: block;
  background-color: var(--wp--preset--color--card);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chief-doc-compact:last-child {
  margin-bottom: 0;
}

a.chief-doc-compact:hover {
  border-color: rgba(196, 154, 60, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.chief-doc-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
  margin: 0 0 0.5rem;
}

.chief-doc-compact-title {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--wp--preset--color--foreground);
  margin: 0 0 0.375rem;
  line-height: 1.4;
}

.chief-doc-compact-subtitle {
  font-size: 0.875rem;
  color: var(--wp--preset--color--muted);
  margin: 0 0 0.75rem;
}

.chief-doc-compact-excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--wp--preset--color--muted);
  margin: 0 0 1rem;
}

.chief-doc-compact-excerpt a {
  color: var(--wp--preset--color--accent);
}

.chief-doc-attribution {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--wp--preset--color--muted);
  margin: 0;
}

.chief-doc-attribution a {
  color: inherit;
}

.chief-doc-attribution a:hover {
  color: var(--wp--preset--color--accent);
}

/* ── Service grid (同奮服務) ───────────────────────────────── */
/*
 * Single CSS grid for all 6 cards — repeat(4, 1fr) ensures every card
 * is exactly 25% wide. Cards 5–6 auto-flow into row 2 at the same width.
 * Matches v0: sm:grid-cols-2 lg:grid-cols-4
 */
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.service-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-radius: 12px;
  border: 1px solid #e4e0da;
  background: #fdfbf8;
  padding: 1.25rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.service-card:hover {
  border-color: rgba(196, 154, 60, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.service-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: #eeebe6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a3e2a;
}

.service-card-icon.highlight {
  background-color: rgba(196, 154, 60, 0.15);
  color: #c49a3c;
}

.service-card-content {
  flex: 1;
  min-width: 0;
}

.service-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2d2a27;
  margin: 0 0 0.25rem;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
}

.service-card-desc {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #716c67;
  margin: 0;
}

.service-card-arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
  color: #716c67;
  display: flex;
}

.service-card:hover .service-card-arrow {
  opacity: 1;
}

/* ── Classic books list ────────────────────────────────────── */
.books-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 2rem !important;
}

.books-list li {
  border-bottom: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.books-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  transition: background-color 0.15s;
  text-decoration: none;
  color: inherit;
}

.books-link:hover {
  background-color: #eeebe6;
}

.books-link-icon {
  flex-shrink: 0;
  color: #c49a3c;
  display: flex;
  align-items: center;
}

.books-link-title {
  font-size: 1rem;
  font-weight: 500;
  color: #2d2a27;
  flex: 1;
}

.books-link-arrow {
  opacity: 0;
  transition: opacity 0.2s;
  color: #716c67;
  display: flex;
}

.books-link:hover .books-link-arrow {
  opacity: 1;
}

/* ── Classic Books — 1:1 square image ───────────────────── */
.classic-books-image {
  aspect-ratio: 1 / 1 !important;
  /* Override WP's inline min-height */
  min-height: unset !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.classic-books-image .wp-block-cover__image-background {
  object-fit: cover !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* ── Classic Books list ──────────────────────────────────── */
.classic-books-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1.5rem !important;
}

.classic-books-list li {
  display: flex !important;
  align-items: center !important;
  gap: 0.625rem !important;
  padding: 0.75rem 0 !important;
  border-bottom: 1px solid #e4e0da !important;
  margin: 0 !important;
  color: #2d2a27 !important;
  font-size: 0.9375rem !important;
}

.classic-books-list li:last-child {
  border-bottom: none !important;
}

.book-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 24px;
  background-color: rgba(196, 154, 60, 0.12);
  border: 1px solid rgba(196, 154, 60, 0.4);
  border-radius: 3px;
  color: #c49a3c;
  font-size: 11px;
  flex-shrink: 0;
}

/* ── News read-more hover ──────────────────────────────────── */
.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #5a3e2a;
  opacity: 0;
  transition: opacity 0.2s;
}

.card-hover:hover .news-read-more,
.news-card:hover .news-read-more {
  opacity: 1;
}

/* ── News cards grid ─────────────────────────────────────── */
.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .news-cards-grid {
    grid-template-columns: 1fr;
  }
}

.news-card {
  display: flex;
  flex-direction: column;
  background-color: var(--wp--preset--color--card);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.news-card:hover {
  border-color: rgba(196, 154, 60, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.news-source {
  display: inline-block;
  background-color: rgba(196, 154, 60, 0.1);
  color: var(--wp--preset--color--accent);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.25rem 0.625rem;
}

.news-date {
  font-size: 0.75rem;
  color: var(--wp--preset--color--muted);
}

.news-card-title {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--wp--preset--color--foreground);
  margin: 0 0 1rem;
  flex: 1;
}

.news-empty {
  font-size: 1rem;
  color: var(--wp--preset--color--muted);
  margin: 0;
}

/* ── Video aspect ratio ────────────────────────────────────── */
.video-thumb-ratio {
  aspect-ratio: 16 / 9 !important;
  min-height: unset !important;
}

/* ── Video thumbnail ─────────────────────────────────────── */
.video-thumb {
  cursor: pointer;
  transition: opacity 0.2s;
}

.video-thumb:hover {
  opacity: 0.88;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Classic books: wider aspect on mobile */
  .classic-books-image {
    aspect-ratio: 4 / 3 !important;
  }
}
