/*
Theme Name: MDS Mirror
Template: extendable
Description: Extendable child theme mirroring gomds.com (Memphis Distribution Services) for a redesign workspace.
Version: 1.0.0
Text Domain: mds-mirror
*/

/* Header sits over each page's hero, like gomds.com */
.mds-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 20;
}
.admin-bar .mds-header { top: 32px; }
.mds-header a,
.mds-header .wp-block-navigation .wp-block-navigation-item__content { color: #fff; }
.mds-header .wp-block-navigation { font-size: clamp(.9rem, .3rem + .85vw, 1.1rem); }
.mds-header .wp-block-navigation__responsive-container.is-menu-open a { color: var(--wp--preset--color--foreground); }

.mds-logo a {
	display: block;
	width: clamp(200px, 24vw, 350px);
	aspect-ratio: 500 / 183;
	height: auto;
	background: url("assets/images/mds-logo-ko.webp") no-repeat left center / contain;
	text-indent: -9999px;
	overflow: hidden;
}

/* Hero eyebrow and rule */
.mds-eyebrow { font-weight: 500; letter-spacing: .03em; }
.mds-hero hr.wp-block-separator { border-top-width: 1px; opacity: .6; }
.mds-hero h1 { line-height: 1.1; }

/* Small orange service icons above headings */
.mds-icon img { width: 56px; height: auto; }
.mds-icon-lg img { width: 72px; height: auto; }

/* Stats band */
.mds-stat h2 { line-height: 1.1; }

/* Footer: blue box cars under a dark overlay */
.mds-footer {
	background: linear-gradient(rgba(24, 66, 115, .72), rgba(24, 66, 115, .72)), url("assets/images/footer-boxcars.webp") center / cover no-repeat;
}
.mds-footer a { color: #fff; }

/* Buttons: square corners and tracked caps, like the source */
.wp-block-button__link {
	border-radius: 0;
	text-transform: uppercase;
	letter-spacing: .1em;
	font-weight: 700;
	font-size: .85rem;
	padding: 1rem 2rem;
}

/* Quote form */
.mds-quote .wp-block-jetpack-contact-form input,
.mds-quote .wp-block-jetpack-contact-form textarea { border-radius: 0; }

/* Photo columns fill their side like the source's image blocks */
.mds-media img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; }
.mds-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.mds-icon-lg { text-align: center; }
.mds-icon-lg img { display: inline-block; }
.mds-hero .wp-block-separator { color: #fff; max-width: none; }

/* Body copy size and heading tracking closer to the source */
.wp-block-post-content p, .wp-block-post-content li { font-size: clamp(1rem, .4rem + 1.1vw, 1.45rem); }
.wp-block-post-content p.mds-eyebrow { font-size: clamp(.9rem, .5rem + .5vw, 1.1rem); }
.mds-cta { min-height: 0 !important; }
h1, h2, h3, h4 { letter-spacing: .01em; }
.mds-hero h1 { max-width: 70rem; }
.mds-cta .wp-block-columns { margin: 0; }
.mds-avatar { text-align: center; }
.mds-avatar img { display: inline-block; width: 200px; height: 200px; border-radius: 50%; object-fit: cover; }
.wp-block-post-content .wp-block-separator.has-background:not(.is-style-dots) { max-width: none; width: 100%; height: 1px; border: 0; }

/* Headings never hyphenate mid-word (gomds.com wraps whole words) */
h1, h2, h3, h4, h5, h6 { hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; word-break: normal; }

/* Hand-drawn underline under key words, drawn in the text colour */
.mds-swoosh { position: relative; display: inline-block; }
.mds-swoosh::after {
	content: "";
	position: absolute;
	left: -3%;
	right: -4%;
	bottom: -.16em;
	height: .2em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 11 C 40 6, 110 4, 186 5 C 190 5, 194 4, 197 2' stroke='black' stroke-width='3.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 11 C 40 6, 110 4, 186 5 C 190 5, 194 4, 197 2' stroke='black' stroke-width='3.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* Mobile menu icon matches the white header text */
.mds-header .wp-block-navigation__responsive-container-open { color: #fff; }
.mds-header .wp-block-navigation__responsive-container-open svg { width: 34px; height: 34px; }

@media (max-width: 781px) {
	/* gomds.com shows only logo + menu icon on phones */
	.mds-header { padding: 1.25rem 6vw !important; }
	.mds-header .wp-block-buttons { display: none; }
	.mds-logo a { width: 170px; }

	.mds-hero { padding-left: 6vw !important; padding-right: 6vw !important; padding-top: 9rem !important; padding-bottom: 3rem !important; }
	.mds-hero h1 { font-size: 3.1rem; line-height: 1.12; }

	/* footer: big centered logo first, copyright last, as on gomds.com */
	.mds-footer .mds-footcol { display: contents; }
	.mds-footer .mds-logo { order: -1; align-self: center; }
	.mds-footer .mds-logo a { width: 230px; }
	.mds-footer .mds-copy { order: 9; margin-top: 2rem; }
	.mds-hero h2 { font-size: 2.3rem; }

	.wp-block-post-content > .wp-block-group.alignfull {
		padding-top: 3rem !important;
		padding-bottom: 3rem !important;
		padding-left: 6vw !important;
		padding-right: 6vw !important;
	}
	.mds-cta { padding-left: 6vw !important; padding-right: 6vw !important; }
	.mds-cta .wp-block-buttons { justify-content: flex-start; }

	/* photo above the text where the source stacks it that way */
	.mds-img-first > .wp-block-column:has(.mds-media) { order: -1; }
	.mds-text-first > .wp-block-column:has(.mds-portrait) { order: 2; }


	.mds-avatar img { width: 140px; height: 140px; }
	.mds-media img { min-height: 260px; }
}

/* Sections butt together like the source; no default block gap between them */
.wp-block-post-content > * + * { margin-block-start: 0 !important; }
main.wp-block-group + footer, .wp-site-blocks > footer { margin-block-start: 0 !important; }

/* Sliders (services icons, Memphis stats) */
.mds-carousel { position: relative; padding: 0 4rem; }
.mds-track {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}
.mds-track::-webkit-scrollbar { display: none; }
.mds-track > .mds-card { flex: 0 0 auto; scroll-snap-align: start; margin: 0 !important; padding: 0 1rem; box-sizing: border-box; }
.mds-svc .mds-card { flex-basis: 22%; }
.mds-stats .mds-card { flex-basis: 100%; }
.mds-svc .mds-card h4 { font-size: clamp(1rem, .6rem + .8vw, 1.35rem); }
.mds-stats .mds-card h2 { font-size: clamp(2.2rem, 3.4vw, 3rem); }
.mds-stats .mds-card p { font-size: clamp(1.1rem, .8rem + .8vw, 1.5rem) !important; color: var(--wp--preset--color--tertiary); }
.mds-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: var(--wp--preset--color--primary);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.mds-arrow-prev { left: 0; }
.mds-arrow-next { right: 0; }
.mds-stats .mds-arrow { background: transparent; box-shadow: none; font-size: 1.8rem; }
.mds-svc .mds-icon-lg img { width: clamp(80px, 8vw, 120px); }

@media (max-width: 781px) {
	/* sliders: one card per view on phones, as on gomds.com */
	.mds-svc .mds-card { flex-basis: 100%; }
	.mds-carousel { padding: 0 3rem; }
}
