/*
Theme Name:   Hello EP Architects
Theme URI:    https://ep-architects.com
Description:  Child theme of Hello Elementor that recreates the EP Architects look (previously Kalium).
Author:       EP Architects
Template:     hello-elementor
Version:      1.0.0
Text Domain:  hello-ep
*/

/* ---------- Design tokens (taken from the live Kalium site) ---------- */
:root {
	--ep-bg: #252525;
	--ep-bg-dark: #1e1e1e;
	--ep-text: #ffffff;
	--ep-muted: #b5b5b5;
	--ep-accent: #fbc441;
	--ep-overlay: rgba(255, 255, 255, 0.9);
	--ep-dark-text: #212121;
	--ep-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--ep-gutter: 45px;
	--ep-container: 1350px;

	/* Type scale (≈1.25 ratio). Headings grow fluidly from phone to desktop. */
	--ep-fs-h1: clamp(32px, 2.2vw + 12px, 44px);
	--ep-fs-h2: clamp(28px, 1vw + 20px, 34px);
	--ep-fs-h3: clamp(22px, .7vw + 16px, 26px);
	--ep-fs-h4: 18px;
	--ep-fs-body: 18px;
	--ep-fs-ui: 16px;     /* menu, navigation links */
	--ep-fs-small: 14px;  /* excerpts, details, captions, footer */
	--ep-fs-label: 12px;  /* uppercase labels */
	--ep-lh-heading: 1.15;
	--ep-lh-body: 1.5;
	--ep-track-caps: .04em;
	--ep-track-label: .08em;

	/* Spacing scale (8-point) and layout rhythm. */
	--ep-space-1: 8px;
	--ep-space-2: 16px;
	--ep-space-3: 24px;
	--ep-space-4: 32px;
	--ep-space-5: 48px;
	--ep-space-6: 64px;
	--ep-space-7: 96px;
	--ep-space-8: 128px;
	--ep-section: clamp(64px, 8vw, 128px);       /* space between page sections */
	--ep-section-first: clamp(32px, 4vw, 64px);  /* first section under the header */
	--ep-head-gap: var(--ep-space-4);            /* heading → its content */
	--ep-col-gap: var(--ep-space-5);             /* gap between side-by-side columns */
	--ep-widget-gap: 20px;                       /* Elementor's own gap between widgets */
}
@media (max-width: 767px) {
	:root { --ep-head-gap: var(--ep-space-3); --ep-col-gap: var(--ep-space-3); }
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
	background: var(--ep-bg);
	color: var(--ep-text);
	font-family: var(--ep-font);
	font-size: var(--ep-fs-body);
	font-weight: 300;
	line-height: var(--ep-lh-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
a { color: var(--ep-text); text-decoration: none; transition: color .2s ease, opacity .2s ease; }
a:hover, a:focus { color: var(--ep-accent); }
h1, h2, h3, h4, h5, h6 { font-family: var(--ep-font); color: var(--ep-text); font-weight: 600; line-height: var(--ep-lh-heading); margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: var(--ep-fs-h1); }
h2 { font-size: var(--ep-fs-h2); }
h3 { font-size: var(--ep-fs-h3); }
h4 { font-size: var(--ep-fs-h4); line-height: 1.3; }
h6 { font-size: var(--ep-fs-label); letter-spacing: var(--ep-track-label); text-transform: uppercase; margin: 1.3em 0 .25em; }
/* Elementor's heading widget forces line-height: 1; use the scale instead. */
.elementor .elementor-widget-heading .elementor-heading-title { line-height: var(--ep-lh-heading); }
/* Light (300) is too thin for small light-on-dark text: everything below the body size uses Regular. */
small, .ep-small { font-size: var(--ep-fs-small); font-weight: 400; line-height: 1.55; }
p { margin: 0 0 1em; }
strong, b { font-weight: 600; }
img { max-width: 100%; height: auto; }

/* One content edge for the whole site: --ep-container of content plus the gutters on each side.
   Header, footer, theme templates and Elementor sections all line up on it. */
.ep-container,
.ep-container--full,
body .site-main.ep-container,
body .site-main.ep-container--full { max-width: calc(var(--ep-container) + 2 * var(--ep-gutter)); width: 100%; margin: 0 auto; padding: 0 var(--ep-gutter); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* ---------- Header ---------- */
.ep-header { position: relative; z-index: 50; padding: 8px 0; }
.ep-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 104px; }
.ep-header__logo img { width: 160px; height: auto; display: block; }
.ep-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 32px; }
.ep-nav a { font-size: var(--ep-fs-ui); font-weight: 300; line-height: 1.35; position: relative; padding-bottom: 3px; }
.ep-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.ep-nav a:hover { color: var(--ep-text); }
.ep-nav a:hover::after,
.ep-nav .current-menu-item > a::after,
.ep-nav .current-menu-ancestor > a::after,
.ep-nav .current_page_parent > a::after { transform: scaleX(1); }
.ep-nav-toggle { display: none; background: none; border: 0; color: var(--ep-text); cursor: pointer; padding: 8px; }
.ep-nav-toggle span { display: block; width: 26px; height: 2px; background: currentColor; margin: 5px 0; transition: transform .25s ease, opacity .25s ease; }

@media (max-width: 900px) {
	:root { --ep-gutter: 20px; }
	.ep-header__inner { min-height: 72px; }
	.ep-header__logo img { width: 110px; }
	.ep-nav-toggle { display: block; }
	.ep-nav { position: fixed; inset: 0; background: var(--ep-bg-dark); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
	.ep-nav ul { flex-direction: column; align-items: center; gap: 22px; }
	.ep-nav a { font-size: 26px; }
	body.ep-nav-open { overflow: hidden; }
	body.ep-nav-open .ep-nav { opacity: 1; visibility: visible; }
	body.ep-nav-open .ep-nav-toggle { position: relative; z-index: 60; }
	body.ep-nav-open .ep-nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	body.ep-nav-open .ep-nav-toggle span:nth-child(2) { opacity: 0; }
	body.ep-nav-open .ep-nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Footer ---------- */
.ep-footer { margin-top: var(--ep-section); padding: var(--ep-space-5) 0 var(--ep-space-4); font-size: var(--ep-fs-small); font-weight: 400; line-height: 1.55; }
.ep-footer__widgets a { color: var(--ep-accent); display: block; line-height: 1.5; }
.ep-footer__widgets a:hover { color: var(--ep-text); }
.ep-footer__bottom { display: flex; align-items: center; justify-content: space-between; margin-top: var(--ep-space-5); position: relative; }
.ep-footer__copy { color: var(--ep-text); }
.ep-social { display: flex; gap: 8px; }
.ep-social a { width: 30px; height: 30px; border-radius: 50%; background: var(--ep-text); color: var(--ep-bg); display: inline-flex; align-items: center; justify-content: center; }
.ep-social a:hover { background: var(--ep-accent); color: var(--ep-bg); }
.ep-social svg { width: 15px; height: 15px; fill: currentColor; }
.ep-to-top { position: absolute; left: 50%; transform: translateX(-50%); color: var(--ep-text); font-size: 22px; line-height: 1; }
.ep-to-top:hover { color: var(--ep-accent); }

/* ---------- Project grid ---------- */
.ep-projects__filter { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; list-style: none; margin: 0 0 22px; padding: 0 5px; font-size: var(--ep-fs-small); }
.ep-projects__filter button { background: none; border: 0; padding: 0 0 3px; color: var(--ep-text); font: inherit; font-weight: 400; cursor: pointer; border-bottom: 1px solid transparent; }
.ep-projects__filter button:hover { color: var(--ep-accent); }
.ep-projects__filter button.is-active { border-bottom-color: currentColor; }
.ep-projects__grid { display: grid; grid-template-columns: repeat(var(--ep-cols, 4), minmax(0, 1fr)); }
.ep-project { padding: 5px; position: relative; transition: opacity .35s ease, transform .35s ease; }
.ep-project.is-hidden { display: none; }
.ep-project__link { display: block; position: relative; overflow: hidden; aspect-ratio: 700 / 401; background: #1b1b1b; }
.ep-project__link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-project__hover { position: absolute; inset: 0; background: var(--ep-overlay); color: var(--ep-dark-text); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; opacity: 0; transition: opacity .3s ease; }
.ep-project__hover h3 { color: var(--ep-dark-text); font-size: var(--ep-fs-h3); margin: 0 0 6px; transform: translateY(12px); transition: transform .35s ease; }
.ep-project__hover span { font-size: var(--ep-fs-small); font-weight: 400; line-height: 1.45; color: #555; transform: translateY(12px); transition: transform .35s ease .05s; }
.ep-project__link:hover .ep-project__hover,
.ep-project__link:focus .ep-project__hover { opacity: 1; }
.ep-project__link:hover .ep-project__hover h3,
.ep-project__link:hover .ep-project__hover span { transform: none; }

/* Fade-in when tiles scroll into view (replaces Kalium "reveal" effect) */
.ep-js .ep-reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.ep-js .ep-reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 1024px) { .ep-projects__grid { --ep-cols: 3 !important; } }
@media (max-width: 768px)  { .ep-projects__grid { --ep-cols: 2 !important; } .ep-projects__filter { justify-content: flex-start; } }
@media (max-width: 480px)  { .ep-projects__grid { --ep-cols: 1 !important; } }

.ep-more-link { display: inline-block; color: var(--ep-accent); font-size: var(--ep-fs-ui); font-weight: 400; margin-top: 14px; }
.ep-more-link:hover { color: var(--ep-text); }

/* ---------- Single project ---------- */
.ep-breadcrumb { font-size: var(--ep-fs-small); font-weight: 400; color: var(--ep-muted); margin: 6px 0 40px; }
.ep-breadcrumb a { color: var(--ep-accent); }
.ep-breadcrumb a:hover { color: var(--ep-text); }
.ep-single { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 110px; align-items: start; }
/* Project title: H1 role, but capped at 34px – long uppercase titles sit in a narrow column. */
.ep-single__details h1 { font-size: clamp(28px, 1.2vw + 16px, 34px); font-weight: 300; text-transform: uppercase; letter-spacing: var(--ep-track-caps); line-height: 1.2; margin-bottom: 30px; }
.ep-single__details h6 { color: var(--ep-text); font-size: var(--ep-fs-label); font-weight: 600; letter-spacing: var(--ep-track-label); }
.ep-single__details p { font-size: var(--ep-fs-small); font-weight: 400; line-height: 1.55; margin-bottom: .3em; }
.ep-single__details.is-sticky { position: sticky; top: 30px; }
.ep-share { display: flex; gap: 8px; margin-top: 30px; }
.ep-share a { width: 30px; height: 30px; border-radius: 50%; background: var(--ep-text); color: var(--ep-bg); display: inline-flex; align-items: center; justify-content: center; }
.ep-share a:hover { background: var(--ep-accent); }
.ep-share svg { width: 14px; height: 14px; fill: currentColor; }

.ep-slider { position: relative; }
.ep-slider__track { display: flex; overflow: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.ep-slider__slide { flex: 0 0 100%; scroll-snap-align: start; }
.ep-slider__slide img { width: 100%; height: auto; display: block; }
.ep-slider__arrows { display: flex; justify-content: space-between; margin-top: 18px; }
.ep-slider__arrows button { background: none; border: 0; color: var(--ep-text); font-size: 26px; cursor: pointer; padding: 4px 10px; line-height: 1; }
.ep-slider__arrows button:hover { color: var(--ep-accent); }
.ep-slider__arrows button[disabled] { opacity: .3; cursor: default; }
.ep-slider__count { font-size: var(--ep-fs-small); font-weight: 400; color: var(--ep-muted); align-self: center; font-variant-numeric: tabular-nums; }
.ep-gallery-image { margin-bottom: 20px; }
.ep-gallery-image img { width: 100%; height: auto; display: block; }
.ep-video { position: relative; aspect-ratio: 16 / 9; margin-bottom: 20px; }
.ep-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ep-project-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 80px; font-size: var(--ep-fs-ui); }
.ep-project-nav__prev { justify-self: start; }
.ep-project-nav__next { justify-self: end; }
.ep-project-nav__grid svg { width: 18px; height: 18px; fill: var(--ep-text); display: block; }
.ep-project-nav__grid:hover svg { fill: var(--ep-accent); }
.ep-project-nav .is-disabled { opacity: .3; }

@media (max-width: 900px) {
	.ep-single { grid-template-columns: 1fr; gap: 40px; }
	.ep-single__details.is-sticky { position: static; }
}

/* ---------- News list (homepage + blog) ---------- */
.ep-news { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 60px; }
.ep-news__item { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: start; }
.ep-news__thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #1b1b1b; }
.ep-news__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* News titles use the H4 role (semantically h3 inside each list). */
.ep-news__item h3 { font-size: var(--ep-fs-h4); line-height: 1.3; margin: 0 0 10px; }
.ep-news__item p { font-size: var(--ep-fs-small); font-weight: 400; line-height: 1.55; color: var(--ep-text); margin: 0; }
.ep-news-more { display: inline-block; font-size: var(--ep-fs-h4); font-weight: 400; margin-top: 40px; }
.ep-news--text .ep-news__item { grid-template-columns: 1fr; }
.ep-news__date { display: block; font-size: var(--ep-fs-label); font-weight: 400; letter-spacing: var(--ep-track-label); text-transform: uppercase; color: var(--ep-muted); margin-bottom: 8px; }
.ep-light .ep-news__item h3 a, .ep-light .ep-news__item p, .ep-light .ep-news-more { color: var(--ep-dark-text); }
.ep-light .ep-news__date { color: #666; }

/* ---------- Scroll animations (site-wide) ---------- */
/* Elements get .ep-anim (+ a direction) from ep.js; they ease in once when scrolled into view. */
.ep-js .ep-anim {
	opacity: 0;
	transform: translate3d(var(--ep-from-x, 0), var(--ep-from-y, 48px), 0) scale(var(--ep-from-scale, 1));
	filter: blur(6px);
	transition:
		opacity 1.1s cubic-bezier(.22, 1, .36, 1) var(--ep-delay, 0ms),
		transform 1.3s cubic-bezier(.22, 1, .36, 1) var(--ep-delay, 0ms),
		filter 1.1s cubic-bezier(.22, 1, .36, 1) var(--ep-delay, 0ms);
	will-change: opacity, transform;
}
.ep-js .ep-anim--left  { --ep-from-x: -60px; --ep-from-y: 0; }
.ep-js .ep-anim--right { --ep-from-x: 60px;  --ep-from-y: 0; }
.ep-js .ep-anim--zoom  { --ep-from-y: 30px;  --ep-from-scale: .96; }
.ep-js .ep-anim.is-in  { opacity: 1; transform: none; filter: none; }
/* Phones: rise instead of sliding sideways (no horizontal overflow), and a bit quicker. */
@media (max-width: 768px) {
	.ep-js .ep-anim--left, .ep-js .ep-anim--right { --ep-from-x: 0; --ep-from-y: 32px; }
	.ep-js .ep-anim { transition-duration: .8s, 1s, .8s; }
	body { overflow-x: clip; }
}

/* Project tiles: staggered rise, then a slow image settle; a light zoom on hover. */
.ep-js .ep-project.ep-anim .ep-project__link img { transform: scale(1.08); transition: transform 1.6s cubic-bezier(.22, 1, .36, 1) var(--ep-delay, 0ms); }
.ep-js .ep-project.ep-anim.is-in .ep-project__link img { transform: none; }
.ep-js .ep-project.ep-anim.is-in .ep-project__link:hover img { transform: scale(1.03); transition-duration: .8s; transition-delay: 0ms; }

/* Service rows: a hairline that draws across as each row arrives (replaces the static border). */
.ep-js .ep-service-row { position: relative; border-bottom-color: transparent; }
.ep-js .ep-service-row::after { content: ""; position: absolute; left: 15px; right: 15px; bottom: -1px; height: 1px; background: #333; transform: scaleX(0); transform-origin: left; transition: transform 1.4s cubic-bezier(.22, 1, .36, 1) .2s; }
.ep-js .ep-service-row.is-in::after { transform: scaleX(1); }
.ep-js .ep-service-row.ep-last::after, .ep-js .ep-last .ep-service-row::after { display: none; }

/* The sticky project details column must not keep a transform once it has arrived. */
.ep-js .ep-single__details.ep-anim.is-in { transform: none; will-change: auto; }

@media (prefers-reduced-motion: reduce) {
	.ep-js .ep-anim, .ep-js .ep-project__link img, .ep-js .ep-service-row::after { transition: none !important; transform: none !important; filter: none !important; opacity: 1 !important; }
}

/* Masonry variant (Atraktos): keep each image's own proportions */
.ep-projects__grid--natural { display: block; column-count: var(--ep-cols, 4); column-gap: 0; }
.ep-projects__grid--natural .ep-project { break-inside: avoid; }
.ep-projects__grid--natural .ep-project__link { aspect-ratio: auto; }
.ep-projects__grid--natural .ep-project__link img { height: auto; }
@media (max-width: 1024px) { .ep-projects__grid--natural { column-count: 3; } }
@media (max-width: 768px)  { .ep-projects__grid--natural { column-count: 2; } }
@media (max-width: 480px)  { .ep-projects__grid--natural { column-count: 1; } }

/* Page sections built in Elementor */
.ep-service-row { border-bottom: 1px solid #333; }
.ep-service-row.ep-last, .ep-last .ep-service-row { border-bottom: 0; }
.ep-service-row h3 { font-size: var(--ep-fs-h3); margin: 0; }
.ep-contact-row h2 { margin-bottom: 15px; }
/* Team names are H3-sized (same role as services), award titles H4-sized. */
.ep-team-member h4 { font-size: var(--ep-fs-h3); line-height: var(--ep-lh-heading); margin: 18px 0 10px; }
.ep-award h4 { font-size: var(--ep-fs-h4); margin: 0; }
.ep-award p { font-size: var(--ep-fs-small); font-weight: 400; color: var(--ep-muted); margin: 8px 0 16px; font-variant-numeric: tabular-nums; }
.ep-white-card { background: rgba(255, 255, 255, .97); color: #000; padding: 35px; }
.ep-white-card h2, .ep-white-card p { color: #000; }
.ep-map iframe { filter: grayscale(1) invert(.9) contrast(.9); }
@media (max-width: 768px) { .ep-news { grid-template-columns: 1fr; } .ep-news__item { grid-template-columns: 110px minmax(0, 1fr); } }

/* ---------- Auto-typing headline ---------- */
.ep-autotype { display: inline-block; min-height: 1.1em; }
.ep-autotype::after { content: "|"; margin-left: 2px; animation: ep-blink 1s steps(1) infinite; font-weight: 300; }
@keyframes ep-blink { 50% { opacity: 0; } }

/* ---------- Blog / generic content ---------- */
.ep-content { padding-bottom: 20px; }
.ep-content .entry-title { font-size: var(--ep-fs-h1); margin-bottom: 30px; }
.ep-content .entry-content a { color: var(--ep-accent); }
.ep-content .entry-content a:hover { color: var(--ep-text); }
.ep-post-meta { font-size: var(--ep-fs-small); font-weight: 400; color: var(--ep-muted); margin-bottom: 24px; }
.ep-post-thumb { margin-bottom: 30px; }
.ep-pagination { display: flex; gap: 14px; margin-top: 50px; font-size: var(--ep-fs-ui); }
.ep-pagination .current { color: var(--ep-accent); }

/* Elementor sections sit directly on the dark background */
.elementor-page .site-main { max-width: none; padding: 0; }
.elementor-widget-text-editor a { color: var(--ep-accent); }

/* ---------- Spacing system for Elementor pages ----------
   Elementor writes each container's padding as CSS variables (--padding-*) on its own ID;
   these rules set those variables from the scale instead, with just enough specificity to win. */

/* Widths: boxed sections use the site container and gutters. */
body .elementor .e-con { --container-max-width: calc(var(--ep-container) + 2 * var(--ep-gutter)); }
/* Side padding comes only from the gutter (some containers carried their own 10–15px from the original build). */
body .elementor > .e-con.e-parent,
body .elementor .e-con.e-con-boxed { --padding-left: 0px; --padding-right: 0px; }
body .elementor .e-con-boxed > .e-con-inner { padding-inline: var(--ep-gutter); }
/* Rows of columns: columns are split by --ep-col-gap and their text still lands on the gutter. */
body .elementor .e-con-boxed > .e-con-inner:has(> .e-con.e-child) { padding-inline: calc(var(--ep-gutter) - var(--ep-col-gap) / 2); }
body .elementor .e-con-inner > .e-con.e-child { --padding-left: calc(var(--ep-col-gap) / 2); --padding-right: calc(var(--ep-col-gap) / 2); }
/* Full-width sections that hold a project grid line up with the same edge. */
body .elementor > .e-con.e-con-full:has(.ep-projects, .efg) { --padding-left: max(var(--ep-gutter), calc((100% - var(--ep-container)) / 2)); --padding-right: max(var(--ep-gutter), calc((100% - var(--ep-container)) / 2)); }
/* Tiles have 5px padding for their 10px gutter; pull the grid out so image edges sit on the gutter. */
.ep-projects { margin-inline: -5px; }

/* Filterable Grid widget (plugin) in the EP look: full-strength term colour, theme title size. */
.efg .efg__terms { opacity: 1; line-height: 1.45; }
.efg .efg__title { font-size: var(--ep-fs-h3); line-height: var(--ep-lh-heading); }
.efg .efg__btn { line-height: 1.55; }

/* Header and footer built in Elementor (Header Footer Elementor plugin). */
#masthead { position: relative; z-index: 50; }
#colophon { margin-top: var(--ep-section); }
#masthead .hfe-nav-menu__toggle { cursor: pointer; }
/* Let the menu widget shrink next to the logo (flex items default to min-width:auto and overflow). */
#masthead .elementor-element.elementor-widget-navigation-menu { --flex-grow: 1; --flex-shrink: 1; --flex-basis: 0%; min-width: 0; }
/* The plugin's "Hamburger align" only applies to its vertical/fly-out layouts; keep the toggle on the right edge. */
#masthead .hfe-nav-menu__toggle { margin-left: auto; margin-right: 0; }
.ep-site-footer__bottom { position: relative; }
.ep-footer-top { position: absolute !important; left: 50%; transform: translateX(-50%); }
.ep-footer-top .ep-to-top { position: static; transform: none; font-size: 22px; line-height: 1; color: var(--ep-text); }
.ep-footer-top .ep-to-top:hover { color: var(--ep-accent); }
.ep-footer-legal p { margin: 0; }
.ep-footer-top p { margin: 0; }

/* Vertical rhythm (page content only): one section space above each section; bands (sections with a background) get it on both sides. */
body #content .elementor > .e-con.e-parent:not(.ep-band) { --padding-top: var(--ep-section); --padding-bottom: 0px; }
body #content .elementor > .e-con.e-parent:first-child:not(.ep-band) { --padding-top: var(--ep-section-first); }
body #content .elementor > .e-con.e-parent:first-child:has(rs-module-wrap, .elementor-widget-google_maps) { --padding-top: 0px; }
body #content .elementor > .e-con.e-parent.ep-band { --padding-top: var(--ep-section); --padding-bottom: var(--ep-section); }

/* Service rows: one block with 48px rows and hairline dividers, set off from what comes before it. */
body #content .elementor > .e-con.e-parent.ep-band:has(.ep-service-row) { --padding-top: 0px; --padding-bottom: 0px; }
body #content .elementor > .e-con:not(.ep-band) + .e-con.ep-band:has(.ep-service-row) { margin-top: var(--ep-section); }
body #content .elementor .e-con.e-con.ep-service-row { --padding-top: var(--ep-space-5); --padding-bottom: var(--ep-space-5); }
/* Service rows placed directly on the page (About): first one gets the section space above. */
body #content .elementor > .e-con:not(.ep-service-row) + .e-con.e-con.ep-service-row { margin-top: var(--ep-section); --padding-top: var(--ep-space-5); }
body #content .elementor > .e-con.ep-service-row + .e-con:not(.ep-service-row) { margin-top: 0; }

/* Related rows sit closer than unrelated sections (Contact: Address then Reach Us). */
body #content .elementor > .e-con.e-con.ep-contact-row + .e-con.ep-contact-row { --padding-top: var(--ep-space-6); }

/* Heading → content: --ep-head-gap in total (Elementor already adds --ep-widget-gap). */
body .elementor .elementor-element.elementor-widget-heading:not(:last-child) { margin-block-end: max(0px, calc(var(--ep-head-gap) - var(--ep-widget-gap))); }
.elementor .elementor-widget-heading .elementor-heading-title { margin-bottom: 0; }

/* Phones: stacked columns of one row get a small gap, never 0. */
@media (max-width: 767px) {
	body #content .elementor .e-con-inner > .e-con.e-child + .e-con.e-child { margin-top: 12px; }
	body #content .elementor .e-con-inner > .e-con.e-child:empty { display: none; }
}
