:root {
  --fz-ink: #141414;
  --fz-mono: "IBM Plex Mono", ui-monospace, monospace;
  --fz-font: "Syne", sans-serif;
  --fz-accent: #f0d84a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html.fazumzine-view-html,
body.fazumzine-view-body {
  margin: 0;
  min-height: 100%;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body.fazumzine-view-body:not(.is-mobile-view) {
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
}

body.fazumzine-view-body {
  font-family: var(--fz-mono);
  color: var(--fz-ink);
}

.fz-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1rem 1.25rem;
  overscroll-behavior: none;
}

body:not(.is-mobile-view) .fz-view {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding-bottom: 4.75rem;
}

.fz-view-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  z-index: 50;
  position: relative;
}

.fz-zineteca-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.65rem;
  border: 1px solid #141414;
  background: rgba(255, 255, 255, 0.95);
  color: #141414;
  font-family: var(--fz-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.fz-zineteca-link:hover,
.fz-zineteca-link:focus-visible {
  background: var(--fz-accent);
  outline: none;
}

.fz-zoom {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid #141414;
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fz-zoom__label {
  font-weight: 600;
}

.fz-zoom input[type="range"] {
  width: min(160px, 36vw);
  accent-color: #141414;
}

.fz-zoom__value {
  min-width: 2.8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Janela fixa (tamanho do zine em 100%). O zoom cresce só o conteúdo interno. */
.fz-view-book-wrap {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(20, 20, 20, 0.15);
  touch-action: none;
  z-index: 5;
}

.fz-view-book-wrap.is-pannable {
  cursor: grab;
}

.fz-view-book-wrap.is-panning {
  cursor: grabbing;
}

.fz-view-book-pan {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.fz-view-book {
  width: auto;
  height: auto;
  box-shadow: none;
  overflow: hidden;
  touch-action: none;
  contain: layout paint;
  position: relative;
}

.fz-view-book .stf__parent {
  touch-action: none !important;
  -ms-touch-action: none !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.fz-view-book .stf__wrapper,
.fz-view-book .stf__block {
  overflow: hidden !important;
}

.fz-view-page {
  background: #fff;
  overflow: hidden;
}

.fz-view-page__inner {
  width: 100%;
  height: 100%;
  background-color: #111;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* Capa/contracapa usam densidade hard — sem clone soft na face vazia. */

.fz-view-nav {
  display: flex;
  gap: 0.6rem;
  position: relative;
  z-index: 50;
  flex: 0 0 auto;
}

.fz-view-btn {
  appearance: none;
  border: 1px solid #141414;
  background: rgba(255, 255, 255, 0.95);
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  z-index: 51;
  touch-action: manipulation;
}

.fz-view-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fz-authors-bar {
  background: #111;
  color: #f7f7f3;
  padding: 0.7rem 1rem;
  text-align: center;
  width: 100%;
  position: relative;
  z-index: 50;
}

body:not(.is-mobile-view) .fz-authors-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  pointer-events: none;
}

.fz-authors-bar p {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

@media (max-width: 700px) {
  html.fazumzine-view-html,
  body.fazumzine-view-body {
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto !important;
  }

  .fz-view {
    height: auto;
    max-height: none;
    min-height: 100vh;
    justify-content: flex-start;
    overflow: visible;
    padding: 0.85rem 0.75rem 1.5rem;
  }

  .fz-zoom {
    position: sticky;
    top: 0.4rem;
    align-self: center;
  }

  .fz-view-book-wrap {
    width: min(100%, 920px);
    max-width: 100%;
  }

  .fz-authors-bar {
    position: static;
    margin-top: 0.35rem;
    pointer-events: auto;
  }
}
