/* ============================================================================
   SIGVIN — Референция (общий компонент: главная block 9 + страница проекта)
   .refdoc — карточка-документ (Figma 329:5760): тёмная зона «REFERENCJA PDF»
     (gframe-обводка white 12%→0) + пунктирная рамка с листом, снизу белая полоса
     «Zobacz referencję ↗». Кнопка, клик → шифтскрин.
   .refm — шифтскрин (Figma 729:3290), калька дравера вакансий (kariera .vacm):
     правый дравер; на телефоне (≤767) — bottom-sheet. Логика — referencja.js.
   ========================================================================== */

.refdoc {
  display: flex; flex-direction: column;
  width: 100%; height: 100%; min-height: 0;
  padding: 0; border: 0; cursor: pointer; text-align: center;
  border-radius: 12px;
  /* белый фон только под полосой CTA (+12px под скруглёнными углами тёмной зоны) */
  background: linear-gradient(var(--light-white), var(--light-white)) bottom / 100% 52px no-repeat;
}
.refdoc__view {
  flex: 1 0 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 4px 4px;
  border-radius: 12px;
  background: var(--dark-black);
  overflow: hidden;
  /* Linear-обводка white 12% → 0 вместо сплошного белого канта */
  --glass-border: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 100%);
}
.refdoc__label { color: var(--light-white); }
.refdoc__frame {
  flex: 1 0 0; min-height: 0; width: 100%;
  display: block;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  background: var(--light-4);
  overflow: hidden;
}
.refdoc__img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform .5s cubic-bezier(0.22, 1, 0.36, 1);
}
.refdoc:hover .refdoc__img { transform: scale(1.04); }
.refdoc__cta {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 0;
  color: var(--dark-black); white-space: nowrap;
}
.refdoc__cta svg { width: 20px; height: 20px; transform: rotate(-45deg); transition: transform .4s cubic-bezier(0.22, 1, 0.36, 1); }
.refdoc:hover .refdoc__cta svg { transform: rotate(-45deg) translateX(3px); }
.refdoc:focus-visible { outline: 2px solid var(--light-white); outline-offset: 2px; }

/* ---- шифтскрин ---- */
.refm {
  position: fixed; inset: 0; z-index: 200;
  display: flex; justify-content: flex-end; align-items: stretch;
  padding: 48px 24px 24px;
  background: var(--dark-64);
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.refm.is-open { opacity: 1; visibility: visible; }
body.refm-lock { overflow: hidden; }
.refm__panel {
  position: relative; width: 534px; max-width: 100%;
  display: flex; flex-direction: column;
  background: var(--light-white); border-radius: 32px;
  transform: translateX(32px); opacity: 0;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .4s ease;
}
.refm.is-open .refm__panel { transform: none; opacity: 1; }
.refm__close {
  position: absolute; top: -20px; right: 30px; z-index: 3;
  width: 56px; height: 40px; flex: none; padding: 0; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-pill);
  color: var(--light-white);
  background-color: var(--dark-64);
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--light-16);
  transition: transform .2s ease;
}
.refm__close:hover { transform: scale(1.08); }
.refm__close svg { width: 20px; height: 20px; }
.refm__head { display: flex; justify-content: center; padding: 12px; }
.refm__title { color: var(--dark-black); }
.refm__scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 12px;   /* многостраничный документ — листы друг под другом */
  padding: 16px;
  background: var(--light-light); border-radius: 24px;
  scrollbar-width: thin;
}
.refm__img { display: block; width: 100%; height: auto; flex: none; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  .refdoc__img, .refdoc__cta svg, .refm, .refm__panel { transition: none; }
}

/* правый дравер до планшета включительно; bottom-sheet — только на телефоне */
@media (max-width: 767px) {
  .refm { padding: 72px 0 0; }
  .refm__panel { width: 100%; border-radius: 32px 32px 0 0; transform: translateY(40px); }
  .refm__scroll { border-radius: 24px 24px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
