/*
Theme Name: TRHAC (DFI2026 Child)
Theme URI: https://dfiproductions.com
Author: DFI Productions
Author URI: https://dfiproductions.com
Description: Site-specific child theme for TRHAC, built on the DFI2026 parent theme. Holds TRHAC-only overrides so the parent theme can be updated independently.
Version: 1.0.18
Template: dfi2026
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: dfi2026-child
*/

/*
 * Everything else built so far (colors, sizing, hero copy, contact info,
 * etc.) lives in theme options / post content in the database, not in
 * theme files, so it's independent of which theme is active.
 */

/* Temporarily hide the homepage Vimeo hero's timed text slides (content/
   timings left untouched in the Vimeo instance so they can come back
   later - just not shown right now). */
.home .dfi-vimeo-slides-layer {
	display: none;
}

/* Homepage Vimeo hero text box: white border on top/right/bottom only,
   and rounded top-right/bottom-right corners (parent theme's radius
   option) - this is the look for a LEFT-justified slide, flush against
   the left edge of the video. */
.dfi-vimeo-slide-box {
	border-top: 2px solid #fff;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	border-left: none;
}

/* Right-justified slides sit flush against the right edge instead, so
   mirror both the border and the corner rounding to the other side. */
.dfi-justify-desktop-right .dfi-vimeo-slide-box {
	border-right: none;
	border-left: 2px solid #fff;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
	border-top-left-radius: var(--dfi-slide-radius-desktop, 0);
	border-bottom-left-radius: var(--dfi-slide-radius-desktop, 0);
}

/* Nudge the hero text box down from its default vertical-center position
   over the video (the video itself is untouched). */
.home .dfi-vimeo-slide-box {
	margin-top: 4vh;
}

/* Credit card / payment logos strip, just right of the footer logo. Its
   own fixed vw size (not tied to --dfi-footer-logo-height) so it can be
   sized independently of the company logo; the 280x89 source image's
   own aspect ratio (~3.15:1) keeps it from stretching. */
.site-footer__logo {
	display: flex;
	align-items: center;
	gap: 2.5rem;
}

.site-footer__logo::after {
	content: "";
	display: inline-block;
	width: calc(3vw * 3.146);
	height: 3vw;
	background-image: url('https://trhac.newwebsite.me/wp-content/uploads/2026/10/cc-logos.png');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: left center;
}

/* Homepage Vimeo dimmer: on desktop, turn the parent theme's flat black
   "Video Dimming" overlay into a top-down gradient - full strength behind
   the transparent logo/nav row, then trailing off to fully transparent
   further down the video. Strength is still controlled by the Video
   Dimming slider (Theme Options -> Vimeo Background Video), which sets
   the overlay's opacity. Mobile keeps the flat dim. */
@media (min-width: 768px) {
	.home .dfi-vimeo-dim {
		background: linear-gradient(
			to bottom,
			#000 0,
			#000 8vw,
			rgba(0, 0, 0, 0.6) 14vw,
			rgba(0, 0, 0, 0.2) 22vw,
			transparent 32vw
		);
	}
}

/* Stat Counters with exactly 5 stats: keep them all on one row on desktop
   (the parent caps the grid at 4 columns, which would wrap the 5th onto
   its own row), and trim the number size a touch so 4-digit values like
   "1,310" fit the narrower columns. Mobile keeps the parent's 2 columns. */
@media (min-width: 769px) {
	.dfi-stats:has(.dfi-stats__item:nth-child(5):last-child) {
		--dfi-stats-cols: 5 !important;
	}

	.dfi-stats:has(.dfi-stats__item:nth-child(5):last-child) .dfi-stats__number {
		font-size: clamp(2.25rem, 4vw, 3.5rem);
	}
}

/* Stat Counters "Full Width Breakout": the parent stretches the block's
   wrapper edge to edge but still caps the row of stats at 1200px, so
   without a background the breakout looks like it does nothing. Let the
   stats themselves spread across the full width when the toggle is on. */
.dfi-stats.dfi-full-bleed .dfi-stats__grid {
	max-width: none;
}

/* Stat Counters: drop the parent's 2rem top/bottom outer margin so the
   block sits flush against its neighbours. */
.dfi-stats {
	margin-block: 0;
}

/* Desktop nav dropdowns: thin light-blue outline (the logo's #4882c3) so
   the navy submenu stands out against the matching navy header bar. The
   theme has no option for this. Mobile menu is untouched. */
@media (min-width: 769px) {
	.primary-menu .sub-menu {
		border: 1px solid #4882c3;
		/* Deeper shadow than the parent's 12% black, which disappears
		   against the navy header. */
		box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
	}
}

/* Site-wide Call to Action band: show the accepted credit card logos
   centered below the Contact button (the CTA has no option/hook for
   extra content). Same cc-logos.png as the footer, 280x89 source. */
.dfi-cta__inner::after {
	content: "";
	display: block;
	width: 220px;
	max-width: 100%;
	aspect-ratio: 280 / 89;
	margin: 1.5rem auto 0;
	background: url('https://trhac.newwebsite.me/wp-content/uploads/2026/10/cc-logos.png') center / contain no-repeat;
}

/* Brands Carried page: logo grid as a 3x3 - every logo ~20% of the row
   width (5% gaps between columns) instead of the parent grid's
   equal-area sizing, which lets the row count vary with screen width. */
.page-id-210 .dfi-logo-grid {
	column-gap: 5%;
}

.page-id-210 .dfi-logo-grid__item {
	flex: 0 0 20%;
}

.page-id-210 .dfi-logo-grid__link {
	width: 100%;
}

.page-id-210 .dfi-logo-grid__logo {
	width: 100%;
	height: auto;
}

/* Blog posts: WordPress alignment classes. The parent theme has no rules
   for these, so images imported from the old site (classic <img
   class="alignright">) and aligned Image blocks sat inline instead of
   floating with the text wrapping around them. Floats switch off on
   phones so text never gets squeezed beside an image. */
.dfi-blog-content .alignright {
	float: right;
	margin: 0.35em 0 1em 1.5em;
}

.dfi-blog-content .alignleft {
	float: left;
	margin: 0.35em 1.5em 1em 0;
}

.dfi-blog-content .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.dfi-blog-content img.alignright,
.dfi-blog-content img.alignleft,
.dfi-blog-content .alignright img,
.dfi-blog-content .alignleft img {
	max-width: 50%;
	height: auto;
}

.dfi-blog-content figure.alignright,
.dfi-blog-content figure.alignleft {
	max-width: 50%;
}

.dfi-blog-content figure.alignright img,
.dfi-blog-content figure.alignleft img {
	max-width: 100%;
}

/* Keep floats inside the post so they can't hang into what follows. */
.dfi-blog-content::after {
	content: "";
	display: table;
	clear: both;
}

@media (max-width: 600px) {
	.dfi-blog-content .alignright,
	.dfi-blog-content .alignleft {
		float: none;
		display: block;
		margin: 1em auto;
	}

	.dfi-blog-content img.alignright,
	.dfi-blog-content img.alignleft,
	.dfi-blog-content figure.alignright,
	.dfi-blog-content figure.alignleft {
		max-width: 100%;
	}
}

/* Ads landing page (/heating-air-conditioning-repair/): the "FREE
   ESTIMATE!" form as a card floated right of the text (the old site
   floated it too). White card, navy header band, light-blue accent edge,
   soft shadow; the red Send button is the strongest color in it.
   Stacks above the text, full width, on narrow screens. */
.trhac-estimate-box {
	float: right;
	width: 360px;
	max-width: 100%;
	margin: 0.25rem 0 1.75rem 2.5rem;
	padding: 0 1.5rem 1.5rem;
	background: #ffffff;
	border: 1px solid rgba(35, 39, 88, 0.12);
	border-radius: 10px;
	box-shadow: 0 18px 40px rgba(35, 39, 88, 0.18), 0 2px 6px rgba(35, 39, 88, 0.08);
	overflow: hidden;
}

.trhac-estimate-box > h2 {
	margin: 0 -1.5rem 1.1rem;
	padding: 1rem 1.25rem 0.9rem;
	background: #232758;
	color: #ffffff;
	font-size: 1.6rem;
	line-height: 1.15;
	letter-spacing: 0.04em;
	text-align: center;
}

.trhac-estimate-box > p {
	margin: 0 0 1.1rem;
	color: #4a4f6a;
	font-size: 0.95rem;
	line-height: 1.5;
	text-align: center;
}

.trhac-estimate-box .dfi-contact-form__field label {
	color: #232758;
	font-weight: 600;
}

.trhac-estimate-box .dfi-contact-form__field input,
.trhac-estimate-box .dfi-contact-form__field textarea {
	background: #f5f7fb;
	border-color: rgba(35, 39, 88, 0.18);
}

.trhac-estimate-box .dfi-contact-form__field input:focus,
.trhac-estimate-box .dfi-contact-form__field textarea:focus {
	background: #ffffff;
	border-color: #4882c3;
	outline: 2px solid rgba(72, 130, 195, 0.35);
	outline-offset: 0;
}

.trhac-estimate-box .dfi-contact-form__field textarea {
	min-height: 6.5rem;
}

.trhac-estimate-box .dfi-contact-form__submit {
	width: 100%;
	padding-top: 0.85rem;
	padding-bottom: 0.85rem;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.trhac-estimate-box .trhac-estimate-box__call {
	margin: 1rem 0 0;
	padding-top: 0.9rem;
	border-top: 1px solid rgba(35, 39, 88, 0.1);
	color: #4a4f6a;
	font-size: 0.9rem;
	text-align: center;
}

.trhac-estimate-box .trhac-estimate-box__call a {
	color: #232758;
	font-weight: 700;
	white-space: nowrap;
}

/* Keep the float inside the page content. */
.entry-content:has(.trhac-estimate-box)::after {
	content: "";
	display: table;
	clear: both;
}

@media (max-width: 768px) {
	.trhac-estimate-box {
		float: none;
		width: auto;
		margin: 0 0 2rem;
	}
}

/* Mobile phone button on the logo / hamburger row (added by
   trhac_mobile_header_phone_script() in functions.php). Same color as the
   hamburger, a touch smaller so the two read as a pair. */
.trhac-header-phone {
	display: none;
}

@media (max-width: 768px) {
	.trhac-header-phone {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		margin-left: auto;
		padding: 0.25rem;
		color: var(--dfi-toggle-color, #ffffff);
		font-size: calc(var(--dfi-toggle-size, 1.5rem) * 0.9);
		line-height: 1;
		text-decoration: none;
	}

	.trhac-header-phone:hover,
	.trhac-header-phone:focus-visible {
		color: var(--dfi-toggle-color, #ffffff);
		opacity: 0.85;
	}

	/* Header row: logo left, phone + hamburger grouped on the right. */
	.site-header__inner:has(.trhac-header-phone) {
		column-gap: 0.75rem;
	}

	.site-header__inner:has(.trhac-header-phone) .menu-toggle {
		margin-left: 0;
	}

	/* The top bar keeps just the social icons on mobile. */
	.top-bar:has(~ .site-header .trhac-header-phone) .top-bar__phone,
	body:has(.trhac-header-phone) .top-bar__phone {
		display: none;
	}
}

/* Homepage Vimeo: no dimming on mobile (desktop keeps the gradient dimmer
   behind the nav, above). */
@media (max-width: 767px) {
	.home .dfi-vimeo-dim {
		display: none;
	}
}

/* Footer on mobile: company logo stacked above the credit card logos,
   both centered. The card strip gets a fixed size here because its
   desktop 3vw sizing is only ~12px tall on a phone. */
@media (max-width: 768px) {
	.site-footer__logo {
		flex-direction: column;
		justify-content: center;
		gap: 1.25rem;
	}

	.site-footer__logo::after {
		width: 180px;
		height: calc(180px / 3.146);
		background-position: center;
	}
}
