@font-face {
  font-family: "Super Train";
  src: url("../fonts/supertrain.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Catalog — inherits the active theme. Reader keeps its own stage. */

.folio-catalog,
.folio-theme-slot {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  box-sizing: border-box;
}

.folio-catalog *,
.folio-theme-slot *,
.folio-reader-root * {
  box-sizing: border-box;
}

.entry-content:has(.folio-catalog),
.entry-content:has(.folio-theme-slot),
.entry-content:has(.folio-reader-root),
.wp-block-post-content:has(.folio-catalog),
.wp-block-shortcode:has(.folio-catalog),
.wp-block-group:has(.folio-catalog) {
  max-width: none !important;
  width: 100%;
}

body.folio-catalog-page .entry-content,
body.folio-catalog-page .post-content,
body.folio-catalog-page .page-content,
body.folio-catalog-page .wp-block-post-content,
body.folio-reading .entry-content,
body.folio-reading .post-content,
body.folio-reading .page-content,
body.folio-reading .wp-block-post-content {
  max-width: none;
  width: 100%;
}

body.folio-catalog-page .entry-header,
body.folio-catalog-page .page-header,
body.folio-catalog-page .entry-title,
body.folio-catalog-page .page-title,
body.folio-catalog-page .folio-page-title {
  display: block;
  visibility: visible;
  clip: auto;
  height: auto;
  overflow: visible;
}

.folio-page-head,
body.folio-catalog-page .entry-header,
body.folio-catalog-page .page-header {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 0 1.25em;
  text-align: center !important;
}

.folio-page-title,
body.folio-catalog-page .entry-header h1,
body.folio-catalog-page .page-header h1,
body.folio-catalog-page h1.entry-title,
body.folio-catalog-page h1.page-title,
body.folio-catalog-page h1.wp-block-post-title {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: center !important;
  font-family: "Super Train", sans-serif;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1;
  color: inherit;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.folio-search {
  margin: 0;
  padding: 0;
  list-style: none;
}

.folio-search__hit {
  margin: 0 0 0.85em;
}

.folio-search__hit a {
  color: inherit;
}

.folio-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1.25em;
}

.folio-search-form input[type="search"] {
  flex: 1 1 180px;
  min-height: 40px;
}

.folio-search-empty {
  margin: 0;
}

.folio-catalog__head {
  margin: 0 0 1.5em;
}

.folio-catalog__title {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: 1.15;
  color: inherit;
}

.folio-catalog__empty {
  margin: 0;
  color: inherit;
  opacity: 0.7;
  line-height: 1.5;
}

.folio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
  width: 100%;
}

.folio-card {
  min-width: 0;
}

.folio-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.folio-card__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 2px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  box-shadow: none;
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  transition: transform 0.25s ease;
}

.folio-card__link:hover .folio-card__cover,
.folio-card__link:focus-visible .folio-card__cover {
  transform: translateY(-3px);
}

.folio-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.folio-card__link:hover .folio-card__cover img {
  transform: scale(1.03);
}

.folio-card__placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: inherit;
  opacity: 0.45;
  font-size: 0.8em;
}

.folio-card__cover:has(img)::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
  pointer-events: none;
}

.folio-card__title {
  margin: 0.75em 0 0;
  font-family: inherit;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: inherit;
  line-height: 1.2;
  color: inherit;
}

.folio-card__meta {
  margin: 0.3em 0 0;
  font-family: inherit;
  font-size: 0.75em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.55;
}

.folio-missing {
  color: inherit;
  opacity: 0.7;
}

/* Reader stage — fills the theme content column, keeps the page-turn. */

.folio-theme-slot {
  min-height: calc(100dvh - 0px);
}

.folio-reader-root {
  --folio-ink: #1a1612;
  --folio-ink-soft: #2c261f;
  --folio-paper: #f4ede4;
  --folio-paper-deep: #e8dfd2;
  --folio-burgundy: #7a2e2a;
  --folio-burgundy-deep: #5c221f;
  --folio-gold: #c4a574;
  --folio-ease: cubic-bezier(0.645, 0.045, 0.355, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100dvh - 0px);
  background: radial-gradient(ellipse at center, #2c261f 0%, #1a1612 72%);
  color: #f4ede4;
  font-family: inherit;
  overflow: hidden;
}

.folio-reader-root.is-embed {
  min-height: min(88dvh, 820px);
}

body.folio-reader-body {
  margin: 0 !important;
  padding: 0 !important;
  background: #1a1612 !important;
}

body.folio-reading .folio-reader-root,
body.folio-reading .folio-theme-slot {
  min-height: 100dvh;
}

body.admin-bar .folio-reader-root:not(.is-embed),
body.admin-bar .folio-theme-slot {
  min-height: calc(100dvh - 32px);
}

.folio-reader__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  z-index: 5;
}

.folio-reader__title {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 600;
  text-align: center !important;
  line-height: 1.15;
}

.folio-reader__label {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--folio-gold);
  text-align: center !important;
}

.folio-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.folio-icon-btn:hover:not(:disabled) {
  background: rgba(244, 237, 228, 0.1);
}

.folio-icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.folio-share-box {
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  width: min(calc(100% - 24px), 440px);
  margin: 0 12px 20px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(244, 237, 228, 0.1);
  border: 1px solid rgba(244, 237, 228, 0.22);
  color: #f4ede4;
  z-index: 6;
}

.folio-share-box__label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.folio-share-box__nets {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folio-share-box__net {
  appearance: none;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.folio-share-box__net:hover,
.folio-share-box__net:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.folio-share-box__net.is-facebook {
  background: #1877f2;
}

.folio-share-box__net.is-x {
  background: #000;
}

.folio-share-box__net.is-whatsapp {
  background: #25d366;
}

.folio-share-box__net.is-copy {
  background: var(--folio-gold, #c4a574);
  color: #1a1612;
}

.folio-share-box__net.is-native {
  background: #f4ede4;
  color: #1a1612;
}

.folio-share-box__net.is-done {
  background: #3d8b5a;
  color: #fff;
}

.folio-reader__stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 4px;
  overflow: hidden;
  touch-action: pan-y;
}

.folio-synopsis {
  position: absolute;
  z-index: 5;
  left: clamp(16px, 5vw, 56px);
  top: 50%;
  width: min(34vw, 380px);
  max-height: min(70%, calc(var(--page-h, 70dvh) - 24px));
  overflow: auto;
  transform: translateY(-46%) translateX(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  color: #f4ede4;
  transition:
    opacity 0.45s ease,
    transform 0.55s var(--folio-ease, ease),
    visibility 0.45s;
}

.folio-synopsis.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-46%) translateX(0);
}

.folio-synopsis__kicker {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--folio-gold, #c4a574);
}

.folio-synopsis__text {
  margin: 0;
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  line-height: 1.55;
  white-space: pre-wrap;
  color: rgba(244, 237, 228, 0.88);
}

.folio-reader-root:has(.folio-book.is-single) .folio-synopsis {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 8px;
  width: min(86vw, 420px);
  max-height: 28%;
  transform: translateX(-50%) translateY(8px);
}

.folio-reader-root:has(.folio-book.is-single) .folio-synopsis.is-on {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 719px) {
  .folio-synopsis {
    left: 50%;
    top: auto;
    bottom: 8px;
    width: min(86vw, 420px);
    max-height: 26%;
    transform: translateX(-50%) translateY(8px);
  }
  .folio-synopsis.is-on {
    transform: translateX(-50%) translateY(0);
  }
}

.folio-book {
  --page-w: min(38vw, 420px);
  --page-h: min(calc(var(--page-w) * 1.5), calc(100dvh - 248px));
  position: relative;
  width: calc(var(--page-w) * 2);
  height: var(--page-h);
  perspective: 2800px;
  transform-style: preserve-3d;
  transition: transform 0.85s var(--folio-ease);
  filter: drop-shadow(0 18px 50px rgba(0, 0, 0, 0.45));
}

.folio-book.is-closed {
  transform: translateX(calc(var(--page-w) / 2));
}

.folio-book.is-single {
  --page-w: min(86vw, 420px);
  --page-h: min(calc(var(--page-w) * 1.5), calc(100dvh - 248px));
  width: var(--page-w);
  transform: none;
}

.folio-sheet {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--page-w);
  height: var(--page-h);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.85s var(--folio-ease);
  will-change: transform;
}

.folio-book.is-single .folio-sheet {
  left: 0;
}

.folio-sheet.is-flipped {
  transform: rotateY(-180deg);
}

.folio-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--folio-paper-deep);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(26, 22, 18, 0.08),
    0 0 0 1px rgba(26, 22, 18, 0.04);
}

.folio-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--folio-paper-deep);
  user-select: none;
  -webkit-user-drag: none;
  display: block;
}

.folio-face.is-back {
  transform: rotateY(180deg);
}

.folio-face.is-empty {
  background:
    linear-gradient(90deg, rgba(26, 22, 18, 0.06), transparent 18px),
    var(--folio-paper-deep);
}

.folio-face.is-front::after,
.folio-face.is-back::after {
  content: "";
  position: absolute;
  top: 0;
  width: 36px;
  height: 100%;
  pointer-events: none;
}

.folio-face.is-front::after {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(26, 22, 18, 0.1));
}

.folio-face.is-back::after {
  left: 0;
  background: linear-gradient(270deg, transparent, rgba(26, 22, 18, 0.14));
}

.folio-sheet.is-hard .folio-face.is-front::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: linear-gradient(90deg, var(--folio-burgundy-deep), var(--folio-burgundy) 70%, transparent);
  pointer-events: none;
}

.folio-curl {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 56px;
  height: 56px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    135deg,
    transparent 48%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(26, 22, 18, 0.18) 52%
  );
  transition: opacity 180ms ease;
}

.folio-sheet:not(.is-flipped):hover .folio-curl {
  opacity: 1;
}

.folio-spine {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 250;
  width: 2px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(26, 22, 18, 0.08),
    rgba(26, 22, 18, 0.28) 12%,
    rgba(26, 22, 18, 0.22) 88%,
    rgba(26, 22, 18, 0.08)
  );
  opacity: 0;
  transition: opacity 400ms ease;
}

.folio-book:not(.is-closed):not(.is-single) .folio-spine {
  opacity: 1;
}

.folio-reader__hint {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(26, 22, 18, 0.72);
  color: #f4ede4;
  font-size: 12px;
  letter-spacing: 0.06em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
}

.folio-reader__hint.is-on {
  opacity: 1;
}

.folio-reader__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4px 16px 10px;
  z-index: 5;
}

.folio-reader__progress {
  width: min(56vw, 240px);
  height: 4px;
  border-radius: 999px;
  background: rgba(244, 237, 228, 0.15);
  overflow: hidden;
}

.folio-reader__progress > span {
  display: block;
  height: 100%;
  background: var(--folio-gold);
  width: 0%;
  transition: width 300ms ease;
}

.folio-hotspot {
  position: absolute;
  top: 64px;
  bottom: 148px;
  width: 22%;
  z-index: 4;
  background: transparent;
  border: 0;
  cursor: e-resize;
}

.folio-hotspot.is-prev {
  left: 0;
  cursor: w-resize;
}

.folio-hotspot.is-next {
  right: 0;
}

@media (prefers-reduced-motion: reduce) {
  .folio-book,
  .folio-sheet,
  .folio-card__cover,
  .folio-card__cover img {
    transition: none !important;
  }
}
