/* Folio Engine: styles shared by every book template. Templates add theirs under .tpl-<slug>. */

@font-face { font-family: "Montserrat"; src: url("../fonts/montserrat-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Palanquin Dark"; src: url("../fonts/palanquin-dark-700-latin.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Parisienne"; src: url("../fonts/parisienne-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-latin.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.folio-book { margin: 0; font: 400 16px/1.6 "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; color: #333; background: #fff; }
.folio-book img { max-width: 100%; height: auto; display: block; }
.folio-book h1, .folio-book h2, .folio-book h3, .folio-book p, .folio-book dl, .folio-book dd { margin: 0; }
.folio-book a { color: inherit; }
.folio-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.folio-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }

/* Buttons */
.folio-btn { display: inline-flex; align-items: center; gap: .5em; padding: .7em 1.4em; border: 2px solid currentColor; border-radius: 999px; background: #111; border-color: #111; color: #fff; font: 600 15px/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer; }
.folio-btn--ghost { background: transparent; color: #111; }

/* Characteristics */
.folio-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem 2rem; }
.folio-facts__item { display: flex; gap: .5em; padding: .35rem 0; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.folio-facts dt { flex-shrink: 0; max-width: 55%; font-weight: 700; }
.folio-facts dt::after { content: " :"; }
.folio-facts dd { margin: 0; }

/* Links */
.folio-links { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.folio-links__item { display: inline-flex; width: 2.4rem; height: 2.4rem; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0, 0, 0, .06); font-size: 1.15rem; text-decoration: none; transition: transform .15s; }
.folio-links__item:hover { transform: translateY(-2px); }
.folio-cv { display: inline-flex; align-items: center; gap: .6em; padding: .55em 1.2em; border: 2px solid currentColor; font-weight: 700; text-decoration: none; }

/* Gallery: masonry with CSS columns, keeps the photos' own ratio */
.folio-album + .folio-album { margin-top: 2.5rem; }
.folio-album__title { margin-bottom: .5rem; }
.folio-album__description { max-width: 46rem; margin: 0 0 1rem; opacity: .85; }
.folio-album__photos { columns: 3 16rem; column-gap: .6rem; }
.folio-photo { display: block; margin-bottom: .6rem; break-inside: avoid; overflow: hidden; cursor: zoom-in; }
.folio-photo img { width: 100%; transition: transform .4s ease, opacity .2s; }
.folio-photo:hover img { transform: scale(1.03); }
@media (max-width: 700px) { .folio-album__photos { columns: 2; column-gap: .4rem; } .folio-photo { margin-bottom: .4rem; } }

/* Lightbox */
.folio-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(8, 8, 10, .94); }
.folio-lightbox[hidden] { display: none; }
.folio-lightbox__img { max-width: calc(100vw - 7rem); max-height: calc(100vh - 5rem); width: auto; height: auto; object-fit: contain; user-select: none; }
.folio-lightbox button { position: absolute; display: flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.3rem; cursor: pointer; }
.folio-lightbox button:hover, .folio-lightbox button:focus-visible { background: rgba(255, 255, 255, .25); }
.folio-lightbox__close { top: 1rem; right: 1rem; }
.folio-lightbox__nav--prev { left: 1rem; }
.folio-lightbox__nav--next { right: 1rem; }
.folio-lightbox__count { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .7); font-size: 14px; }
@media (max-width: 700px) { .folio-lightbox__img { max-width: 100vw; } .folio-lightbox__nav { bottom: 1rem; top: auto; } .folio-lightbox__nav--prev { left: 25%; } .folio-lightbox__nav--next { right: 25%; } }
body.folio-noscroll { overflow: hidden; }

/* Adult warning */
.folio-gate { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(10, 10, 12, .97); color: #fff; }
.folio-adult .folio-main { filter: blur(24px); }
.folio-adult.folio-adult-ok .folio-main { filter: none; }
.folio-adult-ok .folio-gate { display: none; }
.folio-gate__box { max-width: 30rem; text-align: center; }
.folio-gate__badge { display: inline-flex; width: 3.5rem; height: 3.5rem; align-items: center; justify-content: center; margin-bottom: 1rem !important; border: 3px solid #e53935; border-radius: 50%; color: #e53935; font-weight: 800; font-size: 1.2rem; }
.folio-gate__title { margin-bottom: .75rem !important; font-size: 1.5rem; }
.folio-gate__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.5rem; }
.folio-gate .folio-btn { background: #fff; border-color: #fff; color: #111; }
.folio-gate .folio-btn--ghost { background: transparent; color: #fff; }

/* Footer of free books */
.folio-ad { max-width: 970px; margin: 2rem auto; padding: 0 1rem; text-align: center; }
.folio-credit { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; padding: 1.25rem 1rem; background: #f4f5f8; color: #5a6077; font-size: 14px; text-align: center; }
.folio-credit a { color: inherit; text-decoration: none; }
.folio-credit a:hover { text-decoration: underline; }
.folio-credit strong { color: #3f51f5; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .folio-book *, .folio-book *::before { animation: none !important; transition: none !important; } }

/* Contact form (Premium) */
.folio-contact { max-width: 46rem; margin: 3rem auto 0; padding: 0 1.25rem; }
.folio-contact__title { margin-bottom: 1.2rem; font-size: 1.6rem; }
.folio-contact__form { display: grid; gap: 1rem; }
.folio-contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.folio-contact__form label { display: grid; gap: .35rem; font-size: 14px; font-weight: 600; }
.folio-contact__form input, .folio-contact__form textarea { width: 100%; padding: .75rem .9rem; border: 1px solid rgba(128, 128, 128, .35); border-radius: 8px; background: rgba(255, 255, 255, .9); color: #1d2238; font: 400 15px/1.5 inherit; font-family: inherit; }
.folio-contact__form input:focus, .folio-contact__form textarea:focus { outline: 2px solid var(--folio-accent, #3c52ff); outline-offset: 1px; }
.folio-contact__hp { position: absolute; left: -9999px; }
.folio-contact__legal { font-size: 12px; opacity: .75; }
.folio-contact__form .folio-btn { justify-self: start; background: var(--folio-accent, #111); border-color: var(--folio-accent, #111); }
.folio-contact__status.is-ok { color: #18745b; font-weight: 600; }
.folio-contact__status.is-error { color: #c0392b; font-weight: 600; }
@media (max-width: 640px) { .folio-contact__row { grid-template-columns: 1fr; } }
