/* ─── Our History Block ──────────────────────────────────────────────────── */
/*
 * Styling pulled directly from the old DMA site's about page template.
 * Key values sourced from gotheme2015/stylesheets/css/layout.css:
 *   .history-slider-wrap, .history-slide, .info-wrap, .year, .line, .img
 */

.dma-our-history {
	position: relative;
	/* No overflow:hidden — the decorative parallax image is allowed to bleed
	   past the section's top/bottom edges into neighboring modules. */
	/* Section bg must match --dma-history-bg so the year text masks the line */
	--dma-history-bg: #ffffff;
	background: var(--dma-history-bg);
}

.wp-block-pro-design-our-history.alignfull,
.dma-our-history.alignfull {
	margin-left:  calc(-1 * var(--wp--style--root--padding-left,  0px));
	margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px));
	max-width: none;
	width: 100%;
}

/* ── Background decorative image ─────────────────────────────────────────── */
/*
 * Left-anchored decorative layer, fully visible (no crop): the image keeps its
 * natural aspect ratio (height:auto) and is vertically centered on the section.
 * The section has no overflow clipping, so the image — and its GSAP parallax
 * travel (±48px, speed 0.3 × 160) — may bleed above/below into neighboring
 * modules by design. GSAP parallax is triggered on the section itself (in
 * flow) so ScrollTrigger can measure scroll position accurately.
 */
.dma-history-parallax {
	position: absolute;
	top: 0;
	left: 0;
	width: 28%;   /* midpoint between 27.5% and 34.375% */
	height: 100%;
	margin-left: -5%;
	z-index: 0;
	pointer-events: none;
	display: flex;
	align-items: center;
}
.dma-history-parallax img {
	display: block;
	width: 100%;
	height: auto;
}

/* ── Inner wrapper ───────────────────────────────────────────────────────── */
.dma-history-inner {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	margin: 0 auto;
	padding: 56px 0 100px;   /* matches original margin-top:56px + padding-bottom:100px */
	overflow: hidden;
}

/* ── Section title (h3) ──────────────────────────────────────────────────── */
/* Original: 18px/24px, Space Mono bold, color:#007d8a, text-align:center */
.dma-history-title {
	font-size: 18px;
	line-height: 20px;
	font-weight: 400;
	font-family: 'space-mono', 'Space Mono', monospace;
	color: #007d8a;
	text-align: center;
	margin: 0 0 56px;
}

/* ── Slides container ────────────────────────────────────────────────────── */
.dma-history-slides {
	position: relative;
}

/* ── Individual slide ────────────────────────────────────────────────────── */
/* Original: .history-slide — position:relative, overflow:visible, two-column */
.dma-history-slide {
	display: none;
	position: relative;
}
.dma-history-slide.active {
	display: block;
}

/* ── Info wrap (left column) ─────────────────────────────────────────────── */
/*
 * Original: width:50%, float:left, padding:100px, padding-top:140px,
 *           position:relative, min-height:356px
 */
.dma-history-info {
	width: 50%;
	float: left;
	padding: 140px 100px 100px 100px;
	position: relative;
	min-height: 356px;
	box-sizing: border-box;
	text-align: center;
}

/* Clearfix for the float */
.dma-history-slide::after {
	content: '';
	display: table;
	clear: both;
}

/* ── Decorative lines ────────────────────────────────────────────────────── */
/*
 * Original: position:absolute inside .info-wrap, background:#007d8a, z-index:-1
 * Desktop overrides set top:60px for all lines; top/bottom extend to right:-100px
 * (past the info-wrap edge, into the image area).
 */
.dma-hline {
	position: absolute;
	background-color: #007d8a;
	z-index: 0;
}

/* Top horizontal line: spans from left:25px to right:-100px (into image) */
.dma-hline--top {
	height: 2px;
	top: 60px;
	left: 25px;
	right: -100px;
}

/* Left vertical line: from top-line to near bottom */
.dma-hline--left {
	width: 2px;
	top: 60px;
	left: 25px;
	bottom: 10px;
}

/* Bottom horizontal line: same span as top */
.dma-hline--bottom {
	height: 2px;
	bottom: 10px;
	left: 25px;
	right: -100px;
}

/* ── Year ────────────────────────────────────────────────────────────────── */
/*
 * Original: position:absolute, left:50%, transform:translateX(-50%), top:30px
 *           font-size:64px, line-height:71px, color:#007d8a, font-weight:700,
 *           font-family:"mr-eaves-modern", display:inline, bg:#fff, padding:0 10px
 *
 * The white background masks the top line, creating the framed title effect.
 */
.dma-history-year-pos {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	top: 30px;
	z-index: 1;
	text-align: center;
	white-space: nowrap;
}

.dma-history-year {
	display: inline;
	font-size: 64px;
	line-height: 71px;
	color: #007d8a;
	font-weight: 700;
	font-family: 'mr-eaves-modern', sans-serif;
	text-align: center;
	background-color: var(--dma-history-bg);
	padding: 0 10px;
}

/* ── Description ─────────────────────────────────────────────────────────── */
/* Original: margin:0, margin-top:8px, text-align:center, padding:0 40px */
.dma-history-desc {
	margin: 8px 0 0;
	text-align: center;
	padding: 0 40px;
	position: relative;
	z-index: 1;
	font-size: 17px;
	line-height: 1.6;
	color: #646569;
}

/* ── Image (right column) ────────────────────────────────────────────────── */
/*
 * Original: width:calc(50% - 20px), position:absolute, top:0, right:0,
 *           bottom:-40px, height:auto, min-height:376px,
 *           box-shadow:0 0 16px 0 rgba(0,0,0,.3)
 *           margin-top:10px
 */
.dma-history-imgwrap {
	width: calc(50% - 20px);
	position: absolute;
	top: 0;
	right: 0;
	bottom: -40px;
	height: auto;
	min-height: 376px;
	margin-top: 10px;
	box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.dma-history-imgwrap img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.dma-history-img-placeholder {
	width: 100%;
	height: 100%;
	min-height: 376px;
	background: #c8c9ca;
}

/* ── Navigation arrows ───────────────────────────────────────────────────── */
/*
 * Original: prev at left:calc(25% - 45px), next at left:calc(25% + 45px)
 * relative to the full-width slider container. 25% = center of the 50%-wide
 * info column. We replicate this by making the nav width:50% (= info-wrap
 * width) and using flex to center the two buttons inside it — so "center"
 * lands exactly at the info column center without any coordinate math.
 *
 * Year labels: Space Mono 14px bold, color:#e4002b
 * Arrow icon: 20x20px, color:#646569
 */
.dma-history-nav {
	clear: both;
	width: 50%;                   /* matches info-wrap width → center = info column center */
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 20px 0;
}

.dma-history-prev,
.dma-history-next {
	display: inline-flex;
	align-items: center;
	gap: 0;
	background-color: var(--dma-history-bg);
	border: none;
	cursor: pointer;
	padding: 4px 6px;
	color: #646569;
	line-height: 1;
}

.dma-history-prev:focus-visible,
.dma-history-next:focus-visible {
	outline: 2px solid #e4002b;
	outline-offset: 2px;
}

/* Kadence's global.min.css sets a blanket `button:hover{background:...}` rule
   (its palette blue) on every <button> site-wide. We never had our own
   :hover background, so that rule won with nothing to compete against —
   pin it back to the section background and keep the arrow/label colors
   from being hijacked too. */
.dma-history-prev:hover,
.dma-history-next:hover,
.dma-history-prev:focus,
.dma-history-next:focus,
.dma-history-prev:active,
.dma-history-next:active {
	background-color: var(--dma-history-bg);
	color: #646569;
	box-shadow: none;
}

/* Year labels inside the buttons — <span> so block-level margin never applies */
.dma-history-prev-year,
.dma-history-next-year {
	display: inline;          /* span, but be explicit */
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1;           /* match the SVG visual midpoint */
	color: #e4002b;
	font-family: 'space-mono', 'Space Mono', monospace;
	font-weight: 700;
	vertical-align: middle;
}

.dma-history-prev-year { padding-right: 6px; }
.dma-history-next-year { padding-left:  6px; }

.dma-history-prev:hover .dma-history-prev-year,
.dma-history-next:hover .dma-history-next-year,
.dma-history-prev:focus-visible .dma-history-prev-year,
.dma-history-next:focus-visible .dma-history-next-year {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Arrow SVG icon */
.dma-history-prev svg,
.dma-history-next svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	vertical-align: middle;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.dma-our-history--empty {
	padding: 40px;
	text-align: center;
	color: #646569;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
	.dma-history-info {
		width: 100%;
		float: none;
		/* Image now flows normally below (see .dma-history-imgwrap below), so
		   this only needs a normal bottom breathing space — NOT room reserved
		   for an absolutely-positioned image. The old 320px value left a dead
		   gap between the desc text and the bottom border line, making the
		   frame look disconnected from its content. */
		padding: 80px 40px 48px;
		min-height: auto;
	}

	.dma-history-imgwrap {
		width: calc(100% - 40px);
		position: relative;
		top: auto;
		right: auto;
		bottom: auto;
		left: 20px;
		/* Fixed ratio (not just a min-height) so every slide's photo renders at
		   the same height regardless of its natural dimensions — desktop gets
		   this for free from the absolute top/bottom stretch, but in normal
		   flow here a min-height alone still let taller/wider source photos
		   change the box's height, shifting everything below it every time
		   the prev/next arrows were clicked. */
		aspect-ratio: 5 / 4;
		height: auto;
		margin-top: 20px;
	}

	.dma-hline--top,
	.dma-hline--bottom {
		right: 0;
	}

	/* Nav: full width on mobile, still centered */
	.dma-history-nav {
		width: 100%;
	}
}

@media (max-width: 600px) {
	.dma-history-inner {
		padding: 40px 16px 80px;
	}
	.dma-history-info {
		/* .dma-history-inner adds 16px of horizontal padding at this breakpoint
		   (above), which was insetting the border frame from the true screen
		   edge. Cancel that out here with a negative margin so the frame
		   reaches the edge, then add the same 16px onto this box's own
		   padding so the year/desc text doesn't actually shift position —
		   only the border does. .dma-history-imgwrap is untouched and keeps
		   its own independent left:20px inset, so the image stays contained.
		   width MUST be auto (not the 100% inherited from the 991px rule) —
		   with an explicit width AND both margins set, CSS treats the three
		   as over-constrained and silently discards the margin-right value,
		   which was the bug: only the left edge actually reached the screen
		   edge and the right edge snapped back in. width:auto lets the browser
		   solve the width from both margins instead of ignoring one. */
		width: auto;
		margin-left: -16px;
		margin-right: -16px;
		padding: 80px 40px 40px;
	}
	.dma-history-year {
		font-size: 48px;
		line-height: 1.1;
	}
	.dma-history-desc {
		padding: 0 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dma-history-slide {
		animation: none;
	}
}
