/* Portfolio Page Styles */

/* ============================================
   GALLERY COLUMN CONFIGURATION
   ============================================
   Control how many images per row for each portfolio page.
   Change the number in var(--gallery-columns) to adjust columns:
   - 2 = two images per row
   - 3 = three images per row
   - 4 = four images per row, etc.
*/

/* Default: 3 columns for all pages */
body {
  --gallery-columns: 3;
  --gallery-gap: 2rem;
}

/* Individual page settings - customize per portfolio item */
body[data-page="sneaker-ar"] {
  --gallery-columns: 2;
}

body[data-page="fahrenheit-451"] {
  --gallery-columns: 2;
}

body[data-page="gorinov"] {
  --gallery-columns: 3;
}

body[data-page="pierrot"] {
  --gallery-columns: 3;
}

body[data-page="space-angel"] {
  --gallery-columns: 3;
}

body[data-page="aquapunk"] {
  --gallery-columns: 2;
}

body[data-page="ar-glasses"] {
  --gallery-columns: 2;
}

body[data-page="fahrenheit-451"] {
  --gallery-columns: 2;
}

body[data-page="santamobile"] {
  --gallery-columns: 3;
}

/* Hero Section */
.portfolio-hero {
  position: relative;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  background-position: center;
  background-size: cover;
  padding-bottom: 5rem;
  padding-top: 3rem;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
}

.portfolio-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to top, var(--dark-section-bg) 20%, rgba(7,8,18,0.7) 70%, rgba(7,8,18,0.1) 100%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Gradient transition from hero to content */
.portfolio-hero::before {
  content: '';
  position: absolute;
  bottom: -250px;
  left: 0;
  right: 0;
  height: 250px;
  background: linear-gradient(to bottom, var(--dark-section-bg) 0%, rgb(from var(--dark-section-bg) r g b / 0) 100%);
  pointer-events: none;
  z-index: 0;
}

.portfolio-hero .container {
  position: relative;
  z-index: 2; /* Above both ::after and ::before gradients */
  padding-top: 25%;
  width: 100%;
  margin: 0 auto;
}

/* Breadcrumb link */
.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: opacity 0.3s ease;
}

.breadcrumb-link:hover {
  opacity: 0.8;
}

/* Breadcrumb divider */
.breadcrumb-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, rgba(242,211,138,.95) 0%, rgba(242,211,138,0) 100%);
  flex-shrink: 0;
}

/* Breadcrumb text */
.breadcrumb-text {
  font-family: "Fraunces", ui-serif, Georgia, serif;
  font-size: 14px;
  color: rgba(242,211,138,.95);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Hero Content */
.portfolio-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: rgba(242,211,138,.95);
  margin-bottom: 0.5rem;
  max-width: 60ch;
}

.portfolio-hero p {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.9);
  max-width: 60ch;
}

/* Overview Section */
.overview-section {
  position: relative;
  padding: 0;
  margin-top: 20px; /* Space for gradient transition */
  z-index: 10; /* Ensure content sits above gradient */
}

.overview-section .container {
  position: relative;
  z-index: 10;
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.overview-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(242,211,138,.95);
  margin-bottom: 2rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.overview-content {
  max-width: none;
}

.overview-section p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
}

.overview-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  image-rendering: auto;
  image-rendering: smooth;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: bicubic;
}

.overview-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(242,211,138,.95);
  margin-bottom: 1.5rem;
}

/* Related Services Grid */
.related-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.related-services-grid .card {
  max-width: 400px;
}

.related-services-grid .card .icon-badge {
  aspect-ratio: 1;
}

.related-services-grid .card h3 {
  font-size: 1.125rem;
}

.related-services-grid .card p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Override flexbox layout from main CSS for portfolio pages with 3 cards */
@media (min-width: 661px) {
  #services .grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  #services .grid .card {
    flex: 0 0 calc((100% - 2 * var(--grid-gap)) / 3) !important;
    max-width: calc((100% - 2 * var(--grid-gap)) / 3) !important;
  }
}

/* Gallery Section */
.gallery-section {
  position: relative;
  background: var(--dark-section-bg);
  padding: 0;
  z-index: 0;
  margin-top: 100px; 
}

/* Top gradient transition into gallery */
.gallery-section::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, rgb(from var(--dark-section-bg) r g b / 0) 0%, var(--dark-section-bg) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Bottom gradient transition out of gallery */
.gallery-section::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, var(--dark-section-bg) 0%, rgb(from var(--dark-section-bg) r g b / 0) 100%);
  pointer-events: none;
  z-index: -1;
}

.gallery-section .container {
  position: relative;
  z-index: 1;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.gallery-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(242,211,138,.95);
  margin-bottom: 2.5rem;
  text-align: left;
}

.gallery-main {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns, 3), 1fr);
  gap: var(--gallery-gap, 2rem);
  margin-bottom: 2rem;
}

.gallery-secondary {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns, 3), 1fr);
  gap: var(--gallery-gap, 2rem);
  margin-bottom: 3rem;
}

.gallery-section img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
  image-rendering: auto;
  image-rendering: smooth;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: bicubic;
}

.gallery-section img:hover {
  transform: scale(1.02);
}

/* Features Section */
.features-section {
  padding: 4rem 0;
  margin-top: 100px;
}

.features-section .container {
  max-width: var(--max);
}

.feature-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 6rem;
}

.feature-item:last-child {
  margin-bottom: 0;
}

/* Reverse layout for alternating pattern - second item */
.feature-reverse .feature-content {
  order: 2;
}

.feature-reverse .feature-media {
  order: 1;
}

.feature-content h3 {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(242,211,138,.95);
  margin-bottom: 1.5rem;
}

.feature-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
}

.feature-media {
  position: relative;
  width: 500px;
  aspect-ratio: 9 / 16;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.feature-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Video Section */
.video-section {
  position: relative;
  background: var(--dark-section-bg);
  padding: 0;
  z-index: 0;
  margin-top: 100px;
}

/* Top gradient transition into video section */
.video-section::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, rgb(from var(--dark-section-bg) r g b / 0) 0%, var(--dark-section-bg) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Bottom gradient transition out of video section */
.video-section::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, var(--dark-section-bg) 0%, rgb(from var(--dark-section-bg) r g b / 0) 100%);
  pointer-events: none;
  z-index: -1;
}

.video-section .container {
  position: relative;
  z-index: 1;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.video-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(242,211,138,.95);
  margin-bottom: 2.5rem;
  text-align: left;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-container video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
  min-height: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .feature-item,
  .feature-reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
  }
  
  /* Always show text first, then video on mobile - for ALL items */
  .feature-content,
  .feature-reverse .feature-content {
    text-align: center;
    order: 1;
  }
  
  .feature-media,
  .feature-reverse .feature-media {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    order: 2;
  }
  
  .video-container {
    min-height: 250px;
  }
  
  .video-container video {
    min-height: 250px;
  }
}

/* Back to Portfolio Section */
.back-section {
  padding: 3rem 0;
}

.back-section .container {
  text-align: center;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: rgba(246,227,163,0.1);
  border: 2px solid #f6e3a3;
  color: #f6e3a3;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(246,227,163,0.2);
  transform: translateY(-2px);
}

/* Footer */
.portfolio-footer {
  background: #000;
  padding: 2rem 0;
  margin-top: 4rem;
}

.portfolio-footer .container {
  text-align: center;
}

.portfolio-footer p {
  margin: 0;
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  
  .related-services-grid {
    grid-template-columns: 1fr;
  }
  
  /* Keep service cards in one row on portfolio pages */
  #services .grid .card {
    grid-column: span 4 !important;
  }
}

@media (max-width: 768px) {
  .creative-process {
    grid-template-columns: 1fr;
  }
  
  .related-services-grid {
    grid-template-columns: 1fr;
  }
  
  /* Stack service cards vertically on mobile */
  #services .grid .card {
    grid-column: span 12 !important;
  }
}
