/* ==========================================================
   2025-v0 Custom CSS — 同奮101 Member Portal
   ========================================================== */

/* ── Base font size (1rem = 18px, matching production) ──── */
html {
  font-size: 112.5%;
}

/* ── Google Fonts typography ─────────────────────────────── */
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Serif TC", Georgia, serif;
}

/* ── Remove default block gap between header/main/footer ─── */
/*
 * WordPress injects gap via TWO mechanisms:
 *   1. flexbox gap on .wp-site-blocks
 *   2. margin-block-start on each child after the first
 * Both must be zeroed. Also clear any root padding that
 * useRootPaddingAwareAlignments may inject on .wp-site-blocks.
 */
.wp-site-blocks {
  gap: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Header bottom: no margin leaking below the sticky bar */
header.wp-block-template-part {
  margin-block-end: 0 !important;
}

/* Footer top: no gap between main content and footer */
footer.wp-block-template-part {
  margin-block-start: 0 !important;
}

/* Main top: no margin pushing content away from the header */
.wp-site-blocks > main {
  margin-block-start: 0 !important;
}

/* Zero WP block gap between patterns inside main */
main.wp-block-group {
  --wp--style--block-gap: 0;
}

main.wp-block-group > * {
  margin-block-start: 0 !important;
}

/* ── Sticky header wrapper ────────────────────────────────── */
/*
 * The FSE template-part <header> is the correct sticky target.
 * It wraps the full header content and spans the viewport width.
 */
header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 244, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e4e0da;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Admin bar offset */
.admin-bar header.wp-block-template-part {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar header.wp-block-template-part {
    top: 46px;
  }
}

/* Inner header bar — layout only, background comes from the wrapper */
/*
 * max-width + margin:auto centres the logo/nav content at 1280px
 * while header.wp-block-template-part keeps the full-width frosted background.
 */
.site-header {
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0.875rem 2rem !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* ── Custom navigation — desktop ─────────────────────────── */
.custom-site-nav {
  display: flex;
  align-items: center;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-desktop a {
  color: #716c67;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-desktop a:hover {
  color: #2d2a27;
}

/* ── Hamburger button ─────────────────────────────────────── */
.nav-toggle {
  display: none; /* hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  color: #2d2a27;
  padding: 0;
  line-height: 0;
  align-items: center;
  justify-content: center;
}

/* ── Mobile dropdown ──────────────────────────────────────── */
/*
 * position: absolute pulls the dropdown out of document flow so it
 * overlays the hero instead of pushing it down.
 * top: 100% pins it flush to the bottom of the sticky header bar.
 * The containing block is header.wp-block-template-part (position:sticky).
 */
.nav-mobile-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: rgba(246, 244, 240, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e4e0da;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 99;
}

.nav-mobile-dropdown.is-open {
  display: flex;
}

.nav-mobile-dropdown a {
  display: block;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: "Noto Serif TC", Georgia, serif;
  color: #2d2a27;
  text-decoration: none;
  border-bottom: 1px solid #e4e0da;
  transition: color 0.2s;
}

.nav-mobile-dropdown a:last-child {
  border-bottom: none;
}

.nav-mobile-dropdown a:hover {
  color: #c49a3c;
}

/* ── Mobile breakpoint (< 1024px = v0 "lg") ──────────────── */
@media (max-width: 1023px) {
  .nav-desktop {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }
}

/* ── 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;
}

/* ── 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;
}

/* ── 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 cards (horizontal layout) ───────────────────── */
/* ── 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;
}

/* ── 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 (dynamic via tt_news_sync_cache transient) */
.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;
}

/* ── 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;
}

/* ── 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;
}

/* ── 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);
}

/* ── 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;
}

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

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

/* ── Footer ──────────────────────────────────────────────── */

/* Branding row */
.footer-branding {
  gap: 1.25rem;
}

.footer-brand-id {
  gap: 0.75rem;
}

/* Footer icon — matches CTA button height */
.footer-logo-icon {
  height: 2.125rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

/* Tighten gap between brand name and subtitle */
.footer-brand-id .wp-block-group {
  gap: 0 !important;
}

/* Action buttons */
.footer-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 6px;
  background: #c49a3c;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2d2a27 !important;
  text-decoration: none;
  transition: background 0.2s;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
  white-space: nowrap;
}

.footer-btn-primary:hover {
  background: #b8913a;
}

.footer-btn-line {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 6px;
  border: 1px solid rgba(246, 244, 240, 0.2);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(246, 244, 240, 0.8) !important;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
  white-space: nowrap;
}

.footer-btn-line:hover {
  background: rgba(6, 199, 85, 0.1);
  border-color: rgba(6, 199, 85, 0.3);
  color: #06C755 !important;
}

.footer-brand-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Divider */
.footer-divider {
  height: 1px;
  background: rgba(246, 244, 240, 0.1);
  margin: 2rem 0;
}

/* Section heading */
.footer-section-title {
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(246, 244, 240, 0.9);
  margin: 0 0 0.625rem;
}

/* Link list */
.footer-link-list-v2 {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.footer-link-list-v2 a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(246, 244, 240, 0.5);
  text-decoration: none;
  transition: color 0.2s;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
}

.footer-link-list-v2 a:hover {
  color: rgba(246, 244, 240, 0.8);
}

.footer-ext-icon {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.footer-link-list-v2 a:hover .footer-ext-icon {
  opacity: 1;
}

/* Desktop grid (>= 1024px) */
.footer-desktop-grid {
  display: none;
}

@media (min-width: 1024px) {
  .footer-desktop-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
}

.footer-primary-grid,
.footer-secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

/* "顯示更多連結" toggle button */
.footer-other-section {
  margin-top: 2rem;
}

.footer-other-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(246, 244, 240, 0.7);
  font-size: 1rem;
  font-weight: 600;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
  transition: color 0.2s;
}

.footer-other-trigger:hover {
  color: rgba(246, 244, 240, 0.9);
}

.footer-other-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, padding-bottom 0.3s ease;
}

.footer-other-section.is-open .footer-other-content {
  max-height: 800px;
  padding-bottom: 0.5rem;
}

.footer-other-section.is-open .footer-acc-chevron {
  transform: rotate(180deg);
}

/* Mobile accordion (< 1024px) */
.footer-accordion {
  display: block;
}

@media (min-width: 1024px) {
  .footer-accordion {
    display: none;
  }
}

.footer-acc-item {
  border-bottom: 1px solid rgba(246, 244, 240, 0.1);
}

.footer-acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 0;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(246, 244, 240, 0.9);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
  text-align: left;
}

.footer-acc-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-acc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgba(246, 244, 240, 0.1);
  font-size: 0.6875rem;
  font-weight: 400;
  color: rgba(246, 244, 240, 0.4);
}

.footer-acc-chevron {
  flex-shrink: 0;
  color: rgba(246, 244, 240, 0.4);
  transition: transform 0.2s ease;
}

.footer-acc-item.is-open .footer-acc-chevron {
  transform: rotate(180deg);
}

.footer-acc-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease, padding-bottom 0.25s ease;
}

.footer-acc-item.is-open .footer-acc-content {
  max-height: 600px;
  padding-bottom: 0.875rem;
}

/* Bottom bar */
.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(246, 244, 240, 0.1);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-bottom p,
.footer-bottom .wp-block-tt-blocks-tt-copyright-date-block,
.footer-bottom .wp-block-tt-blocks-tt-copyright-date-block * {
  font-size: 0.75rem;
  color: rgba(246, 244, 240, 0.4);
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-header {
    padding: 0.75rem 1.5rem !important;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 1.25rem !important;
  }

  .nav-mobile-dropdown a {
    padding: 1rem 1.25rem;
  }

  h1.wp-block-heading {
    font-size: clamp(2rem, 8vw, 3rem) !important;
  }

  h2.wp-block-heading {
    font-size: 1.5rem !important;
  }

  /* Classic books: wider aspect on mobile */
  .classic-books-image {
    aspect-ratio: 4 / 3 !important;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.75rem 1rem !important;
  }

  .nav-mobile-dropdown a {
    padding: 1rem;
  }
}

/* ── Calendar Cards (行事曆與教節) ──────────────────────────── */

.cal-card {
  background-color: var(--wp--preset--color--card);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  box-sizing: border-box;
}

.cal-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--wp--preset--color--border);
}

.cal-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--wp--preset--color--secondary);
  border-radius: 8px;
  color: var(--wp--preset--color--muted);
  flex-shrink: 0;
}

.cal-card-title {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--wp--preset--color--foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.cal-card-title:hover {
  color: var(--wp--preset--color--accent);
}

.cal-events {
  display: flex;
  flex-direction: column;
}

.cal-event {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--wp--preset--color--border);
}

.cal-event:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cal-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--wp--preset--color--secondary);
  color: var(--wp--preset--color--muted);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.cal-event-content {
  flex: 1;
}

.cal-event-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--wp--preset--color--foreground);
  margin: 0 0 0.125rem;
  line-height: 1.45;
}

.cal-event-sub {
  font-size: 0.75rem;
  color: var(--wp--preset--color--muted);
  margin: 0;
  line-height: 1.3;
}

