/* ============================================================
   Project Detail Page — case-study layout
   ============================================================ */

.detail-page {
  max-width: 960px;
  margin-inline: auto;
}

/* ============ BREADCRUMB ============ */
.detail-page .breadcrumb {
  align-self: flex-start;
  margin-bottom: 8px;
}

/* ============ HERO / VIDEO ============ */
.detail-hero {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 56px;
}
.detail-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}

.detail-video {
  width: 100%;
  margin: 0 0 56px;
}
.detail-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0d1e2e;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.detail-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 11px 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  background: var(--btn-grad);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base);
  box-shadow: 0 4px 14px rgba(74, 159, 229, 0.3);
}
.detail-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 159, 229, 0.4);
}

.detail-download-btn {
  color: var(--accent-text);
  background: var(--white);
  border: 1.5px solid var(--blue-light);
  box-shadow: var(--shadow-sm);
}
.detail-download-btn:hover {
  color: var(--white);
  background: var(--accent-text);
  border-color: var(--accent-text);
  box-shadow: 0 8px 24px rgba(74, 159, 229, 0.35);
}

/* ============ SECTIONS ============ */
.detail-section {
  width: 100%;
  margin-bottom: 72px;
}
.detail-section-head {
  text-align: start;
  margin-bottom: 28px;
}
.detail-section-head .section-tag { margin-bottom: 12px; }
.detail-heading {
  font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ============ META GRID ============ */
#info-heading {
  margin-bottom: 14px;
}
.detail-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}
.detail-meta {
  flex: 1 1 120px;
  min-width: 0;
}
.detail-meta dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.detail-meta dd {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ============ PROSE STACK (challenge blocks) ============ */
.detail-prose-stack {
  display: grid;
  gap: 20px;
}
.detail-prose-block {
  background: var(--white);
  border: 1px solid rgba(74, 159, 229, 0.14);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}
.detail-prose-block h3,
.solution-text-heading {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 10px;
  color: var(--accent-text);
}
.rich-text.solution-text {
  background: var(--white);
  border: 1px solid rgba(74, 159, 229, 0.14);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

/* ============ PROCESS STEPS ============ */
.process-steps {
  list-style: none;
  display: grid;
  gap: 16px;
  counter-reset: step;
}
.process-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  align-items: start;
  padding: 24px;
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.process-step-num {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-text);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 2px solid var(--blue-light);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.process-step-body h3 {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 6px;
}
.process-step-body p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* ============ RESULTS ============ */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.result-card {
  padding: 32px 24px;
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base);
}
.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.result-value {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-weight: 700;
  font-size: 38px;
  color: var(--accent-text);
  line-height: 1.1;
}
.result-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ============ RELATED / MORE POSTS CARDS ============ */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.related-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(74, 159, 229, 0.14);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base), border-color var(--dur-base);
}
.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-light);
  box-shadow: var(--shadow-lg);
}
.related-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
}
.related-card-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--blue-light) 100%);
  color: var(--blue-deep);
}
.related-card-placeholder--text {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
}
.related-card-body {
  padding: 20px;
}
.related-card-body h3 {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
  line-height: 1.5;
  transition: color var(--dur-fast);
}
.related-card:hover .related-card-body h3 {
  color: var(--accent-text);
}
.related-card-body p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ============ GALLERY — simple flex images ============ */
.gallery-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.gallery-item {
  width: calc((100% - 40px) / 3);
  margin: 0;
}
.gallery-link {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base), transform var(--dur-base) var(--ease-spring);
}
.gallery-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.gallery-link img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.gallery-item figcaption {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.7;
  padding: 10px 4px 0;
}

@media (max-width: 1024px) {
  .gallery-item { width: calc((100% - 20px) / 2); }
}
@media (max-width: 640px) {
  .gallery-flex { gap: 14px; }
  .gallery-item { width: 100%; }
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(13, 30, 46, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: lightbox-in var(--dur-base) ease;
}
.lightbox[hidden] { display: none; }
@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-figure {
  margin: 0;
  max-width: min(920px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
}
.lightbox-figure figcaption {
  color: var(--white);
  font-size: 14px;
  text-align: center;
  line-height: 1.7;
}
.lightbox-figure figcaption:empty { display: none; }
.lightbox-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ============ PREV/NEXT PAGER ============ */
.detail-pager {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 24px;
}
.detail-pager-neighbours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  flex: 1;
  max-width: 560px;
}
.pager-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 22px;
  background: var(--white);
  border: 1.5px solid var(--blue-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base), border-color var(--dur-base);
  box-shadow: var(--shadow-sm);
}
.pager-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-text);
  box-shadow: var(--shadow-md);
}
.pager-next {
  text-align: end;
}
.pager-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.pager-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-text);
}

/* ============ BLOG DETAIL — MORE POSTS ============ */
.more-posts {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 56px 90px;
  width: 100%;
}
.more-posts h2 {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  text-align: center;
}

@media (max-width: 1024px) {
  .more-posts { padding: 0 32px 72px; }
}
@media (max-width: 640px) {
  .more-posts { padding: 0 20px 56px; }
  .process-step { grid-template-columns: 44px 1fr; gap: 14px; padding: 20px; }
  .process-step-num { width: 44px; height: 44px; font-size: 15px; }
  .detail-meta-grid { padding: 20px; }
  .detail-pager-neighbours { grid-template-columns: 1fr; }
}
