/* ==================== REUSABLE PROJECT DETAIL STYLES ==================== */

/* Patterned gallery */
.project-gallery.patterned {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 320px;
  gap: 40px;
  max-width: 1400px;
  margin: 80px auto 120px;
  padding: 0 5%;
  position: relative;
  z-index: 10;
}

/* Responsive fallback */
@media (max-width: 992px) {
  .project-gallery.patterned {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    padding: 0 5%;
    margin: 60px auto 100px;
  }
  .project-gallery.patterned img {
    width: 100%;
    height: auto; /* preserves aspect ratio */
  }
}

/* Reusable content card – under grain */
.project-content-card {
  background: var(--magenta);
  padding: 48px;
  border-radius: 24px;
  box-shadow: var(--shadow-glow);
  border: 0.5px solid white;
  color: var(--text-light);
  position: relative;
  z-index: 1;
}

.project-content-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: white;
  margin: 60px 0 24px;
}

.project-content-card p,
.project-content-card ul {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 32px;
}

.project-content-card ul {
  padding-left: 28px;
}

/* Responsive adjustments for content card */
@media (max-width: 768px) {
  .project-content-card {
    padding: 24px;
  }
  .project-content-card h2 {
    margin: 40px 0 16px;
  }
}

/* ==================== FULL-BODY GRAIN OVERLAY ==================== */

body > .grain-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 450px 450px;
  opacity: 0.28;
  mix-blend-mode: luminosity;
  pointer-events: none;
  z-index: 5;
}

/* ==================== HERO ==================== */

.project-hero {
  position: relative;
  z-index: 10;
  margin-top: 15px; /* space for fixed nav; adjust to nav height */
}

.project-hero img {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: auto;
  display: block;
}

/* ==================== REUSABLE PROJECT PAGE STYLES ==================== */

.project-page-container {
  position: relative;
  z-index: 1;
  padding: 120px 5%;
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
}

.project-title {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  color: white;
  margin-bottom: 16px;
}

.project-meta {
  text-align: center;
  color: white;
  font-size: 18px;
  margin-bottom: 80px;
}

@media (max-width: 868px) {
  .project-title {
    font-size: 48px;
  }
}

/* Cleanup old grain overlays in project container */
.project-detail > .grain-overlay,
.project-page-container .grain-overlay {
  display: none;
}
