/* Project detail page */

.pd-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  box-sizing: border-box;
}

/* Hero */
.pd-hero {
  margin-bottom: 2.5rem;
}

.pd-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: #0c58d0;
}

.pd-intro {
  max-width: none;
  width: 100%;
  margin: 0 0 1.75rem;
  font-size: 0.92rem;
  line-height: 1.75;
  color: #8a8a8a;
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
}

.pd-gallery {
  display: grid;
  gap: 0.85rem;
}

.pd-gallery__main {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #f3f3f3;
}

.pd-gallery__main-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
}

.pd-gallery__dots {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
}

.pd-gallery__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.pd-gallery__dot.is-active {
  background: #fff;
}

.pd-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.pd-gallery__thumb {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: #f3f3f3;
  cursor: pointer;
}

.pd-gallery__thumb.is-active {
  border-color: #0c58d0;
}

.pd-gallery__thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  background: #f3f3f3;
}

.pd-gallery__thumb.has-more img {
  filter: brightness(0.45);
}

.pd-gallery__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
}

/* Body layout */
.pd-body {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
}

.pd-panel + .pd-panel,
.pd-panel + .pd-share {
  margin-top: 2rem;
}

.pd-panel__title,
.pd-share__title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111;
}

.pd-meta,
.pd-team {
  margin: 0;
}

.pd-meta__row,
.pd-team__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid #ececec;
}

.pd-meta__row dt,
.pd-team__row dt {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #666;
}

.pd-meta__row dd,
.pd-team__row dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
}

.pd-status.is-completed {
  color: #1f9d55;
}

.pd-status.is-progress {
  color: #d9822b;
}

.pd-status.is-idea {
  color: #666;
}

.pd-team__row {
  padding: 0.7rem 0.85rem;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fafafa;
}

.pd-team__row + .pd-team__row {
  margin-top: 0.55rem;
}

.pd-team .pd-team__row {
  border-bottom: 1px solid #e7e7e7;
}

.pd-share__icons {
  display: flex;
  gap: 0.65rem;
}

.pd-share__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d0d0d0;
  border-radius: 50%;
  color: #0c58d0;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.pd-share__link:hover {
  border-color: #0c58d0;
  background: #f5f9ff;
}

/* Alternating content blocks */
.pd-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.pd-block {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 2rem;
  align-items: start;
}

.pd-block--reverse .pd-block__media {
  order: 2;
}

.pd-block--reverse .pd-block__text {
  order: 1;
}

.pd-block__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  background: #f3f3f3;
  border-radius: 4px;
}

.pd-block__text p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #444;
  text-align: justify;
}

.pd-block__text p:last-child {
  margin-bottom: 0;
}

/* Map */
.pd-map-section {
  margin-bottom: 3rem;
}

.pd-map-section__title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #222;
}

.pd-map {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  background: #e9e9e9;
}

.pd-map__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pd-map__open {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  color: #0c58d0;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.pd-map__open:hover {
  color: #0847a8;
}

/* More projects */
.pd-more {
  padding-top: 1rem;
  border-top: 1px solid #ececec;
}

.pd-more__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pd-more__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0c58d0;
}

.pd-more__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pd-more__button:hover {
  border-color: #0c58d0;
  color: #0c58d0;
}

.pd-more__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.pd-more__card {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: #efefef;
}

.pd-more__card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.pd-more__card:hover img {
  transform: scale(1.03);
}

/* Not found */
.pd-not-found {
  padding: 4rem 0;
  text-align: center;
}

.pd-not-found h1 {
  margin: 0 0 0.75rem;
  color: #111;
}

.pd-not-found p {
  margin: 0 0 1.5rem;
  color: #666;
}

/* Responsive */
@media (max-width: 960px) {
  .pd-page {
    padding: 0 1rem 2.5rem;
  }

  .pd-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .pd-block,
  .pd-block--reverse {
    grid-template-columns: 1fr;
  }

  .pd-block--reverse .pd-block__media,
  .pd-block--reverse .pd-block__text {
    order: initial;
  }

  .pd-more__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .pd-gallery__thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pd-more__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pd-more__grid {
    grid-template-columns: 1fr 1fr;
  }

  .pd-block__media img {
    min-height: 0;
  }
}

/* Full gallery preview */
body.pd-lightbox-open {
  overflow: hidden;
}

.pd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.pd-lightbox[hidden] {
  display: none;
}

.pd-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.88);
}

.pd-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.pd-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 780px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #111;
  border-radius: 6px;
}

.pd-lightbox__close,
.pd-lightbox__nav {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.pd-lightbox__close {
  top: -0.35rem;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.7rem;
}

.pd-lightbox__nav {
  top: 42%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.35rem;
  transform: translateY(-50%);
}

.pd-lightbox__prev {
  left: 0.25rem;
}

.pd-lightbox__next {
  right: 0.25rem;
}

.pd-lightbox__close:hover,
.pd-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.pd-lightbox__counter {
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.pd-lightbox__thumbs {
  display: flex;
  gap: 0.45rem;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.15rem 0 0.35rem;
}

.pd-lightbox__thumb {
  flex: 0 0 auto;
  width: 128px;
  height: auto;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: #222;
  cursor: pointer;
}

.pd-lightbox__thumb.is-active {
  border-color: #0c58d0;
}

.pd-lightbox__thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  background: #222;
}

@media (max-width: 700px) {
  .pd-lightbox {
    padding: 0.75rem;
  }

  .pd-lightbox__nav {
    width: 36px;
    height: 36px;
  }

  .pd-lightbox__thumb {
    width: 56px;
    height: 56px;
  }
}
