/* صفحه جزئیات پروژه — هم‌سبک فشرده با درباره ما */

.page-shell.section-project-detail {
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.project-detail-nav {
  margin-bottom: 1.25rem;
}

.project-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.project-detail-back:hover {
  color: var(--accent);
}

.project-detail-card {
  padding: clamp(0.9rem, 2vw, 1.15rem);
  border-radius: 14px;
  scroll-margin-top: 1.25rem;
}

.project-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  grid-template-areas: "visual content";
  gap: clamp(0.85rem, 2vw, 1.35rem);
  align-items: center;
  direction: rtl;
}

.project-detail-layout__visual {
  grid-area: visual;
  position: relative;
  min-width: 0;
}

.project-detail-layout__media {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 168px;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
}

.project-detail-layout__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-detail-layout__media .project-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 35%, var(--text-subtle));
  opacity: 0.55;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 8%, var(--bg)),
    color-mix(in srgb, var(--accent-soft) 40%, var(--surface))
  );
}

.project-detail-layout__badge {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.5rem;
  z-index: 2;
  padding: 0.2rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.project-detail-layout__content {
  grid-area: content;
  min-width: 0;
  direction: rtl;
  text-align: right;
}

.project-detail-layout__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
}

.project-detail-layout__tagline {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.project-detail-layout__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.project-detail-layout__lead {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text-muted);
  font-weight: 500;
}

.project-detail-layout__body {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  line-height: 1.85;
  color: var(--text-muted);
  text-align: justify;
  text-align-last: right;
}

.project-detail-layout__highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.project-detail-layout__highlights li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.project-detail-layout__highlights .icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--accent);
}

.project-detail-gallery {
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  scroll-margin-top: 1.25rem;
}

.project-detail-gallery__title {
  margin: 0.35rem 0 1rem;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-detail-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0.65rem;
}

.project-detail-gallery__item {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
}

.project-detail-gallery__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-detail-gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 140px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s var(--ease);
}

.project-detail-gallery__link:hover img {
  transform: scale(1.03);
}

.project-gallery-video {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  overflow: hidden;
}

.project-gallery-video__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-gallery-video__poster--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--accent);
  opacity: 0.65;
}

.project-gallery-video__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 85%, #000);
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, #000 35%, transparent);
  transition: transform 0.2s var(--ease);
}

.project-gallery-video__play:hover {
  transform: scale(1.06);
}

.project-gallery-video__iframe {
  width: 100%;
  height: 100%;
  min-height: 160px;
  border: 0;
  display: block;
}

.project-gallery-video__file {
  width: 100%;
  max-height: 220px;
  display: block;
  background: #000;
}

.project-detail-gallery__item figcaption {
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.project-detail-related {
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.project-detail-related__title {
  margin: 0.35rem 0 1rem;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-detail-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: clamp(0.75rem, 2vw, 1rem);
}

.project-detail-related__card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  direction: rtl;
  min-width: 0;
  transition:
    transform 0.35s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.35s var(--ease);
}

.project-detail-related__card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--glass-border));
}

.project-detail-related__thumb {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  max-height: none;
  border: none;
  border-bottom: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
}

.project-detail-related__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-detail-related__thumb .project-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 35%, var(--text-subtle));
  opacity: 0.55;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 8%, var(--bg)),
    color-mix(in srgb, var(--accent-soft) 40%, var(--surface))
  );
}

.project-detail-related__text {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  text-align: right;
}

.project-detail-related__text h3 {
  margin: 0;
  font-size: clamp(0.92rem, 1.6vw, 1.02rem);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-detail-related__card:hover .project-detail-related__text h3 {
  color: var(--accent);
}

@media (max-width: 899px) {
  .project-detail-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "visual"
      "content";
    align-items: start;
  }

  .project-detail-layout__media {
    max-height: 180px;
    aspect-ratio: 16 / 9;
  }

  .project-detail-related__grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  }

  .project-detail-gallery__item img {
    max-height: 160px;
  }
}

@media (min-width: 640px) {
  .project-detail-related__grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 1100px) {
  .project-detail-related__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
