/* ===========================================================
   pages.css — 各頁專屬調整、零散片段
   =========================================================== */

/* —— about page：5 nav cards 排成 5/3/1 —— */
@media (max-width: 980px) and (min-width: 561px) {
  .nav-card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* —— page-hero 變體：文左圖右（文字優先，適合長標題頁） —— */
.page-hero--text {
  grid-template-columns: 1fr;
}

.page-hero--text .container {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.page-hero--text img {
  aspect-ratio: 4 / 5;
  max-height: 460px;
  object-fit: cover;
}

/* —— contact hero：橫式會徽與文字等比例配置 —— */
.contact-hero .container,
.taiwan-hero .container {
  grid-template-columns: minmax(0, 1fr) minmax(400px, 0.95fr);
  gap: clamp(48px, 7vw, 96px);
}

.contact-hero img,
.taiwan-hero img {
  width: min(100%, 560px);
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  justify-self: end;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.taiwan-hero h1 {
  font-size: clamp(2.4rem, 4vw, 3rem);
}

/* —— Nepal hero：完整呈現橫幅建築全景 —— */
.nepal-hero .container {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: clamp(48px, 7vw, 96px);
}

.nepal-hero img {
  width: min(100%, 600px);
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  justify-self: end;
  object-fit: contain;
}

/* —— Bhutan hero：正方形會徽與長標題平衡配置 —— */
.bhutan-hero .container {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(48px, 7vw, 96px);
}

.bhutan-hero img {
  width: min(100%, 420px);
  height: auto;
  aspect-ratio: 1;
  max-height: none;
  justify-self: end;
  object-fit: contain;
  background: #fff;
}

.bhutan-hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
}

/* —— 台灣點燈壇城固定頁 —— */
.lamp-hero .container,
.practice-hero .container {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: clamp(48px, 7vw, 96px);
}

.lamp-hero img,
.practice-hero img {
  width: min(100%, 600px);
  height: auto;
  aspect-ratio: 16 / 10;
  max-height: none;
  justify-self: end;
  object-fit: cover;
}

.practice-table-title {
  margin-bottom: 20px;
}

.practice-table-note {
  max-width: 900px;
  margin: -8px 0 20px;
  color: var(--muted);
}

.practice-price-table {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-card);
  -webkit-overflow-scrolling: touch;
}

.practice-price-table:focus-visible {
  outline: 3px solid rgba(178, 31, 53, 0.25);
  outline-offset: 3px;
}

.practice-price-table table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
}

.practice-price-table th,
.practice-price-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.practice-price-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--kagyu-red);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.practice-price-table tbody tr:nth-child(even) { background: rgba(255, 246, 216, 0.42); }
.practice-price-table tbody tr:hover { background: rgba(245, 197, 24, 0.14); }
.practice-price-table th:first-child,
.practice-price-table td:first-child { width: 10%; }

.practice-price-table td:first-child { color: var(--muted); font-family: var(--font-en); }

.practice-price-table th:nth-child(2),
.practice-price-table td:nth-child(2) {
  width: 30%;
  font-size: 1.08rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.practice-price-table th:nth-child(3),
.practice-price-table td:nth-child(3) { width: 40%; }

.practice-price-table th:last-child,
.practice-price-table td:last-child {
  width: 20%;
  font-family: var(--font-en);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.practice-price-table th:last-child { color: #fff; }
.practice-price-table td:last-child { color: var(--kagyu-red-deep); }

.practice-taiwan-intro {
  max-width: 980px;
}

.practice-line-action {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.practice-line-action p {
  margin: 0;
}

.lamp-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.lamp-option-grid .card {
  padding: 28px;
}

.lamp-fees {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  gap: 18px;
  margin-top: 28px;
}

.lamp-fees > div {
  display: grid;
  gap: 4px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-warm);
}

.lamp-fees span {
  color: var(--muted);
  font-weight: 700;
}

.lamp-fees strong {
  color: var(--kagyu-red-deep);
  font-family: var(--font-en);
  font-size: 1.6rem;
}

.lamp-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 280px));
  gap: 28px;
  justify-content: center;
}

.lamp-image-grid figure {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.lamp-image-grid img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
}

.lamp-image-grid figcaption {
  padding: 12px 4px 2px;
  color: var(--ink);
  font-weight: 700;
}

.lamp-cta {
  text-align: center;
}

.lamp-cta .eyebrow,
.lamp-cta p,
.lamp-cta .hero-actions {
  margin-inline: auto;
}

/* —— 不丹教室屋頂護持專案 —— */
.project-poster {
  width: 100%;
  margin-bottom: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.project-poster--compact {
  max-width: 520px;
  margin-right: auto;
  margin-left: auto;
}

.support-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 32px 0 48px;
}

.support-summary-grid > div {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-warm);
}

.support-summary-grid span {
  color: var(--muted);
  font-weight: 700;
}

.support-summary-grid strong {
  color: var(--kagyu-red-deep);
  font-family: var(--font-en);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.support-account-card {
  margin: 40px 0;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-warm);
}

.support-account-card dl {
  display: grid;
  gap: 0;
  margin: 24px 0;
}

.support-account-card dl > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.support-account-card dl > div:last-child {
  border-bottom: 1px solid var(--line);
}

.support-account-card dt {
  color: var(--muted);
  font-weight: 700;
}

.support-account-card dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-en);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.support-account-card .support-account-note {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* —— support page：清楚呈現三地護持入口與專案 —— */
.support-hero .container {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: clamp(48px, 7vw, 88px);
}

.support-hero img {
  width: min(100%, 560px);
  aspect-ratio: 16 / 10;
  max-height: none;
  justify-self: end;
  object-fit: cover;
}

.support-hero .hero-actions {
  margin-top: 28px;
}

.support-jump-nav {
  padding: 22px 0;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.support-jump-nav .container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.support-jump-nav a {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: var(--paper);
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}

.support-jump-nav a:hover {
  border-color: var(--line-strong);
  background: var(--paper-warm);
}

.support-jump-nav span {
  color: var(--kagyu-red);
  font-family: var(--font-en);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.support-jump-nav strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.support-section {
  scroll-margin-top: 120px;
}

.support-section-heading {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: end;
  margin-bottom: 32px;
}

.support-section-heading h2,
.support-section-heading p {
  margin-bottom: 0;
}

.support-section-heading > p {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.support-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.support-project-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.support-project-grid .card p {
  color: var(--muted);
}

.support-project-grid .card .text-link {
  margin-top: auto;
  padding-top: 12px;
}

.support-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.support-note p {
  margin: 0;
  padding: 20px 22px;
  border-left: 3px solid var(--kagyu-yellow);
  background: var(--paper-warm);
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .page-hero--text .container {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .page-hero--text img { aspect-ratio: 16/10; max-height: none; }

  .contact-hero img,
  .taiwan-hero img {
    width: min(100%, 560px);
    aspect-ratio: auto;
    justify-self: center;
  }

  .nepal-hero img {
    width: 100%;
    aspect-ratio: auto;
    justify-self: center;
  }

  .bhutan-hero img {
    width: min(100%, 420px);
    aspect-ratio: 1;
    justify-self: center;
  }

  .lamp-hero img,
  .practice-hero img {
    width: 100%;
    aspect-ratio: 16 / 10;
    justify-self: center;
  }

  .lamp-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .lamp-option-grid,
  .lamp-fees,
  .lamp-image-grid {
    grid-template-columns: 1fr;
  }

  .practice-line-action {
    display: grid;
  }

  .support-summary-grid {
    grid-template-columns: 1fr;
  }

  .support-account-card dl > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .support-hero .container,
  .support-section-heading {
    grid-template-columns: 1fr;
  }

  .support-hero img {
    width: 100%;
    justify-self: center;
  }

  .support-project-grid,
  .support-project-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .support-jump-nav .container,
  .support-project-grid,
  .support-project-grid--four,
  .support-note {
    grid-template-columns: 1fr;
  }
}

/* —— 無圖文頁 hero：純居中標題 —— */
.page-hero--plain {
  grid-template-columns: 1fr;
}

.page-hero--plain .container {
  max-width: 880px;
  text-align: center;
}

.page-hero--plain .eyebrow,
.page-hero--plain h1,
.page-hero--plain p { margin-inline: auto; }
.page-hero--plain p { max-width: 640px; }

/* —— ask page：表單與 LINE 雙欄 —— */
.ask-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 36px;
  align-items: start;
}

@media (max-width: 980px) {
  .ask-layout { grid-template-columns: 1fr; }
}

/* —— contact footer map —— */
.contact-map-section {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: stretch;
}

.contact-map {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-warm);
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
}

@media (max-width: 980px) {
  .contact-map-section { grid-template-columns: 1fr; }
  .contact-map,
  .contact-map iframe { min-height: 420px; }
}

/* —— 文章頁 hero —— */
.post-hero {
  background: linear-gradient(180deg, #ffffff, var(--paper-cream));
  padding: 64px 0 32px;
}

.post-hero .container {
  display: grid;
  gap: 16px;
  max-width: 960px;
}

.post-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  color: var(--kagyu-red-deep);
  line-height: 1.15;
  margin-bottom: 8px;
}

.post-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  color: var(--muted);
  font-size: 0.94rem;
}

.post-hero img.cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hover);
  margin-top: 14px;
}

/* —— admin form —— */
.admin-form {
  display: grid;
  gap: 18px;
  max-width: 880px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 700;
}

.admin-form input[type="text"],
.admin-form input[type="date"],
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
}

.admin-form textarea { resize: vertical; min-height: 120px; }

.admin-preview {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-cream);
}

.admin-preview > h3 { margin-bottom: 14px; }


.admin-steps {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 197, 24, 0.16);
}

.admin-steps h3 { color: var(--kagyu-red); margin-bottom: 12px; }
.admin-steps ol { padding-left: 1.4rem; display: grid; gap: 8px; }

/* —— guide page —— */
.guide-body {
  max-width: 920px;
  margin-inline: auto;
}

.guide-body h2 {
  margin-top: 2.6rem;
  margin-bottom: 14px;
  color: var(--kagyu-red-deep);
}

.guide-body h3 {
  margin-top: 1.6rem;
  color: var(--kagyu-red);
}

.code-block {
  padding: 18px;
  margin: 16px 0;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: ui-monospace, monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
