/* Chorkuma Bilder – responsive images + lightbox */

.ckb-img {
  max-width: 100%;
  height: auto;
}

/* ---------- clickable images ---------- */

a.ckb-link {
  --ckb-accent: #f0bc03;
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  vertical-align: top;
  cursor: zoom-in;
  border-radius: 3px;
  outline-offset: 3px;
}

a.ckb-link--center {
  display: table;
  margin-left: auto;
  margin-right: auto;
}

a.ckb-link .ckb-img {
  border-radius: inherit;
  transition: box-shadow .3s ease, filter .3s ease;
}

a.ckb-link::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ckb-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 20px no-repeat;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .25s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}

@media (hover: hover) {
  a.ckb-link:hover .ckb-img,
  a.ckb-link:focus-visible .ckb-img {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
    filter: brightness(1.04);
  }

  a.ckb-link:hover::after,
  a.ckb-link:focus-visible::after {
    opacity: 1;
    transform: scale(1);
  }
}

a.ckb-link:focus-visible {
  outline: 3px solid var(--ckb-accent);
}

/* ---------- lightbox ---------- */

html.ckb-lock {
  overflow: hidden;
  padding-right: var(--ckb-scrollbar, 0);
}

.ckb-lb {
  --ckb-accent: #f0bc03;
  --ckb-accent-dark: #9c8328;
  --ckb-bg: rgba(16, 14, 8, .94);
  --ckb-ui: rgba(255, 255, 255, .08);
  position: fixed;
  inset: 0;
  /* above the cookie "reopen" button (99997), below an open cookie banner (99999) */
  z-index: 99998;
  display: grid;
  place-items: center;
  color: #f4f1e8;
  -webkit-tap-highlight-color: transparent;
}

.ckb-lb[hidden] {
  display: none;
}

.ckb-lb__backdrop {
  position: absolute;
  inset: 0;
  background: var(--ckb-bg);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ckb-lb__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 64px 88px 24px;
  box-sizing: border-box;
  touch-action: none;
}

.ckb-lb__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.ckb-lb__cap {
  max-width: 70ch;
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
  color: rgba(244, 241, 232, .88);
}

.ckb-lb__count {
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--ckb-accent);
}

.ckb-lb__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ckb-ui);
  color: var(--ckb-accent);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.ckb-lb__btn[hidden] {
  display: none;
}

.ckb-lb__btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ckb-lb__btn:hover {
  background: var(--ckb-accent);
  color: #1e1a0c;
}

.ckb-lb__btn:active {
  transform: scale(.94);
}

.ckb-lb__btn:focus-visible {
  outline: 3px solid var(--ckb-accent);
  outline-offset: 3px;
}

.ckb-lb__close {
  top: 12px;
  right: 16px;
}

.ckb-lb__prev,
.ckb-lb__next {
  top: 50%;
  margin-top: -26px;
}

.ckb-lb__prev {
  left: 20px;
}

.ckb-lb__next {
  right: 20px;
}

.ckb-lb__prev:active,
.ckb-lb__next:active {
  transform: scale(.94);
}

.ckb-lb__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(240, 188, 3, .25);
  border-top-color: var(--ckb-accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity .2s ease .25s;
  pointer-events: none;
}

.ckb-lb.is-loading .ckb-lb__spinner {
  opacity: 1;
  animation: ckb-spin .8s linear infinite;
}

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

/* Phones: arrows at the bottom, full-width image */
@media (max-width: 700px) {
  .ckb-lb__stage {
    padding: 60px 8px 96px;
  }

  .ckb-lb__img {
    max-height: calc(100dvh - 190px);
  }

  .ckb-lb__prev,
  .ckb-lb__next {
    top: auto;
    bottom: 20px;
    margin-top: 0;
  }

  .ckb-lb__prev {
    left: calc(50% - 66px);
  }

  .ckb-lb__next {
    right: calc(50% - 66px);
  }

  .ckb-lb__count {
    top: 26px;
    left: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.ckb-link .ckb-img,
  a.ckb-link::after,
  .ckb-lb__btn {
    transition: none;
  }
}
