/*
Theme Name: Elm Creek
Theme URI: https://elmcreekservices.com
Author: Elm Creek Property Services
Description: Custom WordPress theme for Elm Creek Property Services, converted from the original HTML design.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: elm-creek
*/

/* latin-ext */
@font-face {
  font-family: 'Figtree';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/figtree-italic-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Figtree';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/figtree-italic-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/figtree-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/figtree-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body { margin: 0; font-family: 'Figtree', sans-serif; color: #3B3B3B; -webkit-font-smoothing: antialiased; }
a { color: #C81E1E; text-decoration: none; }
a:hover { color: #9E1717; }
h1, h2, h3 { font-family: 'Figtree', sans-serif; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
* { box-sizing: border-box; }
img { max-width: 100%; }

/* Primary navigation (wp_nav_menu) */
.primary-nav { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.primary-nav a { color: #1B1B1B; }
.primary-nav a.current-menu-item,
.primary-nav a.current_page_item,
.primary-nav a.current_page_ancestor { color: #C81E1E; }

/* Footer quick links (wp_nav_menu) */
.footer-nav { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-nav a { color: #B9B5AC; }

.testimonial-bg-section {
    background-color: #1B1B1B !important; /* photo is set inline from the elm_creek_testimonial_bg option */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.testimonial-bg-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 80%);
    z-index: 0;
    pointer-events: none;
}
.testimonial-bg-section > * {
    position: relative;
    z-index: 1;
}
.elm-testimonial p {
    color: #fff !important;
    font-size: clamp(15px, 1.5vw, 17px) !important; /* real reviews run long */
    line-height: 1.65 !important;
}
.elm-testimonials { max-width: 760px !important; }
.elm-testimonial div {
    color: #fff !IMPORTANT;
}


/* Gallery grid image frame */
.elm-gallery-item img { width: 100%; height: 220px; object-fit: cover; display: block; border-radius: 10px; }
.elm-gallery-item .elm-gallery-caption { color: #B9B5AC; font-size: 13px; margin-top: 8px; text-align: center; }
.elm-gallery-light .elm-gallery-caption { color: #6B6B6B; }
.elm-project-collage { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 3px; height: 220px; border-radius: 10px; overflow: hidden; }
.elm-project-collage img { height: 100%; min-height: 0; border-radius: 0; }
.elm-project-collage img:only-child, .elm-project-collage img:nth-child(3):last-child { grid-column: 1 / -1; }

/* Contact form success/error notice */
.elm-form-notice { padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.elm-form-notice.success { background: #E7F5E9; color: #1E6B33; }
.elm-form-notice.error { background: #FBE6E6; color: #9E1717; }
/* ==========================================================================
   Hover system — one place for every interactive element. Templates are
   inline-styled, so components are matched by their existing inline styles.
   Transitions are always on; lifts/shadows only for real hover devices
   (hover: hover), so touch devices behave exactly as before.
   ========================================================================== */
a, button, .elm-gallery-item img, [style*="object-fit:cover"] {
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease, text-decoration-color .25s ease;
}
[style*="background:#fff;border-radius:10px"],
[style*="border:1px solid #E7E2D9;border-radius:14px;overflow:hidden"] {
  transition: box-shadow .3s ease, transform .3s ease;
}
/* Text links: underline fades in (color stays the theme's). */
a[style*="color:#C81E1E;font-weight:700"]:not([style*="padding"]),
a[style*="color:#D9D5CC"],
.primary-nav a, .footer-nav a {
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
a .fa-arrow-right { transition: transform .25s ease; }

@media (hover: hover) and (pointer: fine) {
  /* Primary (red) buttons: header CTA, hero, forms, CTA banners. */
  a[style*="background:#C81E1E;color:#fff"]:hover,
  button[style*="background:#C81E1E"]:hover {
    background-color: #A91818 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(200, 30, 30, .55);
  }
  /* Dark buttons. */
  a[style*="background:#1B1B1B;color:#fff"]:hover {
    background-color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .45);
  }
  /* Outline (white) button on dark banners. */
  a[style*="border:2px solid #fff"]:hover {
    background-color: #fff;
    color: #1B1B1B !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .4);
  }
  /* Pill links ("Explore Other Services"). */
  a[style*="border-radius:20px"]:hover {
    border-color: #C81E1E !important;
    color: #C81E1E !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -8px rgba(27, 27, 27, .25);
  }
  /* Text links. */
  a[style*="color:#C81E1E;font-weight:700"]:not([style*="padding"]):hover { text-decoration-color: currentColor; }
  a:hover .fa-arrow-right { transform: translateX(3px); }
  .primary-nav a:hover { color: #C81E1E; text-decoration-color: currentColor; }
  .footer-nav a:hover { color: #fff; text-decoration-color: currentColor; }
  a[style*="color:#D9D5CC"]:hover { color: #fff !important; text-decoration-color: currentColor; } /* Breadcrumbs */
  #header-main a[style*="display:block"] { transition: opacity .25s ease; }
  #header-main a[style*="display:block"]:hover { opacity: .8; } /* Logo */

  /* Cards: service cards (homepage + Services page), process steps. */
  [style*="background:#fff;border-radius:10px"]:hover,
  [style*="border:1px solid #E7E2D9;border-radius:14px;overflow:hidden"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -16px rgba(27, 27, 27, .28);
  }
  /* Card photos zoom slightly inside their clipped frame. */
  [style*="background:#fff;border-radius:10px;overflow:hidden"]:hover [style*="overflow:hidden"] > img,
  [style*="border:1px solid #E7E2D9;border-radius:14px;overflow:hidden"]:hover [style*="overflow:hidden"] > img {
    transform: scale(1.03);
  }
  /* Project / gallery tiles: lift (no zoom — the tile has no clipping frame). */
  a.elm-gallery-item:hover img, a.elm-gallery-item:hover .elm-project-collage,
  .elm-gallery-item img:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px -14px rgba(27, 27, 27, .35);
  }
  a.elm-gallery-item:hover .elm-gallery-caption { color: #C81E1E; }
  .elm-project-collage { transition: transform .25s ease, box-shadow .25s ease; }
  a.elm-gallery-item:hover .elm-project-collage img { transform: none; box-shadow: none; }

  /* Carousel / testimonial arrows (existing hover colors) gain depth. */
  .elm-t-nav:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgba(200, 30, 30, .5); }
  .elm-hero-dots button:not([aria-current="true"]):hover { background: rgba(255, 255, 255, .8); }
}

/* Gallery lightbox (js/theme.js) */
.elm-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(15, 15, 15, .94); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
.elm-lightbox.is-open { opacity: 1; visibility: visible; }
.elm-lb-figure { margin: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 88px; box-sizing: border-box; }
.elm-lb-figure img { max-width: 100%; max-height: calc(100% - 36px); object-fit: contain; border-radius: 6px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); transform: scale(.96); transition: transform .3s ease; }
.elm-lightbox.is-open .elm-lb-figure img { transform: scale(1); }
.elm-lb-figure figcaption { color: #D9D5CC; font-size: 14px; margin-top: 14px; text-align: center; }
.elm-lb-count { position: absolute; top: 20px; left: 24px; color: #B9B5AC; font-size: 13px; letter-spacing: .06em; }
.elm-lb-close, .elm-lb-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .08); color: #fff; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; transition: background .2s ease, transform .2s ease; }
.elm-lb-close { top: 12px; right: 16px; font-size: 22px; }
.elm-lb-prev { left: 20px; top: 50%; margin-top: -24px; }
.elm-lb-next { right: 20px; top: 50%; margin-top: -24px; }
.elm-lb-close:hover, .elm-lb-nav:hover, .elm-lb-close:focus-visible, .elm-lb-nav:focus-visible { background: #C81E1E; }
@media (max-width: 767px) {
  .elm-lb-figure { padding: 64px 12px 88px; }
  .elm-lb-prev, .elm-lb-next { top: auto; bottom: 20px; margin-top: 0; }
  .elm-lb-prev { left: calc(50% - 60px); }
  .elm-lb-next { right: calc(50% - 60px); }
}

/* Sticky header (all pages / sizes) + smooth anchor scrolling that clears it. */
#top { overflow-x: clip !important; } /* inline overflow-x:hidden would disable sticky */
#header-main { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 1000; transition: box-shadow .25s ease; }
#header-main.is-stuck { box-shadow: 0 6px 18px -10px rgba(27, 27, 27, .25); }
@media (max-width: 600px) { #header-main { top: 0; } } /* WP admin bar scrolls away on phones */
html { scroll-padding-top: calc(var(--elm-header-h, 90px) + var(--wp-admin--admin-bar--height, 0px) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Hamburger (shown < 992px only) */
.elm-menu-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid #E7E2D9; border-radius: 6px; background: #fff; color: #1B1B1B; font-size: 20px; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.elm-menu-toggle:hover, .elm-menu-toggle:focus-visible, #header-main.menu-open .elm-menu-toggle { color: #C81E1E; border-color: #C81E1E; }

/* Hero carousel controls (arrows reuse .elm-t-nav) */
.elm-hero-dots { position: absolute; z-index: 2; left: clamp(20px,5vw,56px); bottom: 12px; display: flex; gap: 8px; }
.elm-hero-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.45); cursor: pointer; transition: background .2s, width .2s; }
.elm-hero-dots button[aria-current="true"] { background: #C81E1E; width: 26px; border-radius: 5px; }
.elm-hero-arrows { position: absolute; z-index: 2; right: clamp(20px,5vw,56px); bottom: 24px; display: flex; gap: 10px; }
.elm-hero { touch-action: pan-y; }
@media (max-width: 767px) { .elm-hero-arrows { display: none; } }

/* Testimonial slider arrows */
.elm-t-nav { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #E6DDD4; background: #fff; color: #C81E1E; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .25s ease, box-shadow .25s ease; }
.elm-t-nav:hover, .elm-t-nav:focus-visible { background: #C81E1E; border-color: #C81E1E; color: #fff; }
.elm-t-nav i { font-size: 16px; line-height: 1; }
/* FA icons in the FAQ toggle keep the old "+" glyph's footprint. */
.faq-icon i { font-size: 14px; }
@media (max-width: 767px) {
  .elm-t-section { flex-wrap: wrap; gap: 28px 12px !important; }
  .elm-t-section .elm-testimonials { order: -1; flex-basis: 100%; }
}

div#header-main img {
    width: auto !IMPORTANT;
    height: 54px !IMPORTANT;
    max-width: none !IMPORTANT;
    object-fit: contain !IMPORTANT;
}
#header-main .elm-login { display: inline-flex; align-items: center; gap: 8px; }
#header-main .elm-login:hover { background: #1B1B1B; color: #fff !important; }
@media (max-width: 991px) {
  #header-main > a.elm-login { display: inline-flex !important; order: 1; margin-left: auto; margin-right: 10px; padding: 8px 12px !important; font-size: 13px !important; }
  #header-main .elm-menu-toggle { order: 2; }
  #header-main .primary-nav { order: 3; }
}
@media (max-width: 380px) { #header-main .elm-login i { display: none; } }
@media (max-width: 767px) { div#header-main img { height: 44px !IMPORTANT; } }
/* Scroll-reveal + hero entrance animations (js/theme.js adds .elm-anim to <html>) */
@media (prefers-reduced-motion: no-preference) {
  .elm-anim [data-elm-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--elm-d, 0s); }
  .elm-anim [data-elm-reveal].is-in { opacity: 1; transform: none; }
  .elm-anim [data-elm-reveal="left"] { transform: translateX(-36px); }
  .elm-anim [data-elm-reveal="right"] { transform: translateX(36px); }
  .elm-anim [data-elm-reveal="left"].is-in, .elm-anim [data-elm-reveal="right"].is-in { transform: none; }
  @keyframes elmHeroIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  .elm-hero-slide > div:nth-child(3) > * { animation: elmHeroIn .8s cubic-bezier(.2,.7,.2,1) both; }
  .elm-hero-slide > div:nth-child(3) > *:nth-child(2) { animation-delay: .12s; }
  .elm-hero-slide > div:nth-child(3) > *:nth-child(3) { animation-delay: .24s; }
  .elm-hero-slide > div:nth-child(3) > *:nth-child(4) { animation-delay: .36s; }
  @keyframes elmKenBurns { from { transform: scale(1); } to { transform: scale(1.06); } }
  .elm-hero-slide > div:first-child img { animation: elmKenBurns 14s ease-out both; }
}
div#footer-sect img {
    width: 234px !IMPORTANT;
    height: auto !IMPORTANT;
    max-width: none !IMPORTANT;
    object-fit: contain !IMPORTANT;
}

/* ==========================================================================
   Mobile / tablet layer. Templates are inline-styled, so layout overrides
   need !important to beat the inline styles.
   ========================================================================== */
@media (max-width: 767px) {
  /* clip (not hidden) so the sticky header keeps working. */
  html, body { overflow-x: clip; }

  /* Any two/three/four-column grid section stacks to one column. */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Two-column checklists (service "What's Included" lists, featured
     services on the homepage) read better as one column on a phone. */
  [style*="columns:2;"] {
    columns: 1 !important;
  }

  /* The bordered divider between the "Commercial" / "Residential" featured
     panels on the homepage is a vertical rule meant for side-by-side
     columns — once they stack, swap it for a horizontal rule instead. */
  [style*="border-right:1px solid #E7E2D9"] {
    border-right: none !important;
    border-bottom: 1px solid #E7E2D9 !important;
    padding-bottom: 28px !important;
    margin-bottom: 12px !important;
  }

  /* Keep long words (URLs, long phrases in tight boxes) from overflowing. */
  body { word-wrap: break-word; overflow-wrap: break-word; }

  /* Footer columns already collapse via the grid rule above; just tighten
     the stacked spacing so the three blocks don't feel disconnected. */
  #footer-sect [style*="grid-template-columns"] {
    gap: 32px !important;
  }

  /* Top info strip wrapped with its 32px desktop gap on both axes (a big
     empty band) — tighten it. */
  #top > div:first-child { gap: 2px 16px !important; padding: 8px 16px !important; font-size: 12px !important; }

}

/* Tablet and below (< 992px). */
@media (max-width: 991px) {
  /* Mobile / tablet header: logo left, hamburger right; the existing
     WordPress menu becomes a slide-down panel; header CTA hidden. */
  #header-main { justify-content: space-between !important; padding: 10px 16px !important; gap: 0 !important; }
  #header-main > div:first-child { padding: 0 !important; }
  #header-main > a { display: none !important; } /* Header CTA */
  .elm-menu-toggle { display: flex; }
  #header-main .primary-nav {
    order: 3; flex-basis: 100%; flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .3s ease, visibility .3s;
  }
  #header-main.menu-open .primary-nav { max-height: 480px; visibility: visible; }
  #header-main .primary-nav a { padding: 13px 4px; border-top: 1px solid #E7E2D9; font-size: 16px; }
  #header-main .primary-nav a:first-child { margin-top: 10px; }

  /* Homepage intro photos: fixed desktop heights crop the before/after
     shots once the column narrows — show them at their natural ratio, and
     drop the stats badge below the photos instead of over them. */
  #services [style*="height:260px"], #services [style*="height:200px"] { height: auto !important; }
  #services [style*="height:260px"] > img, #services [style*="height:200px"] > img { height: auto !important; }
  #services [style*="bottom:-22px"] { position: relative !important; left: auto !important; bottom: auto !important; transform: none !important; width: fit-content; margin: 16px auto 0; }

  /* Main side-by-side sections (text + photo, 56px gap) are too cramped
     at tablet width — stack them. Inner grids keep their columns. */
  [style*="grid-template-columns"][style*="gap:56px"],
  [style*="grid-template-columns"][style*="gap: 56px"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
}

@media (max-width: 480px) {
  /* Tightest phones: trim large display headings slightly further so
     multi-line hero/section titles never crowd the edges. */
  h1 { word-break: break-word; }
}


/* Visually hidden text (kept for screen readers / SEO). */
.elm-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }


/* Services page hero tiles */
@media (max-width: 991px) {
  .elm-svc-hero-intro { position: static !important; max-width: none !important; padding: 28px 20px !important; pointer-events: auto !important; }
  .elm-svc-tiles { grid-template-columns: 1fr 1fr !important; }
  .elm-svc-tile { min-height: 300px !important; border-top: 2px solid #fff; }
  .elm-svc-tile:nth-child(odd) { border-left: 0 !important; }
}
@media (max-width: 560px) { .elm-svc-tiles { grid-template-columns: 1fr !important; } .elm-svc-tile { border-left: 0 !important; } }
@media (min-width: 992px) { .elm-svc-hero-intro { background: linear-gradient(90deg, rgba(15,15,15,.7) 0%, rgba(15,15,15,0) 100%); bottom: 40%; width: 25%; max-width: none !important; } }

/* Loading screen: main logo fades/scales in gently, then the overlay fades away. */
#elm-loader{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;background:#FAF8F4;animation:elm-loader-out .5s ease 1.3s forwards;}
#elm-loader .elm-loader-logo{height:auto!important;width:min(280px,60vw)!important;max-width:none!important;opacity:0;transform:scale(.94);animation:elm-logo-in .8s ease .1s forwards,elm-logo-pulse 1.6s ease-in-out .9s infinite;}
@keyframes elm-logo-in{to{opacity:1;transform:scale(1);}}
@keyframes elm-logo-pulse{0%,100%{transform:scale(1);}50%{transform:scale(1.03);}}
@keyframes elm-loader-out{to{opacity:0;visibility:hidden;}}
@media (prefers-reduced-motion:reduce){#elm-loader{animation-duration:.01s;animation-delay:.4s;}#elm-loader .elm-loader-logo{animation:none;opacity:1;transform:none;}}

/* Footer secondary logo */
.elm-footer-badge{width:96px;height:96px;border-radius:50%;display:block;margin-top:18px;}
