/* ==========================================================================
   COMPONENTS — elemen yang dipakai ulang di banyak section
   ========================================================================== */

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.btn__icon {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn:hover .btn__icon {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* Primary: gold */
.btn--primary {
  background: var(--color-gold);
  color: var(--color-navy);
}

.btn--primary:hover {
  background: var(--color-gold-soft);
}

/* Secondary: outline navy */
.btn--secondary {
  background: transparent;
  border-color: var(--color-navy);
  color: var(--color-navy);
}

.btn--secondary:hover {
  background: var(--color-navy);
  color: var(--color-white);
}

/* Secondary di latar navy */
.btn--on-navy {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--color-white);
}

.btn--on-navy:hover {
  border-color: var(--color-gold-soft);
  color: var(--color-gold-soft);
}

.btn--small {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
}

.btn--block {
  width: 100%;
}

/* Tautan teks dengan panah */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-navy);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--color-gold);
  padding-bottom: 2px;
}

.link-arrow .btn__icon {
  width: 14px;
  height: 14px;
}

.link-arrow:hover .btn__icon {
  transform: translateX(3px);
}

/* ---------- Penanda bagian (identitas utama) ----------
   Nomor urut situs "01 / 08" … "08 / 08": menunjukkan posisi pembaca
   di dalam cerita proposal. Sengaja tidak memakai penomoran PDF.
   Gold Ink dipakai untuk nomor besar: 5,3:1 di putih, 4,7:1 di ivory. */
.chapter {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 0 0 20px;
}

.chapter__num {
  color: var(--color-gold-ink);
  font-family: var(--font-serif);
  font-size: clamp(44px, 4.6vw, 68px);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.chapter__of {
  margin-left: -6px;
  padding-bottom: 4px;
  color: var(--color-muted);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.chapter--on-navy .chapter__of {
  color: var(--color-on-navy-muted);
}

.chapter__label {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-gold);
  color: var(--color-gold-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.chapter--on-navy .chapter__num,
.chapter--on-navy .chapter__label {
  color: var(--color-gold-soft);
}

.chapter--on-navy .chapter__label {
  border-bottom-color: var(--color-gold-soft);
}

.chapter--center {
  justify-content: center;
}

/* ---------- Section heading ---------- */
.section-heading {
  max-width: 720px;
  margin-bottom: 48px;
}

@media (min-width: 1024px) {
  .section-heading {
    margin-bottom: 64px;
  }
}

/* ---------- Lead paragraph ---------- */
.lead {
  font-size: var(--fs-lead);
  line-height: 1.7;
}

/* ---------- Figure + caption ---------- */
.figure {
  position: relative;
}

.figure__frame {
  position: relative;
  overflow: hidden;
  background: var(--color-ivory);
}

.figure__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-out);
}

.figure--hover:hover .figure__frame img {
  transform: scale(1.03);
}

.figure__caption {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 12px;
  color: var(--color-muted);
  font-size: var(--fs-caption);
  line-height: 1.5;
}

.figure__caption-label {
  color: var(--color-navy);
  font-weight: 600;
}

/* ---------- Penanda gambar placeholder (WAJIB selama foto asli belum ada) ---------- */
.ph-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 9px;
  background: var(--color-navy);
  color: var(--color-white);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  pointer-events: none;
}

/* ---------- Penanda data belum terverifikasi ----------
   Tampil hanya bila pengaturan.tandaiDataBelumTerverifikasi = true
   (JS menambahkan kelas .show-verify pada <html>). */
.verify-flag {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px dashed currentColor;
  color: var(--color-gold-ink);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  vertical-align: middle;
}

.show-verify .verify-flag {
  display: inline-flex;
}

.section--navy .verify-flag {
  color: var(--color-gold-soft);
}

/* ---------- Stat card ---------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat::before {
  content: "";
  width: 24px;
  height: 1px;
  margin-bottom: 6px;
  background: var(--color-gold);
}

.stat__value {
  color: var(--color-white);
  font-family: var(--font-serif);
  font-size: var(--fs-stat);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-variant-numeric: lining-nums;
}

.stat__unit {
  margin-left: 0.12em;
  font-size: 0.62em;
  color: var(--color-gold-soft);
}

.stat__label {
  color: var(--color-on-navy-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ---------- Pull quote ---------- */
.pullquote {
  max-width: 920px;
  margin-inline: auto;
  text-align: center;
}

.pullquote::before {
  content: "";
  display: block;
  width: 1px;
  height: 48px;
  margin: 0 auto 32px;
  background: var(--color-gold);
}

.pullquote p {
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.4vw, 40px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}

.pullquote footer {
  margin-top: 24px;
  color: var(--color-muted);
  font-size: 14px;
}

/* ---------- Catatan verifikasi di bawah section ---------- */
.verify-note {
  margin-top: 24px;
  color: var(--color-muted);
  font-size: var(--fs-caption);
}

.verify-note:empty {
  display: none;
}

/* ---------- Empty / error state ----------
   Dipakai saat data belum tersedia. Selalu menyebut apa yang ditunggu. */
.state {
  padding: 20px 22px;
  border: 1px dashed var(--color-gold);
  color: var(--color-text);
  font-size: 0.94em;
  line-height: 1.6;
}

.state__title {
  margin-bottom: 4px;
  color: var(--color-navy);
  font-weight: 600;
}

.state--error {
  border-style: solid;
  border-color: var(--color-navy);
}

.section--navy .state {
  border-color: var(--color-gold-soft);
  color: var(--color-on-navy);
}

.section--navy .state__title {
  color: var(--color-white);
}

.is-pending {
  color: var(--color-muted);
  font-style: italic;
}

.section--navy .is-pending {
  color: var(--color-on-navy-muted);
}

/* ---------- Daftar fakta (dl) ---------- */
.facts {
  margin: 32px 0 0;
  border-top: 1px solid var(--color-border);
}

.facts__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding-block: 16px;
  border-bottom: 1px solid var(--color-border);
}

.facts dt {
  color: var(--color-muted);
  font-size: var(--fs-caption);
}

.facts dd {
  margin: 0;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}

.facts dd.is-pending {
  font-family: var(--font-sans);
  font-size: 15px;
}

@media (min-width: 768px) {
  .facts__row {
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: baseline;
    gap: 24px;
  }
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  margin-top: 8px;
}

.timeline__item {
  position: relative;
  padding: 0 0 28px 32px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: -6px;
  width: 1px;
  background: var(--color-border);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item:last-child::before {
  display: none;
}

.timeline__marker {
  position: absolute;
  left: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--color-gold);
}

.timeline__label {
  display: block;
  color: var(--color-gold-ink);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.timeline__title {
  margin-top: 2px;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
}

.timeline__detail {
  margin-top: 2px;
  font-size: 15px;
}

/* ---------- Bar keuangan ----------
   Lebar diisi lewat --w. Animasi melebar saat section terlihat. */
.stackbar {
  display: flex;
  gap: 3px;
  height: 14px;
}

.stackbar__seg,
.bar__fill {
  display: block;
  height: 100%;
  width: var(--w);
  transition: width 900ms var(--ease-out);
}

.js .reveal:not(.is-visible) .stackbar__seg,
.js .reveal:not(.is-visible) .bar__fill {
  width: 0;
}

/* Warna segmen sumber dana. Semua ≥3:1 terhadap putih:
   navy 16,2:1 · muted blue 5,5:1 · gold ink 5,3:1 (emas = target donatur). */
.tone--seg-1 {
  background: var(--color-navy);
}

.tone--seg-2 {
  background: var(--color-muted);
}

.tone--seg-3 {
  background: var(--color-gold-ink);
}

.tone--seg-rest {
  background: repeating-linear-gradient(135deg, var(--color-muted) 0 2px, transparent 2px 6px);
  outline: 1px solid var(--color-muted);
  outline-offset: -1px;
}

.source-note {
  margin-top: 32px;
  color: var(--color-muted);
  font-size: var(--fs-caption);
}

/* Tautan-panah yang berupa <button> (mis. "Perbesar denah") */
button.link-arrow {
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  padding-inline: 0;
  cursor: pointer;
}

.legend {
  margin-top: 16px;
}

.legend__row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding-block: 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
}

.legend__swatch {
  width: 12px;
  height: 12px;
  transform: translateY(1px);
}

.legend__value {
  color: var(--color-navy);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.legend__pct {
  margin-left: 8px;
  color: var(--color-muted);
  font-weight: 500;
}

.bar-list__row {
  padding-block: 14px;
  border-bottom: 1px solid var(--color-border);
}

.bar-list__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 15px;
}

.bar-list__name {
  color: var(--color-text);
}

.bar-list__value {
  color: var(--color-navy);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar {
  height: 6px;
  background: var(--color-ivory);
}

.bar__fill {
  background: var(--color-navy);
}

.bar-list__note {
  margin-top: 8px;
  color: var(--color-muted);
  font-size: var(--fs-caption);
}

/* ---------- Status dana (direncanakan / diterima / sisa) ---------- */
.fund-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  border: 1px solid var(--color-border);
}

.fund-status > div {
  padding: 18px 20px;
}

.fund-status > div + div {
  border-top: 1px solid var(--color-border);
}

.fund-status dt {
  color: var(--color-muted);
  font-size: var(--fs-caption);
}

.fund-status dd {
  margin: 6px 0 0;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
}

.fund-status dd.is-pending {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .fund-status {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fund-status > div + div {
    border-top: 0;
    border-left: 1px solid var(--color-border);
  }
}

/* ---------- Progres penggalangan (di latar navy) ---------- */
.progress__figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}

.progress__label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-on-navy-muted);
  font-size: 13px;
}

.progress__value {
  display: block;
  color: var(--color-white);
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}

.progress__value.is-pending {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  padding-top: 6px;
}

.progress-bar {
  height: 10px;
  margin-top: 36px;
  background: var(--color-navy-line);
}

.progress-bar .bar__fill {
  background: var(--color-gold-soft);
}

.progress__pending {
  margin-top: 36px;
  padding: 18px 20px;
  border: 1px dashed var(--color-gold-soft);
  color: var(--color-white);
  font-size: 15px;
}

.progress__updated {
  margin-top: 16px;
  color: var(--color-on-navy-muted);
  font-size: var(--fs-caption);
}

@media (min-width: 768px) {
  .progress__figures {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Sebelum ada laporan: hanya target, ditampilkan lebih besar */
.progress__figures.progress__figures--single {
  grid-template-columns: minmax(0, 1fr);
}

.progress__figures--single .progress__value {
  font-size: clamp(44px, 5vw, 64px);
}

/* ---------- Galeri ---------- */
.gallery {
  columns: 2;
  column-gap: 12px;
}

.gallery__item {
  break-inside: avoid;
  margin-bottom: 20px;
}

.gallery__btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--color-ivory);
  overflow: hidden;
}

.gallery__btn img {
  width: 100%;
  transition: transform 900ms var(--ease-out);
}

.gallery__btn:hover img {
  transform: scale(1.03);
}

.gallery__caption {
  margin-top: 10px;
  color: var(--color-muted);
  font-size: var(--fs-caption);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .gallery {
    columns: 3;
    column-gap: 20px;
  }

  .gallery__item {
    margin-bottom: 28px;
  }
}

/* ---------- Kartu rekening (donation card) ---------- */
.donation-card {
  padding: 28px 24px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-gold);
}

.donation-card + .donation-card {
  margin-top: 16px;
}

.donation-card__label {
  color: var(--color-muted);
  font-size: var(--fs-caption);
}

.donation-card__bank {
  margin-top: 4px;
  color: var(--color-navy);
  font-size: 15px;
  font-weight: 600;
}

.donation-card__number {
  display: block;
  margin-top: 16px;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
  overflow-wrap: anywhere;
}

.donation-card__holder {
  margin-top: 8px;
  font-size: 15px;
}

.donation-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 20px;
}

.copy-status {
  color: var(--color-gold-ink);
  font-size: 14px;
  font-weight: 600;
}

/* QRIS: lembar putih bergaya standee QRIS, kode QR vektor tajam */
.qris__sheet {
  width: 100%;
  max-width: 280px;
  margin: 16px 0 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  text-align: center;
}

.qris__head {
  display: block;
  margin-bottom: 10px;
}

.qris__merchant {
  display: block;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.qris__nmid {
  display: block;
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.qris__img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.qris__note {
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.5;
}

.qris__note strong {
  color: var(--color-navy);
}

.modal__qris {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.contact-card {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
}

.contact-card__text {
  margin: 4px 0 12px;
  font-size: 15px;
}

/* Kontak WhatsApp: tiap baris satu tautan penuh, mudah diketuk di HP */
.wa-list {
  border-top: 1px solid var(--color-border);
}

.wa-list li {
  border-bottom: 1px solid var(--color-border);
}

.wa-list__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 14px 0;
  color: var(--color-navy);
  text-decoration: none;
}

.wa-list__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wa-list__name {
  font-weight: 600;
}

.wa-list__role {
  color: var(--color-muted);
  font-size: 13px;
}

.wa-list__num {
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.wa-list__cta {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  color: var(--color-gold-ink);
  font-size: 14px;
  font-weight: 600;
}

.wa-list__cta .btn__icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.wa-list__link:hover .wa-list__name,
.wa-list__link:hover .wa-list__cta {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.wa-list__link:hover .btn__icon {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .wa-list__cta .btn__icon {
    transition: none;
  }
}

/* ---------- Langkah bernomor ---------- */
.steps {
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 12px 0 12px 40px;
  border-bottom: 1px solid var(--color-border);
  counter-increment: step;
  font-size: 15px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 9px;
  color: var(--color-gold-ink);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

/* ---------- FAQ accordion (native <details>) ---------- */
.faq {
  max-width: 840px;
  margin-top: 80px;
}

.faq__item {
  border-bottom: 1px solid var(--color-border);
}

.faq__item:first-of-type {
  border-top: 1px solid var(--color-border);
}

.faq__q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding-block: 16px;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: "+";
  flex: none;
  color: var(--color-gold-ink);
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 400;
  transition: transform var(--dur) var(--ease-out);
}

.faq__item[open] .faq__q::after {
  transform: rotate(45deg);
}

.faq__a {
  padding-bottom: 20px;
  max-width: 68ch;
}

/* ---------- Popup langkah transfer (native <dialog>) ----------
   Dialog dibuat selebar layar & transparan; kartu putih di tengah.
   Klik di luar kartu = klik pada <dialog> itu sendiri = tutup. */
.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px var(--gutter);
  border: 0;
  background: transparent;
}

.modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-in var(--dur) var(--ease-out);
}

.modal::backdrop {
  background: rgba(10, 16, 40, 0.72);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.modal__card {
  width: 100%;
  max-width: 520px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--color-white);
  border-top: 3px solid var(--color-gold);
  box-shadow: 0 30px 60px -30px rgba(10, 16, 40, 0.6);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0 28px;
}

.modal__title {
  font-size: var(--fs-h3);
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-navy);
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}

.modal__close:hover {
  border-color: var(--color-navy);
}

.modal__close:active {
  background: var(--color-ivory);
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__body {
  padding: 16px 28px 28px;
}

.modal__account {
  margin-top: 24px;
  padding: 20px;
  background: var(--color-ivory);
}

.modal__number {
  display: block;
  margin-top: 8px;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: clamp(28px, 6vw, 34px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.modal__wa {
  margin-top: 20px;
}

.modal__wa .wa-list {
  margin-top: 8px;
}

.modal__note {
  margin-top: 20px;
  color: var(--color-muted);
  font-size: 13px;
}

@media (max-width: 767px) {
  /* HP: kartu menempel di bawah layar, mudah dijangkau jempol */
  .modal[open] {
    align-items: flex-end;
    padding: 0;
  }

  .modal__card {
    max-width: none;
    max-height: 88vh;
    max-height: 88dvh;
  }

  .modal__head {
    padding-left: 20px;
  }

  .modal__body {
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  }
}

/* ---------- Lightbox (native <dialog>) ---------- */
.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 56px 16px 24px;
  border: 0;
  background: rgba(10, 16, 40, 0.94);
  color: var(--color-white);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightbox-in var(--dur) var(--ease-out);
}

.lightbox::backdrop {
  background: transparent;
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Lebar penuh agar lebar gambar (persen) terhitung dari layar, lalu
   dibatasi JS maksimal 2x ukuran asli foto. */
.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(1200px, 100%);
  max-height: 100%;
}

.lightbox__figure img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  width: min(1100px, 100%);
  height: auto;
  object-fit: contain;
  background: var(--color-navy);
}

.lightbox__caption {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.lightbox__count {
  color: var(--color-gold-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lightbox__btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(17, 29, 73, 0.6);
  color: var(--color-white);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}

.lightbox__btn:hover {
  border-color: var(--color-gold-soft);
  color: var(--color-gold-soft);
}

.lightbox__btn svg {
  width: 20px;
  height: 20px;
}

.lightbox__btn[hidden] {
  display: none;
}

.lightbox :focus-visible {
  outline-color: var(--color-gold-soft);
}

.lightbox__close {
  top: 8px;
  right: 8px;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--prev {
  left: 8px;
}

.lightbox__nav--next {
  right: 8px;
}

@media (max-width: 767px) {
  .lightbox__nav {
    top: auto;
    bottom: 12px;
    transform: none;
  }

  .lightbox {
    padding-bottom: 76px;
  }
}

@media (min-width: 1024px) {
  .lightbox {
    padding: 64px 96px 40px;
  }

  .lightbox__close {
    top: 20px;
    right: 24px;
  }

  .lightbox__nav--prev {
    left: 24px;
  }

  .lightbox__nav--next {
    right: 24px;
  }
}
