.page-portfolio {
  align-items: flex-start;
  padding-top: 28px;
  padding-bottom: 56px;
}

.portfolio-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 4px;
}

.portfolio-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 24px 28px;
  background: var(--white-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.portfolio-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  margin-bottom: 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--green-light) 0%, var(--green) 100%);
  border-radius: 100px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-back:hover {
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(45, 106, 79, 0.3);
}

.portfolio-back svg {
  opacity: 0.9;
}

.portfolio-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  color: var(--text);
  margin-bottom: 8px;
}

.portfolio-lead {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ===== Вкладки и вид ===== */
.portfolio-controls {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 24px;
}

.portfolio-tabs {
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding: 6px;
  background: var(--white-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.portfolio-view {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  padding: 6px;
  background: var(--white-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.portfolio-view__btn {
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.portfolio-view__btn:hover {
  color: var(--green);
  background: rgba(216, 243, 220, 0.5);
}

.portfolio-view__btn.is-active {
  color: var(--white);
  background: linear-gradient(135deg, var(--green-light), var(--green));
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
}

.portfolio-tab {
  flex: 1;
  min-width: 100px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.portfolio-tab:hover {
  color: var(--green);
  background: rgba(216, 243, 220, 0.5);
}

.portfolio-tab.is-active {
  color: var(--white);
  background: linear-gradient(135deg, var(--green-light), var(--green));
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
}

/* ===== Панели разделов ===== */
.portfolio-panel {
  animation: panelIn 0.35s ease;
}

.portfolio-panel[hidden] {
  display: none;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portfolio-panel__inner {
  padding: 22px 22px 24px;
  background: var(--white-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.portfolio-panel__intro {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* ===== Карточки проектов ===== */
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.case-card {
  display: flex;
  flex-direction: column;
  background: var(--white-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.case-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(27, 67, 50, 0.16);
}

.case-card__cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--green-soft);
  position: relative;
}

.case-card__cover .carousel {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.case-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-card__cover {
  cursor: pointer;
}

.case-card__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  transition: background 0.2s ease;
}

.case-card__cover:hover::after {
  background: rgba(27, 67, 50, 0.08);
}

.case-card__cover .carousel__btn {
  z-index: 4;
}

.case-card__cover .carousel__counter {
  z-index: 4;
}

.case-card__icon {
  display: none;
}

/* ===== Карусель ===== */
.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.carousel__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.carousel__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--green);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.12);
  transition: background 0.2s ease, color 0.2s ease;
}

.carousel__btn:hover {
  background: var(--green-soft);
  color: var(--green);
}

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

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

.carousel__counter {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 3;
  padding: 3px 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(27, 67, 50, 0.55);
  border-radius: 100px;
}

.case-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 16px;
}

.case-card__tag {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-light);
  margin-bottom: 6px;
}

.case-card__title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.case-card__desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 14px;
}

.case-card__btn {
  width: 100%;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.case-card__btn:hover {
  background: var(--green-soft);
  border-color: rgba(45, 106, 79, 0.35);
  color: var(--green);
}

/* ===== Неактивные карточки (архив / в процессе) ===== */
.case-card--disabled {
  cursor: default;
}

.case-card--disabled:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.case-card--disabled .case-card__cover {
  cursor: default;
  filter: grayscale(0.5) opacity(0.8);
}

.case-card--disabled .case-card__cover::after,
.case-card--disabled .case-card__cover:hover::after {
  background: rgba(82, 121, 111, 0.1);
}

.case-card__status {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--white);
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.case-card__status::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}

.case-card__status--archive {
  background: rgba(82, 121, 111, 0.88);
}

.case-card__status--progress {
  background: rgba(199, 130, 24, 0.92);
}

.case-card__btn--disabled {
  color: var(--text-muted);
  background: rgba(82, 121, 111, 0.08);
  border-color: rgba(82, 121, 111, 0.18);
  cursor: not-allowed;
}

.case-card__btn--disabled:hover {
  background: rgba(82, 121, 111, 0.08);
  border-color: rgba(82, 121, 111, 0.18);
  color: var(--text-muted);
}

/* ===== Вид списком ===== */
body.is-list-view .case-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

body.is-list-view .case-card {
  flex-direction: row;
  align-items: stretch;
  min-height: 108px;
}

body.is-list-view .case-card:hover {
  transform: translateY(-1px);
}

body.is-list-view .case-card:not(.case-card--disabled) {
  cursor: pointer;
}

body.is-list-view .case-card:not(.case-card--disabled)::after {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  align-self: center;
  margin-right: 16px;
  background: currentColor;
  color: var(--green-muted);
  opacity: 0.7;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.is-list-view .case-card__cover {
  width: 108px;
  min-width: 108px;
  aspect-ratio: auto;
  flex-shrink: 0;
}

body.is-list-view .case-card__cover img,
body.is-list-view .case-card__cover .carousel,
body.is-list-view .case-card__cover::after {
  display: none;
}

body.is-list-view .case-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  z-index: 1;
  color: var(--green);
}

body.is-list-view .case-card__icon svg {
  width: 52px;
  height: 52px;
}

body.is-list-view .case-card--disabled .case-card__icon {
  color: var(--text-muted);
}

body.is-list-view .case-card__cover .case-card__status {
  display: none;
}

body.is-list-view .case-card__status--inline {
  position: static;
  display: inline-flex;
  width: fit-content;
  margin: 0;
  box-shadow: none;
}

.case-card__status--inline {
  display: none;
}

body.is-list-view .case-card__body {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  column-gap: 8px;
  row-gap: 4px;
  padding: 14px 12px 14px 18px;
  min-width: 0;
}

body.is-list-view .case-card__tag {
  grid-column: 1;
  margin-bottom: 0;
  align-self: center;
}

body.is-list-view .case-card__status--inline {
  grid-column: 2;
  justify-self: start;
  align-self: center;
}

body.is-list-view .case-card__title,
body.is-list-view .case-card__desc {
  grid-column: 1 / -1;
}

body.is-list-view .case-card__title {
  margin-bottom: 0;
  font-size: 1.125rem;
}

body.is-list-view .case-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

body.is-list-view .case-card__btn {
  display: none;
}

/* ===== Панель «Подробнее» ===== */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(27, 67, 50, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.detail-overlay.is-visible {
  opacity: 1;
}

.detail-panel {
  position: fixed;
  z-index: 201;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: min(88vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 28px 60px rgba(27, 67, 50, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.detail-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.detail-panel[hidden] {
  display: none !important;
}

/* ===== iOS Safari: снимаем лишние backdrop-filter слои, пока открыта
   панель подробностей или лайтбокс — иначе несколько «стеклянных»
   блюров друг на друге иногда залипают смазанным кадром вместо контента ===== */
body.detail-open .portfolio-header,
body.detail-open .portfolio-controls,
body.detail-open .portfolio-tabs,
body.detail-open .portfolio-view,
body.detail-open .portfolio-panel__inner,
body.detail-open .case-card,
body.lightbox-open .portfolio-header,
body.lightbox-open .portfolio-controls,
body.lightbox-open .portfolio-tabs,
body.lightbox-open .portfolio-view,
body.lightbox-open .portfolio-panel__inner,
body.lightbox-open .case-card,
body.lightbox-open .detail-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.detail-panel__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.detail-panel__close:hover {
  color: var(--green);
  background: var(--green-soft);
}

.detail-panel__cover {
  aspect-ratio: 16 / 9;
  background: var(--green-soft);
  position: relative;
}

.detail-panel__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-panel__cover .carousel {
  aspect-ratio: 16 / 9;
}

.detail-panel__content {
  padding: 22px 24px 28px;
}

.detail-panel__tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-light);
  margin-bottom: 8px;
}

.detail-panel__title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.3;
  padding-right: 32px;
}

.detail-panel__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.detail-panel__text p + p {
  margin-top: 12px;
}

.detail-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.detail-panel__link,
.detail-panel__file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.detail-panel__link:hover,
.detail-panel__file:hover {
  background: #b7e4c7;
  border-color: rgba(45, 106, 79, 0.35);
}

.detail-panel__link--primary {
  color: var(--white);
  background: var(--green-light);
  border-color: transparent;
}

.detail-panel__link--primary:hover {
  background: var(--green);
  color: var(--white);
}

@media (max-width: 768px) {
  .page-portfolio {
    padding: 16px 12px 40px;
  }

  .portfolio-header {
    padding: 18px 16px 16px;
    margin-bottom: 12px;
  }

  .portfolio-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-bottom: 14px;
    padding: 4px;
    background: var(--white-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .portfolio-tabs,
  .portfolio-view {
    background: none;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
  }

  .portfolio-tabs {
    flex: 1;
    min-width: 0;
    width: auto;
    flex-wrap: nowrap;
    gap: 2px;
  }

  .portfolio-tab {
    min-width: 0;
    padding: 9px 6px;
    font-size: 0.75rem;
    border-radius: 10px;
  }

  .portfolio-view {
    flex-shrink: 0;
    margin-left: 2px;
    padding-left: 4px;
    border-left: 1px solid var(--border);
    gap: 2px;
  }

  .portfolio-view__btn {
    width: 36px;
    height: 36px;
  }

  .portfolio-panel__inner {
    padding: 16px 14px 16px;
  }

  .portfolio-panel__intro {
    margin-bottom: 14px;
    font-size: 0.8125rem;
  }

  .case-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .case-card__cover {
    aspect-ratio: 16 / 9;
  }

  body.is-list-view .case-card {
    min-height: 0;
  }

  body.is-list-view .case-card__cover {
    width: 72px;
    min-width: 72px;
  }

  body.is-list-view .case-card__icon svg {
    width: 34px;
    height: 34px;
  }

  body.is-list-view .case-card__body {
    padding: 10px 8px 10px 12px;
    row-gap: 3px;
  }

  body.is-list-view .case-card__title {
    font-size: 1rem;
  }

  body.is-list-view .case-card:not(.case-card--disabled)::after {
    margin-right: 10px;
  }
}

@media (max-width: 640px) {
  .detail-panel {
    top: auto;
    bottom: 0;
    left: 0;
    transform: translateY(100%);
    width: 100%;
    max-width: none;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  .detail-panel.is-open {
    transform: translateY(0);
    visibility: visible;
  }
}

/* ===== Lightbox — полный размер ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 35, 25, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.is-visible {
  opacity: 1;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 301;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  line-height: 1;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--green);
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox__nav:hover {
  background: var(--green-soft);
  transform: translateY(-50%) scale(1.05);
}

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

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

.lightbox__nav[hidden] {
  display: none;
}

.lightbox__stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(1100px, 96vw);
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.lightbox__image {
  max-width: 100%;
  max-height: min(78vh, 860px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  user-select: none;
  transform-origin: center center;
  transition: transform 0.15s ease;
  cursor: zoom-in;
  touch-action: none;
}

.lightbox__image.is-zoomed {
  cursor: grab;
}

.lightbox__image.is-dragging {
  cursor: grabbing;
  transition: none;
}

.lightbox__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  width: 100%;
  max-width: min(1100px, 96vw);
}

.lightbox__footer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.lightbox__zoom {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
}

.lightbox__zoom-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--white);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox__zoom-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox__zoom-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.lightbox__zoom-level {
  min-width: 56px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: center;
}

.lightbox__zoom-level:hover {
  text-decoration: underline;
}

.lightbox__caption {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  line-height: 1.4;
}

.lightbox__counter {
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  border-radius: 100px;
}

.detail-panel__cover--zoom {
  cursor: zoom-in;
}

.detail-panel__cover--zoom::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  transition: background 0.2s ease;
}

.detail-panel__cover--zoom:hover::after {
  background: rgba(27, 67, 50, 0.08);
}

.detail-panel__cover--zoom .carousel__btn,
.detail-panel__cover--zoom .carousel__counter {
  z-index: 4;
}

.detail-panel__zoom-hint {
  position: absolute;
  bottom: 10px;
  left: 12px;
  z-index: 3;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(27, 67, 50, 0.55);
  border-radius: 100px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.detail-panel__cover--zoom:hover .detail-panel__zoom-hint {
  opacity: 1;
}

@media (max-width: 640px) {
  .lightbox__nav {
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }

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

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

  .lightbox__image {
    max-height: 70vh;
  }
}
