/* =============================================
   CASES PAGE — catalog layout (cr-* prefix)
   ============================================= */

main.blocks.cases-page {
  gap: 20px !important;
}

.cr-hero {
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cr-back__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 8px 6px;
  background: var(--color-white-second);
  border-radius: 50px;
  font-family: 'Onest', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-grey);
  text-decoration: none;
  transition: color 0.2s;
  align-self: flex-start;
}

.cr-back__link:hover {
  background: var(--color-white-second);
  color: var(--color-grey);
}

.cr-hero__title {
  font-size: 48px;
  line-height: 52px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-black);
  margin: 0;
}

.cr-hero__desc {
  font-size: 20px;
  line-height: 26px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--color-black);
  max-width: 860px;
  margin: 0;
}

/* ---- stats: 4 in a row, no heavy cards ---- */
.cr-stats {
  margin: 0 32px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--color-white-second, #F3F3F3);
  border-radius: 24px;
  overflow: hidden;
}

.cr-stats__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 28px 24px;
  border-right: 1px solid #D9D9DB;
}

.cr-stats__item:last-child {
  border-right: none;
}

.cr-stats__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-orange-second, #FFE4B4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cr-stats__value {
  font-size: 22px;
  line-height: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-black);
}

.cr-stats__label {
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: var(--color-text-grey, #918F99);
}

/* ---- filters ---- */
.cr-filters {
  padding: 0 32px;
}

.cr-filters__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cr-filters__list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: 0;
  padding: 2px 0;
}

.cr-filters__list::-webkit-scrollbar {
  display: none;
}

.cr-filter__btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 16px;
  border-radius: 50px;
  border: 1px solid #D9D9DB;
  background: #fff;
  color: var(--color-black);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cr-filter__btn:hover {
  background: var(--color-white-second, #F3F3F3);
}

.cr-filter__btn.is-active {
  background: var(--color-black, #2B2A32);
  border-color: var(--color-black, #2B2A32);
  color: #fff;
}

.cr-filters__count {
  margin: 0;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: var(--color-text-grey);
  white-space: nowrap;
}

/* ---- case cards ---- */
.cr-list {
  padding: 0 32px 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cr-case {
  background: #fff;
  border: 1px solid #E8E8EA;
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(43, 42, 50, 0.04);
}

.cr-case.is-hidden {
  display: none;
}

.cr-case__body {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.18fr);
  gap: 28px;
  align-items: stretch;
}

.cr-case__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.cr-case__title {
  font-size: 32px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-black);
  margin: 0;
}

.cr-case__addr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-text-grey);
}

.cr-case__addr-icon,
.cr-case__cat-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cr-case__cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 50px;
  background: var(--color-orange-second, #FFE4B4);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-black);
}

.cr-case__done {
  width: 100%;
  padding: 16px 0 0;
  border-top: 1px solid #E8E8EA;
}

.cr-case__done-title {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  color: var(--color-black);
}

.cr-case__done-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px 16px;
  align-items: start;
}

.cr-case__done-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: var(--color-black);
}

.cr-case__done-text {
  min-width: 0;
}

.cr-case__done-list a {
  display: inline;
}

.cr-case__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent, #FDA206);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.cr-case__desc {
  width: 100%;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid #E8E8EA;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  color: var(--color-text-grey);
}

.cr-case__gallery {
  min-width: 0;
}

.cr-case__photos {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  height: 100%;
}

.cr-case__shot {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.cr-case__shot--main {
  grid-column: 1 / -1;
  min-height: 260px;
}

.cr-case__shot--more {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.cr-case__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.cr-case__photo--main {
  min-height: 260px;
  max-height: 320px;
}

.cr-case__photo--thumb {
  height: 108px;
}

.cr-case__badge {
  display: none;
}

.cr-case__more {
  position: absolute;
  inset: 0;
  background: rgba(43, 42, 50, 0.62);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.cr-empty {
  margin: 0;
  padding: 32px;
  text-align: center;
  font-size: 16px;
  color: var(--color-text-grey);
  background: var(--color-white-second);
  border-radius: 20px;
}

.cases-page .cta.blocks__item {
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .cr-case__body {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .cr-case__title {
    font-size: 26px;
    line-height: 30px;
  }

  .cr-case__done-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .cases-page,
  main.blocks.cases-page {
    gap: 16px !important;
  }

  .cr-hero,
  .cr-filters,
  .cr-list {
    padding-left: 24px;
    padding-right: 24px;
  }

  .cr-stats {
    margin: 0 24px;
    grid-template-columns: 1fr 1fr;
  }

  .cr-stats__item {
    padding: 20px 18px;
    border-right: 1px solid #D9D9DB;
    border-bottom: 1px solid #D9D9DB;
  }

  .cr-stats__item:nth-child(2n) {
    border-right: none;
  }

  .cr-stats__item:nth-child(n+3) {
    border-bottom: none;
  }

  .cr-hero__title {
    font-size: 36px;
    line-height: 42px;
  }

  .cr-hero__desc {
    font-size: 16px;
    line-height: 22px;
  }

  .cr-filters__count {
    display: none;
  }

  .cr-case {
    padding: 20px;
  }

  .cr-case__body {
    grid-template-columns: 1fr;
  }

  .cr-case__photos {
    grid-template-columns: 1fr;
  }

  .cr-case__shot--thumb,
  .cr-case__shot--more {
    display: none;
  }

  .cr-case__shot--main {
    min-height: 220px;
  }

  .cr-case__photo--main {
    min-height: 220px;
    max-height: 280px;
  }

  .cr-case__badge {
    display: inline-flex;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 6px 10px;
    border-radius: 50px;
    background: rgba(43, 42, 50, 0.78);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

}

@media (max-width: 480px) {
  .cases-page,
  main.blocks.cases-page {
    gap: 14px !important;
  }

  .cr-hero {
    padding: 16px 16px 0;
    gap: 16px;
  }

  .cr-stats {
    margin-left: 16px;
    margin-right: 16px;
  }

  .cr-filters,
  .cr-list {
    margin-left: 16px;
    margin-right: 16px;
  }

  .cr-filters,
  .cr-list {
    padding-left: 0;
    padding-right: 0;
  }

  .cr-hero__title {
    font-size: 28px;
    line-height: 32px;
  }

  .cr-hero__desc {
    font-size: 15px;
    line-height: 20px;
  }

  .cr-stats {
    border-radius: 20px;
  }

  .cr-stats__item {
    padding: 16px 14px;
    gap: 6px;
  }

  .cr-stats__icon {
    width: 40px;
    height: 40px;
  }

  .cr-stats__value {
    font-size: 16px;
    line-height: 20px;
  }

  .cr-stats__label {
    font-size: 12px;
    line-height: 16px;
  }

  .cr-filter__btn {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }

  .cr-case {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .cr-case__body {
    gap: 14px;
  }

  .cr-case__info {
    padding: 0 2px;
    gap: 10px;
  }

  .cr-case__title {
    font-size: 22px;
    line-height: 26px;
  }

  .cr-case__done-list {
    grid-template-columns: 1fr;
  }

  .cr-case__shot--main,
  .cr-case__photo--main {
    min-height: 220px;
    max-height: 260px;
    border-radius: 20px;
  }

  .cr-case__desc {
    padding-top: 12px;
  }
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lb {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lb.is-open {
  display: flex;
}

.lb__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100vw - 160px);
  height: calc(100vh - 80px);
  overflow: hidden;
  touch-action: none;
  flex-shrink: 0;
}

.lb__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  border-radius: 8px;
  transition: opacity 0.18s ease;
}

.lb__close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background 0.2s;
  flex-shrink: 0;
}

.lb__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lb__arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background 0.2s, opacity 0.2s;
}

.lb__arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lb__arrow[disabled] {
  opacity: 0.2;
}

.lb__arrow--prev {
  left: 16px;
}

.lb__arrow--next {
  right: 16px;
}

.lb__counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .lb__stage {
    width: 100vw;
    height: calc(100vh - 100px);
  }

  .lb__arrow {
    width: 40px;
    height: 40px;
  }

  .lb__arrow--prev {
    left: 8px;
  }

  .lb__arrow--next {
    right: 8px;
  }
}

/* align-20261008 */
.cr-hero__desc,
.cr-case__desc {
  max-width: none;
  width: 100%;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* text-unify-20261008 */
.cr-hero__desc,
.cr-case__desc {
  color: #5C5A63;
  font-family: Onest, sans-serif;
  font-weight: 400;
}
