/*
Theme Name: Red Deer Construction
Author: Barker
Author URI: https://yourbarker.com
Description: Custom theme for Red Deer Construction. Edit text and photos in Pages, add homes under Projects, see consultation requests under Leads.
Version: 1.2.1
Requires at least: 6.6
Requires PHP: 7.4
License: Proprietary. Owned by Red Deer Construction.
Text Domain: red-deer
*/

/* ---------- Base ---------- */
.wp-site-blocks { padding-top: 0; padding-bottom: 0; }
.wp-site-blocks > * { margin-block-start: 0; }
/* Full-width sections sit flush against each other, no white gaps. */
.entry-content > .alignfull, .wp-block-post-content > .alignfull, .wp-block-post-content > .alignfull + * { margin-block-start: 0 !important; }
.wp-block-post-content > .alignfull:last-child { margin-block-end: 0; }
main.wp-block-group { margin-block-start: 0 !important; }
:where(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 2px; }
.rd-lead { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--muted); max-width: 46ch; }
.rd-more a { font-weight: 600; text-underline-offset: 0.25em; }

/* ---------- Header ---------- */
.rd-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.admin-bar .rd-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .rd-header { top: 0; position: relative; } }
.rd-header .wp-block-site-logo img { max-height: 56px; width: auto; }
.rd-header .wp-block-navigation a { text-decoration: none; }
.rd-header .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }
.rd-contact-btn .wp-block-button__link { padding: 0.7rem 1.25rem; }

/* ---------- Hero ---------- */
.rd-hero h1 {
	color: #fff;
	max-width: 15ch;
	font-size: clamp(2.5rem, 6vw, 4.5rem);
	line-height: 1.05;
	letter-spacing: -0.01em;
}
.rd-hero .rd-since { color: #fff; font-weight: 600; margin-bottom: 0.5rem; }
.rd-hero .rd-hero-lead { color: rgba(255, 255, 255, 0.92); font-size: var(--wp--preset--font-size--large); max-width: 44ch; }
.rd-hero h1, .rd-hero p { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.rd-hero .wp-block-buttons { margin-top: 2rem; }
.rd-hero .is-style-outline .wp-block-button__link { color: #fff; border-color: #fff; }
.rd-hero .wp-block-cover__inner-container { max-width: 1200px; margin-inline: auto; position: static; z-index: auto !important; }
.rd-hero .wp-block-cover__inner-container > * { margin-left: 0 !important; position: relative; z-index: 2; }
.rd-hero .wp-block-cover__background { z-index: 1 !important; }

/* Hero slideshow: the gallery in the hero becomes the background. */
.rd-hero .rd-hero-slides.wp-block-gallery {
	position: absolute !important;
	inset: 0;
	z-index: 0 !important;
	margin: 0 !important;
	max-width: none !important;
	display: block;
}
.rd-hero .rd-hero-slides .wp-block-image {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100%;
	margin: 0 !important;
	opacity: 0;
	transition: opacity 1.4s ease;
}
.rd-hero .rd-hero-slides .wp-block-image.is-active { opacity: 1; }
.rd-hero .rd-hero-slides .wp-block-image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	border-radius: 0;
	animation: rd-zoom 14s ease-out infinite alternate;
}
@keyframes rd-zoom { from { transform: scale(1); } to { transform: scale(1.05); } }
.editor-styles-wrapper .rd-hero .rd-hero-slides.wp-block-gallery { position: relative !important; inset: auto; }
.editor-styles-wrapper .rd-hero .rd-hero-slides .wp-block-image { position: relative; opacity: 1; height: auto; width: calc(25% - 1rem) !important; }

/* ---------- Proof band (numbers) ---------- */
.rd-proof { background: var(--wp--preset--color--ink); color: rgba(255, 255, 255, 0.75); padding-top: 2.25rem; padding-bottom: 2.25rem; }
.rd-proof-row { gap: 0 !important; }
.rd-proof-row > .wp-block-column { padding: 0.25rem 2rem; border-left: 1px solid rgba(255, 255, 255, 0.18); }
.rd-proof-row > .wp-block-column:first-child { padding-left: 0; border-left: 0; }
.rd-proof-row p { margin: 0; }
.rd-proof .rd-proof-num {
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.15;
	color: #fff;
}

/* ---------- Sections ---------- */
.rd-section { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
.rd-section--surface { background: var(--wp--preset--color--surface); }
.rd-section--dark { background: var(--wp--preset--color--ink); color: rgba(255, 255, 255, 0.85); }
.rd-section--dark h2, .rd-section--dark h3 { color: #fff; }
.rd-section--dark a { color: #fff; }
.rd-head-row { margin-bottom: 2.5rem; }
.rd-head-row h2 { margin-bottom: 0; }
.rd-head-row p { margin-bottom: 0; }

/* Photo next to the "what building with us looks like" list */
.rd-why-photo { margin: 0; height: 100%; }
.rd-why-photo img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; border-radius: 2px; }

/* Stacked statements separated by rules */
.rd-points { margin-top: 1.5rem; }
.rd-point { border-top: 1px solid var(--wp--preset--color--border); padding: 1.5rem 0; margin: 0 !important; }
.rd-point:last-child { border-bottom: 1px solid var(--wp--preset--color--border); }
.rd-point h3 { font-size: 1.4rem; margin: 0 0 0.4rem; }
.rd-point p { margin: 0; color: var(--wp--preset--color--muted); max-width: 52ch; }

/* ---------- Pricing options ---------- */
.rd-plans { gap: 1.5rem !important; align-items: stretch; }
.rd-plan { border-top: 2px solid var(--wp--preset--color--ink); padding-top: 1.5rem; }
.rd-plan h3, .rd-plan .rd-plan-title { font-size: 1.5rem; margin: 0; }
.rd-plan .rd-plan-for { color: var(--wp--preset--color--muted); font-size: 0.95rem; margin-top: 0.35rem; }
.rd-plan ul { padding-left: 1.1rem; margin-top: 1rem; }
.rd-plan li { margin-bottom: 0.4rem; }
.rd-plan--main {
	background: var(--wp--preset--color--white);
	border-top: 4px solid var(--wp--preset--color--primary);
	padding: 1.5rem 1.75rem 1.75rem;
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
}
.rd-plan--main .rd-plan-for { color: var(--wp--preset--color--primary); font-weight: 600; }

/* Comparison table on the Pricing page */
.rd-compare { margin-top: 2rem; overflow-x: auto; }
.rd-compare table { border-collapse: collapse; width: 100%; min-width: 600px; background: var(--wp--preset--color--white); }
.rd-compare th, .rd-compare td { border: 1px solid var(--wp--preset--color--border); padding: 1rem 1.25rem; text-align: left; vertical-align: top; }
.rd-compare thead th { background: var(--wp--preset--color--ink); color: #fff; font-weight: 600; }
.rd-compare thead th:nth-child(2) { background: var(--wp--preset--color--primary); }
.rd-compare td:first-child { white-space: nowrap; }
.rd-compare td:last-child { color: var(--wp--preset--color--muted); }

/* ---------- Page headers ---------- */
.rd-page-head h1 { max-width: 20ch; }
.is-layout-constrained > h1.wp-block-heading { max-width: 1200px !important; box-sizing: border-box; padding-inline-end: clamp(0px, calc(100% - 20ch), calc(1200px - 20ch)); }

/* ---------- Projects ---------- */
.rd-projects .wp-block-post {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	overflow: hidden;
	padding-bottom: 1.25rem;
}
.rd-projects .wp-block-post > *:not(.wp-block-post-featured-image) { padding-left: 1.25rem; padding-right: 1.25rem; }
.rd-projects .wp-block-post-featured-image { margin-bottom: 1rem; }
.rd-projects .wp-block-post-title { font-size: 1.35rem; }
.rd-projects .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--ink); }
.rd-projects .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.rd-projects .wp-block-post-excerpt { color: var(--wp--preset--color--muted); }
.rd-tag, .rd-tag a { color: var(--wp--preset--color--primary); font-size: var(--wp--preset--font-size--small); font-weight: 600; text-decoration: none; }
.rd-filter { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.rd-filter li a {
	display: inline-block;
	padding: 0.45rem 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--white);
}
.rd-filter li a:hover, .rd-filter li.current-cat a { background: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); color: #fff; }
.rd-project-photo img { border-radius: 2px; }
.wp-block-gallery img { border-radius: 2px; }

/* ---------- Call to action band (bottom of every page) ---------- */
.rd-cta { background: var(--wp--preset--color--primary); color: rgba(255, 255, 255, 0.92); padding-top: 3.5rem; padding-bottom: 3.5rem; }
.rd-cta h2 { color: #fff; margin-top: 0; }
.rd-cta p { margin-bottom: 0; max-width: 52ch; }
.rd-cta-buttons { justify-content: flex-end; }
.rd-cta .wp-block-button__link { background: #fff; color: var(--wp--preset--color--primary); }
.rd-cta .wp-block-button__link:hover { background: var(--wp--preset--color--ink); color: #fff; }
.rd-cta .is-style-outline .wp-block-button__link { background: transparent; color: #fff; border: 2px solid #fff; }
.rd-page-contact .rd-cta { display: none; }

/* ---------- Contact page ---------- */
.rd-contact h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); }
.rd-small-head { font-size: 1.25rem; margin-top: 2.5rem; }
.rd-steps { list-style: none; counter-reset: rd-step; padding: 0; margin-top: 1rem; }
.rd-steps li { counter-increment: rd-step; position: relative; padding-left: 2.75rem; margin-bottom: 1rem; }
.rd-steps li::before {
	content: counter(rd-step);
	position: absolute;
	left: 0;
	top: -0.1rem;
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--primary);
}
.rd-contact-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--wp--preset--color--border); }
.rd-contact-info p { margin: 0; }

/* Consultation form */
.rd-form {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-top: 4px solid var(--wp--preset--color--primary);
	border-radius: 2px;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	display: grid;
	gap: 1.1rem;
	scroll-margin-top: 110px;
}
.rd-form h2 { font-size: 1.6rem; margin: 0; }
.rd-form label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.rd-form .rd-optional { font-weight: 400; color: var(--wp--preset--color--muted); }
.rd-form input, .rd-form select, .rd-form textarea {
	font: inherit;
	font-weight: 400;
	width: 100%;
	box-sizing: border-box;
	padding: 0.75rem 0.85rem;
	border: 1px solid #C9C9C9;
	border-radius: 2px;
	background: #fff;
	color: var(--wp--preset--color--ink);
}
.rd-form input:focus, .rd-form select:focus, .rd-form textarea:focus { border-color: var(--wp--preset--color--primary); outline: 2px solid var(--wp--preset--color--primary); outline-offset: 0; }
.rd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rd-form button {
	cursor: pointer;
	border: 0;
	border-radius: 2px;
	padding: 1rem 1.5rem;
	font: inherit;
	font-weight: 600;
	background: var(--wp--preset--color--primary);
	color: #fff;
	justify-self: start;
}
.rd-form button:hover { background: var(--wp--preset--color--ink); }
.rd-form-note { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); margin: 0; }
.rd-form-error { background: #FBEAEA; color: var(--wp--preset--color--primary); padding: 0.75rem 1rem; margin: 0; font-weight: 600; }
.rd-form--done p { margin: 0; }
.rd-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.rd-footer { background: var(--wp--preset--color--ink); color: rgba(255, 255, 255, 0.8); }
.rd-footer h3 { color: #fff; font-size: 1.1rem; }
.rd-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.rd-footer a:hover { color: #fff; text-decoration: underline; }
.rd-footer .rd-copy { border-top: 1px solid rgba(255, 255, 255, 0.15); font-size: var(--wp--preset--font-size--small); }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 781px) {
	.rd-proof-row > .wp-block-column { padding: 1rem 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.18); }
	.rd-proof-row > .wp-block-column:first-child { border-top: 0; padding-top: 0; }
	.rd-head-row .has-text-align-right { text-align: left; }
	.rd-why-photo img { min-height: 260px; }
	.rd-cta-buttons { justify-content: flex-start; }
	.rd-form-row, .rd-contact-info { grid-template-columns: 1fr; }
	.rd-header .wp-block-site-logo img { max-height: 44px; }
	.rd-contact-btn .wp-block-button__link { padding: 0.55rem 0.9rem; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
	.rd-hero .rd-hero-slides .wp-block-image img { animation: none; }
}

/* ---------- Project page ---------- */
.rd-project .rd-back a { font-weight: 600; text-decoration: none; }
.rd-project .rd-back a::before { content: "\2039"; margin-right: 0.4em; }
.rd-project h1 { margin-top: 0.25rem; }
.rd-project .rd-lead { max-width: 60ch; }
.rd-project .rd-project-photo { margin-top: 2rem; }
.rd-project-body { margin-top: 3rem !important; }
.rd-project-body .wp-block-gallery { margin-top: 0; }

.rd-details {
	position: sticky;
	top: 110px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-top: 4px solid var(--wp--preset--color--primary);
	border-radius: 2px;
	padding: 1.75rem;
}
.rd-details h2 { font-size: 1.5rem; margin: 0 0 1rem; }
.rd-details h3 { font-family: var(--wp--preset--font-family--sans); font-size: 0.95rem; font-weight: 600; color: var(--wp--preset--color--muted); margin: 1.75rem 0 0.5rem; }
.rd-details-list { margin: 0; }
.rd-details-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.rd-details-list > div:last-child { border-bottom: 0; }
.rd-details-list dt { color: var(--wp--preset--color--muted); }
.rd-details-list dd { margin: 0; font-weight: 600; text-align: right; }
.rd-details-list .is-total dd { color: var(--wp--preset--color--primary); }
.rd-features { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rd-features li { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); padding: 0.35rem 0.75rem; border-radius: 2px; font-size: 0.95rem; }
.rd-details-cta { margin: 1.75rem 0 0; }
.rd-details-cta .wp-element-button { display: block; text-align: center; text-decoration: none; padding: 0.85rem 1rem; background: var(--wp--preset--color--primary); color: #fff; font-weight: 600; border-radius: 2px; }
.rd-details-cta .wp-element-button:hover { background: var(--wp--preset--color--ink); }

/* Facts line on project cards */
.rd-card-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: var(--wp--preset--font-size--small); font-weight: 600; color: var(--wp--preset--color--ink); margin-top: 0.5rem; }

@media (max-width: 781px) {
	.rd-details { position: static; }
}

/* Lead text inside full-width sections lines up with the heading above it. */
.is-layout-constrained > .rd-lead { max-width: 1200px !important; box-sizing: border-box; padding-inline-end: clamp(0px, calc(100% - 46ch), calc(1200px - 46ch)); }
.rd-project .rd-lead p { margin: 0; }
