/* Lifdri — flipbook photo album */

/* Without JavaScript: a simple grid */
.lf-flipbook{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
.lf-flipbook figure{margin:0}
.lf-flipbook img{width:100%;height:240px;object-fit:cover;border-radius:18px}
.lf-flipbook figcaption{font-size:.8rem;color:var(--muted,#60758e);text-align:center;font-style:italic;margin-top:.35rem}
@media (max-width:700px){.lf-flipbook{grid-template-columns:1fr 1fr}}

/* Album */
.lf-flipbook.lf-ready{display:block;overflow-x:clip;padding:10px 0;width:min(1000px,calc(100vw - 2rem));position:relative;left:50%;transform:translateX(-50%)}
.lf-wrap{position:relative;max-width:min(1000px,calc((100vh - 190px) * 1.5));margin:0 auto;user-select:none;-webkit-user-select:none;outline:none}
.lf-book{margin:0 auto;transition:transform .9s ease}
.lf-book.lf-closed-front{transform:translateX(-25%)}
.lf-book.lf-closed-back{transform:translateX(25%)}
.lf-pg{background:#fffdf8;overflow:hidden}
.lf-pg img{max-width:none}

/* Paper pages */
.lf-page{position:relative;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8% 8% 11%;
  background:radial-gradient(ellipse at 50% 40%,#fffdf8 0%,#fbf7ee 70%,#f3ecdd 100%)}
.lf-page::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,rgba(120,100,60,.018) 0 2px,transparent 2px 4px)}
.lf-photo{flex:1;width:100%;min-height:0;display:flex;align-items:center;justify-content:center}
/* Whole photo (default): the print itself carries the white border and a slight tilt */
.lf-photo:not(.lf-fill) .lf-frame{display:contents}
.lf-photo img{max-width:100% !important;max-height:100% !important;width:auto !important;height:auto !important;object-fit:contain;border:9px solid #fff;
  box-shadow:0 1px 1px rgba(0,0,0,.08),0 8px 20px rgba(30,30,30,.22);border-radius:2px;transform:rotate(-.7deg)}
.lf-pg:nth-child(odd) .lf-photo img{transform:rotate(.7deg)}
/* Fill & crop (set by an admin): fixed frame, the photo is panned / zoomed inside it */
.lf-photo.lf-fill .lf-frame{position:relative;width:100%;height:100%;overflow:hidden;border:9px solid #fff;border-radius:2px;background:#fff;
  box-shadow:0 1px 1px rgba(0,0,0,.08),0 8px 20px rgba(30,30,30,.22);transform:rotate(-.7deg)}
.lf-pg:nth-child(odd) .lf-photo.lf-fill .lf-frame{transform:rotate(.7deg)}
.lf-photo.lf-fill .lf-frame img{width:100% !important;height:100% !important;max-width:none !important;max-height:none !important;object-fit:cover;border:0;box-shadow:none;border-radius:0;transform:none}
.lf-pg .lf-photo .lf-frame.lf-notilt,.lf-pg .lf-photo .lf-notilt img,.lf-pg:nth-child(odd) .lf-photo .lf-frame.lf-notilt,.lf-pg:nth-child(odd) .lf-photo .lf-notilt img{transform:none}
.lf-cap{position:relative;z-index:1;margin:1rem 0 0;font-family:Georgia,'Times New Roman',serif;font-style:italic;color:#4a5a6e;font-size:calc(clamp(.78rem,1.5vw,1.02rem) * var(--k,1));text-align:center;min-height:1.2em}
.lf-num{position:absolute;bottom:4%;left:0;right:0;text-align:center;font-size:.72rem;color:#a39780;letter-spacing:.12em}
.lf-ornament{font-size:clamp(1.6rem,4vw,2.6rem);margin:0;color:#d6b66e;line-height:1}
.lf-ornament-soft{color:#e3d4ae}

/* Hard covers */
.lf-cover{width:100%;height:100%;padding:5.5%;background:linear-gradient(140deg,#1b4170 0%,#122f52 55%,#0b1f38 100%);position:relative}
.lf-cover::before{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 30% 20%,rgba(255,255,255,.10),transparent 60%);pointer-events:none}
.lf-cover-frame{position:relative;height:100%;border:1px solid rgba(214,182,110,.7);border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:8% 7%;box-shadow:inset 0 0 0 4px rgba(214,182,110,.12)}
.lf-cover-ring{width:48%;aspect-ratio:1/1;border-radius:50%;overflow:hidden;border:3px solid #d6b66e;margin:0 auto 7%;box-shadow:0 10px 26px rgba(0,0,0,.45);background:#0b1f38;flex:none}
.lf-cover-img{width:100% !important;height:100% !important;max-width:none !important;max-height:none !important;border-radius:0 !important;border:0 !important;
  object-fit:cover !important;object-position:50% 22%;display:block;margin:0 !important;box-shadow:none !important}
.lf-cover h3{color:#f6e7c1;font-family:Georgia,'Times New Roman',serif;font-size:calc(clamp(1.1rem,2.6vw,2rem) * var(--k,1));line-height:1.15;margin:.3rem 0 .5rem}
.lf-kicker{color:#d7e8fb;margin:0;font-size:calc(clamp(.66rem,1.25vw,.9rem) * var(--k,1));letter-spacing:.2em;text-transform:uppercase}
.lf-dates{color:#d7e8fb;margin:0;font-size:calc(clamp(.72rem,1.3vw,.95rem) * var(--k,1));letter-spacing:.14em}
.lf-hint{margin:9% 0 0;font-size:.74rem;color:rgba(215,232,251,.75)}
.lf-cover-back .lf-ornament{margin-bottom:6%}
.lf-sign{margin:12% 0 0;font-size:calc(clamp(.66rem,1.1vw,.8rem) * var(--k,1));color:rgba(215,232,251,.8);letter-spacing:.06em}
.lf-sign strong{color:#f6e7c1;font-family:Georgia,'Times New Roman',serif;font-style:italic;font-size:1.1em;letter-spacing:0}

/* Controls */
.lf-controls{display:flex;align-items:center;justify-content:center;gap:1rem;margin-top:1.2rem}
.lf-btn{width:46px;height:46px;border-radius:50%;border:1px solid rgba(23,63,122,.18);background:#fff;color:var(--primary,#173f7a);font-size:1.3rem;cursor:pointer;box-shadow:0 6px 16px rgba(14,50,95,.10);display:inline-flex;align-items:center;justify-content:center}
.lf-btn:disabled{opacity:.35;cursor:default}
.lf-count{min-width:8rem;text-align:center;font-weight:700;color:var(--primary,#173f7a);font-size:.92rem}
.lf-help{text-align:center;color:var(--muted,#60758e);font-size:.8rem;margin-top:.4rem}

/* Fallback (if PageFlip can't load): one page turning on its spine */
.lf-fallback .lf-book{position:relative;width:min(100%,460px);aspect-ratio:3/4;perspective:2000px}
.lf-fallback .lf-pg{position:absolute;inset:0;transform-origin:left center;transition:transform .8s cubic-bezier(.645,.045,.355,1),box-shadow .8s;box-shadow:0 12px 30px rgba(14,50,95,.2);border-radius:0 8px 8px 0;backface-visibility:hidden}
.lf-fallback .lf-pg.is-turned{transform:rotateY(-180deg);box-shadow:none}
@media (prefers-reduced-motion:reduce){.lf-fallback .lf-pg{transition:none}}
