/* ==========================================================================
   PROJECT DETAIL STYLES - MODAL & STANDALONE DETAIL PAGE
   "GIEO MẦM VÙNG CAO"
   ========================================================================== */

/* Native <dialog> Modal with Light-Dismiss */
.project-detail-dialog {
  width: min(1040px, 94vw);
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-highlight);
  border-radius: 26px;
  background: var(--bg-panel-solid);
  color: var(--text-primary);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
  overflow-x: hidden;
  overflow-y: auto;
}

.project-detail-dialog::backdrop {
  background-color: rgba(4, 10, 8, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Standalone Detail Page Wrapper */
body.detail-page-body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100dvh;
  user-select: text;
  background:
    radial-gradient(circle at 20% 0% var(--in-oklab), #16332b 0%, #091310 55%),
    var(--bg-deep);
}

.standalone-container {
  width: min(1120px, 92vw);
  margin: 2rem auto 4rem;
}

.standalone-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.back-to-saban-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-highlight);
  color: var(--accent-gold);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-to-saban-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  transform: translateX(-3px);
}

/* Shared Detail Content Structure */
.detail-hero {
  position: relative;
  height: clamp(280px, 40vh, 420px);
  overflow: hidden;
}

.detail-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-panel-solid) 0%,
    rgba(17, 35, 30, 0.45) 55%,
    rgba(9, 19, 16, 0.3) 100%
  );
}

.detail-close-btn {
  position: sticky;
  top: 1.25rem;
  float: right;
  margin-right: 1.25rem;
  z-index: 20;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(9, 19, 16, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.detail-close-btn:hover {
  background: var(--accent-terracotta);
  border-color: transparent;
}

.detail-hero-content {
  position: absolute;
  bottom: 1.5rem;
  left: clamp(1.25rem, 3vw, 2.5rem);
  right: clamp(1.25rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-tags-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.detail-tag {
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--accent-amber);
  color: var(--accent-gold);
}

.detail-tag--coords {
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--accent-emerald);
  color: var(--accent-Jade);
}

.detail-title {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.65rem);
  color: var(--text-primary);
}

.detail-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Main Body Grid */
.detail-content-body {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* KPI Grid */
.detail-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 1rem;
}

.detail-kpi-card {
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.detail-kpi-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.detail-kpi-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Two-Column Story & Specs */
.detail-columns {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 2rem;
}

.detail-section-title {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.detail-section-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 10px var(--accent-amber);
}

.detail-story-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Before & After Comparison Box */
.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.ba-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
}

.ba-card img {
  width: 100%;
  height: 165px;
  object-fit: cover;
}

.ba-caption {
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ba-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.ba-badge--before {
  background: rgba(234, 88, 12, 0.2);
  color: #fb923c;
}

.ba-badge--after {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-Jade);
}

/* Construction Items Checklist & Timeline */
.spec-card {
  padding: 1.25rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.spec-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.spec-check {
  color: var(--accent-emerald);
  font-weight: 700;
}

/* Timeline Steps */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
  padding-left: 1.1rem;
  border-left: 2px solid rgba(245, 158, 11, 0.3);
}

.timeline-step {
  position: relative;
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: -1.45rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-amber);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-gold);
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Photo Gallery Grid */
.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.gallery-item {
  border-radius: 14px;
  overflow: hidden;
  height: 165px;
  border: 1px solid var(--border-subtle);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out-expo);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

/* Call to Action Footer inside Detail */
.detail-cta-banner {
  padding: 1.5rem 1.75rem;
  border-radius: 20px;
  background: linear-gradient(
    135deg var(--in-oklab),
    rgba(16, 185, 129, 0.16) 0%,
    rgba(245, 158, 11, 0.16) 100%
  );
  border: 1px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.detail-cta-text h4 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.detail-cta-text p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.detail-cta-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .before-after-grid {
    grid-template-columns: 1fr;
  }
}
