/* ===== BASE STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital,wght@0,400;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* Brand Typography */
@font-face {
  font-family: 'MADE Bon Voyage';
  src: url('images/MADE Bon Voyage Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* Brand Color Palette */
:root {
  --brand-algodon: #F8F6F3;    /* Cotton - soft white/cream */
  --brand-nude: #E8D5C4;       /* Nude - neutral beige */
  --brand-marengo: #2C2C2C;    /* Marengo - dark charcoal */
  --brand-ultramar: #1B365D;    /* Ultramar - deep blue */
  --brand-linea: #8B8B8B;       /* Linea - medium gray */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: sans-serif;
  margin: 0;
}

main {
  padding: 0;
}

/* ===== HEADER STYLES ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  /*background: rgba(44, 44, 44, 0.1);*/
  
  color: var(--brand-algodon);
  transition: background 0.3s ease;
  font-family: 'MADE Bon Voyage', 'DM Serif Display', serif;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

header.scrolled {
  /*background: rgba(0, 0, 0, 0.8);*/
  backdrop-filter: blur(2px);
}

.logo {
  font-weight: bold;
  text-decoration: none;
}

.logo-img {
  height: 60px;
  width: auto;
}

nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #ccc;
}

nav a.active {
  color: var(--brand-nude);
  font-weight: bold;
  position: relative;
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--brand-nude);
  border-radius: 1px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: white;
}

/* ===== OVERLAY UTILITY ===== */
.dark-overlay {
  position: relative;
}

.dark-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.0);
  z-index: 1;
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  height: 100vh;
  background-image: url('images/1x/estudio.jpg');
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

/* Responsive background images for high-DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero {
    background-image: url('images/3x/estudio@3x.jpg');
  }
  
  /* Project item responsive backgrounds */
  #avenida { background-image: url('images/optimized/avenida-llosa@3x.jpg') !important; }
  #robert { background-image: url('images/3x/robert@3x.jpg') !important; }
  #diagonal { background-image: url('images/optimized/diagonal@3x.jpg') !important; }
  #avenida-llosa { background-image: url('images/optimized/avenida-llosa@3x.jpg') !important; }
  #bodega-dalmau { background-image: url('images/optimized/bodega-dalmau@3x.jpg') !important; }
  #castillejos { background-image: url('images/optimized/castillejos@3x.jpg') !important; }
  #diagonal-web { background-image: url('images/optimized/diagonal@3x.jpg') !important; }
  #robert-gerhard { background-image: url('images/optimized/robert-gerhard@3x.jpg') !important; }
  #rovira-virgili { background-image: url('images/optimized/rovira-virgili@3x.jpg') !important; }
  #travessera-dalt { background-image: url('images/optimized/travessera-dalt@3x.jpg') !important; }
}

@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
  .hero {
    background-image: url('images/3x/estudio@3x.jpg');
  }
  
  /* Project item responsive backgrounds */
  #avenida { background-image: url('images/optimized/avenida-llosa@3x.jpg') !important; }
  #robert { background-image: url('images/3x/robert@3x.jpg') !important; }
  #diagonal { background-image: url('images/optimized/diagonal@3x.jpg') !important; }
  #avenida-llosa { background-image: url('images/optimized/avenida-llosa@3x.jpg') !important; }
  #bodega-dalmau { background-image: url('images/optimized/bodega-dalmau@3x.jpg') !important; }
  #castillejos { background-image: url('images/optimized/castillejos@3x.jpg') !important; }
  #diagonal-web { background-image: url('images/optimized/diagonal@3x.jpg') !important; }
  #robert-gerhard { background-image: url('images/optimized/robert-gerhard@3x.jpg') !important; }
  #rovira-virgili { background-image: url('images/optimized/rovira-virgili@3x.jpg') !important; }
  #travessera-dalt { background-image: url('images/optimized/travessera-dalt@3x.jpg') !important; }
}


.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  font-family: 'DM Serif Display', serif;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  font-family: 'DM Sans', sans-serif;
}

/* ===== PROJECT LINKS (HERO SECTION) ===== */
.project-links {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-link {
  color: white;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.project-link::before {
  content: '';
  width: 17px;
  height: 17px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' id='e36ffd47-1d77-4f27-ad31-c238e7c661ff' data-name='Layer 1' width='17.3457' height='17.3467' viewBox='0 0 17.3457 17.3467'%3E%3Cpolygon points='0 0 0 2.7 12.715 2.7 0.041 15.393 1.951 17.301 14.646 4.587 14.646 17.347 17.346 17.347 17.346 0 0 0' fill='white'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
}

/* ===== PROJECTS SHOWCASE ===== */
.projects-showcase {
  padding: 0;
}

.project-item {
  position: relative;
  width: 100%;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-content {
  position: absolute;
  align-items: baseline; /* aligns children by text baseline */
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: white;
}

.project-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 4rem;
  margin: 0;
  color: white;
}

.project-content h2 a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.project-content h2 a:hover {
  opacity: 0.8;
}

.see-project-btn {
  font-family: 'DM Sans', sans-serif;
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease;
  font-size: 1.1rem;
}

.see-project-btn:hover {
  opacity: 0.8;
}

/* ===== PROJECT PAGES ===== */
.project-header {
  position: relative;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}


.project-header-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
}

.project-header-content h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 4rem;
  margin-bottom: 1rem;
  color: white;
}

.project-header-content p {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 2px;
  opacity: 0.9;
}

/* ===== PROJECT GALLERY ===== */
.project-gallery {
  /* padding: 4rem 2rem; */
  margin: 0 auto;
}

.gallery-grid {
  column-count: 1;      /* Default: 1 column (mobile) */
  column-gap: 1rem;     /* space between columns */
  padding: 1rem;
}

.gallery-grid img {
  width: 100%;          /* scale to column width */
  border-radius: 8px;
  display: block;
}

@media (min-width: 768px) {
  .gallery-grid {
    column-count: 2;    /* 2 columns on tablet+ */
  }
}

@media (min-width: 1200px) {
  .gallery-grid {
    column-count: 3;    /* 3 columns on large screens */
  }
}

.gallery-item {
  display: block; /* make it behave like a block element */
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  background-color: #fff;
  break-inside: avoid; /* ✅ prevents item from splitting across columns */
  border-radius: 8px;
  margin-bottom: 1rem;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto; /* keeps the natural aspect ratio */
}

/* Progressive loading styles */
img {
  transition: opacity 0.3s ease;
}

/* Contact page image optimization */
.contact-image-column img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  transition: opacity 0.3s ease;
}

/* Studio page specific styles */
body:has(.contact-grid-section) {
  background-color: #ECE8E3;
}

.studio-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  color: var(--brand-marengo);
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 3rem;
  text-align: left;
}




/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 600px) {
  /* Mobile Navigation */
  nav {
    display: none;
    flex-direction: column;
    /*background: rgba(0, 0, 0, 0.1);*/
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem;
  }
  
  nav.show {
    display: flex;
  }
  
  .menu-toggle {
    display: flex;
  }

  /* Hero responsive styles */
  .hero {
    height: 50vh;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-content {
    padding: 1rem;
  }

  .project-links {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.5rem;
  }

      .project-link {
        font-size: 0.9rem;
        flex: 1;
        text-align: center;
        justify-content: center;
      }
}

@media (max-width: 768px) {


      /* Projects showcase responsive */
      .project-item {
        height: 80vh;
      }

      .project-content {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
      }

      .project-content h2 {
        font-size: 2.5rem;
        margin: 0;
        width: 100%;
      }

      .see-project-btn {
        font-size: 1rem;
      }


      /* Project pages responsive */
      .project-header-content h1 {
        font-size: 2.5rem;
      }

      .project-header-content p {
        font-size: 1.2rem;
      }

      .gallery-grid {
        grid-template-columns: 1fr;
      }

      .gallery-item img {
        height: 100%; /* Let aspect-ratio handle the sizing */
      }
    }

/* ===== CONTACT PAGE GRID STYLES ===== */
.contact-grid-section {
  min-height: calc(100vh - 80px);
  background: #ECE8E3;
  padding: 4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 88px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 1200px;
  width: 100%;
}

/* Contact Info Column */
.contact-info-column {
  display: flex;
  align-items: center;
}

.contact-text-content {
  width: 100%;
}

.contact-description {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--brand-marengo);
  margin-bottom: 2rem;
  font-weight: 300;
}

.contact-question {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--brand-marengo);
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 3rem;
}

.contact-details-section {
  border-top: 1px solid #e0e0e0;
  padding-top: 3rem;
}

.contact-details-section h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-marengo);
  margin-bottom: 2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.contact-details a,
.contact-details span {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--brand-marengo);
  text-decoration: none;
  font-weight: 300;
  line-height: 1.6;
}

.contact-details a:hover {
  color: var(--brand-ultramar);
}

.social-icons {
  display: flex;
  gap: 1.5rem;
}

.social-icon {
  width: 48px;
  height: 48px;
  border: 1px solid var(--brand-marengo);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--brand-marengo);
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: var(--brand-marengo);
  color: white;
}

/* Contact Image Column */
.contact-image-column {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Contact image styles moved up to progressive loading section */


/* Desktop: Two column grid */
@media (min-width: 769px) {
  .contact-grid-section {
    padding: 6rem 2rem;
  }
  
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: stretch;
  }
  
  .contact-info-column {
    padding-right: 2rem;
  }
  
  .contact-image-column img {
    height: auto;
    max-height: 600px;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .contact-grid-section {
    padding: 2rem 1rem;
  }
  
  .contact-description {
    font-size: 1rem;
  }
  
  .contact-question {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .contact-details a,
  .contact-details span {
    font-size: 0.9rem;
  }
  
  .social-icons {
    gap: 1rem;
  }
  
  .social-icon {
    width: 40px;
    height: 40px;
  }
  
  .contact-image-column img {
    height: auto;
    max-height: 400px;
  }
  
  .studio-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
}

/* ===== FOOTER STYLES ===== */
.footer {
  background-color: var(--brand-marengo);
  color: var(--brand-algodon);
  padding: 2rem 1rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
}

.footer-left {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-link {
  color: var(--brand-algodon);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-link:hover {
  color: var(--brand-nude);
  transform: translateY(-2px);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

.footer-center {
  text-align: center;
  flex: 1;
}

.footer-center p {
  margin: 0;
  font-weight: 300;
}

.footer-right {
  text-align: right;
}

.footer-right p {
  margin: 0;
  font-weight: 500;
}

/* Footer responsive design */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-left,
  .footer-center,
  .footer-right {
    width: 100%;
    text-align: center;
  }
  
  .footer-left {
    justify-content: center;
  }
  
  .footer {
    padding: 1.5rem 1rem;
  }
  
  .footer-content {
    font-size: 0.8rem;
  }
}
