/* Nitto EMEA Sustainability Report 2025 — viewer
   Vervangt de FlipHTML5-embed. Volledig statisch. */

:root {
  --nitto-navy: #2b377e;
  --nitto-navy-light: #4655a8;
  --bg: #161927;
  --bg-deep: #0f111b;
  --chrome: rgba(22, 25, 39, 0.82);
  --chrome-solid: #1c2033;
  --line: rgba(255, 255, 255, 0.14);
  --text: #eef0f6;
  --text-dim: #a2a8bd;
  --focus: #7d8ce0;
  --toolbar-h: 56px;
  --masthead-h: 44px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

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

#app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(120% 90% at 50% 0%, #232842 0%, var(--bg) 55%, var(--bg-deep) 100%);
}

/* ---------- masthead ---------- */

#masthead {
  height: var(--masthead-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--chrome);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#masthead h1 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- stage ---------- */

#stage {
  position: relative;
  min-height: 0;
  display: grid;
  padding: 18px;
}

.renderer {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.renderer[hidden] { display: none; }

/* ---------- pagina + hotspots (gedeeld door beide modi) ---------- */

.page {
  position: relative;
  background: #ffffff;
  overflow: hidden;
}

.page img.page-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e9ecea;
  user-select: none;
  -webkit-user-drag: none;
}

.page .hotspot {
  position: absolute;
  display: block;
  border-radius: 2px;
  background: transparent;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.page .hotspot:hover,
.page .hotspot:focus-visible {
  background: rgba(43, 55, 126, 0.16);
  box-shadow: 0 0 0 2px rgba(43, 55, 126, 0.55);
  outline: none;
}

/* korte puls om de klikbare gebieden te tonen */
#app.reveal-links .page .hotspot {
  background: rgba(43, 55, 126, 0.2);
  box-shadow: 0 0 0 2px rgba(43, 55, 126, 0.6);
}

/* ---------- flip-modus (StPageFlip) ---------- */

/* StPageFlip zet inline min-width/min-height op de parent om ruimte voor twee
   pagina's te reserveren. Deze pagina's zijn 16:9, dus we tonen er altijd maar
   één en halen die reservering hier weg. */
#flip-root .stf__parent {
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 auto;
}

#flip-root .page {
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
}

#flip-root .stf__item .page { box-shadow: none; }

#flip-root .stf__block { box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5); }

/* ---------- slide-modus ---------- */

/* Breedte en hoogte worden in viewer.js in pixels gezet: aspect-ratio alleen
   levert bij een krappe hoogte een uitgerekte box op, want de expliciete
   breedte wint van de max-height. De ratio hier is de vangnetwaarde. */
#slide-viewport {
  position: relative;
  aspect-ratio: var(--page-aspect, 16 / 9);
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
}

#slide-viewport .page {
  position: absolute;
  inset: 0;
  transform: translate3d(110%, 0, 0);
  transition: transform 0.42s var(--ease);
  will-change: transform;
}

#slide-viewport .page.is-current { transform: translate3d(0, 0, 0); z-index: 2; }
#slide-viewport .page.is-before { transform: translate3d(-110%, 0, 0); }
#slide-viewport.no-anim .page { transition: none; }

/* ---------- toolbar ---------- */

#toolbar {
  height: var(--toolbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 12px calc(env(safe-area-inset-bottom, 0px) / 2);
  border-top: 1px solid var(--line);
  background: var(--chrome);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s var(--ease);
}

.tb svg {
  width: 21px; height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tb:hover { background: rgba(255, 255, 255, 0.1); }
.tb:active { background: rgba(255, 255, 255, 0.16); }
.tb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tb[disabled] { opacity: 0.32; cursor: default; }
.tb[disabled]:hover { background: transparent; }
.tb[aria-expanded="true"], .tb.is-on { background: var(--nitto-navy); }

.tb-mode { gap: 6px; color: var(--text-dim); }
.tb-mode::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--nitto-navy-light);
}

.tb-divider {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--line);
}

#pager {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#page-input {
  width: 46px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

#page-input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
#page-total { min-width: 22px; }

/* ---------- thumbnails: horizontale filmstrip ---------- */

#thumbs {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--toolbar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 44px 12px 8px;
  border-top: 1px solid var(--line);
  background: var(--chrome-solid);
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.45);
  z-index: 20;
  animation: rise 0.22s var(--ease);
}

@keyframes rise { from { transform: translateY(14px); opacity: 0; } }

#thumbs[hidden] { display: none; }

#thumbs-strip {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--nitto-navy-light) transparent;
}

#thumbs-strip::-webkit-scrollbar { height: 7px; }
#thumbs-strip::-webkit-scrollbar-thumb { background: var(--nitto-navy-light); border-radius: 4px; }
#thumbs-strip::-webkit-scrollbar-track { background: transparent; }

.strip-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s var(--ease), opacity 0.15s var(--ease);
}
.strip-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.strip-nav:hover { background: var(--nitto-navy); }
.strip-nav:disabled { opacity: 0.3; cursor: default; }
.strip-nav:disabled:hover { background: rgba(0, 0, 0, 0.3); }

.strip-close {
  position: absolute;
  top: 6px; right: 8px;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--text-dim); cursor: pointer;
}
.strip-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.strip-close:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }

.thumb {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  width: 150px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #10121c;
  cursor: pointer;
  overflow: hidden;
  scroll-margin-inline: 60px;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.thumb img {
  display: block;
  /* Vaste 16:9-box: de thumb heeft een vaste breedte, dus aspect-ratio
     reserveert de hoogte al vóórdat de (lui geladen) afbeelding binnen is —
     anders klapt een nog niet geladen thumb naar hoogte 0. min-height:0 voorkomt
     dat het flex-item terugvalt op de intrinsieke hoogte. */
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: var(--page-aspect, 16 / 9);
  object-fit: cover;
  background: #232842;
}

.thumb span {
  display: block;
  padding: 4px 0 5px;
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.thumb:hover { transform: translateY(-2px); border-color: var(--nitto-navy-light); }
.thumb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumb.is-current { border-color: var(--nitto-navy-light); }
.thumb.is-current span { color: var(--text); }

/* ---------- inhoudstabel ---------- */

#toc {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--toolbar-h);
  max-height: min(64vh, 560px);
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--chrome-solid);
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.45);
  z-index: 21;
  animation: rise 0.22s var(--ease);
}

#toc[hidden] { display: none; }

#toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#toc-list {
  list-style: none;
  margin: 0;
  padding: 8px 8px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  column-gap: 28px;
}

@media (min-width: 900px) { #toc-list { columns: 2; } }

.toc-item {
  break-inside: avoid;
}

.toc-item button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.13s var(--ease);
}

.toc-item button:hover { background: rgba(255, 255, 255, 0.07); }
.toc-item button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.toc-item.is-current button { background: rgba(43, 55, 126, 0.35); }

.toc-title { flex: 1; min-width: 0; }
.toc-sub .toc-title { padding-left: 16px; color: var(--text-dim); font-size: 13px; }
.toc-chapter .toc-title { font-weight: 600; }

.toc-dots {
  flex: 0 0 auto;
  align-self: flex-end;
  min-width: 20px;
  border-bottom: 1px dotted var(--line);
  transform: translateY(-3px);
  flex-grow: 1;
}

.toc-page {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.toc-chapter .toc-page { color: var(--text); }

/* ---------- share-dialoog ---------- */

#share {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 10, 17, 0.72);
  animation: fade 0.18s var(--ease);
}

@keyframes fade { from { opacity: 0; } }

#share[hidden] { display: none; }

#share-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--chrome-solid);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

#share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

#share-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 18px;
}

.share-net {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.share-net svg { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }
.share-net[data-net="email"] svg,
.share-net[data-net="native"] svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.share-net:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--nitto-navy-light); transform: translateY(-1px); }
.share-net:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.share-net[data-net="linkedin"]:hover { color: #4a9fe0; }
.share-net[data-net="whatsapp"]:hover { color: #4ad07d; }

#share-copy {
  display: flex;
  gap: 8px;
  padding: 0 18px 18px;
}

#share-url {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
}

#share-copy-btn {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: var(--nitto-navy);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
#share-copy-btn:hover { background: var(--nitto-navy-light); }
#share-copy-btn.is-done { background: #2e9e63; }

/* ---------- zoom ---------- */

#zoom {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(9, 10, 17, 0.97);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

#zoom[hidden] { display: none; }
#zoom.is-panning { cursor: grabbing; }

#zoom-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

#zoom-bar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--chrome-solid);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#zoom-level {
  min-width: 52px;
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ---------- loader ---------- */

#loader {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 13px;
  transition: opacity 0.35s var(--ease);
}

#loader.is-done { opacity: 0; pointer-events: none; }

.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--nitto-navy-light);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}

.noscript a { color: var(--nitto-navy-light); }

/* ---------- klein scherm ---------- */

@media (max-width: 720px) {
  :root { --toolbar-h: 54px; --masthead-h: 0px; }
  /* Niet display:none — dan verdwijnt de grid-rij en schuift het podium in de
     verkeerde track (auto i.p.v. 1fr), met een gat onder de werkbalk. De rij
     blijft bestaan met hoogte 0. */
  #masthead {
    height: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
  }
  #masthead h1 { display: none; }
  #stage { padding: 10px; }
  /* Werkbalk mag horizontaal scrollen als alle knoppen niet passen, i.p.v.
     eroverheen te lopen. */
  #toolbar {
    gap: 0;
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px) / 2);
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #toolbar::-webkit-scrollbar { display: none; }
  .tb { min-width: 36px; padding: 0 5px; flex: 0 0 auto; }
  .tb-divider { margin: 0 2px; }
  #btn-download { display: none; }

  #thumbs { padding: 10px 8px; }
  .thumb { width: 116px; }
  .strip-nav { display: none; }         /* op touch scroll je gewoon met de vinger */
  #thumbs { padding-right: 34px; }
  .strip-close { top: 4px; right: 6px; }

  #share-buttons { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .tb-mode { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #slide-viewport .page { transition: none; }
  .spinner { animation-duration: 2.4s; }
}
