/* Responsive layout corrections for the Zibara Renovations site. */

.zibara-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zibara-stats-grid > div {
  min-width: 0;
  border-left-width: 0;
  padding-left: 0;
  padding-right: clamp(0.75rem, 3vw, 2rem);
}

.zibara-stats-grid > div:nth-child(even) {
  border-left: 1px solid var(--border);
  padding-left: clamp(1.25rem, 4vw, 2rem);
  padding-right: 0;
}

@media (min-width: 72rem) {
  .zibara-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .zibara-stats-grid > div,
  .zibara-stats-grid > div:nth-child(even) {
    border-left: 1px solid var(--border);
    padding-left: 2rem;
    padding-right: 0;
  }

  .zibara-stats-grid > div:first-child {
    border-left-width: 0;
    padding-left: 0;
  }
}

.zibara-footer-essentials {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.zibara-footer-essential-link {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  color: var(--muted-foreground);
  font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: color 250ms ease;
}

.zibara-footer-essential-link:hover {
  color: var(--primary);
}

.zibara-footer-essential-link > span:last-child {
  flex: 0 0 auto;
  color: var(--primary);
  font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  opacity: 0.85;
  transition: transform 250ms ease;
}

.zibara-footer-essential-link:hover > span:last-child {
  transform: translate(0.2rem, -0.2rem);
}

@media (min-width: 48rem) {
  .zibara-footer-essentials {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(2rem, 6vw, 5rem);
  }
}

/* Keep the dark Gallery case study aligned with the other case-study accents. */
section.section-dark:has(a[href="/projects/vaulted-main-floor-renovation"]) .text-eyebrow {
  color: #9e400d;
}

section.section-dark:has(a[href="/projects/vaulted-main-floor-renovation"]) .btn-primary {
  /* Compensate for the dark surround so this reads like the burgundy button above. */
  background-color: #89370b;
  color: oklch(98% 0.006 82);
}

/* Mobile layout: reserve header space and let hero copy determine its height. */
@media (max-width: 47.999rem) {
  html, body { overflow-x: clip; }
  header {
    background: #1a1917 !important;
    border-bottom-color: rgba(255, 255, 255, .1) !important;
  }
  header > .container-site { height: 72px; }
  header > [aria-hidden="true"] { display: none; }
  header .zibara-logo-lockup { gap: 9px; }
  header .zibara-logo-lockup__mark { width: 40px; height: 40px; flex-basis: 40px; }
  header .zibara-logo-lockup__wordmark { display: inline-flex; }
  header .zibara-logo-lockup__name { font-size: 15px; }
  header .zibara-logo-lockup__descriptor { font-size: 5px; margin-top: 5px; }
  header button { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
  main { padding-top: 72px; }
  main > section:first-child:has(h1) { min-height: 0; }
  main > section:first-child:has(h1) > .container-site { padding-top: 36px; padding-bottom: 40px; }
  main > section:first-child:has(h1) .text-eyebrow {
    font-size: 10px; line-height: 1.7; letter-spacing: .16em; color: #fa9a4c;
  }
  main > section:first-child h1 { font-size: clamp(2.125rem, 9.7vw, 2.75rem); line-height: 1.1; margin-top: 18px; }
  main > section:first-child:has(h1) .body-lg { font-size: 17px; line-height: 1.65; margin-top: 22px; }
  main > section:first-child:has(h1) .caption-veil {
    inset: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(20,18,15,.52), rgba(20,18,15,.74));
  }
  main > section:first-child:has(h1) .flex:has(> .btn) { gap: 12px; margin-top: 28px; }
  main > section:first-child:has(h1) .btn { width: 100%; min-height: 52px; padding: 14px 20px; font-size: 16px; }
  main > section:first-child:has(h1) .body-sm { font-size: 13px; line-height: 1.7; margin-top: 24px; }
}
