.public-works {
  padding-top: 70px;
  background: #f4efe8;
  min-height: 100vh;
}

.works-hero {
  padding: 12px 0 10px;
}

.works-hero h1 {
  margin: 0;
  text-align: center;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: 0.12em;
  font-weight: 500;
  color: #1c1b18;
}

.works-list {
  padding: 24px 0 80px;
}

.public-work {
  padding: 24px 0;
}

.work-card {
  background: #f9f4ee;
  border-radius: 18px;
  border: 1px solid rgba(28, 24, 18, 0.08);
  padding: clamp(18px, 2.2vw, 28px);
  box-shadow: 0 22px 50px rgba(16, 21, 26, 0.06);
}

.work-card.no-media {
  padding-bottom: clamp(18px, 2.2vw, 28px);
}

.work-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 28px;
  align-items: start;
}

.work-card.no-media .work-layout {
  grid-template-columns: 1fr;
}

.work-main {
  display: grid;
  gap: 16px;
}

.work-head {
  display: grid;
  gap: 8px;
}

.work-title {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  color: #1c1b18;
}

.work-subtitle {
  margin: 0;
  font-size: clamp(15px, 1.6vw, 20px);
  color: #6b6055;
}

.work-text {
  margin: 0;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.6;
  color: #4a4139;
}

.work-media {
  display: grid;
  gap: 14px;
}

.work-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #1d1b18;
}

.work-video iframe {
  width: 100%;
  height: 100%;
}

.work-video-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #d8cfc3;
  color: #1c1b18;
  text-decoration: none;
  background: #fffdf8;
  font-weight: 600;
}

.work-photos-grid {
  display: grid;
  gap: 10px;
}

.work-photos-grid.is-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.work-photos-grid.is-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-photo {
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1 / 1;
  box-shadow: 0 12px 30px rgba(16, 21, 26, 0.08);
}

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

.works-empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
}

.works-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 60px;
}

.works-pagination .page-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.works-pagination .page-counter {
  font-size: 14px;
  color: #5f5246;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(31, 27, 22, 0.06);
  font-weight: 600;
}

.works-pagination.is-compact {
  justify-content: center;
}

.works-pagination.is-compact .page-counter {
  font-size: 15px;
  padding: 10px 18px;
}

.works-pagination .page-btn,
.works-pagination .page-number {
  border: 1px solid #d8cfc3;
  background: #fffdf8;
  color: #2a231c;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.works-pagination .page-number.is-active {
  background: #f4b743;
  border-color: #f4b743;
  color: #1a1405;
  font-weight: 600;
}

.works-pagination .page-btn[disabled],
.works-pagination .page-number[disabled] {
  opacity: 0.55;
  cursor: default;
}

.works-pagination .page-ellipsis {
  padding: 8px 4px;
  color: #8b7f73;
}

.works-modal[hidden] {
  display: none;
}

.modal-open {
  overflow: hidden;
}

.works-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.works-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 8, 0.6);
}

.works-modal__content {
  position: relative;
  z-index: 1;
  width: min(980px, 92vw);
  max-height: 90vh;
  background: #f9f4ee;
  border-radius: 20px;
  padding: 18px 18px 14px;
  box-shadow: 0 30px 80px rgba(16, 21, 26, 0.2);
  display: flex;
  flex-direction: column;
}

.works-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 0;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: #1c1b18;
  -webkit-appearance: none;
}

.works-modal__body {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  flex: 1;
  min-height: 0;
}

.works-modal__frame {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #e8e1d7;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.works-modal__image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: contain;
}

.works-modal__nav {
  border: none;
  background: transparent;
  color: #1c1b18;
  width: 40px;
  height: 40px;
  border-radius: 0;
  cursor: pointer;
  font-size: 22px;
  box-shadow: none;
}

.works-modal__nav[disabled] {
  opacity: 0.4;
  cursor: default;
}

.works-modal__counter {
  text-align: center;
  font-size: 14px;
  color: #5f5246;
  padding-top: 8px;
}

@media (max-width: 980px) {
  .work-layout {
    grid-template-columns: 1fr;
  }

  .work-media {
    max-width: 620px;
  }
}

@media (max-width: 720px) {
  .public-works {
    padding-top: 56px;
  }

  .works-modal__content {
    padding: 46px 14px 14px;
  }

  .works-modal__body {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    padding-top: 0;
    gap: 10px;
  }

  .works-modal__nav {
    position: static;
    transform: none;
  }

  .works-modal__nav--prev {
    justify-self: start;
  }

  .works-modal__nav--next {
    justify-self: end;
  }

  .works-modal__close {
    top: 10px;
    right: 10px;
  }

  .works-modal__frame {
    max-height: 60vh;
  }

  .works-modal__image {
    max-height: 60vh;
  }
}

@media (max-width: 600px) {
  .work-photos-grid.is-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
