/* e-Paper: rak sampul (/e-paper) & flipbook (/e-paper/<slug>, assets/flipbook.js). Semua layar. */

/* ---------- Rak sampul ---------- */
.ep-list { padding-top: 26px; padding-bottom: 40px; }
.ep-years { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.ep-years a { padding: 6px 14px; border: 1px solid var(--line, #dfe7e5); border-radius: 99px; background: #fff; color: var(--ink, #1c2b28); font-weight: 600; font-size: .88rem; }
.ep-years a:hover { border-color: var(--green); color: var(--green); }
.ep-years a.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.ep-empty { color: var(--muted, #5d6b68); }
.ep-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 20px; margin: 0; padding: 0; list-style: none; }
.ep-shelf a { display: flex; flex-direction: column; gap: 6px; color: var(--ink, #1c2b28); }
.ep-book { position: relative; display: block; aspect-ratio: 7 / 10; overflow: hidden; border-radius: 4px 8px 8px 4px; background: #e8eeec;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .16), inset 6px 0 10px -6px rgba(0, 0, 0, .35); transition: transform .3s ease, box-shadow .3s ease; }
.ep-book img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ep-book::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: linear-gradient(90deg, rgba(0, 0, 0, .18), transparent); }
.ep-shelf a:hover .ep-book { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 16px 30px rgba(0, 0, 0, .22); }
.ep-shelf b { font-size: .92rem; line-height: 1.35; transition: color .25s ease; }
.ep-shelf a:hover b { color: var(--green); }
.ep-shelf small { color: var(--muted, #5d6b68); font-size: .8rem; }
.ep-shelf.is-row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ep-more { padding-top: 30px; padding-bottom: 40px; }
@media (max-width: 600px) { .ep-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; } }

/* ---------- Flipbook ---------- */
.fb-wrap { margin-top: 18px; border-radius: 18px; background: radial-gradient(ellipse at top, #2c3936 0%, #161d1c 70%); color: #fff; padding-bottom: 18px; overflow: hidden; }
@media (max-width: 600px) { .fb-wrap { margin-top: 0; border-radius: 0; } }
.fb-head { padding-top: 22px; padding-bottom: 10px; text-align: center; }
.fb-crumbs { display: flex; justify-content: center; gap: .4rem; font-size: .8rem; color: rgba(255, 255, 255, .7); }
.fb-crumbs a { color: #fff; }
.fb-head h1 { margin: 8px 0 4px; color: #fff; font-size: clamp(1.25rem, 2.6vw, 1.8rem); line-height: 1.25; }
.fb-head p { margin: 0; color: rgba(255, 255, 255, .7); font-size: .88rem; }
.fb-desc { padding-top: 6px; text-align: center; color: rgba(255, 255, 255, .8); font-size: .92rem; }
.fb { --pw: 420px; --ph: 594px; position: relative; display: flex; flex-direction: column; align-items: center; }
.fb:fullscreen { justify-content: center; background: #121716; }
.fb-stage { display: flex; justify-content: center; align-items: center; width: 100%; padding: 14px 8px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.fb-book { position: relative; display: flex; perspective: 2600px; cursor: pointer; }
.fb-page { position: relative; width: var(--pw); height: var(--ph); background: #fff; overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.fb-page img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.fb-page.is-empty { background: transparent; box-shadow: none; }
.fb-page.is-left { border-radius: 6px 0 0 6px; }
.fb-page.is-right { border-radius: 0 6px 6px 0; }
.fb-page:not(.is-left):not(.is-right) { border-radius: 6px; }
/* Bayangan lipatan tengah. */
.fb-page.is-left:not(.is-empty)::after, .fb-page.is-right:not(.is-empty)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 34px; pointer-events: none; }
.fb-page.is-left::after { right: 0; background: linear-gradient(270deg, rgba(0, 0, 0, .22), transparent); }
.fb-page.is-right::after { left: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .22), transparent); }

/* Lembaran yang sedang dibalik. */
.fb-leaf { position: absolute; top: 0; width: var(--pw); height: var(--ph); transform-style: preserve-3d; transition: transform .6s cubic-bezier(.45, .05, .35, 1); z-index: 3; }
.fb-leaf.is-next { left: var(--pw); transform-origin: left center; }
.fb-leaf.is-prev { left: 0; transform-origin: right center; }
.fb-leaf.is-next.is-turning { transform: rotateY(-180deg); }
.fb-leaf.is-prev.is-turning { transform: rotateY(180deg); }
.fb-leaf .fb-page { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 0; }
.fb-leaf .fb-back { transform: rotateY(180deg); }

/* HP / satu halaman: geser. */
.fb-page.in-next { animation: fb-in-next .3s ease-out; }
.fb-page.in-prev { animation: fb-in-prev .3s ease-out; }
@keyframes fb-in-next { from { opacity: .3; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes fb-in-prev { from { opacity: .3; transform: translateX(-40px); } to { opacity: 1; transform: none; } }

/* Perbesar: halaman 1,8x, bisa digeser. */
.fb.is-zoom .fb-stage { justify-content: flex-start; max-height: calc(100vh - 140px); overflow: auto; cursor: grab; touch-action: auto; }
.fb.is-zoom .fb-book { margin: 0 auto; cursor: default; }
.fb.is-zoom .fb-page { width: calc(var(--pw) * 1.8); height: calc(var(--ph) * 1.8); }

/* Tombol. */
.fb-bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.fb-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 10px; border: 0; border-radius: 99px; background: transparent; color: #fff; font: inherit; font-size: 1.05rem; cursor: pointer; justify-content: center; transition: background-color .2s ease; }
.fb-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.fb-btn:disabled { opacity: .35; cursor: default; }
.fb-btn span { font-size: .85rem; font-weight: 700; }
.fb-audio { background: var(--green); }
.fb-audio:hover:not(:disabled) { background: var(--green-dark, var(--green)); }
.fb-audio.is-on { background: #fff; color: var(--green-dark, #004d40); }
.fb-count { min-width: 84px; text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.fb-sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(255, 255, 255, .2); }
.fb-noscript img { display: block; max-width: 100%; height: auto; margin: 0 auto 12px; }
@media (max-width: 600px) {
    .fb-head { padding-top: 14px; }
    .fb-stage { padding: 10px 4px; }
    .fb-bar { gap: 2px; padding: 4px 6px; }
    .fb-btn { min-width: 34px; height: 34px; padding: 0 6px; }
    [data-fb-first], [data-fb-last], .fb-sep { display: none; }
}

/* Video YouTube di halaman (posisi dari data flipbook lama / admin). */
.fb-vid { position: absolute; z-index: 2; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: rgba(0, 0, 0, .25); cursor: pointer; transition: background-color .2s ease; }
.fb-vid:hover { background: rgba(0, 0, 0, .4); }
.fb-vid span { display: grid; place-items: center; width: 54px; height: 38px; border-radius: 10px; background: #e53935; color: #fff; font-size: 1.1rem; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
iframe.fb-vid { background: #000; cursor: auto; }
.fb-page img { pointer-events: none; }
