/* =========================================================
   Jeff Roof Projects – single project + "Our Projects" grid
   Built to the Figma "Single Project" design (1728px frame)
   ========================================================= */
:root {
	--jr-red: #dd1225;
	--jr-red-dark: #b30e1e;
	--jr-black: #000;
	--jr-ink: #212121;
	--jr-grey: #ededed;
	--jr-grey-text: #404040;
	--jr-text: #000;
	--jr-body: "ProximaNova", "Proxima Nova", "Montserrat", system-ui, sans-serif;
	--jr-display: "Poppins", sans-serif;
	--jr-max: 1567px;                       /* 1728 frame – 82px gutters */
	--jr-gutter: clamp(20px, 4.75vw, 82px);
	--jr-h2: clamp(28px, 2.4vw, 40px);
	--jr-gap: clamp(32px, 5.5vw, 96px);
}

.jr-single, .jr-projects-archive, .jr-projects { font-family: var(--jr-body); color: var(--jr-text); }
.jr-single *, .jr-projects * { box-sizing: border-box; }
.jr-container { width: min(100% - (var(--jr-gutter) * 2), var(--jr-max)); margin-inline: auto; }

.jr-eyebrow { margin: 0 0 6px; font: 700 16px/1.6 var(--jr-display); text-transform: uppercase; color: var(--jr-red); }
.jr-heading { margin: 0 0 28px; font: 700 var(--jr-h2)/1 var(--jr-display); text-transform: uppercase; color: var(--jr-black); }
.jr-heading__line { display: block; }
.jr-heading__red { color: var(--jr-red); }
.jr-heading--case { text-transform: none; }

.jr-richtext, .jr-intro__content { font-size: 16px; line-height: 30px; }
.jr-richtext p, .jr-intro__content p { margin: 0 0 30px; }
.jr-richtext p:last-child, .jr-intro__content p:last-child { margin-bottom: 0; }
.jr-richtext strong { font-weight: 700; }

.jr-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 262px; min-height: 73px; padding: 16px 40px; background: var(--jr-red); color: #fff; border: 0; border-radius: 0; font: 700 16px/1.2 var(--jr-display); text-transform: uppercase; text-decoration: none; transition: background .2s; }
.jr-btn:hover, .jr-btn:focus-visible { background: var(--jr-red-dark); color: #fff; }

/* ---------- Hero (603px) ---------- */
.jr-hero { position: relative; display: flex; align-items: center; min-height: clamp(480px, 35vw, 603px); background: #111 center / cover no-repeat; color: #fff; }
.jr-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(68.59deg, #000 4.64%, rgba(0,0,0,0) 53.41%), rgba(0,0,0,.4); }
.jr-hero__inner { position: relative; width: min(100% - (var(--jr-gutter) * 2), var(--jr-max)); margin-inline: auto; padding: 56px 0 56px 9px; }
.jr-hero .jr-eyebrow { margin-bottom: 8px; font-weight: 400; }
.jr-hero__title { margin: 0 0 44px; max-width: 520px; font: 700 var(--jr-h2)/1 var(--jr-display); text-transform: uppercase; }
.jr-hero__title span { display: block; }
.jr-hero__title-white { color: #fff; }
.jr-hero__title-red { color: var(--jr-red); }
.jr-hero__meta { display: grid; gap: 27px; margin: 0; padding: 0; list-style: none; font: 400 16px/1.2 var(--jr-body); }
.jr-hero__meta li { display: flex; align-items: center; gap: 20px; }
.jr-hero__icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.35); color: #fff; }
.jr-hero__icon svg { width: 17px; height: 17px; }

/* ---------- The project + before/after ---------- */
.jr-intro { padding: 73px 0 0; }
.jr-intro__grid { display: grid; grid-template-columns: minmax(0, 687fr) minmax(0, 835fr); gap: 40px 45px; align-items: stretch; }
.jr-intro__text { display: flex; flex-direction: column; align-items: flex-start; padding-top: 0; }
.jr-intro .jr-heading { text-transform: none; margin-bottom: 30px; }
.jr-intro__content { margin-bottom: 40px; }
.jr-intro__text .jr-btn { margin-top: auto; }

.jr-ba { position: relative; aspect-ratio: 835 / 678; overflow: hidden; background: #000; user-select: none; touch-action: pan-y; }
.jr-ba__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.jr-ba__img--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.jr-ba__tag { position: absolute; bottom: 8px; display: grid; place-items: center; width: 116px; height: 49px; font: 700 16px/1 var(--jr-display); text-transform: uppercase; color: #fff; }
.jr-ba__tag--before { left: 11px; background: #000; }
.jr-ba__tag--after { right: 10px; background: var(--jr-red); }
.jr-ba__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; background: #fff; transform: translateX(-1.5px); pointer-events: none; }
.jr-ba__handle svg { position: absolute; top: 50%; left: 50%; width: 95px; height: 95px; padding: 28px; transform: translate(-50%, -50%); background: #fff; color: var(--jr-red); border-radius: 50%; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.jr-ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.jr-ba:focus-within .jr-ba__handle svg { outline: 3px solid var(--jr-red); outline-offset: 2px; }

/* ---------- Three phases – black rounded band ---------- */
.jr-phases { margin: 153px 0 0; padding: 124px 0 140px; background: #000; color: #fff; border-radius: 8px; }
.jr-phases__head { max-width: 687px; margin: 0 auto 58px; text-align: center; }
.jr-phases .jr-heading { max-width: 647px; margin: 0 auto 22px; color: #fff; }
.jr-phases__intro { margin: 0; font-size: 16px; line-height: 30px; color: #fff; }
.jr-phases__grid { --jr-phase-gap: 46px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--jr-phase-gap); }
.jr-phases__grid > .jr-phase { flex: 0 1 calc((100% - 2 * var(--jr-phase-gap)) / 3); min-width: 0; } /* 1 or 2 phases sit centred */
.jr-phase { min-height: 543px; padding: 42px 32px 48px 29px; background: #fff; color: #050505; border-radius: 8px; }
.jr-phase__badge { display: grid; place-items: center; width: 118px; height: 118px; margin-bottom: 40px; border-radius: 50%; background: var(--jr-red); color: #fff; font: 700 18px/1 var(--jr-display); text-transform: uppercase; }
.jr-phase__title { position: relative; margin: 0 0 27px; padding-bottom: 40px; font: 700 20px/20px var(--jr-display); text-transform: uppercase; color: var(--jr-ink); }
.jr-phase__title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 152px; height: 3px; background: var(--jr-red); }
.jr-phase .jr-richtext { font-size: 16px; line-height: 25px; }
.jr-phase .jr-richtext p { margin-bottom: 25px; }

/* ---------- Image + text splits (630 x 543 image) ---------- */
.jr-split { padding: 69px 0 0; }
.jr-split__grid { display: grid; gap: 40px var(--jr-gap); align-items: center; }
.jr-split--planning .jr-split__grid { grid-template-columns: minmax(0, 630fr) minmax(0, 829fr); }
.jr-split--outcome { padding-top: 76px; }
.jr-split--outcome .jr-split__grid { grid-template-columns: minmax(0, 829fr) minmax(0, 630fr); }
.jr-split__media { position: relative; aspect-ratio: 630 / 543; overflow: hidden; }
.jr-split__media img { position: absolute; inset: 0; display: block; width: 100%; height: 100% !important; object-fit: cover; }
.jr-split--outcome .jr-split__media { border-radius: 8px; }
.jr-split .jr-heading { margin-bottom: 26px; }
.jr-split--outcome .jr-richtext { margin-bottom: 26px; }

/* ---------- Video (1567 x 604) ---------- */
.jr-video { padding: 96px 0 0; }
.jr-video__frame { position: relative; aspect-ratio: 1567 / 604; overflow: hidden; background: #000; }
.jr-video__poster, .jr-video__player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.jr-video__frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(68.59deg, #000 4.64%, rgba(0,0,0,0) 53.41%); pointer-events: none; }
.jr-video__caption { position: absolute; left: 28px; bottom: 30px; z-index: 2; max-width: 80%; color: #fff; font-size: 16px; line-height: 26px; pointer-events: none; }
.jr-video__caption p { margin: 0; }
.jr-video__caption .jr-eyebrow { margin: 0; font-weight: 800; }
.jr-video__frame.is-playing::after, .jr-video__frame.is-playing .jr-video__caption, .jr-video__frame.is-playing .jr-play { display: none; }

.jr-play { position: absolute; top: 50%; left: 50%; z-index: 2; display: grid; place-items: center; width: 96px; height: 96px; padding: 0; transform: translate(-50%, -50%); color: #fff; background: var(--jr-red); border: 0; border-radius: 50%; cursor: pointer; transition: transform .2s, background .2s; }
.jr-play svg { width: 40px; height: 40px; margin-left: 6px; }
.jr-play:hover, .jr-play:focus-visible { background: var(--jr-red-dark); transform: translate(-50%, -50%) scale(1.06); }
.jr-play--sm { pointer-events: none; }

/* ---------- Gallery ---------- */
.jr-gallery { padding: 147px 0 138px; }
.jr-gallery__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 64px; }
.jr-gallery__head .jr-eyebrow { font-weight: 800; }
.jr-gallery__head .jr-heading { margin: 0; max-width: 420px; }
.jr-filters { display: flex; flex-wrap: wrap; gap: 15px; padding-top: 40px; }
.jr-filter { min-width: 84px; height: 57px; padding: 0 30px; border: 0; border-radius: 8px; background: var(--jr-grey); color: var(--jr-grey-text); font: 700 16px/1 var(--jr-display); cursor: pointer; transition: background .2s, color .2s; }
.jr-filter:hover { background: #dcdcdc; }
.jr-filter.is-active { background: var(--jr-red); color: #fff; }

.jr-gallery__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 27px 34px; }
.jr-gallery__item { position: relative; display: block; aspect-ratio: 366 / 363; overflow: hidden; background: #ddd; }
.jr-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.jr-gallery__item:hover img { transform: scale(1.04); }
.jr-gallery__item:hover .jr-play--sm { background: var(--jr-red-dark); }
.jr-gallery__item[hidden] { display: none; }

/* ---------- Lightbox ---------- */
.jr-lb { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; padding: 56px 72px; background: rgba(0,0,0,.92); }
.jr-lb.is-open { display: flex; }
.jr-lb__stage { width: 100%; max-width: 1200px; max-height: 100%; display: grid; place-items: center; }
.jr-lb__stage img, .jr-lb__stage video { max-width: 100%; max-height: calc(100vh - 112px); }
.jr-lb__stage iframe { width: min(100%, 1100px); aspect-ratio: 16 / 9; border: 0; }
.jr-lb button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.jr-lb button:hover, .jr-lb button:focus-visible { background: var(--jr-red); }
.jr-lb__close { top: 16px; right: 16px; }
.jr-lb__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.jr-lb__next { right: 12px; top: 50%; transform: translateY(-50%); }
body.jr-lb-open { overflow: hidden; }

/* =========================================================
   "Our Projects" grid (archive + [jeff_projects] shortcode)
   ========================================================= */
.jr-projects { width: min(100% - (var(--jr-gutter) * 2), var(--jr-max)); margin: 0 auto; padding: 64px 0 80px; }
.jr-projects__heading { position: relative; margin: 0 0 56px; padding-bottom: 18px; text-align: center; color: var(--jr-black); font: 700 var(--jr-h2)/1.1 var(--jr-display); text-transform: uppercase; }
.jr-projects__heading::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 80px; height: 4px; background: var(--jr-red); transform: translateX(-50%); }
.jr-projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.jr-card { position: relative; background: #000; border-bottom: 6px solid var(--jr-red); overflow: hidden; }
.jr-card__link { position: relative; display: block; aspect-ratio: 1 / 1; color: #fff; text-decoration: none; }
.jr-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.jr-card__link::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 64%, rgba(0,0,0,.95) 100%); }
.jr-card__body { position: absolute; inset: auto 0 0; z-index: 2; display: block; padding: 0 24px 24px; text-align: center; }
.jr-card__title { margin: 0 0 14px; color: #fff; font: 700 clamp(20px, 2vw, 26px)/1.15 var(--jr-display); text-transform: uppercase; }
.jr-card__cta { display: inline-block; padding: 10px 28px; background: var(--jr-red); color: #fff; font: 700 14px/1 var(--jr-display); text-transform: uppercase; transition: background .2s; }
.jr-card__link:hover .jr-card__img, .jr-card__link:focus-visible .jr-card__img { transform: scale(1.05); }
.jr-card__link:hover .jr-card__cta, .jr-card__link:focus-visible .jr-card__cta { background: var(--jr-red-dark); }
.jr-card__link:focus-visible { outline: 3px solid var(--jr-red); outline-offset: -3px; }

.jr-projects .navigation.pagination { margin-top: 48px; text-align: center; }
.jr-projects .page-numbers { display: inline-block; min-width: 42px; margin: 0 3px; padding: 11px 14px; border-radius: 8px; background: var(--jr-grey); color: #000; font: 700 15px/1 var(--jr-display); text-decoration: none; }
.jr-projects .page-numbers.current, .jr-projects .page-numbers:hover { background: var(--jr-red); color: #fff; }
.jr-projects__empty { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
	.jr-phases__grid { --jr-phase-gap: 20px; }
	.jr-phase { min-height: 0; }
	.jr-gallery__grid { gap: 18px; }
}
@media (max-width: 1024px) {
	.jr-gallery__grid { grid-template-columns: repeat(3, 1fr); }
	.jr-phases { margin-top: 100px; padding: 80px 0 90px; }
	.jr-gallery { padding: 100px 0 100px; }
}
@media (max-width: 860px) {
	.jr-intro__grid, .jr-split--planning .jr-split__grid, .jr-split--outcome .jr-split__grid { grid-template-columns: 1fr; }
	.jr-intro__text .jr-btn { margin-top: 0; }
	.jr-split--outcome .jr-split__text { order: 2; }
	.jr-hero::before { background: linear-gradient(0deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.35) 100%); }
	.jr-phases { margin-top: 72px; padding: 64px 0; }
	.jr-phases__grid > .jr-phase { flex-basis: 100%; }
	.jr-phase__badge { width: 96px; height: 96px; margin-bottom: 28px; font-size: 16px; }
	.jr-split, .jr-split--outcome { padding-top: 56px; }
	.jr-video { padding-top: 56px; }
	.jr-video__frame { aspect-ratio: 16 / 10; }
	.jr-projects__grid { grid-template-columns: repeat(2, 1fr); }
	.jr-filters { padding-top: 0; }
	.jr-gallery__head { margin-bottom: 32px; }
}
@media (max-width: 600px) {
	.jr-hero { align-items: flex-end; min-height: 540px; }
	.jr-hero__inner { padding-left: 0; }
	.jr-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.jr-filters { gap: 8px; }
	.jr-filter { height: 44px; padding: 0 18px; font-size: 14px; }
	.jr-projects__grid { grid-template-columns: 1fr; }
	.jr-lb { padding: 64px 12px; }
	.jr-lb__prev { left: 4px; } .jr-lb__next { right: 4px; }
	.jr-play { width: 72px; height: 72px; }
	.jr-play svg { width: 30px; height: 30px; margin-left: 5px; }
	.jr-btn { width: 100%; min-width: 0; min-height: 60px; }
	.jr-ba__tag { width: 90px; height: 40px; font-size: 14px; }
	.jr-ba__handle svg { width: 64px; height: 64px; padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
	.jr-single *, .jr-projects * { transition: none !important; }
}

/* =========================================================
   Single project: full width, no theme title banner
   (iThemes Builder layout wrappers)
   ========================================================= */
body.single-projects .builder-module-html-background-wrapper:has(.entry-header) { display: none !important; }
body.single-projects .builder-container:has(.jr-single) { padding-bottom: 0 !important; max-width: none !important; }
body.single-projects .builder-module-outer-wrapper:has(.jr-single) { max-width: none !important; width: 100% !important; margin: 0 !important; }
body.single-projects .builder-module-content:has(.jr-single) { padding: 0 !important; }
body.single-projects .builder-module-content:has(.jr-single) .builder-module-block,
body.single-projects .builder-module-content:has(.jr-single) .builder-module-block-outer-wrapper { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; float: none !important; }

/* Theme forces img, video { height: auto !important } – keep cropped images filling their boxes */
.jr-single .jr-ba__img,
.jr-single .jr-gallery__item img,
.jr-single .jr-video__poster,
.jr-single .jr-video__player,
.jr-projects .jr-card__img { height: 100% !important; max-width: none; }

/* Theme heading resets */
.jr-single h1, .jr-single h2, .jr-single h3 { letter-spacing: normal; }

/* "Our Projects" page ([jeff_projects] shortcode): no theme title banner, like rdssealcoating.com/our-projects */
body.page .builder-module-html-background-wrapper:has(.entry-header):has(~ .builder-module-content-background-wrapper .jr-projects) { display: none !important; }
