/* Halaman publik Sarana & Prasarana (/sarana-prasarana). Memakai pb-* (publikasi.css) dan hp-cta (halaman.css). */

/* Hero ------------------------------------------------------------------- */
.sp-hero { padding: 2.6rem 0 6.5rem; }
.sp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 3rem; }
.sp-hero h1 { max-width: 34rem; }
.sp-hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .65rem; max-width: 36rem; margin: 1.8rem 0 0; }
.sp-hero-stats div { padding: .85rem 1rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; background: rgba(255, 255, 255, .08); backdrop-filter: blur(6px); }
.sp-hero-stats dt { color: rgba(255, 255, 255, .7); font-size: .74rem; font-weight: 600; }
.sp-hero-stats dd { display: flex; align-items: baseline; gap: .25rem; margin: .2rem 0 0; color: #fff; font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.sp-hero-stats small { color: var(--sin-accent); font-size: .8rem; font-weight: 700; letter-spacing: 0; }

.sp-hero-visual { position: relative; display: grid; gap: .8rem; min-height: 320px; }
.sp-hero-visual-2 { grid-template-columns: 1fr 1fr; }
.sp-hero-visual-3 { grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; }
.sp-hero-visual-3 .sp-hero-photo:first-child { grid-row: 1 / span 2; }
.sp-hero-visual-2 .sp-hero-photo:last-child { margin-top: 2.5rem; }
.sp-hero-visual-2 .sp-hero-photo:first-child { margin-bottom: 2.5rem; }
.sp-hero-photo { position: relative; overflow: hidden; margin: 0; min-height: 150px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 24px; background: var(--sin-navy); box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .65); }
.sp-hero-visual-1 .sp-hero-photo { aspect-ratio: 4 / 3; transform: rotate(1.2deg); }
.sp-hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-hero-photo figcaption { position: absolute; left: .8rem; top: .8rem; right: .8rem; display: inline-flex; align-items: center; gap: .35rem; width: fit-content; max-width: calc(100% - 1.6rem); padding: .35rem .7rem; border-radius: 999px; background: rgba(6, 22, 52, .62); backdrop-filter: blur(6px); color: #fff; font-size: .76rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-hero-photo figcaption .icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--sin-accent); }
.sp-hero-placeholder { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.sp-hero-placeholder span { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, .14); border-radius: 22px; background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .7); }
.sp-hero-placeholder span:nth-child(even) { transform: translateY(1.2rem); }
.sp-hero-placeholder .icon { width: 34px; height: 34px; }
.sp-hero-badge { position: absolute; left: -1.2rem; bottom: -1.4rem; z-index: 2; display: inline-flex; align-items: center; gap: .65rem; padding: .75rem 1rem; border-radius: 16px; background: #fff; color: var(--sin-text-2); font-size: .82rem; line-height: 1.35; box-shadow: 0 24px 50px -22px rgba(3, 12, 30, .6); }
.sp-hero-badge > .icon { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--sin-success-50, #ecfdf3); color: var(--sin-success-700, #067647); flex-shrink: 0; }
.sp-hero-badge strong { display: block; color: var(--sin-text); font-size: 1.05rem; }

/* Penjelajah kategori ------------------------------------------------------ */
.sp-main > .container { margin-top: -4rem; }
.sp-explorer { padding: 1.4rem; border: 1px solid var(--sin-border); border-radius: 24px; background: var(--sin-surface); box-shadow: 0 24px 50px -30px rgba(6, 44, 101, .4); }
.sp-explorer-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.sp-explorer-head h2 { margin: 0; color: var(--sin-text); font-size: 1.15rem; }
.sp-explorer-head p { margin: .2rem 0 0; color: var(--sin-muted); font-size: .88rem; }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: .6rem; }
.sp-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; padding: .9rem; border: 1px solid var(--sin-border); border-radius: 16px; background: var(--sin-surface); color: var(--sin-text); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; }
.sp-tile:hover:not(:disabled) { border-color: var(--sin-primary); box-shadow: 0 14px 28px -20px rgba(7, 85, 181, .7); transform: translateY(-2px); }
.sp-tile:focus-visible { outline: 3px solid var(--sin-primary-100, #cfe0f7); outline-offset: 2px; }
.sp-tile-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--sin-primary-50); color: var(--sin-primary); transition: background .2s ease, color .2s ease; }
.sp-tile-icon .icon { width: 20px; height: 20px; }
.sp-tile-text { display: grid; min-width: 0; }
.sp-tile-text strong { font-size: .88rem; line-height: 1.3; }
.sp-tile-text small { color: var(--sin-muted); font-size: .74rem; }
.sp-tile.is-active { border-color: transparent; background: linear-gradient(135deg, var(--sin-primary), var(--sin-navy)); color: #fff; box-shadow: 0 16px 30px -18px rgba(7, 85, 181, .9); }
.sp-tile.is-active .sp-tile-icon { background: rgba(255, 255, 255, .16); color: var(--sin-accent); }
.sp-tile.is-active small { color: rgba(255, 255, 255, .75); }
.sp-tile:disabled { cursor: default; opacity: .5; }
.sp-tile:disabled .sp-tile-icon { background: var(--sin-surface-3, #f2f4f7); color: var(--sin-muted); }

/* Katalog ------------------------------------------------------------------ */

.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.3rem; margin-top: 2rem; }
.sp-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--sin-border); border-radius: 22px; background: var(--sin-surface); box-shadow: 0 18px 40px -32px rgba(6, 44, 101, .45); cursor: pointer; transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease; animation: sp-rise .5s ease both; animation-delay: calc(var(--i, 0) * 70ms); }
.sp-card[hidden] { display: none; }
.sp-card:hover { border-color: var(--sin-primary-100); box-shadow: 0 30px 55px -30px rgba(6, 44, 101, .55); transform: translateY(-4px); }
.sp-card:has(.sp-open:focus-visible) { outline: 3px solid var(--sin-primary); outline-offset: 3px; }
@keyframes sp-rise { from { opacity: 0; transform: translateY(14px); } }

.sp-card-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--sin-navy), var(--sin-primary)); }
.sp-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.sp-card:hover .sp-card-media img { transform: scale(1.06); }
.sp-card-empty { display: grid; place-items: center; height: 100%; padding-bottom: 3rem; color: rgba(255, 255, 255, .35); background: radial-gradient(circle at 30% 20%, rgba(244, 207, 69, .18), transparent 45%); }
.sp-card-empty .icon { width: 64px; height: 64px; }
.sp-card-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 12, 30, 0) 40%, rgba(3, 12, 30, .82) 100%); pointer-events: none; }
.sp-card-media > .sp-condition { position: absolute; top: .85rem; left: .85rem; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
.sp-zoom { position: absolute; top: .85rem; right: .85rem; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: rgba(6, 22, 52, .5); backdrop-filter: blur(6px); color: #fff; opacity: 0; transform: scale(.85); transition: opacity .25s ease, transform .25s ease; }
.sp-zoom .icon { width: 18px; height: 18px; }
.sp-card:hover .sp-zoom { opacity: 1; transform: none; }
.sp-card-caption { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1rem; color: #fff; }
.sp-card-type { display: inline-flex; align-items: center; gap: .3rem; color: var(--sin-accent); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sp-card-type .icon { width: 14px; height: 14px; }
.sp-card-caption h3 { margin: .3rem 0 0; font-size: 1.2rem; line-height: 1.25; letter-spacing: -.01em; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.sp-card-caption p { display: flex; align-items: center; gap: .3rem; margin: .35rem 0 0; color: rgba(255, 255, 255, .85); font-size: .84rem; }
.sp-card-caption p .icon { width: 15px; height: 15px; flex-shrink: 0; }

/* Klik di mana pun pada kartu ditangani skrip; tombol nama menjadi target fokus keyboard. */
.sp-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sp-open:focus-visible { outline: none; }

.sp-card-body { display: flex; flex: 1; flex-direction: column; gap: .75rem; padding: 1rem 1.15rem 1.15rem; }
.sp-facts { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.sp-facts li { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border-radius: 999px; background: var(--sin-surface-2, #f8fafc); color: var(--sin-muted); font-size: .8rem; }
.sp-facts strong { color: var(--sin-text); }
.sp-facts .icon { width: 15px; height: 15px; color: var(--sin-primary); }
.sp-note { margin: 0; color: var(--sin-muted); font-size: .88rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-more { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .75rem; border-top: 1px dashed var(--sin-border); color: var(--sin-primary); font-size: .86rem; font-weight: 700; }
.sp-more-arrow { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sin-primary-50); transition: background .25s ease, color .25s ease, transform .25s ease; }
.sp-more-arrow .icon { width: 16px; height: 16px; }
.sp-card:hover .sp-more-arrow { background: var(--sin-primary); color: #fff; transform: translateX(3px); }

.sp-condition { display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.sp-condition::before { content: ''; width: 6px; height: 6px; margin-right: .35rem; border-radius: 50%; background: currentColor; }
.sp-condition-baik { background: #ecfdf3; color: #067647; }
.sp-condition-rusak_ringan { background: #fffaeb; color: #b54708; }
.sp-condition-rusak_berat { background: #fef3f2; color: #b42318; }

.sp-cta { margin-top: 3.5rem; }

/* Hanya satu fasilitas: kartu dibuat lebar (foto kiri, isi kanan) agar halaman tidak terasa kosong. */
@media (min-width: 761px) {
    .sp-card:only-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
    .sp-card:only-child .sp-card-media { aspect-ratio: auto; min-height: 380px; }
    .sp-card:only-child .sp-card-caption h3 { font-size: 1.6rem; }
    .sp-card:only-child .sp-card-body { justify-content: center; gap: 1rem; padding: 2rem; }
    .sp-card:only-child .sp-note { -webkit-line-clamp: 6; font-size: .98rem; line-height: 1.75; }
    .sp-card:only-child .sp-facts li { padding: .5rem .9rem; font-size: .88rem; }
    .sp-card:only-child .sp-more { margin-top: .4rem; }
}

/* Dialog detail ------------------------------------------------------------ */
.sp-dialog { width: min(980px, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); padding: 0; overflow: hidden; border: 0; border-radius: 26px; background: var(--sin-surface); color: var(--sin-text); box-shadow: 0 50px 100px -30px rgba(3, 12, 30, .75); cursor: default; }
.sp-dialog::backdrop { background: rgba(3, 12, 30, .74); backdrop-filter: blur(4px); }
.sp-dialog-panel { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); max-height: calc(100dvh - 2rem); }
.sp-dialog-panel.is-text-only { grid-template-columns: 1fr; }
.sp-dialog-close { position: absolute; top: .9rem; right: .9rem; z-index: 3; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--sin-surface-2, #f2f4f7); color: var(--sin-text); cursor: pointer; transition: background .2s ease; }
.sp-dialog-close:hover { background: var(--sin-surface-3, #e4e7ec); }
.sp-dialog-close .icon { width: 20px; height: 20px; }
.sp-dialog-photo { position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden; min-height: 420px; background: var(--sin-navy); cursor: zoom-in; }
.sp-dialog-photo-bg { position: absolute; inset: -10%; z-index: -1; width: 120%; height: 120%; max-width: none; object-fit: cover; filter: blur(28px) brightness(.7); }
.sp-dialog-photo > img:not(.sp-dialog-photo-bg) { width: 100%; height: 100%; max-height: calc(100dvh - 2rem); object-fit: contain; }
.sp-dialog-photo-hint { position: absolute; left: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(6, 22, 52, .6); backdrop-filter: blur(6px); color: #fff; font-size: .75rem; font-weight: 600; opacity: 0; transition: opacity .2s ease; }
.sp-dialog-photo-hint .icon { width: 14px; height: 14px; }
.sp-dialog-photo:hover .sp-dialog-photo-hint, .sp-dialog-photo:focus-visible .sp-dialog-photo-hint { opacity: 1; }
.sp-dialog-body { overflow-y: auto; padding: 2.2rem 2rem 2rem; }
.sp-dialog-type { display: inline-flex; align-items: center; gap: .35rem; color: var(--sin-primary); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sp-dialog-type .icon { width: 15px; height: 15px; }
.sp-dialog h2 { margin: .4rem 2.6rem .4rem 0; color: var(--sin-text); font-size: 1.55rem; line-height: 1.25; letter-spacing: -.02em; }
.sp-dialog-location { display: flex; align-items: center; gap: .35rem; margin: 0; color: var(--sin-muted); font-size: .9rem; }
.sp-dialog-location .icon { width: 16px; height: 16px; }
.sp-dialog-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 1.3rem 0 0; }
.sp-dialog-specs div { padding: .7rem .85rem; border: 1px solid var(--sin-border); border-radius: 14px; }
.sp-dialog-specs dt { color: var(--sin-muted); font-size: .72rem; font-weight: 600; }
.sp-dialog-specs dd { margin: .25rem 0 0; color: var(--sin-text); font-size: .98rem; font-weight: 700; }
.sp-dialog h3 { margin: 1.5rem 0 .5rem; color: var(--sin-text); font-size: .95rem; }
.sp-dialog .sp-dialog-desc { margin: 0; color: var(--sin-text-2); font-size: .95rem; line-height: 1.75; }
.sp-dialog .sp-dialog-empty { color: var(--sin-muted); font-style: italic; }
.sp-dialog[open] { animation: sp-pop .25s ease both; }
@keyframes sp-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Responsif ---------------------------------------------------------------- */
@media (max-width: 960px) {
    .sp-hero-grid { grid-template-columns: 1fr; gap: 2.2rem; }
    .sp-hero-visual { min-height: 0; max-width: 560px; }
    .sp-hero-visual-2, .sp-hero-visual-3 { height: 300px; }
    .sp-hero-badge { left: .8rem; }
}
@media (max-width: 760px) {
    .sp-dialog { width: calc(100% - 1.2rem); border-radius: 22px; }
    .sp-dialog-panel { grid-template-columns: 1fr; overflow-y: auto; }
    .sp-dialog-photo { min-height: 0; aspect-ratio: 4 / 3; }
    .sp-dialog-body { overflow: visible; padding: 1.4rem 1.2rem 1.6rem; }
    .sp-dialog-close { background: rgba(255, 255, 255, .92); }
    .sp-dialog h2 { font-size: 1.25rem; }
}
@media (max-width: 560px) {
    .sp-hero { padding-bottom: 5.5rem; }
    .sp-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sp-hero-stats dd { font-size: 1.4rem; }
    .sp-hero-visual-2, .sp-hero-visual-3 { height: 240px; }
    .sp-hero-visual-1 .sp-hero-photo { transform: none; }
    .sp-explorer { padding: 1rem; border-radius: 20px; }
    .sp-explorer-head .pb-search { flex: 1 1 100%; }
    .sp-tiles { display: flex; overflow-x: auto; margin: 0 -1rem; padding: .2rem 1rem .4rem; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .sp-tiles::-webkit-scrollbar { display: none; }
    .sp-tile { flex: 0 0 auto; flex-direction: row; align-items: center; scroll-snap-align: start; }
    .sp-tile-text strong { white-space: nowrap; }
        .sp-dialog-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .sp-card, .sp-dialog[open] { animation: none; }
    .sp-card, .sp-card-media img, .sp-tile, .sp-zoom, .sp-more-arrow { transition: none; }
}
