/* =====================================================================
   M.M GROMADA — realizacje: zakładki, galeria, podgląd
   ===================================================================== */

.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.tab {
  background: var(--paper); border: 1px solid var(--line); color: var(--carbon);
  padding: 11px 18px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 500;
  transition: all .2s var(--ease);
}
.tab:hover { border-color: var(--amber); }
.tab[aria-selected="true"] { background: var(--carbon); color: #fff; border-color: var(--carbon); }
.tab .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #c9c1b4; margin-right: 8px; vertical-align: middle; }
.tab[aria-selected="true"] .dot { background: var(--amber); }
.tab .n { margin-left: 6px; color: var(--mercury); font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .n { color: #a9a9ad; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.shot {
  position: relative; border: 0; padding: 0; margin: 0; background: var(--line);
  border-radius: var(--radius-tile); overflow: hidden; aspect-ratio: 4/3; cursor: pointer;
  text-align: left; color: inherit;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.shot:hover img { transform: scale(1.06); }
.shot-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(14,14,15,.85), rgba(14,14,15,0));
  color: #fff; font-size: 14px; font-weight: 500; padding: 34px 22px 18px;
}
.shot-cap span { display: block; font-weight: 400; font-size: 12px; color: #d4d4d7; margin-top: 3px; }
.shot-badge {
  position: absolute; top: 16px; left: 16px;
  display: inline-flex; gap: 6px;
}
.shot-badge span {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: var(--radius-pill); background: var(--amber); color: var(--carbon);
}
.shot:focus-visible { outline: 3px solid var(--carbon); outline-offset: 3px; }

.gallery-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px;
  min-height: 280px; padding: 48px 24px;
  background: var(--vellum); border: 1px solid var(--line); border-radius: var(--radius-tile);
}
.gallery-state .mark { width: 12px; height: 12px; background: var(--amber); }
.gallery-state .gs-title { font-size: 1.2rem; font-weight: 400; color: var(--carbon); margin: 4px 0 0; }
.gallery-state .gs-sub { font-size: 14px; color: var(--mercury); max-width: 46ch; margin: 0; }
.gallery-state .gs-sub a { color: var(--carbon); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.gallery-state .spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--carbon);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Podgląd ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center;
  background: rgba(14,14,15,.97); padding: 70px 24px 90px; overscroll-behavior: contain;
}
.lightbox.open { display: grid; }
/* poziome przesunięcie palcem trafia do skryptu (zmiana zdjęcia), szczypanie nadal powiększa */
.lb-stage { display: grid; place-items: center; width: 100%; height: 100%; touch-action: pinch-zoom; }
.lb-img { max-width: min(1100px, 92vw); max-height: 100%; width: auto; height: auto; border-radius: 20px; object-fit: contain; }
.lb-close {
  position: absolute; top: 16px; right: 18px; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 0; color: #fff; font-size: 28px; line-height: 1;
}
.lb-close:hover { background: rgba(255,255,255,.2); }
.lb-cap { position: absolute; bottom: 26px; left: 90px; right: 90px; text-align: center; color: #e6e6e8; font-size: 14px; }
.lb-cap small { display: block; color: #a9a9ad; font-size: 12.5px; margin-top: 3px; }
.lb-count { position: absolute; top: 28px; left: 24px; color: #a9a9ad; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center;
}
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-nav svg { width: 22px; height: 22px; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-nav[disabled] { opacity: .25; cursor: default; }

/* Przed / po */
.cmp { position: relative; max-width: min(1100px, 92vw); max-height: 100%; border-radius: 20px; overflow: hidden; user-select: none; touch-action: none; }
.cmp img { display: block; max-width: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); width: auto; height: auto; -webkit-user-drag: none; }
.cmp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--cut, 50%)); }
.cmp-after img { width: 100%; height: 100%; object-fit: cover; max-height: none; }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 2px; background: var(--amber); transform: translateX(-1px); pointer-events: none; }
.cmp-knob {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--amber); color: var(--carbon); display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.cmp-knob svg { width: 20px; height: 20px; }
.cmp-lbl {
  position: absolute; top: 14px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 10px; border-radius: var(--radius-pill); background: rgba(14,14,15,.75); color: #fff; pointer-events: none;
}
.cmp-lbl--b { left: 14px; }
.cmp-lbl--a { right: 14px; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }

@media (max-width: 640px) {
  /* pasek zakładek przewijany palcem od krawędzi do krawędzi — margines = --gutter, więc nigdy nie wystaje */
  .tabs {
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
    padding-bottom: 4px; margin-bottom: 22px;
    scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; scroll-snap-align: start; padding: 12px 18px; min-height: 44px; }
  .gallery { grid-template-columns: 1fr; gap: 12px; }
  .shot { border-radius: 22px; }
  .shot-cap { padding: 30px 18px 16px; }
  .gallery-state { border-radius: 22px; min-height: 220px; padding: 36px 20px; }
  .lightbox {
    padding: calc(64px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .lb-close { top: calc(12px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
  .lb-count { top: calc(26px + env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); }
  .lb-img { border-radius: 14px; max-width: 100%; }
  .cmp { max-width: 100%; border-radius: 14px; }
  .lb-nav { top: auto; bottom: calc(22px + env(safe-area-inset-bottom)); transform: none; width: 48px; height: 48px; }
  .lb-prev { left: max(12px, env(safe-area-inset-left)); }
  .lb-next { right: max(12px, env(safe-area-inset-right)); }
  .lb-cap { left: 72px; right: 72px; bottom: calc(24px + env(safe-area-inset-bottom)); font-size: 13px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .gallery { grid-template-columns: 1fr 1fr; }
}
@media (hover: none) {
  .shot:hover img { transform: none; }
  .shot:active img { transform: scale(1.03); }
  .tab:hover { border-color: var(--line); }
  .tab[aria-selected="true"]:hover { border-color: var(--carbon); }
}
