html.is-locked,
body.is-locked {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 80;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 0;
}

.modal.is-open {
  display: block;
}

.modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 36, 53, 0.72);
  backdrop-filter: blur(8px);
}

.modal__dialog {
  position: relative;
  width: min(calc(100% - 1.5rem), 1050px);
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  background: var(--color-white);
  border-radius: 1.8rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal__gallery {
  background: linear-gradient(180deg, rgba(21, 50, 71, 0.08), rgba(15, 139, 141, 0.04));
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.modal__gallery-main {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 1.3rem;
}

.modal__thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.modal__thumbs button {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 1rem;
  overflow: hidden;
  opacity: 0.75;
}

.modal__thumbs button.is-active {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.24);
}

.modal__content {
  padding: 1.6rem 1.6rem 1.2rem;
  overflow-y: auto;
}

.modal__content h3 {
  margin: 0.3rem 0 0.75rem;
  font-size: 2rem;
  line-height: 1.05;
}

.modal__close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 50, 71, 0.08);
  color: var(--color-primary);
  font-size: 1.4rem;
  z-index: 2;
}

.modal__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.modal__meta span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-secondary);
  background: rgba(47, 91, 120, 0.08);
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
}

.modal__content p {
  color: var(--color-text-soft);
  margin-top: 0;
}

.modal__section-title {
  margin: 1.2rem 0 0.6rem;
  font-size: 1rem;
  color: var(--color-primary);
}

@media (max-width: 860px) {
  .modal__dialog {
    grid-template-columns: 1fr;
    width: min(calc(100% - 1rem), 760px);
    max-height: none;
  }
}
