/* =====================================================
   NovaLuxe CDA Homes — global.css
   -----------------------------------------------------
   One file to rule them all. Shared across every page.
   Load order: tailwind → global → navbar → page → footer

   Sections:
   1.  Variables
   2.  Base (html/body/fonts/images)
   3.  Scroll animations (reveal/fade/hero)
   4.  Gradient utilities
   5.  Gold underline
   6.  Social pills
   7.  Buttons (CTA + gradient)
   8.  Divider
   9.  Back-to-top
   10. Focus ring
   11. Touch tap-hint pill
   12. Touch hover suppress
   13. iPad CTA layout fix
   14. CTA section safety
   15. FAQ safety
   ===================================================== */


/* ─────────────────────────────────────────────
   1. VARIABLES
   ───────────────────────────────────────────── */
:root {
  --gold:   #c8a45b;
  --gold2:  #e6cd8c;
  --cream:  #fffbe3;

  /* font stacks — use these in page CSS instead of repeating the long string */
  --nlx-sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --nlx-serif: "DM Serif Display", "DM Serif Text", ui-serif, Georgia, "Times New Roman", serif;
}


/* ─────────────────────────────────────────────
   2. BASE
   ───────────────────────────────────────────── */
html, body {
  font-family: var(--nlx-sans);
  font-weight: 400;
  background: #000;
  color: #fff;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Stable scrollbar so layout doesn't shift when content changes height */
html { overflow-y: scroll; scrollbar-gutter: stable; }
body { overflow-y: visible; }

/* Serif opt-in — add .font-serif or .nlx-section-title to an element */
.font-serif,
.nlx-section-title {
  font-family: var(--nlx-serif) !important;
  letter-spacing: -0.01em;
}
.font-sans { font-family: var(--nlx-sans) !important; }

img {
  -webkit-user-drag: none;
  user-select: none;
}


/* ─────────────────────────────────────────────
   3. SCROLL ANIMATIONS
   ─────────────────────────────────────────────
   All reveal variants share one hidden state.
   JS adds .in-view, .is-visible, or .nlx-in
   depending on which observer script is running.
   ───────────────────────────────────────────── */
.reveal,
.fade-item,
.nlx-reveal,
.js .nlx-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .65s ease, transform .65s ease;
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}

/* All activation classes */
.reveal.in-view,   .reveal.is-visible,   .reveal.nlx-in,
.fade-item.in-view, .fade-item.is-visible,
.nlx-reveal.in-view, .nlx-reveal.is-visible, .nlx-reveal.nlx-in,
.in-view .reveal,  .in-view .fade-item,
/* When a parent section gets nlx-in, reveal its fade/reveal children */
.nlx-in .fade-item, .nlx-in .reveal {
  opacity: 1;
  transform: none;
}

/* Renovation pages reveal .nlx-reveal via Tailwind opacity-100 class.
   The CSS .nlx-reveal { opacity: 0 } would otherwise override it. */
.nlx-reveal.opacity-100 {
  opacity: 1 !important;
  transform: none !important;
}

/* .is-visible needs !important because pages use ID-selector rules (high specificity)
   to set opacity:0 on specific elements, and only !important can override them */
.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Hero stagger lives in each page's own CSS
   (about.js animates the wrapper div, not hero-items directly,
   so a generic [id$="-hero"] .hero-item rule breaks the about page) */

/* Reduced motion: show everything immediately */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .fade-item,
  .nlx-reveal,
  [id$="-hero"] .hero-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }
}


/* ─────────────────────────────────────────────
   4. GRADIENT UTILITIES
   ───────────────────────────────────────────── */

/* Gradient text — gold → cream → white */
.nlx-gradient-text {
  display: inline-block;
  padding-bottom: .08em;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold2) 45%, #fff 72%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-weight: inherit;
  font-family: inherit;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Per-word gradient (wrap individual words in .nlx-wordgrad spans) */
.nlx-wordgrad {
  display: inline-block;
  padding-bottom: .08em;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold2) 45%, #fff 72%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Logo-style gradient (used on About page heading) */
.nlx-logo-gradient {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold2) 50%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Gradient border frame */
.nlx-gradient-border {
  position: relative;
  border-radius: 1.5rem;
  padding: 2px;
  background: linear-gradient(180deg, var(--gold), var(--gold2), #fff);
  max-width: 100%;
  box-sizing: border-box;
}
.nlx-gradient-border > .nlx-border-inner {
  border-radius: calc(1.5rem - 2px);
  background: #000;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 2.5rem);
  position: relative;
  z-index: 1;
}
/* Kill any pseudo-element border hacks */
.nlx-gradient-border::before,
.nlx-gradient-border::after { content: none !important; }
.nlx-border-inner::before,
.nlx-border-inner::after  { pointer-events: none; }


/* ─────────────────────────────────────────────
   5. GOLD UNDERLINE
   ─────────────────────────────────────────────
   Used on nav links, footer links, inline CTAs.
   ───────────────────────────────────────────── */
.nlx-gold-underline {
  position: relative;
  transition: color .2s ease;
}
.nlx-gold-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold2), #fff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .nlx-gold-underline:hover { color: var(--gold2); }
  .nlx-gold-underline:hover::after { transform: scaleX(1); }
}

/* Convenience heading colour */
.nlx-gold-heading { color: #e9d39c; }


/* ─────────────────────────────────────────────
   6. SOCIAL PILLS
   ─────────────────────────────────────────────
   40×40 circle icon buttons (footer + mobile menu).
   ───────────────────────────────────────────── */
.nlx-pill {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: saturate(120%) blur(2px);
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.nlx-pill i { transition: background .3s ease, color .3s ease; }

@media (hover: hover) and (pointer: fine) {
  .nlx-pill:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .35);
  }
  .nlx-pill:hover i {
    background: linear-gradient(180deg, var(--gold), var(--gold2), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}


/* ─────────────────────────────────────────────
   7. BUTTONS
   ───────────────────────────────────────────── */

/* Footer / section CTA button */
.nlx-cta-btn {
  display: inline-block;
  border-radius: .75rem;
  padding: .5rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: #000;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold2) 55%, #fff 100%);
  transition: filter .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .nlx-cta-btn:hover { filter: brightness(.85); }
}

/* Gradient button (Build / Reno pages) */
.btn-grad {
  background: linear-gradient(180deg, var(--gold), var(--gold2), #fff);
  color: #111;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: .75rem 1.25rem;
  font-weight: 600;
  transition: opacity .2s ease, transform .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn-grad:hover { opacity: .9; transform: translateY(-1px); }
}


/* ─────────────────────────────────────────────
   8. DIVIDER
   ─────────────────────────────────────────────
   Full-width gold fade (footer top + section breaks).
   ───────────────────────────────────────────── */
.nlx-divider {
  height: 2px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(200, 164, 91, 0)   0%,
    rgba(200, 164, 91, .55) 12%,
    var(--gold2)            50%,
    rgba(200, 164, 91, .55) 88%,
    rgba(200, 164, 91, 0)   100%
  );
}
@media (min-width: 1024px) { .nlx-divider { height: 3px; } }


/* ─────────────────────────────────────────────
   9. BACK TO TOP
   ───────────────────────────────────────────── */
.nlx-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: #000;
  background: linear-gradient(180deg, var(--gold), var(--gold2), #fff);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: transform .25s ease, filter .25s ease, opacity .25s ease;
}
.nlx-to-top[hidden] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}
@media (hover: hover) and (pointer: fine) {
  .nlx-to-top:hover { transform: translateY(-2px); filter: brightness(.95); }
}


/* ─────────────────────────────────────────────
   10. FOCUS RING
   ─────────────────────────────────────────────
   Gold glow for keyboard navigation.
   ───────────────────────────────────────────── */
:where(a, button):focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .9), 0 0 0 4px rgba(200, 164, 91, .55);
  border-radius: 12px;
}


/* ─────────────────────────────────────────────
   11. TOUCH TAP-HINT PILL
   ─────────────────────────────────────────────
   Gold "View →" pill shown on mobile/touch only
   in card grids (What We Build, Past Projects, etc).
   ───────────────────────────────────────────── */
.tap-arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  pointer-events: none;
  z-index: 10;
  display: none;
}
.tap-arrow__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  color: #0b0b0b;
  background: linear-gradient(180deg, var(--gold), var(--gold2), #fff);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35);
  opacity: .92;
  transform: translateY(2px);
}
.tap-arrow__icon { font-size: 16px; line-height: 1; }

@media (hover: none) and (pointer: coarse) {
  .tap-arrow { display: block; }
  .tap-arrow__pill { animation: tapHint 1.4s ease-out 1; }
}

@keyframes tapHint {
  0%   { opacity: 0; transform: translate(10px, 10px) scale(.98); }
  100% { opacity: .92; transform: translateY(2px) scale(1); }
}


/* ─────────────────────────────────────────────
   12. TOUCH HOVER SUPPRESS
   ─────────────────────────────────────────────
   Tailwind hover classes do nothing on touch
   devices — remove transforms, opacity changes, etc.
   ───────────────────────────────────────────── */
@media (hover: none), (pointer: coarse) {
  .hover\:scale-105:hover,
  .hover\:scale-110:hover,
  .hover\:-translate-y-1:hover,
  .hover\:opacity-90:hover,
  .hover\:shadow:hover,
  .hover\:shadow-lg:hover,
  .hover\:shadow-2xl:hover,
  .hover\:bg-white:hover,
  .hover\:text-black:hover,
  .hover\:border-white\/60:hover {
    transform: none !important;
    opacity: 1 !important;
    box-shadow: none !important;
    background: inherit !important;
    color: inherit !important;
    border-color: inherit !important;
  }
}


/* ─────────────────────────────────────────────
   13. IPAD CTA LAYOUT FIX
   ─────────────────────────────────────────────
   Every page has a #contact-cta or similar section.
   On iPad (768–1023px) the two-column CTA grid
   needs to collapse to one column + centre.
   ───────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {

  #contact-cta            .md\:grid-cols-\[1\.2fr_auto\],
  #renovations-cta        .md\:grid-cols-\[1\.2fr_auto\],
  #projects-cta           .md\:grid-cols-\[1\.2fr_auto\],
  #contact-cta-basement   .md\:grid-cols-\[1\.2fr_auto\],
  #final-cta              .md\:grid-cols-\[1\.2fr_auto\],
  #customhome-cta         .md\:grid-cols-\[1\.2fr_auto\] {
    grid-template-columns: 1fr !important;
  }

  #contact-cta            .md\:text-left,
  #renovations-cta        .md\:text-left,
  #projects-cta           .md\:text-left,
  #contact-cta-basement   .md\:text-left,
  #final-cta              .md\:text-left,
  #customhome-cta         .md\:text-left {
    text-align: center !important;
  }

  #contact-cta            .md\:mx-0,
  #renovations-cta        .md\:mx-0,
  #projects-cta           .md\:mx-0,
  #contact-cta-basement   .md\:mx-0,
  #final-cta              .md\:mx-0,
  #customhome-cta         .md\:mx-0 {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #contact-cta            .md\:items-end,
  #renovations-cta        .md\:items-end,
  #projects-cta           .md\:items-end,
  #contact-cta-basement   .md\:items-end,
  #final-cta              .md\:items-end,
  #customhome-cta         .md\:items-end {
    align-items: center !important;
  }
}


/* ─────────────────────────────────────────────
   14. CTA SECTION SAFETY
   ─────────────────────────────────────────────
   Prevent text overflow and keep grid kids
   from forcing the card wider than the screen.
   ───────────────────────────────────────────── */
section[id$="-cta"],
section[id*="cta"] {
  overflow: visible;
}

section[id$="-cta"] .grid > *,
section[id*="cta"]  .grid > * {
  min-width: 0;
}

section[id$="-cta"] h2,
section[id*="cta"]  h2,
section[id$="-cta"] p,
section[id*="cta"]  p {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

section[id$="-cta"] a,
section[id*="cta"]  a {
  max-width: 100%;
}

/* Stack on phones */
@media (max-width: 767.98px) {
  section[id$="-cta"] .grid,
  section[id*="cta"]  .grid {
    grid-template-columns: 1fr !important;
  }

  section[id$="-cta"] h2,
  section[id*="cta"]  h2 {
    font-size: clamp(1.75rem, 7vw, 3rem);
    line-height: 1.1;
  }
}


/* ─────────────────────────────────────────────
   15. FAQ SAFETY
   ─────────────────────────────────────────────
   Prevent clipping on alpine.js accordions.
   ───────────────────────────────────────────── */
#faq,
#faq * {
  overflow: visible;
  max-height: none;
}
