
/* =========================================================
   ELCHPOWER V5.3 – DYNAMIC STAGE
   Header → Content → Service Navigation → Footer
   ========================================================= */

:root{
  --ep-header-h:92px;
  --ep-subnav-h:64px;
  --ep-footer-h:70px;
}

/* SERVICE PAGE MASTER FRAME */
body.services-overview-page{
  min-height:100vh !important;
  height:100vh !important;
  display:grid !important;
  grid-template-rows:var(--ep-header-h) 1fr var(--ep-subnav-h) var(--ep-footer-h) !important;
  overflow:hidden !important;
}

body:has(.ep-detail-main){
  min-height:100vh !important;
  height:100vh !important;
  display:grid !important;
  grid-template-rows:var(--ep-header-h) 1fr var(--ep-subnav-h) var(--ep-footer-h) !important;
  overflow:hidden !important;
}

/* Header remains stable */
.site-header{
  min-height:var(--ep-header-h) !important;
  height:var(--ep-header-h) !important;
}

/* Dynamic stage now gets the center */
body.services-overview-page .v47-overview,
body.services-overview-page .clickfirst-overview,
body:has(.ep-detail-main) .ep-detail-main{
  min-height:0 !important;
  overflow:hidden !important;
}

body.services-overview-page .service-hub-v47,
body:has(.ep-detail-main) .ep-detail-screen{
  min-height:0 !important;
  height:100% !important;
}

/* Overview content centered vertically a little more confidently */
body.services-overview-page .service-hub-v47-grid{
  height:100%;
  min-height:0;
  padding-top:24px !important;
  padding-bottom:22px !important;
  align-items:center !important;
}

/* Detail content same stage proportions */
body:has(.ep-detail-main) .ep-detail-grid{
  height:100%;
  min-height:0;
  padding-top:24px !important;
  padding-bottom:22px !important;
  align-items:center !important;
}

/* Service navigation belongs UNDER the dynamic stage */
.ep-master-service-nav{
  position:relative !important;
  top:auto !important;
  bottom:auto !important;
  height:var(--ep-subnav-h) !important;
  min-height:var(--ep-subnav-h) !important;
  border-top:1px solid rgba(213,170,80,.10) !important;
  border-bottom:1px solid rgba(243,240,230,.045) !important;
  background:#07130c !important;
  box-shadow:none !important;
}

.ep-master-service-nav .ep-master-shell{
  height:100%;
  grid-template-columns:repeat(4,1fr) !important;
}

.ep-master-service-link{
  min-height:100% !important;
  gap:11px !important;
  justify-content:center !important;
  font-size:inherit;
}

.ep-master-service-link span{
  font-size:.75rem !important;
}

.ep-master-service-link strong{
  font-size:.9rem !important;
  letter-spacing:.005em;
}

.ep-master-service-link::after{
  top:0 !important;
  bottom:auto !important;
  height:2px !important;
  left:18% !important;
  right:18% !important;
}

/* Footer remains readable but calm */
.ep-master-footer{
  height:var(--ep-footer-h) !important;
  min-height:var(--ep-footer-h) !important;
}

.ep-master-footer-left span,
.ep-master-footer-left a,
.ep-master-partner-trigger{
  font-size:.78rem !important;
}

/* HOME: one viewport, no extra contact section below */
body:has(.v5-home-main){
  min-height:100vh;
  height:100vh;
  display:grid;
  grid-template-rows:var(--ep-header-h) 1fr var(--ep-footer-h);
  overflow:hidden;
}

body:has(.v5-home-main) .v5-home-main{
  min-height:0;
  overflow:hidden;
}

body:has(.v5-home-main) .v5-home-screen{
  height:100% !important;
  min-height:0 !important;
}

body:has(.v5-home-main) .v5-home-shell{
  height:calc(100% - 54px);
  min-height:0;
  padding-top:24px !important;
  padding-bottom:20px !important;
}

body:has(.v5-home-main) .v5-home-bottom-inner{
  min-height:54px !important;
}

/* Keep the home middle balanced, not vertically crushed */
body:has(.v5-home-main) .v5-home-right{
  min-height:0 !important;
  height:min(520px,88%);
  align-self:center;
}

body:has(.v5-home-main) .v5-home-left{
  align-self:center;
}

/* CONTACT DRAWER */
.ep-contact-layer{
  position:fixed;
  inset:0;
  z-index:200;
}
.ep-contact-layer[hidden]{display:none}
.ep-contact-backdrop{
  position:absolute;
  inset:0;
  border:0;
  background:rgba(2,9,5,.62);
  backdrop-filter:blur(5px);
  cursor:pointer;
}
.ep-contact-drawer{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:min(560px,calc(100vw - 40px));
  padding:34px 36px 32px;
  border:1px solid rgba(213,170,80,.18);
  border-radius:22px 22px 42px 22px;
  background:
    radial-gradient(circle at 86% 14%,rgba(213,170,80,.07),transparent 26%),
    #0a1b12;
  box-shadow:0 28px 90px rgba(0,0,0,.45);
}
.ep-contact-close{
  position:absolute;
  top:14px;
  right:16px;
  width:34px;
  height:34px;
  border-radius:50%;
  border:1px solid rgba(243,240,230,.08);
  background:rgba(243,240,230,.02);
  color:#9aa69f;
  font-size:1.2rem;
  cursor:pointer;
}
.ep-contact-kicker{
  margin:0 0 12px;
  color:#d5aa50;
  font-size:.66rem;
  letter-spacing:.14em;
  font-weight:800;
}
.ep-contact-drawer h2{
  margin:0 0 16px;
  color:#f3f0e6;
  font-size:clamp(2rem,3vw,3rem);
  line-height:1.02;
  max-width:10ch;
}
.ep-contact-drawer>p{
  margin:0;
  color:#95a29a;
  line-height:1.7;
  font-size:.88rem;
}
.ep-contact-mail{
  display:inline-block;
  margin-top:22px;
  color:#d5aa50;
  font-size:.9rem;
}
.ep-contact-note{
  margin-top:22px;
  padding-top:14px;
  border-top:1px solid rgba(243,240,230,.06);
  color:#6e7b73;
  font-size:.68rem;
}

/* Shorter desktop */
@media(min-width:980px) and (max-height:820px){
  :root{
    --ep-header-h:84px;
    --ep-subnav-h:58px;
    --ep-footer-h:62px;
  }

  .ep-master-service-link strong{font-size:.82rem !important}
  .ep-master-service-link span{font-size:.69rem !important}

  body.services-overview-page .service-hub-v47-grid,
  body:has(.ep-detail-main) .ep-detail-grid{
    padding-top:14px !important;
    padding-bottom:12px !important;
  }

  body:has(.v5-home-main) .v5-home-shell{
    padding-top:14px !important;
    padding-bottom:12px !important;
  }
}

/* Mobile/tablet naturally scroll again */
@media(max-width:979px){
  body.services-overview-page,
  body:has(.ep-detail-main),
  body:has(.v5-home-main){
    display:block !important;
    height:auto !important;
    min-height:100vh !important;
    overflow:auto !important;
  }

  .ep-master-service-nav{
    height:auto !important;
    min-height:58px !important;
    overflow-x:auto;
  }

  .ep-master-service-nav .ep-master-shell{
    width:max-content;
    min-width:100%;
    grid-template-columns:repeat(4,minmax(160px,1fr)) !important;
  }

  .ep-master-service-link{
    min-height:58px !important;
    padding:0 16px;
  }

  body:has(.v5-home-main) .v5-home-shell{
    height:auto;
  }
}
