/* ─── Services page — scoped styles ─────────────────────────────────────────
   Relies on style.css for: .navbar, .site-footer__* shared tokens.
   Everything here is prefixed .svc- to avoid collisions.
──────────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Rothefight';
  src: url('Fonts/ROTHEFIGHT.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  /* block: hide text while the font loads rather than flash a fallback.
     The preload tag in <head> keeps the invisible window very brief. */
  font-display: block;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.svc-hero {
  position: relative;
  /* Height is vw-based so it scales with viewport width — same reference unit
     as the heading font-size and the house width, keeping all three in sync
     during viewport resize AND browser zoom. */
  height: clamp(280px, 40vw, 560px);
  background: #f7f5f2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
  padding-top: 60px;
}

/* Rothefight — ultra-tall condensed display font */
.svc-hero__heading {
  font-family: 'Rothefight', sans-serif;
  font-weight: normal;
  /* Scales with viewport width — same unit as the hero height so the text
     and house image grow/shrink together during resize and browser zoom. */
  font-size: clamp(80px, 25vw, 300px);
  line-height: 0.88;
  letter-spacing: 0.02em;
  color: #1a1816;
  margin: 0;

  padding-top: 16px;

  /* Above the house image */
  position: relative;
  z-index: 1;

  /* Center the text */
  text-align: center;
  width: 100%;

  /* Prevent text selection on decorative heading */
  user-select: none;
}

/* House wrapper — carries the absolute position so ::after can shadow beneath.
   height: 65% mirrors the original img height (65% of the hero section).
   display: flex shrink-wraps the width to the image's intrinsic aspect ratio. */
.svc-hero__house-wrap {
  position: absolute;
  bottom: -10%;
  left: 50%;
  transform: translateX(-50%);
  height: 65%;
  display: flex;
  align-items: flex-end;
  z-index: 2;
  pointer-events: none;
}

/* Ground shadow — flat ellipse as if the house sits on a surface */
.svc-hero__house-wrap::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 72%;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.28) 0%, transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

/* House PNG — fills the wrapper height, width follows aspect ratio.
   max-width handles desktop; on mobile the wrapper clips instead
   (see @media max-width:560px) so max-width is removed there. */
.svc-hero__house {
  height: 100%;
  width: auto;
  max-width: calc(100vw - 24px);
  display: block;
  transform-origin: bottom center;
}

/* ─── Services Grid ─────────────────────────────────────────────────────── */

.svc-services {
  /* padding-top accounts for the house that overflows the hero by ~10% of hero
     height. Hero = clamp(280px,40vw,560px) → overflow ≈ 4vw. Adding ~32px
     of breathing room keeps the gap consistent at every viewport width. */
  padding: calc(4vw + 32px) 16px 80px;
  background: #f7f5f2;
}

/*  3-col grid. Photography + Videography each span rows 1-2.
    Row 3: Aerial (col 1) spans rows 3+4. 3D Tours (col 2) + Floor Plans (col 3) in row 3.
    Row 4: Digital Enhancements fills cols 2-3 beside Aerial's lower half. */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 260px 310px 260px 420px;
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

/* ─── Card base ──────────────────────────────────────────────────────────── */

/* Page-load: cards are "placed down" — dropping from a tilted angle */
@keyframes card-place {
  from {
    opacity: 0;
    transform: perspective(900px) rotateX(22deg) rotateY(-7deg) translateY(-28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) rotateY(0deg) translateY(0) scale(1);
  }
}

.svc-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  background-size: cover;
  background-position: center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  animation: card-place 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transform-origin: center bottom;
}

/* Hover: perspective tilt toward viewer — top edge tips forward */
.svc-card:hover {
  transform: perspective(1200px) rotateX(-2deg) rotateY(1.5deg) translateY(-5px);
}

/* Per-card background images mapped to our-work content */
.svc-card--photography { background-image: url('our-work-8.jpg'); }
.svc-card--aerial      { background-image: url('our-work-4.jpg'); }
.svc-card--3dtours     { background-image: url('our-work-3.jpg'); }
.svc-card--floorplans  { background-image: url('our-work-7.jpg'); }
.svc-card--digital     { background-image: url('our-work-2.jpg'); }

/* Looping video background for Videography card */
.svc-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* ─── Gradient overlay — darkens bottom for text readability ─────────────── */

.svc-card__glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.74) 0%,
    rgba(0, 0, 0, 0.26) 48%,
    rgba(0, 0, 0, 0.06) 100%
  );
  transition: background 0.35s ease;
}

.svc-card:hover .svc-card__glass {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.30) 48%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

/* ── 3D Liquid Glass: outer lift shadow ──────────────────────────────────── */

.svc-card {
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.32),
    0 24px 64px rgba(0, 0, 0, 0.28);
}

/* ── 3D Liquid Glass: inner edge highlights + bubble glares ──────────────── */

.svc-card__glass {
  /* Asymmetric border: bright top + left (light source), dim bottom + right */
  border-top:    2.5px solid rgba(255, 255, 255, 0.85);
  border-left:   2.5px solid rgba(255, 255, 255, 0.64);
  border-bottom: 1.2px solid rgba(255, 255, 255, 0.21);
  border-right:  1.2px solid rgba(255, 255, 255, 0.21);
  /* Clip bubble glares to the card's rounded corners */
  overflow: hidden;
  /* Inset top-edge glow strip — appears above the gradient */
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Corner glare — all cards, same settings as aerial */
.svc-card__glass::before {
  content: '';
  position: absolute;
  top:    0;
  left:   0;
  width:  55%;
  height: 65%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.57) 0%,
    rgba(255, 255, 255, 0.14) 32%,
    transparent 52%
  );
  border-radius: 0;
  transform: none;
  filter: blur(14px);
  pointer-events: none;
}

/* ::after unused — removed secondary glare */
.svc-card__glass::after {
  content: none;
}

/* ─── Card content ───────────────────────────────────────────────────────── */

.svc-card__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 26px 22px;
}

.svc-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.svc-card__num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1;
  flex-shrink: 0;
}

.svc-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.svc-card__tags span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.svc-card__body {
  margin-top: auto;
  padding-top: 10px;
}

.svc-card__name {
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: #fff;
  margin: 0 0 8px;
}

.svc-card__hook {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
  margin: 0;
}

.svc-card__explore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.50);
  transition: color 0.2s, gap 0.2s;
}

.svc-card:hover .svc-card__explore {
  color: #fff;
  gap: 10px;
}

/* ─── Grid placement ─────────────────────────────────────────────────────── */

/* Photography: left 2 cols, spans both tall rows */
.svc-card--photography {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  animation-delay: 0.00s;
}
.svc-card--photography .svc-card__name { font-size: clamp(28px, 3.2vw, 44px); }

/* Videography: right col, spans both tall rows */
.svc-card--videography {
  grid-column: 3;
  grid-row: 1 / 3;
  animation-delay: 0.10s;
}

/* Aerial: col 1, spans rows 3+4 — double height */
.svc-card--aerial     { grid-column: 1;     grid-row: 3 / 5; animation-delay: 0.18s; }

/* 3D Tours + Floor Plans: cols 2-3, row 3 only */
.svc-card--3dtours    { grid-column: 2;     grid-row: 3;     animation-delay: 0.26s; }
.svc-card--floorplans { grid-column: 3;     grid-row: 3;     animation-delay: 0.34s; }

/* Digital Enhancements: cols 2-3, row 4 — beside Aerial's lower half */
.svc-card--digital    { grid-column: 2 / 4; grid-row: 4;     animation-delay: 0.42s; }

/* Digital card — horizontal layout */
.svc-card__inner--row {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 18px 26px;
}
.svc-card__inner--row .svc-card__body { margin-top: 0; padding-top: 0; flex: 1; min-width: 0; }
.svc-card__inner--row .svc-card__name { font-size: 20px; margin-bottom: 2px; }
.svc-card__inner--row .svc-card__hook { font-size: 12px; }
.svc-card__tags--inline { display: flex; flex-wrap: nowrap; gap: 5px; flex-shrink: 0; }
.svc-card__explore--end { margin-top: 0; flex-shrink: 0; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  /* Keep the same vw-based top gap; widen side padding for tablet gutters */
  .svc-services { padding: calc(4vw + 32px) 24px 60px; }
  .svc-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }
  .svc-card--photography { grid-column: 1 / 3; grid-row: auto; min-height: 300px; }
  .svc-card--videography { grid-column: 1 / 3; grid-row: auto; min-height: 260px; }
  .svc-card--aerial,
  .svc-card--3dtours,
  .svc-card--floorplans {
    grid-column: span 1; grid-row: auto;
    height: auto; min-height: 210px; align-self: stretch;
  }
  .svc-card--digital { grid-column: 1 / 3; grid-row: auto; }
  .svc-card__tags--inline { display: none; }
  .svc-card__inner--row { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  /* Hero house: iOS Safari squishes the image when max-width + height:100% clash.
     Fix: remove max-width from the image; constrain and clip at the wrapper
     instead. The house stays at its correct height (overlapping the heading)
     and the wrapper crops any excess width symmetrically — no distortion. */
  .svc-hero__house-wrap {
    width: calc(100vw - 24px);
    overflow: hidden;
    justify-content: center;
  }
  .svc-hero__house {
    max-width: none;
  }

  /* Keep a 2-column bento grid on mobile so the unique-size layout survives.
     Photography + Digital span full width; the rest pair up in 50/50 rows. */
  .svc-services { padding: calc(4vw + 32px) 12px 48px; }

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

  /* Full-width feature card */
  .svc-card--photography {
    grid-column: 1 / 3;
    grid-row: auto;
    min-height: 240px;
  }

  /* Pair: Videography left, Aerial right */
  .svc-card--videography {
    grid-column: 1;
    grid-row: auto;
    min-height: 270px;
  }
  .svc-card--aerial {
    grid-column: 2;
    grid-row: auto;
    min-height: 270px;
  }

  /* Digital moves up — sits between the two pairs.
     order: 0 (default) places it here ahead of the 3dtours/floorplans pair
     which are bumped to order: 1. */
  .svc-card--digital {
    grid-column: 1 / 3;
    grid-row: auto;
    min-height: 150px;
  }

  /* Pair: 3D Tours left, Floor Plans right — bottom row, taller than
     videography/aerial so the two pairs have clearly different form factors. */
  .svc-card--3dtours {
    grid-column: 1;
    grid-row: auto;
    min-height: 225px;
    order: 1;
  }
  .svc-card--floorplans {
    grid-column: 2;
    grid-row: auto;
    min-height: 225px;
    order: 1;
  }

  /* Tighter inner padding on narrow cards */
  .svc-card__inner {
    padding: 14px 16px 14px;
  }

  /* Photography gets a slightly larger name to anchor the section */
  .svc-card--photography .svc-card__name {
    font-size: clamp(22px, 6vw, 34px);
  }

  /* Compact name for the paired (narrower) cards */
  .svc-card--videography .svc-card__name,
  .svc-card--aerial      .svc-card__name,
  .svc-card--3dtours     .svc-card__name,
  .svc-card--floorplans  .svc-card__name {
    font-size: clamp(15px, 4.2vw, 22px);
  }

  /* Hide all tag pills on mobile — cards are too narrow */
  .svc-card__tags { display: none; }
}

/* ─── Final CTA overrides (services page) ───────────────────────────────── */

/* Match page background instead of white */
.final-cta {
  background: #f7f5f2;
}

/* Tighter top padding — less gap from the services grid above */
.final-cta__content {
  padding-top: 4rem;
}

/* No heading margin needed since eyebrow is removed */
.final-cta__heading {
  margin-bottom: 2.25rem;
}

/* Remove the desktop bleed — nothing below the footer on this page */
.final-cta__image-wrap {
  margin-bottom: 0;
}

/* Reduce bottom padding on the services grid to close the gap further */
.svc-services {
  padding-bottom: 40px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .svc-services { padding-bottom: 32px; }
}

@media (max-width: 768px) {
  /* Hero height and house image now scale continuously via clamp/vw + max-width —
     no hard overrides needed here. */
  .final-cta__content {
    padding-top: 2.5rem;
  }
  .svc-services { padding-bottom: 24px; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   RTL OVERRIDES — Arabic (applied when <html dir="rtl">)
   ───────────────────────────────────────────────────────────────────────────── */

/* Services hero: ROTHEFIGHT is Latin-only, use Arabic serif */
[dir="rtl"] .svc-hero__heading {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: clamp(3rem, 9vw, 7.5rem);
  letter-spacing: 0;
}

/* Service card text */
[dir="rtl"] .svc-card__name,
[dir="rtl"] .svc-card__hook,
[dir="rtl"] .svc-card__tags span {
  font-family: 'Noto Naskh Arabic', serif;
  letter-spacing: 0;
}

/* Flip arrow SVG for RTL reading direction */
[dir="rtl"] .svc-card__explore svg {
  transform: scaleX(-1);
}
