/* sections.css — layouts for each scroll panel.
   Variants (composed):
     Background:  .section--white | .section--cream | .section--dark
     Layout:      .section--hero | .section--breather | .section--stacked | .section--close
   Crop helpers for .section__media:  .crop--top | .crop--bottom + .crop--16-9 | .crop--16-10
*/

/* ----- BASE SECTION ------------------------------------------------------- */
.folder-section {
  position: relative;
  width: 100%;
  /* Layout: image flows above text card. Vertical gap controlled per-variant. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}

.section__inner {
  width: 100%;
  max-width: var(--section-max-w);
  margin: 0 auto;
  padding: var(--section-pad-y) var(--section-pad-x);
}
.section__inner--narrow { max-width: 600px; }
.section__inner--wide   { max-width: 900px; }

/* Background colors */
.section--white  { background: var(--bg-surface); color: var(--ink); }
.section--cream  { background: var(--bg-base);    color: var(--ink); }
.section--dark   { background: var(--bg-dark);    color: var(--ink-inverse); }
.section--dark .eyebrow { color: var(--accent); }
.section--dark .kicker  { color: var(--newman-grey); }
.section--dark a:not(.cta-link):not(.contact-value):not(.reviews-tile):not(.socials a) {
  color: var(--accent);
}

/* ----- MEDIA (the section's image) --------------------------------------- */
.section__media {
  width: 100%;
  margin: 0;
  overflow: hidden;
  /* Defaults — overridden by crop classes */
  aspect-ratio: 4 / 3;
  background: var(--newman-grey);
}
.section__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Crop helpers — choose aspect-ratio + object-position to surface the right
   region of the full-page WebP. The source pages are 8.5x11 (0.77 aspect),
   so we crop to wider ratios and slide the image up or down. */
.crop--16-9   { aspect-ratio: 16 / 9; }
.crop--16-10  { aspect-ratio: 16 / 10; }
.crop--4-3    { aspect-ratio: 4 / 3; }
.crop--top    img { object-position: 50% 0%; }
.crop--bottom img { object-position: 50% 100%; }
.crop--middle img { object-position: 50% 50%; }

/* On wider screens (tablet+), crop tighter so text starts higher in the panel */
@media (min-width: 768px) {
  .crop--16-9   { aspect-ratio: 21 / 9; }
  .crop--16-10  { aspect-ratio: 21 / 10; }
}

/* ============================================================================
   1. HERO — full-bleed background image, brand mark and headline overlay
   ============================================================================ */
.section--hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  color: var(--ink-inverse);
  /* Center content vertically over the full-bleed background */
  display: grid;
  grid-template-areas: "stack";
}
.section--hero > * { grid-area: stack; }

.section__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Dark gradient so the hero copy stays legible over varied photography */
.section__overlay {
  background: linear-gradient(
    180deg,
    rgba(1, 1, 1, 0.55) 0%,
    rgba(1, 1, 1, 0.25) 35%,
    rgba(1, 1, 1, 0.65) 100%
  );
  pointer-events: none;
}

.hero__inner {
  /* Centered vertical block within the hero grid cell */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding-top: max(var(--section-pad-y), env(safe-area-inset-top));
  padding-bottom: calc(var(--section-pad-y) + 3rem);
  z-index: 2;
}

/* Brand logo image (white-on-transparent) used on dark backgrounds */
.brand-logo {
  display: block;
  width: clamp(160px, 38vw, 240px);
  height: auto;
  margin: 0 0 var(--space-6);
  /* The white logo PNG has its own alpha; no filter needed.
     Drop-shadow is subtle to keep the logo crisp over photography. */
  filter: drop-shadow(0 2px 16px rgba(0, 0, 0, 0.35));
}
.brand-logo--close {
  width: clamp(140px, 28vw, 180px);
  margin-bottom: var(--space-7);
  filter: none;
}

.hero__inner .display {
  color: var(--ink-inverse);
  margin: 0 0 var(--space-5);
  max-width: 14ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.display__accent {
  color: var(--accent);
  font-family: var(--font-accent);
  font-weight: var(--fw-regular);
  font-style: italic;
  letter-spacing: 0;
}
.display--med { font-size: var(--fs-h2); }

.hero__inner .kicker {
  color: var(--newman-light-gold);
  max-width: 28ch;
  margin: 0;
}

.scroll-cue {
  position: absolute;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--newman-light-gold);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  animation: cue-pulse 2.4s var(--ease-out) infinite;
  transition: opacity 400ms var(--ease-out);
  z-index: 3;
}
body.has-scrolled .scroll-cue { opacity: 0; }

@keyframes cue-pulse {
  0%, 100% { transform: translate(-50%, 0);  opacity: 0.6; }
  50%      { transform: translate(-50%, 6px); opacity: 1; }
}

/* ============================================================================
   BREATHER — pure full-bleed photo, no text overlay (headline burned in)
   ============================================================================ */
.section--breather {
  background: var(--bg-dark);
}
.section--breather img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 100svh;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .section--breather img {
    max-height: 90vh;
  }
}

/* ============================================================================
   STACKED — image on top, text card below (the default content variant)
   ============================================================================ */
.section--stacked .section__inner {
  /* Pull text closer to image but keep clear vertical rhythm */
  padding-top: calc(var(--section-pad-y) * 0.7);
}

/* ============================================================================
   TYPOGRAPHIC ACCENTS USED IN SECTIONS
   ============================================================================ */
.h-accent {
  color: var(--accent);
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: var(--fw-regular);
  letter-spacing: 0;
}
.kicker--quiet { color: var(--ink-muted); max-width: 60ch; }

/* Letter signoff */
.signature { margin-top: var(--space-6); font-family: var(--font-accent); font-style: italic; }
.signature__name {
  display: inline-block;
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  color: var(--ink);
}

/* ============================================================================
   PILLARS GRID (Newman Difference)
   ============================================================================ */
.pillars {
  list-style: none;
  padding: 0;
  margin: var(--space-7) 0 0;
  display: grid;
  gap: var(--space-7);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .pillars { grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
}
.pillar h3 {
  font-size: var(--fs-h3);
  margin: var(--space-3) 0 var(--space-3);
}
.pillar p {
  font-size: 1rem;
  color: var(--ink-muted);
  margin: 0;
  max-width: 38ch;
}
.pillar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--newman-white);
}
.pillar__icon svg { width: 28px; height: 28px; }

/* ============================================================================
   SPEC LIST (dl/dt/dd used for sub-components like Eave Edge, Rake Edge)
   ============================================================================ */
.spec-list {
  margin: var(--space-6) 0 0;
  display: grid;
  gap: var(--space-5);
}
.spec-list dt {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  font-size: 1.0625rem;
  color: var(--ink);
  margin-bottom: var(--space-1);
}
.section--dark .spec-list dt { color: var(--ink-inverse); }
.spec-list dd {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* ============================================================================
   CTA LINK (inline arrow link replacing printed QR codes)
   ============================================================================ */
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.15rem;
  transition: gap 200ms var(--ease-out), color 200ms var(--ease-out);
}
.cta-link:hover, .cta-link:focus-visible { gap: 0.75rem; color: var(--accent); }
.cta-link--inverse { color: var(--ink-inverse); }
.cta-link--inverse:hover, .cta-link--inverse:focus-visible { color: var(--accent); }

/* ============================================================================
   QUOTE / TESTIMONIAL
   ============================================================================ */
.quote {
  margin: var(--space-6) 0;
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
  background: var(--newman-white);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  font-family: var(--font-accent);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
}
.quote p { margin: 0; }
.quote strong { font-family: var(--font-display); font-weight: var(--fw-bold); }

/* Socials line under testimonials */
.socials {
  margin-top: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.socials__label {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.socials a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--gold-20); padding-bottom: 0.1rem; }
.socials a:hover, .socials a:focus-visible { border-bottom-color: var(--accent); }

/* ============================================================================
   CLOSE SECTION — contact + Google reviews
   ============================================================================ */
.section--close {
  text-align: left;
  padding-bottom: calc(var(--section-pad-y) + env(safe-area-inset-bottom));
}
.section--close .display {
  color: var(--ink-inverse);
  margin-bottom: var(--space-7);
  max-width: 18ch;
}

.eyebrow--gold-rule {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-5);
}
.eyebrow--gold-rule::before,
.eyebrow--gold-rule::after {
  content: "";
  flex: 0 0 24px;
  height: 1px;
  background: var(--accent);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-7);
  display: grid;
  gap: var(--space-4);
}
.contact-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(196, 162, 95, 0.2);
}
.contact-label {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--newman-grey);
}
.contact-value {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: 1.125rem;
  color: var(--ink-inverse);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.contact-value:hover, .contact-value:focus-visible { color: var(--accent); }

/* Google reviews tile */
.reviews-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: linear-gradient(180deg, rgba(196,162,95,0.12) 0%, rgba(196,162,95,0.03) 100%);
  border: 1px solid rgba(196, 162, 95, 0.4);
  border-radius: 4px;
  color: var(--ink-inverse);
  text-decoration: none;
  transition: border-color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.reviews-tile:hover, .reviews-tile:focus-visible {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(196,162,95,0.22) 0%, rgba(196,162,95,0.08) 100%);
}
.reviews-tile__stars {
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}
.reviews-tile__count {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 1.25rem;
  letter-spacing: var(--ls-display);
}
.reviews-tile__cta {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--newman-grey);
  font-size: 0.9375rem;
}

.footnote {
  margin-top: var(--space-8);
  font-size: 0.8125rem;
  color: var(--newman-grey);
  letter-spacing: 0.05em;
}
