/* ============================================================
   REFERENCES PAGE — references.css
   Extends style.css tokens and nav/footer already defined there.
   ============================================================ */

/* Override nav opacity — page loads without the overlay animation */
.nav { opacity: 1; }

/* ============================================================
   PAGE HERO
   ============================================================ */
.ref-hero {
  border-bottom: 1px solid var(--border);
}

.ref-hero-intro {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 10rem 4rem 5rem;
  margin-bottom: 0;
  background-image: url("images/kitchens/Gacaferi 1957 - Luce/Gacaferi 1957 - Luce 2.jpg");
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}

.ref-hero-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(14,13,12,0.82) 0%,
    rgba(14,13,12,0.34) 55%,
    rgba(14,13,12,0.18) 100%
  );
  z-index: 0;
}

.ref-hero-inner {
  position: relative;
  width: min(1200px, 100%);
  margin: 0;
  padding: 0;
  max-width: 100%;
  color: #f5f2ee;
  z-index: 1;
  /* Keep support copy aligned to the title's visual left edge */
  --ref-hero-title-align: 0.05em;
}

.ref-hero-title {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 1rem 0 1.5rem;
  max-width: 800px;
  color: #f7f5f2;
}

.ref-hero-title em {
  font-style: italic;
  color: rgba(247, 245, 242, 0.84);
}

.ref-hero-sub {
  font-size: 1.05rem;
  color: rgba(247, 245, 242, 0.9);
  max-width: 520px;
  line-height: 1.75;
  margin-left: var(--ref-hero-title-align);
}
.ref-hero-intro .section-label {
  color: rgba(247, 245, 242, 0.72);
  margin-left: var(--ref-hero-title-align);
}

/* Stats row */
.ref-hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  padding-top: 2.2rem;
  padding-bottom: 2.8rem;
  border-top: 1px solid var(--border);
}

.ref-stat { text-align: center; }

.ref-stat-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--fg);
}

.ref-stat-unit {
  font-size: 0.55em;
  vertical-align: super;
  color: var(--muted);
}

.ref-stat p {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ref-stat-div {
  width: 1px;
  height: 3rem;
  background: var(--border);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.ref-rule {
  height: 1px;
  background: var(--border);
  margin: 1.6rem 4rem 0;
}

/* ============================================================
   PROCESS — aligned with kitchen-detail .kd-details / .kd-desc
   ============================================================ */
.ref-process.kd-details {
  border-top: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4rem;
}

.ref-process .kd-desc {
  padding: 5rem 0;
  max-width: 760px;
  margin: 0 auto;
}

.ref-process .kd-desc h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1rem 0 2rem;
  line-height: 1.15;
}

.ref-process .kd-desc h2 em {
  font-style: italic;
}

.ref-process .kd-desc p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.2rem;
  max-width: 38rem;
}

.ref-process .kd-desc.kd-desc--page-center {
  text-align: center;
}

.ref-process .kd-desc.kd-desc--page-center .section-label,
.ref-process .kd-desc.kd-desc--page-center h2,
.ref-process .kd-desc.kd-desc--page-center p {
  margin-left: auto;
  margin-right: auto;
}

.ref-process .ref-process-timeline {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.ref-process .ref-process-timeline strong {
  color: var(--fg);
  font-weight: 600;
}

/* ============================================================
   PROJECTS GRID
   ============================================================ */
.ref-projects {
  padding: 6rem 0 8rem;
}

.ref-projects .container {
  padding: 0;
}

.ref-projects-header {
  padding: 0;
  margin-bottom: 3rem;
}

.ref-grid {
  display: flex;
  flex-direction: column;
  gap: 3.25rem;
}

.ref-group {
  border-bottom: 1px solid var(--border);
  padding-bottom: 3.25rem;
}

.ref-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ref-group-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(86px, auto);
  gap: 8px;
}

.ref-group.ref-group--two .ref-group-grid .ref-card:nth-child(1) {
  grid-column: 1 / 4;
  grid-row: span 4;
}

.ref-group.ref-group--two .ref-group-grid .ref-card:nth-child(2) {
  grid-column: 4 / 7;
  grid-row: span 4;
}

.ref-group.ref-group--three .ref-group-grid .ref-card:nth-child(1) {
  grid-column: 1 / 5;
  grid-row: span 6;
}

.ref-group.ref-group--three .ref-group-grid .ref-card:nth-child(2) {
  grid-column: 5 / 7;
  grid-row: span 3;
}

.ref-group.ref-group--three .ref-group-grid .ref-card:nth-child(3) {
  grid-column: 5 / 7;
  grid-row: span 3;
}

.ref-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  height: 100%;
  min-height: 200px;
}

/* Landscapes are featured as solo rows */
.ref-card.ref-card--landscape {
  grid-column: auto;
  aspect-ratio: auto;
}

.ref-card.ref-card--portrait {
  min-height: 280px;
}

.ref-card-img {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ref-card-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s ease;
  will-change: transform;
}

.ref-card:hover .ref-card-img img {
  transform: scale(1.04);
}

/* ============================================================
   IMAGE LIGHTBOX
   ============================================================ */
.ref-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2000;
}
.ref-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.ref-lightbox-img {
  max-width: min(92vw, 1600px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
body.ref-lightbox-open {
  overflow: hidden;
}

.ref-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}
.ref-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.66);
}
.ref-lightbox-nav:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}
.ref-lightbox-nav--prev {
  left: clamp(0.8rem, 2.5vw, 2rem);
}
.ref-lightbox-nav--next {
  right: clamp(0.8rem, 2.5vw, 2rem);
}
.ref-lightbox-nav.is-disabled {
  opacity: 0.22;
  cursor: default;
}

.ref-card-overlay {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
}

.ref-card-tag {
  display: inline-block;
  background: rgba(247, 245, 242, 0.88);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  border-radius: 2px;
}

.ref-card-info {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.ref-card-info h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.ref-card-info span {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Initial hidden state (animated by JS) */
.ref-card {
  opacity: 0;
  transform: translateY(40px);
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials {
  padding: 8rem 0;
  background: var(--dark);
}

.testimonials .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
}

.testimonials .section-label {
  color: rgba(247,245,242,0.45);
  display: block;
  margin-bottom: 4rem;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.testimonial-card {
  padding: 2.5rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(30px);
}

.testimonial-quote-mark {
  font-family: var(--serif);
  font-size: 4rem;
  line-height: 0.8;
  color: rgba(247,245,242,0.15);
  margin-bottom: 1rem;
}

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(247,245,242,0.75);
  margin-bottom: 2rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  flex-shrink: 0;
}

.testimonial-author strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(247,245,242,0.9);
}

.testimonial-author span {
  font-size: 0.75rem;
  color: rgba(247,245,242,0.4);
}

/* ============================================================
   GOOGLE REVIEWS
   ============================================================ */
.google-reviews {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}
.gr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.gr-rating-block {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.gr-score {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 1;
}
.gr-stars {
  display: flex;
  gap: 2px;
  align-items: center;
}
.gr-count {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.gr-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
  transition: border-color 0.25s;
}
.gr-cta:hover { border-color: var(--fg); }
.gr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.gr-card {
  padding: 2rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.gr-card-stars { display: flex; gap: 2px; }
.gr-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
  flex: 1;
}
.gr-card-author {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.gr-card-author strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}
.gr-card-author span {
  font-size: 0.75rem;
  color: var(--muted);
}
@media (max-width: 768px) {
  .google-reviews { padding: 4rem 0; }
  .gr-header { flex-direction: column; align-items: flex-start; }
  .gr-rating-block { flex-wrap: wrap; gap: 0.8rem; }
  .gr-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MARKET STRIP
   ============================================================ */
.ref-markets {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ref-markets .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
}

.ref-markets-inner {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.ref-market-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ref-market-tags span {
  padding: 0.35rem 1rem;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 2px;
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.ref-cta {
  position: relative;
  height: 70vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ref-cta-img-wrap {
  position: absolute;
  inset: 0;
}

.ref-cta-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 6s ease;
}

.ref-cta:hover .ref-cta-img {
  transform: scale(1);
}

.ref-cta-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(20,20,18,0.86) 40%, rgba(20,20,18,0.46));
}

.ref-cta-body {
  position: relative;
  z-index: 2;
  padding: 0 4rem;
  max-width: 600px;
}

.ref-cta-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #f7f5f2;
  margin: 1rem 0 1.4rem;
}

.ref-cta-title em {
  font-style: italic;
  color: rgba(247,245,242,0.7);
}

.ref-cta-desc {
  font-size: 0.95rem;
  color: rgba(247,245,242,0.65);
  margin-bottom: 2.5rem;
  max-width: 400px;
  line-height: 1.7;
}

.ref-cta-btn-solid {
  display: inline-block;
  padding: 1rem 2.4rem;
  background: #c0392b;
  color: #f5f2ee;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s;
  white-space: nowrap;
}

.ref-cta-btn-solid:hover {
  background: #a93226;
}

.ref-cta-body .btn-outline {
  opacity: 0;
  transform: translateY(20px);
}

/* ============================================================
   SHARED UTILITIES (reused from style.css patterns)
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-label.light { color: rgba(247,245,242,0.5); }

.btn-outline {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border: 1px solid rgba(247,245,242,0.5);
  color: #f7f5f2;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.btn-outline:hover {
  background: rgba(247,245,242,0.1);
  border-color: rgba(247,245,242,0.8);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .ref-group-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
  .ref-group.ref-group--three .ref-group-grid .ref-card:nth-child(1),
  .ref-group.ref-group--three .ref-group-grid .ref-card:nth-child(2),
  .ref-group.ref-group--three .ref-group-grid .ref-card:nth-child(3),
  .ref-group.ref-group--two .ref-group-grid .ref-card:nth-child(1),
  .ref-group.ref-group--two .ref-group-grid .ref-card:nth-child(2) { grid-column: auto; grid-row: auto; }
  .ref-card.ref-card--landscape { grid-column: 1 / -1; }
  .ref-card.ref-card--portrait { min-height: 240px; }
  .testimonials-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .ref-hero-intro {
    height: 78vh;
    min-height: 520px;
    overflow: hidden;
    margin-bottom: 1rem;
    background-size: cover;
    background-position: center;
  }
  .ref-hero-intro::before {
    background: linear-gradient(to top, rgba(14,13,12,0.76) 0%, rgba(14,13,12,0.18) 62%);
  }
  .ref-hero-inner {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 2rem 1.4rem;
    max-width: 100%;
    --ref-hero-title-align: 0.03em;
  }
  .ref-hero-title { font-size: clamp(3rem, 14vw, 6rem); }
  .ref-hero-intro .section-label { color: rgba(247, 245, 242, 0.56); }
  .ref-hero-title { color: #f7f5f2; }
  .ref-hero-title em { color: rgba(247,245,242,0.66); }
  .ref-hero-sub { color: rgba(247,245,242,0.74); }
  .ref-rule { margin: 1rem 1.4rem 0; }

  .ref-process.kd-details { padding: 0 1.4rem; }
  .ref-process .kd-desc { padding: 3rem 0; }

  .ref-projects { padding: 3rem 0 5rem; }

  .ref-projects-header {
    padding: 0 1.4rem;
    margin-bottom: 1.5rem;
  }

  section.ref-projects .container {
    padding: 0 1.4rem;
    max-width: 100%;
  }

  /* Reverted mobile gallery behavior */
  .ref-grid {
    gap: 2rem;
  }

  .ref-group {
    padding-bottom: 2rem;
  }

  .ref-group-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 4px;
  }

  .ref-card {
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }
  .ref-card.ref-card--landscape { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .ref-card.ref-card--portrait { aspect-ratio: 3 / 4; min-height: 0; }

  /* Image fills full card */
  .ref-card-img {
    height: 100%;
  }

  .ref-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Compact info strip */
  .ref-card-info {
    height: 44px;
    padding: 0 0.7rem;
  }

  .ref-card-info h3 {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ref-card-info span {
    font-size: 0.6rem;
    white-space: nowrap;
  }

  .ref-hero-meta { flex-wrap: wrap; gap: 1.5rem; padding-top: 1.6rem; padding-bottom: 1.8rem; margin-top: 0; }
  .ref-stat-div { display: none; }
  .ref-stat-num { font-size: 2.4rem; }
  .testimonials { padding: 5rem 0; }
  .testimonials-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .testimonial-card { padding: 1.8rem; }
  .testimonials .container,
  .ref-markets .container { padding: 0 1.4rem; }
  .ref-markets-inner { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .ref-cta { height: 55vh; min-height: 380px; }
  .ref-cta-body { padding: 0 1.4rem; }
  .ref-cta-title { font-size: clamp(2rem, 9vw, 3.5rem); }
  .nav { padding: 1.2rem 1.4rem; }

  .ref-lightbox-nav {
    width: 34px;
    height: 34px;
  }
}
