/* ============================================================
   J Legacy Renovations — Custom CSS
   Tailwind handles most styling; this file handles things
   Tailwind CDN cannot do (parallax, lightbox, transitions).
   ============================================================ */

/* ----------  Fonts  ---------------------------------------- */
body {
    font-family: 'Lato', sans-serif;
}

h1, h2, h3, h4, h5, h6,
.font-heading {
    font-family: 'Montserrat', sans-serif;
}

/* ----------  Parallax Background  -------------------------- */
.parallax-bg {
    background-image: url('../images/bg-texture.webp');
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* ----------  Hero Background  ------------------------------ */
.hero-bg {
    background-image: url('../images/carousel/renovation-1.jpeg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Fallback on touch devices where fixed attachment doesn't work */
@media (hover: none) {
    .parallax-bg,
    .hero-bg {
        background-attachment: scroll;
    }
}

/* ----------  Image Carousel  ------------------------------- */
.carousel-slide {
    transition: opacity 0.6s ease-in-out;
}

/* ----------  Gallery Lightbox  ----------------------------- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-img {
    display: block;
    max-height: 95vh;
    max-width: 95vw;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(24, 139, 246, 0.85);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(24, 139, 246, 0.85);
}

.lightbox-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 9999px;
    line-height: 1.5;
    pointer-events: none;
    z-index: 10000;
}

/* ----------  Review Stars  --------------------------------- */
.star-filled  { color: #f59e0b; }
.star-empty   { color: #d1d5db; }

/* ----------  Gallery Thumb Hover  -------------------------- */
.gallery-thumb {
    overflow: hidden;
    cursor: pointer;
    border-radius: 0.5rem;
}

.gallery-thumb img {
    transition: transform 0.4s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb:hover img {
    transform: scale(1.06);
}

/* Before/after thumbnails — portrait aspect, flex fill */
.ba-thumb {
    cursor: pointer;
    position: relative;
    aspect-ratio: 3 / 4;
    flex: 1 1 0%;
    min-width: 0;
    align-self: start;
}

.ba-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.ba-thumb:hover img {
    transform: scale(1.04);
}

/* ----------  Before / After pill badges  ------------------- */
.ba-pill {
    position: absolute;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 9999px;
    line-height: 1.5;
    pointer-events: none;
    z-index: 1;
}

/* Position — left image always top-left, right image always top-right */
.ba-pill-left  { top: 8px; left: 8px; }
.ba-pill-right { top: 8px; right: 8px; }

/* Color — based on badge label */
.ba-badge-before  { background: rgba(0, 0, 0, 0.75); }
.ba-badge-during  { background: rgba(220, 110, 10, 0.88); }
.ba-badge-after   { background: rgba(24, 139, 246, 0.9); }
.ba-badge-default { background: rgba(0, 0, 0, 0.6); }

/* ----------  Navbar FREE QUOTE pulse  ---------------------- */
@keyframes navPulse {
    0%, 100% {
        background-color: #188bf6;
        color: #ffffff;
        box-shadow: 0 0 0 0 rgba(24, 139, 246, 0.5);
    }
    50% {
        background-color: #ffffff;
        color: #188bf6;
        box-shadow: 0 0 0 7px rgba(24, 139, 246, 0);
    }
}
.btn-pulse {
    animation: navPulse 3s ease-in-out infinite;
    border: 2px solid #188bf6;
}

/* ----------  CTA button fade-in from left on scroll  ------- */
.cta-reveal {
    display: inline-block;
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.8s ease-out 0.4s, transform 0.8s ease-out 0.4s;
}
.cta-reveal.cta-animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* ----------  Mobile nav stagger animation  ----------------- */
@keyframes mobileNavItem {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes mobileSubItem {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

.mobile-nav-item {
    opacity: 0;
    animation: mobileNavItem 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mobile-nav-item:nth-child(1) { animation-delay: 0.10s; }
.mobile-nav-item:nth-child(2) { animation-delay: 0.18s; }
.mobile-nav-item:nth-child(3) { animation-delay: 0.26s; }

.mobile-sub-item {
    opacity: 0;
    animation: mobileSubItem 0.28s ease-out forwards;
}
.mobile-sub-item:nth-child(1) { animation-delay: 0.24s; }
.mobile-sub-item:nth-child(2) { animation-delay: 0.29s; }
.mobile-sub-item:nth-child(3) { animation-delay: 0.34s; }
.mobile-sub-item:nth-child(4) { animation-delay: 0.39s; }
.mobile-sub-item:nth-child(5) { animation-delay: 0.44s; }
.mobile-sub-item:nth-child(6) { animation-delay: 0.49s; }
.mobile-sub-item:nth-child(7) { animation-delay: 0.54s; }

/* ----------  Facebook section scroll animation  ------------ */
.fb-preview-img {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fb-preview-img.fb-animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* ----------  Leaflet map stacking context  ------------------ */
/* Leaflet internally uses z-index 200–800; the sticky navbar is z-50.
   Giving the map container position:relative + z-index:0 creates an
   isolated stacking context so Leaflet's panes never bleed above the nav. */
#service-map {
    position: relative;
    z-index: 0;
}

/* ----------  reCAPTCHA badge  ------------------------------ */
/* Badge hidden per Google policy — privacy notice shown in footer */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* ----------  Smooth Scroll  -------------------------------- */
html {
    scroll-behavior: smooth;
}

/* ----------  CTA Pill  ------------------------------------- */
.btn-cta {
    display: inline-block;
    padding: 0.875rem 2.5rem;
    background-color: #188bf6;
    color: #fff;
    border-radius: 9999px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.15s;
}

.btn-cta:hover {
    background-color: #1279d8;
    transform: translateY(-1px);
}

/* ----------  Form Focus  ----------------------------------- */
.form-input:focus {
    outline: none;
    border-color: #188bf6;
    box-shadow: 0 0 0 3px rgba(24, 139, 246, 0.2);
}
