/* Segmenta Katalog – bläddringsbar katalog */
.sgk {
  --sgk-navy: #384858;
  --sgk-navy-2: #2b3846;
  --sgk-green: #70ac7c;
  --sgk-bg: #eef0f2;
  --sgk-ink: #ffffff;
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 1.5em;
  background: var(--sgk-bg);
  border-radius: 6px;
  overflow: hidden;
  outline: none;
  font-family: inherit;
  line-height: 1.2;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sgk:focus-visible { box-shadow: 0 0 0 3px var(--sgk-green); }
.sgk *, .sgk *::before, .sgk *::after { box-sizing: border-box; }
.sgk:not(.sgk--ready) { min-height: 300px; }

/* scen och bok */
.sgk .sgk-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.sgk .sgk-book {
  position: relative;
  display: flex;
  flex: none;
  perspective: 2400px;
  will-change: transform;
}
.sgk--spread .sgk-book:not(.sgk-book--solo)::after {
  /* skugga i bokryggen */
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 60px;
  margin-left: -30px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,.10) 46%, rgba(0,0,0,.18) 50%, rgba(0,0,0,.10) 54%, rgba(0,0,0,0) 100%);
  z-index: 3;
}
.sgk .sgk-slot {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  overflow: hidden;
}
.sgk .sgk-page {
  position: absolute;
  inset: 0;
  background: #fff;
  overflow: hidden;
}
.sgk .sgk-page:not(.sgk-page--loaded):not(.sgk-page--blank)::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(56,72,88,.15);
  border-top-color: var(--sgk-navy);
  border-radius: 50%;
  animation: sgk-spin .8s linear infinite;
}
@keyframes sgk-spin { to { transform: rotate(360deg); } }
.sgk .sgk-page--blank { background: transparent; }
.sgk--spread .sgk-slot .sgk-page:not(.sgk-page--blank),
.sgk--single .sgk-slot .sgk-page { box-shadow: 0 6px 24px rgba(30,40,50,.18), 0 1px 3px rgba(30,40,50,.12); }
.sgk .sgk-img,
.sgk-zoom .sgk-img {
  position: absolute;
  top: 0; left: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  object-fit: cover;
  pointer-events: none;
}

/* länkar */
.sgk .sgk-links, .sgk-zoom .sgk-links { position: absolute; inset: 0; z-index: 2; }
.sgk .sgk-link, .sgk-zoom .sgk-link {
  position: absolute;
  display: block;
  border: 0 !important;
  background: transparent;
  text-decoration: none !important;
  box-shadow: none;
  border-radius: 2px;
  transition: background-color .15s, box-shadow .15s;
  cursor: pointer;
}
.sgk .sgk-link:hover, .sgk-zoom .sgk-link:hover {
  background: rgba(112,172,124,.10);
  box-shadow: inset 0 0 0 2px rgba(112,172,124,.85);
}
.sgk .sgk-link:focus-visible, .sgk-zoom .sgk-link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--sgk-green, #70ac7c);
}

/* bläddring */
.sgk .sgk-leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  z-index: 5;
  pointer-events: none;
}
.sgk .sgk-leaf--fwd { left: 50%; transform-origin: 0 50%; }
.sgk .sgk-leaf--back { left: 0; transform-origin: 100% 50%; }
.sgk .sgk-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}
.sgk .sgk-face--back { transform: rotateY(180deg); }
.sgk .sgk-face .sgk-page { box-shadow: 0 6px 24px rgba(30,40,50,.18); }
.sgk .sgk-shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 4;
  pointer-events: none;
}
.sgk .sgk-leaf--fwd .sgk-face--front .sgk-shade { background: linear-gradient(to right, rgba(0,0,0,.55), rgba(0,0,0,.05)); }
.sgk .sgk-leaf--fwd .sgk-face--back .sgk-shade { background: linear-gradient(to left, rgba(0,0,0,.55), rgba(0,0,0,.05)); }
.sgk .sgk-leaf--back .sgk-face--front .sgk-shade { background: linear-gradient(to left, rgba(0,0,0,.55), rgba(0,0,0,.05)); }
.sgk .sgk-leaf--back .sgk-face--back .sgk-shade { background: linear-gradient(to right, rgba(0,0,0,.55), rgba(0,0,0,.05)); }
.sgk .sgk-book--flipping .sgk-links { pointer-events: none; }

/* knappar */
.sgk .sgk-btn, .sgk-zoom .sgk-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sgk-ink, #fff);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s, opacity .15s;
}
.sgk .sgk-btn svg, .sgk-zoom .sgk-btn svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sgk .sgk-btn:hover, .sgk-zoom .sgk-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sgk .sgk-btn:focus-visible, .sgk-zoom .sgk-btn:focus-visible { outline: 2px solid var(--sgk-green, #70ac7c); outline-offset: 1px; }
.sgk .sgk-btn:disabled, .sgk-zoom .sgk-btn:disabled { opacity: .35; cursor: default; background: transparent; }

.sgk .sgk-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 10px;
  background: var(--sgk-navy);
  color: var(--sgk-ink);
}
.sgk .sgk-group { display: flex; align-items: center; gap: 2px; flex: 1 1 0; }
.sgk .sgk-group:last-child { justify-content: flex-end; }
.sgk .sgk-group--nav { flex: 0 0 auto; justify-content: center; }
.sgk .sgk-counter { min-width: 92px; font-variant-numeric: tabular-nums; }
.sgk .sgk-counter .sgk-of { opacity: .65; margin-left: 2px; }

.sgk .sgk-side {
  position: absolute;
  top: 50%;
  z-index: 8;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
  background: rgba(56,72,88,.88);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.sgk .sgk-side:hover { background: var(--sgk-navy-2); }
.sgk .sgk-side:disabled { opacity: 0; pointer-events: none; }
.sgk .sgk-side--prev { left: 10px; }
.sgk .sgk-side--next { right: 10px; }
.sgk--single .sgk-side { width: 38px; height: 38px; margin-top: -19px; min-width: 0; padding: 0; background: rgba(56,72,88,.55); }
.sgk--single .sgk-side--prev { left: 4px; }
.sgk--single .sgk-side--next { right: 4px; }

/* miniatyrer */
.sgk .sgk-thumbs {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  background: rgba(43,56,70,.97);
  color: #fff;
}
.sgk--thumbs .sgk-thumbs { display: flex; }
.sgk .sgk-thumbs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 18px;
  font-size: 16px;
  font-weight: 600;
}
.sgk .sgk-thumbs-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 16px 12px;
  padding: 6px 18px 24px;
  align-content: start;
}
.sgk .sgk-thumb {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.75);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  box-shadow: none;
  text-transform: none;
}
.sgk .sgk-thumb img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 180 / 255;
  max-width: none !important;
  margin: 0 !important;
  background: #fff;
  border: 0 !important;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  outline: 3px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s, transform .15s;
}
.sgk .sgk-thumb:hover img { transform: translateY(-2px); }
.sgk .sgk-thumb:hover, .sgk .sgk-thumb:focus { background: transparent; color: #fff; }
.sgk .sgk-thumb:focus-visible { outline: none; }
.sgk .sgk-thumb:focus-visible img, .sgk .sgk-thumb--cur img { outline-color: var(--sgk-green); }
.sgk .sgk-thumb--cur { color: #fff; font-weight: 600; }

/* helskärm */
.sgk:fullscreen { width: 100vw; height: 100vh; max-width: none; margin: 0; border-radius: 0; display: flex; flex-direction: column; }
.sgk:-webkit-full-screen { width: 100vw; height: 100vh; max-width: none; margin: 0; border-radius: 0; }
.sgk.sgk--fs {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: 100vw;
  height: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
}
.sgk--is-fs .sgk-stage { flex: 1; }
html.sgk-noscroll, html.sgk-noscroll body { overflow: hidden !important; }

/* zoom */
.sgk-zoom {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: none;
  background: rgba(30,38,47,.97);
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}
.sgk-zoom.sgk-zoom--open { display: block; }
.sgk-zoom *, .sgk-zoom *::before { box-sizing: border-box; }
.sgk-zoom .sgk-zoom-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.sgk-zoom .sgk-zoom-scroll.sgk-dragging { cursor: grabbing; }
.sgk-zoom .sgk-zoom-scroll.sgk-dragging .sgk-link { pointer-events: none; }
.sgk-zoom .sgk-zoom-inner {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 0 80px;
  margin: 0 auto;
}
.sgk-zoom .sgk-page { position: relative; flex: none; background: #fff; }
.sgk-zoom .sgk-zoom-tools {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  background: #384858;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.sgk-zoom .sgk-zoom-close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #384858;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}

/* skärmläsare */
.sgk .sgk-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* små skärmar */
@media (max-width: 480px) {
  .sgk { border-radius: 0; }
  .sgk .sgk-hide-xs { display: none; }
  .sgk .sgk-bar { padding: 4px 6px; }
  .sgk .sgk-counter { min-width: 72px; }
  .sgk .sgk-thumbs-grid { grid-template-columns: repeat(3, 1fr); padding: 6px 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .sgk *, .sgk-zoom * { transition: none !important; animation-duration: .01s !important; }
}
