/* =========================================================================
   AC Flipbook – frontend styles
   Typo3 target path: fileadmin/templates/css/acflipbook.css
   -------------------------------------------------------------------------
   Everything is namespaced under .acfb / .acfb__overlay and the acfb__*
   prefix so it is conflict-free with main.css. The site sets
   body{font-size:0;line-height:0} as a layout reset, so both the inline
   container and the body-level lightbox overlay re-assert font metrics.
   Tweakable knobs live in the custom properties below.
   ========================================================================= */

.acfb,
.acfb__overlay {
  --acfb-band:     #f2f2f2;   /* full-bleed background band (hellgrau) */
  --acfb-ink:      #1a1a1a;   /* text / outlines */
  --acfb-accent:   #31403b;   /* AC dark green (CTA) */
  --acfb-page-bg:  #e7e7e7;   /* placeholder behind not-yet-loaded pages */
  --acfb-book-max: 1000px;    /* inline book max width */
  --acfb-shadow:   0 18px 50px rgba(0, 0, 0, .22);

  font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;            /* undo body{font-size:0} */
  line-height: 1.5;           /* undo body{line-height:0} */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.acfb *,
.acfb__overlay * { box-sizing: border-box; }

.acfb--trigger { display: none !important; }


/* Cover mode: the Fluid cover image stays visible and opens the lightbox. */
.acfb--cover { display: block; cursor: pointer; text-align: center; }
.acfb--cover a { display: inline-block; text-decoration: none; cursor: pointer; }
.acfb--cover img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  transition: opacity .3s ease-in-out;
  width:100%;
  max-width:180px;
}
.acfb--cover:hover img { opacity: .9; }
/* launch button on its own line, centred below the cover */
.acfb--cover .acfb__launch { display: block; width: fit-content; max-width: 100%; margin: 18px auto 0; }

/* ---------------------------------------------------------------- inline -- */
/* Full-viewport-width light-gray band (safe: html{overflow-x:hidden}). */
.acfb__band {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--acfb-band);
  padding: 64px 24px;
}
.acfb__inner {
  position: relative;
  /* book(~1000) + two arrows + gaps -> keeps the inline book near the ~1000px
     target on wide screens (StPageFlip's own max-width is set inline). */
  max-width: 1140px;
  margin: 0 auto;
}
.acfb__title {
  margin: 0 auto 32px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--acfb-ink);
}

/* ----------------------------------------------------------------- stage -- */
.acfb__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.acfb__book {
  position: relative;
  width: 100%;
  max-width: var(--acfb-book-max);
  margin: 0 auto;
  /* reserve height before StPageFlip initialises (two A4 pages side by side) */
  aspect-ratio: 2480 / 1754;
  touch-action: pan-y;
}
.acfb__book .acfb__page { background: var(--acfb-page-bg); }

/* page + image */
.acfb__page {
  position: relative;
  overflow: hidden;
  background: var(--acfb-page-bg);
}
.acfb__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease-in-out;
}
.acfb__img.is-loaded { opacity: 1; }

/* ---------------------------------------------------------------- arrows -- */
.acfb__arrow {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--acfb-ink);
  border-radius: 50%;
  background: #fff;
  color: var(--acfb-ink);
  font-family: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity .3s ease-in-out, background .3s ease-in-out, color .3s ease-in-out;
}
.acfb__arrow:hover { background: var(--acfb-ink); color: #fff; }
.acfb__arrow:focus-visible { outline: 2px solid var(--acfb-accent); outline-offset: 3px; }
.acfb__arrow[disabled] { opacity: .25; pointer-events: none; }
.acfb__arrow span { display: block; margin-top: -3px; } /* optical centering of chevron */

/* ------------------------------------------------------------------ bar --- */
.acfb__bar {
  margin: 36px auto 0;
  text-align: center;
}
.acfb__download {
  display: inline-block;
  padding: 14px 30px;
  border: 1px solid var(--acfb-ink);
  background: transparent;
  color: var(--acfb-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all .4s ease-in-out;
}
.acfb__download:hover { background: var(--acfb-ink); color: #fff; }

/* --------------------------------------------------------- launch button -- */
.acfb {
	text-align:center;
}
.acfb__launch {
  display: inline-block;
  padding: 16px 34px;
  border: 0;
  background: var(--acfb-accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .4s ease-in-out;
}
.acfb__launch:hover { opacity: .82; }

/* ------------------------------------------------------------- lightbox --- */
.acfb__overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;          /* site max z-index is 100 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 48px 24px;
  background: rgba(14, 16, 15, .95);
  opacity: 0;
  transition: opacity .3s ease-in-out;
}
.acfb__overlay.is-open { opacity: 1; }
.acfb__overlay[hidden] { display: none; }

.acfb__overlay .acfb__stage { width: 100%; }
.acfb__overlay .acfb__book {
  max-width: none;
  width: auto;
  height: 82vh;
  aspect-ratio: 2480 / 1754;
  box-shadow: var(--acfb-shadow);
}
.acfb__overlay .acfb__arrow { background: #fff; }
.acfb__overlay .acfb__download { border-color: #fff; color: #fff; }
.acfb__overlay .acfb__download:hover { background: #fff; color: var(--acfb-ink); }

.acfb__close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .3s ease-in-out;
}
.acfb__close:hover { opacity: .6; }
.acfb__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------------------------------------------------------- loading/err --- */
.acfb__loading,
.acfb__error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 100%;
  color: #6a6f6d;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.acfb__spinner {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(0, 0, 0, .15);
  border-top-color: var(--acfb-accent);
  border-radius: 50%;
  animation: acfb-spin 0.8s linear infinite;
}
.acfb__overlay .acfb__spinner { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
@keyframes acfb-spin { to { transform: rotate(360deg); } }

.acfb__error a { color: inherit; }

/* -------------------------------------------------------- StPageFlip lib -- */
/* Required structural classes the library injects inside .acfb__book. */
.stf__parent {
  position: relative;
  display: block;
  box-sizing: border-box;
  transform: translateZ(0);
  -ms-touch-action: pan-y;
  touch-action: pan-y;
  margin: 0 auto;
  transition: transform .55s ease-in-out;
}
/* A lone page (cover / trailing page) sits on its book side by default; shift it
   half a page so single pages appear centered, as requested. Removed during the
   flip itself so the spread animates from the neutral position. NOTE: StPageFlip
   puts the stf__parent class on the book element itself, so target it directly. */
.acfb__book.is-cover { transform: translateX(-25%) translateZ(0); }
.acfb__book.is-back  { transform: translateX(25%)  translateZ(0); }
.stf__wrapper { position: relative; width: 100%; box-sizing: border-box; }
.stf__parent canvas { position: absolute; width: 100%; height: 100%; left: 0; top: 0; }
.stf__block { position: absolute; width: 100%; height: 100%; box-sizing: border-box; perspective: 2000px; }
.stf__item { display: none; position: absolute; transform-style: preserve-3d; }
.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow { position: absolute; left: 0; top: 0; }

/* ----------------------------------------------------------- responsive --- */
@media (max-width: 1023px) {
  .acfb__band { padding: 44px 16px; }
  .acfb__stage { gap: 8px; }
  .acfb__arrow { width: 46px; height: 46px; font-size: 22px; }
}

@media (max-width: 767px) {
  .acfb__band { padding: 28px 10px; }
  /* Single-page (portrait) on phones: book full width & centered, arrows below
     it (the book is capped under the spread threshold so it never shows two
     squeezed pages). */
  .acfb__stage { flex-wrap: wrap; gap: 14px; }
  .acfb__book {
    order: -1;
    flex: 0 0 100%;
    width: 100%;
    max-width: min(86vw, 540px);
    margin: 0 auto;
    aspect-ratio: 1240 / 1754;
  }
  .acfb__arrow { order: 1; width: 44px; height: 44px; font-size: 21px; }
  .acfb__overlay { padding: 52px 8px 20px; gap: 14px; }
  .acfb__overlay .acfb__stage { flex-wrap: wrap; }
  .acfb__overlay .acfb__book { order: -1; flex: 0 0 100%; height: auto; width: 100%; max-width: 86vw; aspect-ratio: 1240 / 1754; }
  .acfb__bar { margin-top: 22px; }
  .acfb__title { font-size: 18px; margin-bottom: 22px; }
}
