/* Horti-Innovations bladerversie */

:root {
  --horti-blue: #124a89;
  --horti-blue-dark: #0d3666;
  --horti-gray: #424341;
  --bg: #d9d9d9;
  --bg-dark: #cfcfcf;
  --paper: #ffffff;
  --toolbar-bg: rgba(255, 255, 255, 0.94);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  --side-btn-w: 42px;
  --top-h: 58px;
  --bottom-h: 56px;
  --gap: 12px;
  --page-w: 612.283;
  --page-h: 858.898;
  --page-aspect: 0.71287;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--horti-gray);
  font-family: "Liberation Sans", Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  min-height: 100%;
}

/* --- Top bar --- */
.topbar {
  position: relative;
  z-index: 20;
  flex: 0 0 var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  pointer-events: none;
}
.brand {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: var(--horti-blue);
  text-decoration: none;
}
.brand strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand span {
  font-size: 11px;
  color: var(--horti-gray);
  font-weight: 400;
}
.tools {
  pointer-events: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--toolbar-bg);
  border-radius: 999px;
  padding: 5px 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.tool {
  appearance: none;
  border: 0;
  background: transparent;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--horti-blue);
  cursor: pointer;
  padding: 0;
}
.tool:hover,
.tool:focus-visible {
  background: #e8eef6;
  outline: none;
}
.tool:active { background: #d5e0ee; }
.tool[aria-pressed="true"] {
  background: var(--horti-blue);
  color: #fff;
}
.tool svg { width: 20px; height: 20px; display: block; }
.tool:disabled {
  opacity: 0.35;
  cursor: default;
}

/* --- Stage --- */
.stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 var(--gap);
  gap: 8px;
}

.side-btn {
  flex: 0 0 var(--side-btn-w);
  align-self: stretch;
  max-height: 100%;
  width: var(--side-btn-w);
  border: 0;
  background: #f4f4f4;
  color: var(--horti-blue);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.side-btn.prev {
  border-radius: 22px 0 0 22px;
}
.side-btn.next {
  border-radius: 0 22px 22px 0;
}
.side-btn:hover {
  background: var(--horti-blue);
  color: #fff;
}
.side-btn:focus-visible {
  outline: 2px solid var(--horti-blue);
  outline-offset: 2px;
}
.side-btn:disabled {
  opacity: 0.28;
  cursor: default;
  background: #ececec;
  color: #7a7a7a;
}
.side-btn svg { width: 22px; height: 22px; }

.book-viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cover-mask {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28%;
  background: var(--bg);
  z-index: 4;
  pointer-events: none;
}
.cover-mask-left { left: 0; }
.cover-mask-right { right: 0; }
.book-viewport.is-cover .cover-mask-left { display: block; }
.book-viewport.is-back .cover-mask-right { display: block; }
.book-viewport.is-zoomed {
  overflow: auto;
}

.book-sizer {
  position: relative;
  /* sized by JS */
  transform-origin: center center;
  transition: transform 0.2s ease;
}

#book {
  margin: 0 auto;
  box-shadow: var(--shadow);
  background: transparent;
}

/* Catalog page */
.page {
  background: var(--paper);
  overflow: hidden;
  container-type: inline-size;
  container-name: page;
  user-select: text;
  -webkit-user-select: text;
}
.page > img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
  background: var(--paper);
}
.page[data-page="1"] > img.bg,
.page[data-page="55"] > img.bg {
  background: #124a89;
}
.texts, .links { position: absolute; inset: 0; }
.t {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  white-space: pre;
  line-height: 1;
  font-family: "Liberation Sans", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-kerning: none;
  font-variant-ligatures: none;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}
.t.b { font-weight: 700; }
.links a {
  position: absolute;
  z-index: 2;
  background: transparent;
}
.links a:hover { background: rgba(18, 74, 137, 0.10); }

/* StPageFlip item should fill its slot */
.stf__item .page,
.stf__item {
  width: 100%;
  height: 100%;
}

/* --- Bottom bar --- */
.bottombar {
  flex: 0 0 var(--bottom-h);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 8px;
  gap: 2px;
}
.page-label {
  font-size: 12px;
  color: var(--horti-gray);
  letter-spacing: 0.02em;
  min-height: 16px;
}
.page-bar {
  width: min(700px, 100%);
  display: flex;
  align-items: center;
}
.page-bar input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: transparent;
  margin: 8px 0;
  cursor: pointer;
}
.page-bar input[type="range"]:focus-visible { outline: none; }
.page-bar input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--horti-blue) var(--progress, 0%), #b7b7b7 var(--progress, 0%));
  border-radius: 999px;
}
.page-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--horti-blue);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.page-bar input[type="range"]::-moz-range-track {
  height: 6px;
  background: #b7b7b7;
  border-radius: 999px;
}
.page-bar input[type="range"]::-moz-range-progress {
  height: 6px;
  background: var(--horti-blue);
  border-radius: 999px;
}
.page-bar input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--horti-blue);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Fullscreen */
:fullscreen .app,
:fullscreen body { background: #c8c8c8; }

@media (max-width: 700px) {
  :root {
    --side-btn-w: 32px;
    --top-h: 52px;
    --bottom-h: 52px;
  }
  .brand strong { font-size: 13px; }
  .brand span { display: none; }
  .tool { width: 34px; height: 34px; }
  .topbar { padding: 0 10px 0 12px; }
  .bottombar { padding: 0 12px 6px; }
  .stage {
    padding: 0;
    gap: 0;
  }
  .side-btn {
    position: absolute;
    z-index: 15;
    top: 50%;
    transform: translateY(-50%);
    height: 88px;
    max-height: 30%;
    align-self: auto;
    width: var(--side-btn-w);
  }
  .side-btn.prev { left: 0; }
  .side-btn.next { right: 0; }
  .book-viewport { width: 100%; }
}

@media (max-width: 480px) {
  .side-btn.prev { border-radius: 16px 0 0 16px; }
  .side-btn.next { border-radius: 0 16px 16px 0; }
}
