/* ==========================================================================
   Projects Page & Lightbox Stylesheet - Dwelcom
   Matches attached designs for desktop & mobile views
   ========================================================================== */

:root {
  --dw-navy: #0c2340;
  --dw-navy-dark: #08182b;
  --dw-navy-card: #102a43;
  --dw-red: #f04449;
  --dw-red-hover: #d9383d;
  --dw-blue-accent: #0284c7;
  --dw-blue-light: #e0f2fe;
  --dw-text-dark: #1e293b;
  --dw-text-body: #475569;
  --dw-text-muted: #64748b;
  --dw-border-color: #e2e8f0;
  --dw-card-bg: #ffffff;
  --dw-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --dw-font-serif: 'Playfair Display', Georgia, serif;
}

/* ==========================================================================
   1. Projects Header (Inherits dark navy header from home-new.css & how-it-works.css)
   ========================================================================== */
.dw-projects-page-body .dw-header.dw-header-inner-page {
  position: relative;
  background: #08182b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dw-projects-page-body .dw-nav-menu li.active a {
  color: #ffffff !important;
  font-weight: 800 !important;
}

.dw-projects-page-body .dw-nav-menu li.active a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #ffffff !important;
  border-radius: 1px;
}

/* ==========================================================================
   2. Hero Section: "Our Work. Our Experience."
   ========================================================================== */
.dw-projects-hero {
  position: relative;
  background-color: #f0f7fd;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
  padding: 70px 0 70px;
  border-bottom: 1px solid #dcebf7;
}

.dw-projects-hero-media {
  position: absolute;
  top: 0;
  right: 0;
  width: 54%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.dw-projects-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}

.dw-projects-hero-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.dw-projects-hero-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    #f0f7fd 0%,
    rgba(240, 247, 253, 0.9) 8%,
    rgba(240, 247, 253, 0.35) 20%,
    rgba(240, 247, 253, 0) 34%
  );
  z-index: 2;
}

.dw-projects-hero-container {
  position: relative;
  z-index: 4;
  width: 100%;
}

.dw-projects-hero-content {
  max-width: 540px;
}

.dw-proj-eyebrow-wrap {
  margin-bottom: 14px;
}

.dw-proj-eyebrow-text {
  font-family: var(--dw-font-sans);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--dw-navy-card);
  text-transform: uppercase;
  display: block;
}

.dw-proj-eyebrow-bar {
  width: 28px;
  height: 3px;
  background-color: var(--dw-red);
  margin-top: 6px;
  border-radius: 2px;
}

.dw-projects-hero-title {
  font-family: var(--dw-font-serif) !important;
  font-size: 50px;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.dw-proj-title-navy {
  color: var(--dw-navy-card);
  display: block;
}

.dw-proj-title-red {
  color: var(--dw-red);
  display: block;
}

.dw-projects-hero-desc {
  font-family: var(--dw-font-sans);
  font-size: 16px;
  line-height: 1.62;
  color: #334155;
  margin: 0;
  max-width: 460px;
}

.dw-projects-hero-desc strong {
  font-weight: 700;
  color: var(--dw-navy-card);
}

/* ==========================================================================
   3. Projects 2-Column Gallery Grid
   ========================================================================== */
.dw-projects-grid-section {
  background-color: #f8fafc;
  padding: 60px 0 70px;
}

.dw-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 30px;
}

/* Single Project Card */
.dw-proj-card {
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease;
}

/* Main Cover Photo */
.dw-proj-cover-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
  cursor: pointer;
}

.dw-proj-cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.4s ease;
  image-rendering: -webkit-optimize-contrast;
}

.dw-proj-cover-container:hover img {
  transform: scale(1.035);
}

/* Badge overlay bottom right */
.dw-proj-badge-pill {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 5px;
  font-family: var(--dw-font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.dw-proj-badge-pill svg {
  flex-shrink: 0;
}

/* Thumbnail Strip below main photo */
.dw-proj-thumb-strip {
  display: flex;
  gap: 6px;
  width: 100%;
}

.dw-proj-thumb-item {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #e2e8f0;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.dw-proj-thumb-item:hover {
  transform: translateY(-2px);
  opacity: 0.88;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.dw-proj-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* Project Card Details */
.dw-proj-card-footer {
  margin-top: 4px;
}

.dw-proj-card-name {
  font-family: var(--dw-font-serif) !important;
  font-size: 24px;
  font-weight: 700;
  color: var(--dw-navy-card);
  margin: 0 0 6px 0;
  letter-spacing: -0.2px;
}

.dw-proj-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  color: var(--dw-red);
  font-family: var(--dw-font-sans);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, gap 0.2s ease;
}

.dw-proj-card-btn:hover {
  color: var(--dw-red-hover);
  gap: 9px;
}

.dw-proj-card-btn span.arrow {
  font-size: 15px;
  transition: transform 0.2s ease;
}

.dw-proj-card-btn:hover span.arrow {
  transform: translateX(3px);
}

/* ==========================================================================
   4. Bottom Panoramic CTA Section - Full Width Matching Mockup
   ========================================================================== */
.dw-projects-cta-section {
  position: relative;
  width: 100%;
  background: linear-gradient(90deg, #00376e 0%, #003870 38%, #034588 62%, #05509d 88%, #024888 100%);
  overflow: hidden;
  padding: 42px 0 44px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dw-proj-cta-container {
  position: relative;
  z-index: 4;
  width: 100%;
}

.dw-proj-cta-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 48px;
  max-width: 820px;
}

/* Evening luxury residence photo positioned cleanly at right side matching defect CTA */
.dw-proj-cta-bg-art {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 42%;
  min-width: 320px;
  pointer-events: none;
  z-index: 1;
}

.dw-proj-cta-bg-art::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, #024888 0%, rgba(2, 72, 136, 0.75) 35%, rgba(2, 72, 136, 0) 100%);
  z-index: 2;
  pointer-events: none;
}

.dw-proj-cta-bg-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

.dw-proj-cta-left {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
}

.dw-proj-cta-left h2 {
  font-family: var(--dw-font-serif) !important;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  margin: 0 0 10px 0;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.dw-proj-cta-left p {
  font-family: var(--dw-font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: #d0e2f2;
  margin: 0;
  max-width: 440px;
}

.dw-proj-cta-right {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  flex-shrink: 0;
}

.dw-proj-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #eb1c24;
  color: #ffffff !important;
  font-family: var(--dw-font-sans);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 4px;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(235, 28, 36, 0.4);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.dw-proj-cta-btn:hover {
  background-color: #d11219;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(235, 28, 36, 0.5);
}

.dw-proj-cta-contact-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 2px;
}

.dw-proj-cta-link-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff !important;
  font-family: var(--dw-font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.dw-proj-cta-link-item:hover {
  opacity: 0.88;
  transform: translateX(2px);
}

.dw-proj-cta-link-item svg {
  flex-shrink: 0;
  fill: currentColor;
}

/* ==========================================================================
   5. Interactive Lightbox Modal (Desktop & Mobile Views)
   Matching attached reference images exactly
   ========================================================================== */
.dw-lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 14, 22, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dw-lightbox-backdrop.active {
  display: flex;
  opacity: 1;
}

/* Desktop Lightbox Dialog Container */
.dw-lightbox-dialog {
  background: #141a22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  animation: dwLbScaleIn 0.25s ease-out;
}

@keyframes dwLbScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Lightbox Header */
.dw-lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: #18202a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dw-lb-title {
  color: #ffffff;
  font-family: var(--dw-font-sans);
  font-size: 19px;
  font-weight: 700;
  margin: 0;
}

.dw-lb-header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dw-lb-counter {
  color: #cbd5e1;
  font-family: var(--dw-font-sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.dw-lb-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}

.dw-lb-close-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Main Image Display Area */
.dw-lb-view-area {
  position: relative;
  width: 100%;
  height: 52vh;
  min-height: 300px;
  max-height: 520px;
  background: #0d1217;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.dw-lb-main-image {
  max-width: 95%;
  max-height: 95%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  transition: opacity 0.18s ease;
  image-rendering: -webkit-optimize-contrast;
}

/* Overlay Navigation Arrow Buttons */
.dw-lb-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.dw-lb-nav-arrow:hover {
  background: var(--dw-red);
  border-color: transparent;
  transform: translateY(-50%) scale(1.08);
}

.dw-lb-prev {
  left: 18px;
}

.dw-lb-next {
  right: 18px;
}

/* Lightbox Thumbnail Strip */
.dw-lb-thumbnails-strip {
  padding: 14px 20px;
  background: #141a22;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.dw-lb-thumbnails-strip::-webkit-scrollbar {
  height: 5px;
}

.dw-lb-thumbnails-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.dw-lb-thumb-btn {
  width: 66px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #0d1217;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.55;
  transition: all 0.2s ease;
  padding: 0;
}

.dw-lb-thumb-btn:hover {
  opacity: 0.85;
}

.dw-lb-thumb-btn.active {
  opacity: 1;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
  transform: scale(1.04);
}

.dw-lb-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* ==========================================================================
   6. Responsive Breakpoints
   Mobile View strictly matches "Lightbox Gallery (Mobile View)" in mockup
   ========================================================================== */
@media (max-width: 991px) {
  .dw-projects-hero {
    min-height: auto;
    padding: 45px 0 45px;
  }
  .dw-projects-hero-title {
    font-size: 40px;
  }
  .dw-projects-grid {
    gap: 28px 24px;
  }
  .dw-proj-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    max-width: 100%;
  }
  .dw-proj-cta-left h2 {
    white-space: normal;
  }
  .dw-proj-cta-bg-art {
    width: 65%;
    opacity: 0.35;
  }
}

@media (max-width: 768px) {
  .dw-projects-header .dw-nav-desktop {
    display: none;
  }
  .dw-projects-header .dw-mobile-toggle {
    display: block;
  }
  .dw-projects-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }
  .dw-projects-hero-media {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    height: 260px;
    aspect-ratio: auto;
    order: 0;
    opacity: 1;
  }
  .dw-projects-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
  }
  .dw-projects-hero-fade {
    display: none;
  }
  .dw-projects-hero-container {
    order: 1;
    padding-top: 28px;
    padding-bottom: 40px;
  }
  .dw-projects-hero-title {
    font-size: 34px;
  }
  
  /* 1-column project cards on mobile */
  .dw-projects-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .dw-proj-thumb-item {
    height: 42px;
  }

  /* Full-width CTA Section Mobile Adjustments */
  .dw-projects-cta-section {
    padding: 38px 0 42px;
  }
  .dw-proj-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
  .dw-proj-cta-left h2 {
    font-size: 26px;
    white-space: normal;
  }
  .dw-proj-cta-right {
    width: 100%;
    align-items: stretch;
  }
  .dw-proj-cta-btn {
    width: 100%;
    justify-content: center;
  }
  .dw-proj-cta-contact-row {
    width: 100%;
    gap: 10px;
  }
  .dw-proj-cta-bg-art {
    width: 100%;
    opacity: 0.22;
  }
  .dw-proj-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .dw-proj-card-btn {
    width: 100%;
    justify-content: space-between;
  }

  /* MOBILE LIGHTBOX VIEW - Matches Image 2 exact layout */
  .dw-lightbox-dialog {
    width: 94%;
    max-height: 94vh;
    border-radius: 16px;
    background: #111720;
  }

  .dw-lb-header {
    padding: 14px 18px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Close button on left in mobile view */
  .dw-lb-close-btn {
    order: 1;
    font-size: 22px;
  }

  /* Project title centered in mobile view */
  .dw-lb-title {
    order: 2;
    font-size: 17px;
    text-align: center;
    flex: 1;
    margin: 0 10px;
  }

  /* Counter on right in mobile view */
  .dw-lb-header-right {
    order: 3;
    gap: 0;
  }

  .dw-lb-counter {
    font-size: 13.5px;
  }

  .dw-lb-view-area {
    height: 48vh;
    min-height: 250px;
  }

  .dw-lb-nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .dw-lb-prev {
    left: 10px;
  }

  .dw-lb-next {
    right: 10px;
  }

  .dw-lb-thumbnails-strip {
    padding: 12px 14px;
    gap: 8px;
  }

  .dw-lb-thumb-btn {
    width: 54px;
    height: 42px;
  }
}

@media (max-width: 480px) {
  .dw-projects-hero-media {
    height: 220px;
  }
}
