/*
Theme Name: Blocksy Child
Theme URI: https://www.creeden.com
Description: Child theme for Creeden public site
Author: Creeden IT
Template: blocksy
Version: 1.3.0
*/

/* ===================================================================
   CREEDEN POLISH LAYER  v1.3
   CANONICAL FILE. Includes every change previously made on the box
   (v1.2 grid cell cleanup, 5-column override).

   Verified against rendered DOM, not assumed:
   - Team Members Pro loads its CSS after the child theme at equal
     specificity, so structural rules carry a `body` prefix.
   - .tmm_photo is a DIV with inline background-image and a
     padding-bottom aspect ratio hack. There is no <img>.
   - The plugin injects clearing elements that become grid cells.
   - WordPress emits .has-*-font-size preset classes with !important,
     so heading scale is corrected by redefining the preset variables
     rather than fighting specificity.

   NOT fixed here, by design:
   - Typeface. The site computes to Arial because no webfont loads.
     Set this in Blocksy Customizer > Typography, not in CSS.
   - Heading hierarchy. Five H1 elements on /our-team/. Editor fix.
   - Hero and stat graphics with baked-in text. Content project.

   Remove this file to revert everything below.
   =================================================================== */

:root {
	--cr-navy:        #22303c;
	--cr-navy-soft:   #4a5a68;
	--cr-orange:      #e8541f;
	--cr-rule:        #e2e6ea;
	--cr-card-bg:     #ffffff;
	--cr-photo-bg:    #eceef0;

	--cr-space-sm:    1rem;
	--cr-space-md:    2rem;
	--cr-space-lg:    4rem;
}


/* -------------------------------------------------------------------
   1. TEAM PHOTOS
   Height comes from padding-bottom as a percentage of width.
   100% = square (plugin default). 125% = 4:5 portrait.
   Inline style sets this per element, so !important is required.
   ------------------------------------------------------------------- */

body .tmm .tmm_photo {
	padding-bottom: 125% !important;
	height: 0 !important;
	background-color: var(--cr-photo-bg);
	background-size: cover !important;
	background-position: 50% 18% !important;
	border-radius: 2px 2px 0 0;
	border: 0 !important;
	filter: saturate(0.88) contrast(1.02);
	transition: filter 0.25s ease;
}

body .tmm .tmm_member:hover .tmm_photo {
	filter: saturate(1) contrast(1.02);
}


/* -------------------------------------------------------------------
   2. CARD GRID
   ------------------------------------------------------------------- */

body .tmm .tmm_container {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1.75rem;
	float: none !important;
	width: 100% !important;
}

@media (min-width: 1200px) {
	body .tmm_5_columns .tmm_container {
		grid-template-columns: repeat(5, 1fr);
	}
}

body .tmm .tmm_member {
	display: flex !important;
	flex-direction: column;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	background: var(--cr-card-bg);
	border: 1px solid var(--cr-rule) !important;
	border-top: 3px solid var(--cr-navy) !important;
	border-radius: 2px;
	box-shadow: 0 1px 2px rgba(34, 48, 60, 0.04);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
	overflow: hidden;
}

body .tmm .tmm_member:hover {
	box-shadow: 0 8px 24px rgba(34, 48, 60, 0.10);
	transform: translateY(-2px);
}

body .tmm .tmm_textblock {
	display: flex !important;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 1.4rem 1.1rem 1.1rem;
	text-align: center;
}

/* v1.2: the plugin injects <span class="tmm_two_containers_tablet">
   clearing elements plus a trailing unclassed div. Harmless under
   float layout, but they become real cells under grid and punch
   holes in the row. */
body .tmm .tmm_container > *:not(.tmm_member) {
	display: none !important;
}


/* -------------------------------------------------------------------
   3. CARD TYPOGRAPHY
   ------------------------------------------------------------------- */

body .tmm .tmm_names {
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--cr-navy);
	margin: 0 0 0.35rem;
	line-height: 1.3;
}

body .tmm .tmm_job {
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cr-navy-soft);
	margin: 0 0 0.9rem;
	line-height: 1.45;
	min-height: 2.6em;
}

body .tmm .tmm_more_info {
	margin-top: auto;
	padding-top: 0.5rem;
}

body .tmm .tmm_more_info a,
body .tmm .tmm_comp_text a {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--cr-orange);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

body .tmm .tmm_more_info a:hover {
	border-bottom-color: var(--cr-orange);
}

body .tmm .tmm_scblock {
	padding: 0.75rem 0 0.25rem;
	border-top: 1px solid var(--cr-rule);
	margin-top: 0.9rem;
}

body .tmm .tmm_scblock img {
	width: 18px;
	height: 18px;
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

body .tmm .tmm_scblock a:hover img {
	opacity: 1;
}


/* -------------------------------------------------------------------
   4. TYPE SCALE  (v1.3)

   Section headings were computing to 50px because WordPress emits
   .has-x-large-font-size with !important. Overriding the rule is a
   specificity war; overriding the variable it reads is not.

   Old x-large: clamp(30px, ..., 50px)
   New x-large: clamp(26px, ..., 36px)

   36px against ~230px-wide cards is a defensible ratio. 50px was not.
   ------------------------------------------------------------------- */

:root {
	--wp--preset--font-size--x-large: clamp(26px, 1.5rem + 0.9vw, 36px);
	--wp--preset--font-size--large:   clamp(20px, 1.2rem + 0.5vw, 26px);
}

/* Headings that are NOT carrying a preset class still need a scale. */
.entry-content h1:not([class*="has-"]):not(.page-title),
.entry-content h2:not([class*="has-"]) {
	font-size: clamp(26px, 1.5rem + 0.9vw, 36px);
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--cr-navy);
	line-height: 1.2;
}

/* Tighten the gap between a section heading and the rule beneath it. */
.entry-content .wp-block-kadence-spacer .kt-divider {
	margin-block: 0.5rem 0;
}


/* -------------------------------------------------------------------
   5. VERTICAL RHYTHM
   ------------------------------------------------------------------- */

.entry-content > .kb-row-layout-wrap {
	padding-block: clamp(2rem, 1rem + 3vw, var(--cr-space-lg));
}


/* -------------------------------------------------------------------
   6. FORMS
   ------------------------------------------------------------------- */

.wpforms-container .wpforms-field-label {
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--cr-navy);
}

.wpforms-container input[type="text"],
.wpforms-container input[type="email"],
.wpforms-container input[type="tel"],
.wpforms-container textarea {
	border: 1px solid var(--cr-rule);
	border-radius: 2px;
	padding: 0.7rem 0.8rem;
	font-size: 0.95rem;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpforms-container input:focus,
.wpforms-container textarea:focus {
	border-color: var(--cr-orange);
	box-shadow: 0 0 0 3px rgba(232, 84, 31, 0.12);
	outline: none;
}

.wpforms-container button[type="submit"] {
	background: var(--cr-orange);
	border: 0;
	border-radius: 2px;
	padding: 0.8rem 2.2rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	transition: background 0.2s ease;
}

.wpforms-container button[type="submit"]:hover {
	background: #cf461a;
}

/* Give the reCAPTCHA widget breathing room above Submit. */
.wpforms-container .wpforms-recaptcha-container {
	margin-block: 1rem 1.25rem;
}


/* -------------------------------------------------------------------
   7. MOBILE
   ------------------------------------------------------------------- */

@media (max-width: 767px) {

	body .tmm .tmm_container {
		grid-template-columns: 1fr;
		gap: 1.25rem;
		max-width: 420px;
		margin-inline: auto;
	}

	body .tmm .tmm_photo {
		padding-bottom: 70% !important;
		background-position: 50% 15% !important;
	}

	body .tmm .tmm_job {
		min-height: 0;
	}

	.entry-content > .kb-row-layout-wrap {
		padding-block: 2rem;
	}

	/* Images with baked-in text stay unreadable at this width.
	   This does not fix that, it only stops them overflowing. */
	.entry-content img {
		max-width: 100%;
		height: auto;
	}
}


/* -------------------------------------------------------------------
   8. ACCESSIBILITY
   ------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--cr-orange);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	body .tmm .tmm_member,
	body .tmm .tmm_photo {
		transition: none;
	}
	body .tmm .tmm_member:hover {
		transform: none;
	}
}


/* -------------------------------------------------------------------
   10. v1.4 corrections, measured at 1440

   - 5 columns only above 1500px. At 1440 the container is ~1082px,
     which gives 194px cards: names and titles wrap badly. 4 columns
     gives ~250px. Wide monitors still get 5.
   - Photo aspect ratio: the plugin's selector outranked v1.3, so the
     4:5 crop never applied and photos stayed square. Higher
     specificity here.
   - Dead space in cards: margin-top:auto belongs on the social block,
     not on Read More, so the filler gap lands below the divider.
   ------------------------------------------------------------------- */

@media (min-width: 1200px) and (max-width: 1499.98px) {
	body .tmm_5_columns .tmm_container {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (min-width: 1500px) {
	body .tmm_5_columns .tmm_container {
		grid-template-columns: repeat(5, 1fr);
	}
}

body .tmm .tmm_wrap .tmm_container .tmm_member .tmm_photo {
	padding-bottom: 125% !important;
}

@media (max-width: 767px) {
	body .tmm .tmm_wrap .tmm_container .tmm_member .tmm_photo {
		padding-bottom: 70% !important;
	}
}

body .tmm .tmm_more_info {
	margin-top: 0;
}

body .tmm .tmm_scblock {
	margin-top: auto;
}


/* -------------------------------------------------------------------
   11. v1.5

   - Team Members Pro hardcodes a system font stack on its own
     elements, so card text ignored the Customizer typography.
   - Switched the card container from grid to flex so a partial final
     row centers instead of hanging left. Grid cannot centre orphans;
     flex-wrap with justify-content can. Column counts preserved via
     explicit flex-basis at each breakpoint.
   ------------------------------------------------------------------- */

body .tmm .tmm_names,
body .tmm .tmm_job,
body .tmm .tmm_more_info,
body .tmm .tmm_more_info a,
body .tmm .tmm_comp_text,
body .tmm .tmm_comp_text a,
body .tmm .tmm_desc {
	font-family: inherit !important;
}

body .tmm .tmm_container {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: 1.75rem;
}

body .tmm .tmm_container .tmm_member {
	flex: 0 1 100%;
	max-width: 420px;
}

@media (min-width: 600px) {
	body .tmm .tmm_container .tmm_member {
		flex: 0 1 calc((100% - 1.75rem) / 2);
		max-width: none;
	}
}

@media (min-width: 900px) {
	body .tmm .tmm_container .tmm_member {
		flex: 0 1 calc((100% - 2 * 1.75rem) / 3);
	}
}

@media (min-width: 1200px) {
	body .tmm .tmm_container .tmm_member {
		flex: 0 1 calc((100% - 3 * 1.75rem) / 4);
	}
}

@media (min-width: 1500px) {
	body .tmm .tmm_container .tmm_member {
		flex: 0 1 calc((100% - 4 * 1.75rem) / 5);
	}
}


/* v1.5.1 - the plugin sets its font stack on .tmm itself, so
   inherit on descendants only re-inherited the same stack.
   Reset at the root and let it cascade from body. */
body .tmm,
body .tmm .tmm_member,
body .tmm .tmm_textblock,
body .tmm .tmm_container {
	font-family: inherit !important;
}


/* v1.5.2 - plugin targets these at greater depth than v1.5/v1.5.1.
   Match its specificity rather than guess at it again. */
body .tmm .tmm_container .tmm_member .tmm_textblock .tmm_names,
body .tmm .tmm_container .tmm_member .tmm_textblock .tmm_job,
body .tmm .tmm_container .tmm_member .tmm_textblock .tmm_more_info,
body .tmm .tmm_container .tmm_member .tmm_textblock .tmm_more_info a,
body .tmm .tmm_container .tmm_member .tmm_textblock .tmm_desc {
	font-family: inherit !important;
}


/* v1.5.3 - the actual break point. Walking the computed chain shows
   .tmm resolves to the theme font but .tmm_wrap / .tmm_plugin_f
   resets it, so every descendant inherited the system stack.
   Fixing it here makes the earlier inherit rules redundant but
   harmless. */
body .tmm .tmm_wrap,
body .tmm .tmm_plugin_f,
body .tmm_plugin_f {
	font-family: inherit !important;
}


/* -------------------------------------------------------------------
   12. v1.6

   - Footer container ignored the content container. Measured at 1440:
     content sat at left 64 / width 1282, footer at left 23 / width
     1364, so every footer element was 41px left of the page above it.
     Mirrors the content group's max-width and centring.
   - Buttons: the site has exactly one, on Careers, rendering in a
     neutral grey rather than the brand accent.
   ------------------------------------------------------------------- */

.ct-footer .ct-container-fluid,
.ct-footer .ct-container {
	max-width: 1550px;
	width: min(100%, 91%);
	margin-inline: auto;
}

/* Buttons - core, Kadence, and theme variants */
.wp-block-button__link,
.kb-button,
.kt-button,
.ct-button,
a.wp-element-button,
.wp-element-button {
	background-color: var(--cr-orange) !important;
	border-color: var(--cr-orange) !important;
	color: #fff !important;
	border-radius: 2px;
	padding: 0.85rem 2.25rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.wp-block-button__link:hover,
.kb-button:hover,
.kt-button:hover,
.ct-button:hover,
a.wp-element-button:hover,
.wp-element-button:hover {
	background-color: #cf461a !important;
	border-color: #cf461a !important;
	color: #fff !important;
	transform: translateY(-1px);
}

.wp-block-button__link:focus-visible,
.kb-button:focus-visible,
a.wp-element-button:focus-visible {
	outline: 2px solid var(--cr-navy);
	outline-offset: 3px;
}


/* v1.6.1 - mobile headshot crop. The 70% landscape ratio cut off
   heads on portrait source images. Square with a higher anchor keeps
   faces in frame; single-column cards absorb the extra height. */
@media (max-width: 767px) {
	body .tmm .tmm_wrap .tmm_container .tmm_member .tmm_photo {
		padding-bottom: 100% !important;
		background-position: 50% 8% !important;
	}
}
