/* ==========================================================================
   1. GLOBAL & RESET STYLES (Shared across all pages)
   ========================================================================== */
:root {
  --text: #111;
  --muted: #777;
  --bg: #ffffff;
  --max: 1200px;
  --gutter: 1.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Outfit", sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 90px; /* Creates identical space for the fixed header on both pages */
}

p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 420px;
  margin-bottom: 1.5rem; /* This creates the perfect visual blank line between consecutive paragraphs */
}

h1, h2, h3 {
  font-weight: 200;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

section {
  width: 100%;
  padding: 5rem 1.5rem;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ==========================================================================
   2. IDENTICAL HEADER STYLES
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  z-index: 1000;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--gutter); /* Uniform padding top and bottom */
  display: flex;
  justify-content: space-between;
  align-items: center;        /* Centers the logo link and the nav container */
}

/* Fixes the anchor wrapper around the logo image */
.header-inner > a {
  display: flex;
  align-items: center;
}

.logo {
  height: 60px; 
  width: auto;
  display: block;
}

/* Turns the nav container into a flexbox row */
nav {
  display: flex;
  align-items: center;
}

nav a {
  margin-left: 4rem;
  font-size: 0.8rem;
  letter-spacing: 1px;
  line-height: 1;            /* Eliminates the phantom text spacing below uppercase letters */
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--muted);
}

/* ==========================================================================
   3. IDENTICAL FOOTER STYLES
   ========================================================================== */
footer {
  width: 100%;
  background: rgba(245, 245, 245, 0.95);
  backdrop-filter: blur(6px);
}

.footer-tagline {
  text-align: left;       /* Keeps the internal text lines left-aligned */
  margin: 0 auto;         /* Centers the text block relative to the parent container */
  width: fit-content;     /* Collapses the width of the box to fit the typography tightly */
}

footer .container {
  padding: 4rem var(--gutter);
  display: grid;
  /* Changed to 'auto 1fr auto' so the middle column shifts left next to the image */
  grid-template-columns: auto 1fr auto; 
  align-items: center;
  gap: 3rem; /* This now controls the exact distance between the photo and text */
}

footer img {
  max-width: 200px;
}

footer .container p {
  justify-self: start;  /* Aligns the paragraph block to the left of its column */
  text-align: left;     /* Left-aligns the actual lines of text */
  font-size: 1.05rem;
  color: var(--muted);
}

footer .right {
  justify-self: end;
  text-align: left;
  font-size: 0.8rem;
}

/* ==========================================================================
   4. INDEX PAGE SPECIFIC STYLES
   ========================================================================== */
.hero {
  width: 100vw;
  height: calc(100vh - 90px);
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorites,
.editorial {
  content-visibility: auto;
  contain-intrinsic-size: 1000px;
}

.section-title {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-bottom: 6rem;
  color: var(--muted);
}

.favorites {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6rem;
  justify-items: center;
}

.favorites img {
  max-width: 220px;
  border-radius: 4px;
}

.favorites p {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: left;
  width: 100%;
}

.editorial {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: flex-start;
}

.editorial > div {
  position: relative;
  top: 9rem;
}

.editorial h2 {
  font-size: 1.7rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.editorial p {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 600px;
}

.editorial img {
  max-height: 70vh;
  width: auto;
  object-fit: contain;
}

.inquire-title {
  font-family: "Playfair Display", serif;
}

form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin: 5rem auto 0;
  max-width: 800px;   /* Adjust width if needed */
  justify-items: center;
}

form input,
form textarea {
  font-family: "Outfit", sans-serif;
  font-weight: 200;
  letter-spacing: 1px;
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 0.8rem 0;
  font-size: 0.9rem;
  background: transparent;
  width: 100%;
}

textarea {
  grid-column: span 2;
  resize: none;
}

button {
  width: 100px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  grid-column: 1 / -1;
  justify-self: center;
}

/* ==========================================================================
   5. ABOUT PAGE SPECIFIC STYLES
   ========================================================================== */
.about-hero {
  width: 100%;
  height: 80vh;
  padding: 0;
  overflow: hidden;
}

.about-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-grid {
  content-visibility: auto;
  contain-intrinsic-size: 1000px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  margin-bottom: 8rem;
}

.about-grid img {
  border-radius: 4px;
}

.reverse {
  direction: rtl;
}

.reverse * {
  direction: ltr;
}

.about-grid h2 {
  font-size: 1.6rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

.about-grid p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 420px;
}

/* ==========================================================================
   6. GLOBAL MEDIA QUERIES (Responsive design)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    padding-top: 70px; /* Slightly smaller gap for mobile headers */
  }

  .logo {
    height: 45px;
  }

  nav a {
    margin-left: 1.5rem;
    font-size: 0.7rem;
  }

  section {
    padding: 3rem 1rem;
  }

  /* Index specific mobile adjustments */
  .editorial {
    grid-template-columns: 1fr;
  }

  .editorial > div {
    top: 0;
  }

  form {
    grid-template-columns: 1fr;
  }

  textarea {
    grid-column: span 1;
  }

  /* About specific mobile adjustments */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
  }

  /* Footer mobile adjustments */
  footer .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }

  footer .container p,
  footer .right {
    justify-self: center;
    text-align: center;
    grid-column: span 1;
  }
}

/* ==========================================================================
   SHOP PAGE SPECIFIC STYLES
   ========================================================================== */

.shop-hero {
  width: 100%;
  height: 90vh; 
  padding: 0;
  overflow: hidden;
}

.shop-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom; 
}

.shop-section {
  padding-top: 5rem;
  padding-bottom: 8rem;
}

.shop-title {
  text-align: left; 
  font-size: 0.85rem;
  font-weight: 500; 
  letter-spacing: 2px;
  margin-bottom: 6rem; 
  color: var(--text); 
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 6rem 4rem; 
  justify-items: center;
}

.product-card {
  width: 100%;
  max-width: 280px; 
}

/* 3D Perspective Container */
.product-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
  perspective: 1200px; /* Gives the 3D flip realistic depth */
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* BRING TOWARDS SCREEN: Scales up and pops forward over adjacent elements */
.product-image-wrap:hover {
  transform: scale(1.08); 
  z-index: 10; /* Ensures the enlarging card stays on top of everything else */
}

/* Base properties for both front and back images */
.product-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  backface-visibility: hidden; /* Hides the reverse side during rotation */
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

/* 3D FLIP: Primary Image (Front side) */
.product-image-wrap .primary-img {
  transform: rotateY(0deg);
}

.product-image-wrap:hover .primary-img {
  transform: rotateY(180deg);
}

/* 3D FLIP: Secondary Image (Back side) */
.product-image-wrap .secondary-img {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateY(-180deg); /* Pre-rotated so it faces away initially */
}

.product-image-wrap:hover .secondary-img {
  transform: rotateY(0deg); /* Flips cleanly into view */
}

.product-details h3 {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  text-align: center;
}

.product-details p {
  font-size: 0.75rem;
  text-align: center;
  margin: 0 auto;
  color: var(--muted);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .shop-hero {
    height: 55vh; 
  }
  
  .product-grid {
    grid-template-columns: 1fr; 
    gap: 4rem 0;
  }
  
  /* Disable intense scaling adjustments on smaller mobile portraits to prevent clipping */
  .product-image-wrap:hover {
    transform: scale(1.03); 
  }
}

/* ==========================================================================
   7. PROJECTS PAGE
   ========================================================================== */

.projects-hero {
  width: 100%;
  height: 82vh;
  padding: 0;
  overflow: hidden;
}

.projects-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.projects-section {
  padding-top: 5rem;
  padding-bottom: 14rem; /* Increased padding to give the shifted middle column breathing room at the bottom */
}

.projects-title {
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: 2px;
  margin-bottom: 1.2rem;
}

.projects-description {
  max-width: none;       /* Removes restriction so it can expand fully */
  white-space: nowrap;   /* Forces the entire text onto a single line on desktop views */
  color: var(--muted);
  margin-bottom: 5rem;
  line-height: 1.8;
  font-size: .95rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2.5rem;
  align-items: start;
}

.project-card {
  overflow: hidden;
}

/* TARGETS THE MIDDLE COLUMN: Shifts cards 2, 5, and 8 downward uniformly */
.project-card:nth-child(3n+2) {
  transform: translateY(5.5rem);
}

.project-card img {
  width: 100%;
  display: block;
  transition: transform .45s ease;
}

.project-card:hover img {
  transform: scale(1.03);
}

/* Responsive fixes for the Projects page elements on mobile devices */
@media (max-width: 768px) {
  .projects-description {
    white-space: normal; /* Allows text to wrap safely on mobile screens instead of overflowing */
  }

  .projects-grid {
    grid-template-columns: 1fr; /* Collapses to a single clean column on mobile views */
    gap: 2rem;
  }

  .project-card:nth-child(3n+2) {
    transform: none; /* Resets the vertical stagger effect on mobile so cards stack normally */
  }

  .projects-section {
    padding-bottom: 4rem;
  }
}

/* ==========================================================================
   8. CONTACT PAGE SPECIFIC STYLES
   ========================================================================== */

.contact-hero {
  width: 100%;
  height: 82vh;
  padding: 0;
  overflow: hidden;
}

.contact-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-section {
  padding-top: 5rem;
  padding-bottom: 8rem;
}

.contact-header-wrap {
  text-align: center;
  margin-bottom: 5rem;
}

.contact-main-title {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 3px;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.contact-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--muted);
  max-width: none;
  margin-bottom: 0;
}

/* Form structure rewrite for elegant label alignments */
.contact-page-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-page-form .form-field {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.contact-page-form label {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: #111;
  font-weight: 400;
  margin-bottom: 0.2rem;
}

.contact-page-form input,
.contact-page-form textarea {
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  background: transparent;
  width: 100%;
  border-radius: 0;
  outline: none;
  font-family: "Outfit", sans-serif;
}

.contact-page-form .span-full {
  grid-column: span 2;
  margin-top: 1rem;
}

.contact-page-form button {
  margin-top: 3rem;
  width: 130px;
  height: 42px;
  border: 1px solid #ccc;
  background: transparent;
  font-size: 0.75rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.contact-page-form button:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Responsiveness adjustments for smaller form screens */
@media (max-width: 768px) {
  .contact-hero {
    height: 50vh;
  }
  
  .contact-page-form {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact-page-form .span-full {
    grid-column: span 1;
  }
  
  .desktop-only {
    display: none;
  }
}