/* Scoped to /uji-terpadu/dokumentasi/. Existing production site.css untouched. */
:root,body.theme-home{
 --accent:var(--f4-portal-primary,#4f46e5);--accent-dark:var(--f4-portal-primary-hover,#4338ca);--accent-soft:var(--f4-portal-soft,#eef2ff);
 --bg:#f8f7fd;--ink:#201f39;--soft:#6c6880;--line:#e7e0f3;
}
.media-top-tabs .btn{min-height:42px}
.media-album-cover svg,.media-photo-placeholder svg{display:block;margin:auto;flex:none}
.media-photo-placeholder{display:grid;place-items:center;line-height:0;color:var(--accent)}
.media-category-tag{background:var(--f4-portal-soft,#eef2ff);color:var(--f4-portal-primary-ink,#3730a3)}
.media-inventory-item{background:#fff;min-height:79px}
.media-inventory-item:not(.is-photo-free):hover{background:#fcfaff}
.media-dialog-header{background:var(--accent-dark);color:#fff}
.f4-album-head{background:var(--f4-portal-soft,#eef2ff);border-bottom:1px solid var(--f4-portal-line,#c7d2fe)}
.f4-album-head h2{color:#39266f}
.f4-album-head small{color:#6e6393}
.f4-album-footer{background:#fff}
:is(.f4-album-close,.f4-lightbox-close,.f4-lightbox-arrow,#media-dialog-close){
 box-sizing:border-box;display:grid;place-items:center;
 padding:0;line-height:0;text-align:center;
 font-size:0;flex-shrink:0;appearance:none;
}
:is(.f4-album-close,.f4-lightbox-close,#media-dialog-close){width:38px;height:38px;border-radius:50%}
.f4-album-close,#media-dialog-close{color:var(--f4-portal-primary-ink,#3730a3);background:var(--f4-portal-soft,#eef2ff)}
.f4-album-close:hover,#media-dialog-close:hover{background:var(--f4-portal-soft-hover,#e0e7ff)}
.f4-lightbox-close,.f4-lightbox-arrow{color:#fff;background:#2e254e}
.f4-lightbox-close:hover,.f4-lightbox-arrow:hover{background:var(--f4-portal-primary-hover,#4338ca)}
.f4-lightbox-arrow{width:48px;height:48px;border-radius:50%}
:is(.f4-album-close,.f4-lightbox-close,.f4-lightbox-arrow,#media-dialog-close) svg{
 display:block;width:20px;height:20px;
 margin:0;flex-shrink:0;position:static;
 transform:none;pointer-events:none
}
.f4-video-thumb svg,.f4-play svg{display:block;margin:auto}
.f4-video-thumb{display:grid;place-items:center;line-height:0}
.f4-play{display:grid;place-items:center;padding:0;
 transform:translate(-50%,-50%);top:50%;left:50%;
 width:44px;height:44px;border-radius:50%;background:#4f46e5cc}
.f4-album-tile{display:grid;place-items:center}
.f4-lightbox-title{color:#faf9ff}
.f4-lightbox-foot{color:#d8d1e9}
.f4-media-original{color:var(--f4-portal-line,#c7d2fe)}
@media(max-width:640px){.f4-lightbox-body{grid-template-columns:47px minmax(0,1fr) 47px}
.f4-lightbox-arrow{width:35px;height:42px}
.f4-album-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Media fullscreen respects the available iframe viewport. No portrait cropping. */
.f4-lightbox[open]{
 box-sizing:border-box;display:grid;
 grid-template-rows:52px minmax(0,1fr) 34px;
 width:100%;height:100dvh;max-width:100%;max-height:100dvh;
 padding:0;margin:auto;overflow:hidden;
}
.f4-lightbox-bar{height:52px;box-sizing:border-box}
.f4-lightbox-body{
 height:auto;min-height:0;min-width:0;
 display:grid;grid-template-columns:52px minmax(0,1fr) 52px;
 align-items:stretch;overflow:hidden;
}
.f4-lightbox-view{
 box-sizing:border-box;display:flex;
 align-items:center;justify-content:center;
 width:100%;height:100%;min-width:0;min-height:0;
 overflow:hidden;padding:6px 0;
}
.f4-lightbox-view img.f4-media-photo{
 display:block;width:auto;height:auto;
 max-width:100%;max-height:calc(100dvh - 110px);
 min-width:0;min-height:0;object-fit:contain;
 object-position:center center;flex-shrink:1;
}
.f4-lightbox-foot{height:34px;box-sizing:border-box}
.f4-lightbox-view :is(.f4-media-video,.f4-media-frame){
 display:block;max-width:100%;max-height:100%;
 object-fit:contain;aspect-ratio:16/9;min-height:0;
}
@media(max-width:640px){
 .f4-lightbox-body{grid-template-columns:39px minmax(0,1fr) 39px}
 .f4-lightbox-view{padding:4px 0}
 .f4-lightbox-view img.f4-media-photo{max-height:calc(100dvh - 100px)}
}


/* 2026-10-23: Two-layer gallery aligned with the working Bank Sampah viewer.
   The old <dialog> classes are left untouched for unrelated components. */
.f4p-overlay[hidden]{display:none}
.f4p-overlay{position:fixed;inset:0;z-index:150;display:grid;place-items:center;
 box-sizing:border-box;width:100%;height:100dvh;overflow:hidden;background:rgba(14,25,22,.76);
 color:#163725;padding:22px}
.f4p-album-card{width:min(100%,1000px);max-height:90dvh;min-height:220px;
 box-sizing:border-box;display:flex;flex-direction:column;min-width:0;
 border-radius:17px;background:#fff;overflow:hidden;box-shadow:0 18px 70px #0c201b69}
.f4p-album-head{flex:none;display:flex;align-items:center;justify-content:space-between;
 gap:12px;padding:17px 19px;border-bottom:1px solid #e7e8f2;background:#f6f1ff}
.f4p-album-title{font:750 19px/1.3 system-ui;margin:0;color:#38256c}
.f4p-album-count{display:inline-flex;align-items:center;gap:5px;margin-top:4px;font:500 12px system-ui;color:#806b9d}
.f4p-count-icon{display:inline-flex;align-items:center;line-height:0}
.f4p-count-icon svg{width:14px;height:14px}
.f4p-close,.f4p-photo-arrow{appearance:none;flex:none;border:0;display:inline-flex;align-items:center;justify-content:center;
 cursor:pointer;line-height:0;padding:0}
.f4p-close{width:38px;height:38px;background:transparent;color:#4a3690;border-radius:0}
.f4p-close:hover{color:var(--f4-portal-primary,#4f46e5)}
.f4p-close:focus-visible,.f4p-photo-zoom:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.f4p-close svg,.f4p-photo-arrow svg{display:block;flex:none;margin:0;pointer-events:none}
.f4p-album-grid{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;
 padding:18px 19px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
 grid-auto-rows:165px;align-content:start;gap:13px}
.f4p-album-tile{display:block;cursor:pointer;position:relative;min-width:0;overflow:hidden;
 border:0;border-radius:12px;padding:0;background:#e0e3ef;touch-action:pan-y}
.f4p-tile-image,.f4p-tile-video{display:block;width:100%;height:100%;object-fit:cover}
.f4p-video-thumb{height:100%;display:grid;place-items:center;background:#dbe0ee;color:var(--f4-portal-primary-ink,#3730a3)}
.f4p-tile-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
 display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--f4-portal-primary,#4f46e5);color:white}
.f4p-media-empty{grid-column:1/-1;align-self:start;color:#667285}
.f4p-photo-overlay{z-index:160;background:#0b0b10;color:#fff;padding:12px 14px;
 display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:0}
.f4p-photo-head{flex:none;display:flex;justify-content:space-between;align-items:center;gap:14px;
 width:100%;min-height:40px;padding:0 3px 8px;color:#fff}
.f4p-photo-name{font:750 15px/1.2 system-ui;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.f4p-photo-controls{display:flex;align-items:center;flex:none;gap:3px}
.f4p-photo-zoom{appearance:none;border:0;border-radius:0;background:transparent;color:#fff;cursor:pointer;width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;padding:0}
.f4p-photo-zoom svg{display:block;width:21px;height:21px}
.f4p-photo-zoom:hover{color:#d4c5ff}
.f4p-photo-zoom[hidden]{display:none}
.f4p-photo-head .f4p-close{color:#fff}
.f4p-photo-head .f4p-close:hover{color:#d4c5ff}
.f4p-photo-stage{position:relative;display:flex;align-items:center;justify-content:center;gap:0;
 min-height:0;width:100%;height:min(79dvh,780px);flex:none}
.f4p-photo-arrow{position:absolute;top:50%;z-index:5;transform:translateY(-50%);
 width:42px;height:42px;background:#191b24bd;color:#fff;border-radius:50%;
 opacity:0;transition:opacity .18s ease,background .18s ease}
.f4p-photo-arrow.is-prev{left:clamp(6px,1.4vw,16px);right:auto}
.f4p-photo-arrow.is-next{right:clamp(6px,1.4vw,16px);left:auto}
.f4p-photo-arrow:hover{background:#494254d9}
@media(hover:hover){.f4p-photo-stage:hover>.f4p-photo-arrow:not([hidden]){opacity:1}}
.f4p-photo-stage.f4p-nav-visible>.f4p-photo-arrow:not([hidden]){opacity:1}
.f4p-photo-arrow:focus-visible{opacity:1;outline:2px solid #fff;outline-offset:2px}
.f4p-photo-arrow[hidden]{display:none;pointer-events:none}
.f4p-photo-content{display:flex;flex:1;align-items:center;justify-content:center;min-width:0;
 height:100%;min-height:0;overflow:hidden;overscroll-behavior:contain}
.f4p-photo-content img.f4p-media-photo{
 display:block;width:100%;height:100%;min-width:0;min-height:0;
 max-width:100%;max-height:100%;object-fit:contain;object-position:center;
 border:0;margin:0;padding:0;touch-action:none;user-select:none;-webkit-user-drag:none;will-change:transform}
.f4p-photo-content iframe,.f4p-photo-content video{display:block;max-width:100%;max-height:100%;
 width:100%;height:100%;object-fit:contain;border:0;background:black}
.f4p-video-shell{position:relative;display:flex;align-items:center;justify-content:center;
 width:100%;height:100%;min-height:0;min-width:0;overflow:hidden;background:#000;color:#fff}
.f4p-video-shell>video.f4p-media-video{display:block;width:100%;height:100%;object-fit:contain;background:#000}
.f4p-video-big-play{position:absolute;z-index:3;left:50%;top:50%;transform:translate(-50%,-50%);
 width:58px;height:58px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;
 color:#fff;background:#1c1c24ac;cursor:pointer}
.f4p-video-big-play svg{width:29px;height:29px}
.f4p-video-big-play[hidden]{display:none}
.f4p-video-controls{position:absolute;z-index:4;left:0;right:0;bottom:0;min-height:52px;
 display:flex;align-items:center;gap:6px;padding:16px 11px 8px;box-sizing:border-box;
 background:linear-gradient(transparent,#000b);opacity:1;transition:opacity .2s ease}
.f4p-video-playing:not(.f4p-video-controls-visible):not(:focus-within) .f4p-video-controls{
 opacity:0;pointer-events:none}
.f4p-v-btn{display:grid;place-items:center;flex:none;width:35px;height:35px;
 padding:0;border:0;background:transparent;color:#fff;cursor:pointer}
.f4p-v-btn svg{width:20px;height:20px}
.f4p-v-btn:focus-visible,.f4p-video-big-play:focus-visible{outline:2px solid #fff;outline-offset:2px}
.f4p-v-progress{flex:1;min-width:34px;height:4px;accent-color:#fff;cursor:pointer}
.f4p-v-time{flex:none;font:500 11px/1 system-ui;color:#fff;white-space:nowrap;font-variant-numeric:tabular-nums}
.f4p-media-open{color:#d7caff;text-underline-offset:3px}
.f4p-photo-count{flex:none;text-align:center;font:400 12px system-ui;color:#b7c4c9;padding:7px 0}
.f4p-media-error{font:500 13px system-ui;color:#f8f2ff}
.f4p-album-overlay.f4p-under-photo{visibility:hidden;pointer-events:none}
@media(max-width:720px){
 .f4p-overlay{padding:9px}
 .f4p-album-card{max-height:94dvh;border-radius:13px}
 .f4p-album-head{padding:12px}
 .f4p-album-grid{padding:12px;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:142px;gap:9px}
 .f4p-photo-overlay{padding:8px 5px calc(8px + env(safe-area-inset-bottom,0px));width:100vw;height:100dvh;max-height:100dvh;box-sizing:border-box}
 .f4p-photo-stage{height:auto;flex:1;min-height:0;gap:4px}
 .f4p-photo-arrow{width:36px;height:40px}
 .f4p-photo-name{font-size:12px}
}
