/*
Theme Name: Indirect Media
Theme URI:    https://indirectmedia.co.za
Description:  Divi child theme for the 2026 department-first rebuild of indirectmedia.co.za. Rebuild styling is scoped to body.im-rebuild so legacy pages are untouched until go-live.
Author:       Indirect Media
Template:     Divi
Version:      1.0.0
Text Domain:  indirect-media
*/

/* ---------- Design tokens (approved 2026-10-04) ---------- */
:root {
	--im-black: #000000;
	--im-ink: #121212;
	--im-red: #ED1F4C;
	--im-white: #FFFFFF;
	--im-blush: #FCE9EE;
	--im-text: #333333;
	--im-muted: #666666;
	--im-font-head: 'Tenor Sans', Georgia, serif;
	--im-font-body: 'Heebo', Helvetica, Arial, sans-serif;
}

/* ---------- Typography (rebuild pages only) ---------- */
body.im-rebuild,
body.im-rebuild p,
body.im-rebuild li,
body.im-rebuild input,
body.im-rebuild textarea,
body.im-rebuild select,
body.im-rebuild button,
body.im-rebuild .et_pb_text,
body.im-rebuild #top-menu a,
body.im-rebuild .et_pb_menu a {
	font-family: var(--im-font-body);
	font-weight: 400;
}

body.im-rebuild { color: var(--im-text); }
body.im-rebuild strong,
body.im-rebuild b { font-weight: 500; }

body.im-rebuild h1,
body.im-rebuild h2,
body.im-rebuild h3,
body.im-rebuild h4,
body.im-rebuild h5,
body.im-rebuild h6,
body.im-rebuild .et_pb_module_header,
body.im-rebuild .et_pb_heading_container * {
	font-family: var(--im-font-head);
	font-weight: 400;
	text-transform: none;   /* sentence case: write it in the copy, never force caps */
	letter-spacing: 0;
	line-height: 1.2;
}

/* Type scale: Divi's 14px default is too small */
body.im-rebuild,
body.im-rebuild p,
body.im-rebuild li,
body.im-rebuild .et_pb_text {
	font-size: 17px;
	line-height: 1.65;
}
body.im-rebuild h1 { font-size: clamp(36px, 5vw, 60px); }
body.im-rebuild h2 { font-size: clamp(28px, 3.4vw, 40px); }
body.im-rebuild h3 { font-size: clamp(21px, 2.2vw, 26px); }
body.im-rebuild h4 { font-size: 20px; }
body.im-rebuild h1,
body.im-rebuild h2,
body.im-rebuild h3 { padding-bottom: 0.4em; }
body.im-rebuild .im-section-label,
body.im-rebuild .im-also,
body.im-rebuild .im-also a { font-size: 14px; }
body.im-rebuild .im-sidetabs a { font-size: 15px; }

/* Heading colour: ink on light, white on dark. Red is for accents only
   (the legacy Divi colour scheme otherwise tints headings red). */
body.im-rebuild h1,
body.im-rebuild h2,
body.im-rebuild h3,
body.im-rebuild h4,
body.im-rebuild h5,
body.im-rebuild h6 { color: var(--im-ink) !important; }
body.im-rebuild .et_pb_bg_layout_dark h1,
body.im-rebuild .et_pb_bg_layout_dark h2,
body.im-rebuild .et_pb_bg_layout_dark h3,
body.im-rebuild .et_pb_bg_layout_dark h4,
body.im-rebuild .et_pb_bg_layout_dark h5,
body.im-rebuild .et_pb_bg_layout_dark h6,
body.im-rebuild .im-on-dark h1,
body.im-rebuild .im-on-dark h2,
body.im-rebuild .im-on-dark h3 { color: var(--im-white) !important; }
body.im-rebuild .et_pb_bg_layout_dark,
body.im-rebuild .et_pb_bg_layout_dark p { color: rgba(255, 255, 255, 0.88); }

/* ---------- Links and buttons: retire Divi blue ---------- */
/* Red on white is ~4.3:1, below WCAG AA for small text. Small links on light
   sections use ink with a red underline; red text is kept for large/accent use. */
body.im-rebuild a { color: var(--im-ink); text-decoration-color: var(--im-red); }
body.im-rebuild .et_pb_bg_layout_dark a { color: var(--im-white); }
body.im-rebuild a:hover,
body.im-rebuild a:focus { color: var(--im-red); }

body.im-rebuild .et_pb_button,
body.im-rebuild .et_pb_contact_submit,
body.im-rebuild .im-btn {
	font-family: var(--im-font-body);
	font-weight: 500;
	color: var(--im-white) !important;
	background-color: var(--im-red) !important;
	border-color: var(--im-red) !important;
	border-radius: 0;
	text-transform: none;
	letter-spacing: 0;
}
body.im-rebuild .et_pb_button:hover,
body.im-rebuild .et_pb_contact_submit:hover,
body.im-rebuild .im-btn:hover {
	background-color: var(--im-ink) !important;
	border-color: var(--im-ink) !important;
}

/* Keyboard focus that's visible on both dark and light sections */
body.im-rebuild a:focus-visible,
body.im-rebuild button:focus-visible,
body.im-rebuild .et_pb_button:focus-visible {
	outline: 2px solid var(--im-red);
	outline-offset: 3px;
}

/* ---------- Section backgrounds ---------- */
body.im-rebuild .im-bg-black { background-color: var(--im-black) !important; }
body.im-rebuild .im-bg-ink { background-color: var(--im-ink) !important; }
body.im-rebuild .im-bg-white { background-color: var(--im-white) !important; }

/* ---------- Global module pieces (used by the Divi Library modules) ---------- */

/* Blush callout: callouts only */
body.im-rebuild .im-callout {
	background: var(--im-blush);
	color: var(--im-ink);
	border-left: 4px solid var(--im-red);
	padding: 24px 28px;
}

/* Red section-number label, e.g. "01 / What you get" */
body.im-rebuild .im-section-label {
	display: inline-block;
	font-family: var(--im-font-body);
	font-weight: 500;
	font-size: 14px;
	letter-spacing: 0.08em;
	color: var(--im-red);
	margin-bottom: 12px;
}

/* Red circle number marker for numbered steps */
body.im-rebuild .im-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--im-red);
	color: var(--im-white);
	font-family: var(--im-font-body);
	font-weight: 500;
	font-size: 18px;
	line-height: 1;
}

/* Neutral dark placeholder for image slots until real work is supplied */
body.im-rebuild .im-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 320px;
	padding: 24px;
	background: var(--im-ink);
	border: 1px dashed #444;
	color: #BBBBBB;
	font-family: var(--im-font-body);
	font-size: 15px;
	text-align: center;
}

/* ---------- Department side tabs ---------- */
body.im-rebuild .im-sidetabs ul { list-style: none; margin: 0; padding: 0; }
body.im-rebuild .im-sidetabs a {
	display: block;
	padding: 12px 16px;
	border-left: 3px solid transparent;
	color: var(--im-text);
	text-decoration: none;
}
body.im-rebuild .im-sidetabs a[aria-current="page"],
body.im-rebuild .im-sidetabs a:hover {
	border-left-color: var(--im-red);
	color: var(--im-ink);
	font-weight: 500;
}
/* Sticky on the Divi text module (the nav alone is boxed in by its module).
   Divi's #page-container has overflow-y: hidden, which disables sticky; clip keeps
   horizontal overflow hidden without creating a scroll container. */
body.im-rebuild,
body.im-rebuild #page-container { overflow-x: clip; overflow-y: visible; }
@media (min-width: 981px) {
	body.im-rebuild .et_pb_text:has(.im-sidetabs) { position: sticky; top: 48px; }
}
@media (max-width: 980px) {
	/* Horizontal scroll strip under the hero on mobile */
	body.im-rebuild .im-sidetabs ul {
		display: flex;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		gap: 4px;
		border-bottom: 1px solid #DDDDDD;
	}
	body.im-rebuild .im-sidetabs li { flex: 0 0 auto; }
	body.im-rebuild .im-sidetabs a {
		border-left: 0;
		border-bottom: 3px solid transparent;
		white-space: nowrap;
	}
	body.im-rebuild .im-sidetabs a[aria-current="page"] { border-bottom-color: var(--im-red); }
}

/* ---------- Header 2026 (Theme Builder layout) ---------- */
body.im-rebuild .im-header .et_pb_menu__menu > nav > ul > li > a,
body.im-rebuild .im-header .et_pb_menu .et-menu > li > a {
	font-family: var(--im-font-body);
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	color: var(--im-white);
}
body.im-rebuild .im-header .et-menu > li.current-menu-item > a,
body.im-rebuild .im-header .et-menu > li > a:hover { color: var(--im-red) !important; opacity: 1; }
body.im-rebuild .im-header .et_pb_menu__logo img { max-height: 56px; width: auto; }
body.im-rebuild .im-header .mobile_menu_bar:before { color: var(--im-white); }

/* ---------- Footer 2026 (Theme Builder layout) ---------- */
body.im-rebuild .im-footer,
body.im-rebuild .im-footer p,
body.im-rebuild .im-footer li { font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, 0.82); }
body.im-rebuild .im-footer p { padding-bottom: 0; }
body.im-rebuild .im-footer p + p:not(.im-footer-label) { margin-top: 4px; }
body.im-rebuild .im-footer .im-footer-label {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;   /* small eyebrow labels only, not headings */
	color: rgba(255, 255, 255, 0.55);
	padding-bottom: 2px;
	margin-top: 10px;
}
body.im-rebuild .im-footer a {
	color: var(--im-white);
	text-decoration: underline;
	text-decoration-color: var(--im-red);
	text-underline-offset: 3px;
}
body.im-rebuild .im-footer a:hover { color: var(--im-red); }
body.im-rebuild .im-footer-links { list-style: none; padding: 0; margin: 0; }
body.im-rebuild .im-footer-links li { padding: 2px 0; }
body.im-rebuild .im-footer-base { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 24px; }
body.im-rebuild .im-footer .im-footer-small { font-size: 13px; color: rgba(255, 255, 255, 0.55); }

/* ---------- "Also from Indirect Media" strip ---------- */
body.im-rebuild .im-also {
	border-top: 1px solid #DDDDDD;
	padding-top: 24px;
	font-size: 15px;
	color: var(--im-muted);
}
body.im-rebuild .im-also a { margin-right: 20px; }

/* ---------- Link tiles (thank-you pairings, department doors) ---------- */
body.im-rebuild ul.im-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 24px;
	list-style: none;
	margin: 24px 0 32px;
	padding: 0;
}
body.im-rebuild ul.im-tiles li { padding: 0; margin: 0; }
body.im-rebuild .im-tile {
	display: block;
	height: 100%;
	padding: 28px 24px;
	background: var(--im-ink);
	border-top: 4px solid var(--im-red);
	text-decoration: none;
	transition: background-color 0.2s ease;
}
body.im-rebuild .im-tile:hover,
body.im-rebuild .im-tile:focus { background: var(--im-black); }
body.im-rebuild .im-tile-dept {
	display: block;
	font-family: var(--im-font-body);
	font-weight: 500;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;   /* small eyebrow label, not a heading */
	color: var(--im-red);
}
body.im-rebuild .im-tile-name {
	display: block;
	margin-top: 8px;
	font-family: var(--im-font-head);
	font-size: 22px;
	line-height: 1.3;
	color: var(--im-white);
}
/* =====================================================================
 * Page components (generated drafts: home, overviews, service pages, work, contact, about)
 * ===================================================================== */

/* Section number label: 24px so red on white counts as large text (WCAG AA 3:1) */
body.im-rebuild .im-section-label {
	font-family: var(--im-font-head);
	font-weight: 400;
	font-size: 24px;
	letter-spacing: 0.04em;
	line-height: 1;
	display: block;
	padding-bottom: 8px;
	margin-bottom: 0;
}
body.im-rebuild .im-lead { font-size: 19px; }

/* Buttons written as links */
body.im-rebuild .im-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; padding-bottom: 0; }
body.im-rebuild a.im-btn {
	display: inline-block;
	padding: 14px 28px;
	font-size: 17px;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

/* Lists with a red dash */
body.im-rebuild ul.im-list { list-style: none; padding: 0; margin: 16px 0 0; }
body.im-rebuild ul.im-list li { position: relative; padding: 0 0 0 30px; margin: 0 0 12px; }
body.im-rebuild ul.im-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.8em;
	width: 16px;
	height: 2px;
	background: var(--im-red);
}

/* Numbered steps (thin rules) */
body.im-rebuild ol.im-steps { list-style: none; padding: 0; margin: 16px 0 24px; }
body.im-rebuild .im-step {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	padding: 20px 0;
	margin: 0;
	border-top: 1px solid #DDDDDD;
}
body.im-rebuild .im-step:last-child { border-bottom: 1px solid #DDDDDD; }
body.im-rebuild .im-step h3 { font-size: 22px; padding-bottom: 4px; }
body.im-rebuild .im-step p { padding-bottom: 0; }
/* 24px numerals: white on red counts as large text */
body.im-rebuild .im-num { flex: 0 0 auto; width: 52px; height: 52px; font-family: var(--im-font-head); font-weight: 400; font-size: 24px; }

/* Content blocks spacing inside the service body column */
body.im-rebuild .im-service-block,
body.im-rebuild .et_pb_column_3_4 > .et_pb_text { margin-bottom: 56px; }
body.im-rebuild .et_pb_column_3_4 > .et_pb_toggle { margin-bottom: 0; }

/* Placeholders */
body.im-rebuild .im-proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
body.im-rebuild .im-proof .im-placeholder { min-height: 260px; }
body.im-rebuild .im-placeholder-logo { min-height: 96px; font-size: 13px; padding: 12px; }
body.im-rebuild .im-placeholder-portrait { min-height: 0; aspect-ratio: 4 / 5; width: 100%; max-width: 260px; }
body.im-rebuild .im-placeholder-small { min-height: 120px; }
body.im-rebuild .et_pb_bg_layout_dark .im-placeholder { min-height: 420px; border-color: #333333; }
@media (max-width: 980px) {
	/* Keep the hero short on phones so the content (and the form) is closer to the top */
	body.im-rebuild .et_pb_bg_layout_dark .im-placeholder,
	body.im-rebuild .et_pb_column_1_2 .im-placeholder { min-height: 220px; }
}

/* Common questions: open on desktop, collapsible on mobile */
body.im-rebuild .et_pb_toggle.im-faq {
	background: transparent;
	border: 0;
	border-bottom: 1px solid #DDDDDD;
	padding: 20px 0;
	margin: 0;
}
body.im-rebuild .et_pb_toggle.im-faq .et_pb_toggle_title {
	font-family: var(--im-font-head);
	font-size: 21px;
	color: var(--im-ink) !important;
	padding-right: 40px;
	padding-bottom: 0;
}
body.im-rebuild .et_pb_toggle.im-faq .et_pb_toggle_title:before { color: var(--im-red); right: 0; }
body.im-rebuild .et_pb_toggle.im-faq .et_pb_toggle_content { padding-top: 10px; }
body.im-rebuild .et_pb_toggle.im-faq .et_pb_toggle_content p { padding-bottom: 0; }
@media (min-width: 981px) {
	body.im-rebuild .et_pb_toggle.im-faq .et_pb_toggle_content { display: block !important; }
	body.im-rebuild .et_pb_toggle.im-faq .et_pb_toggle_title { cursor: default; pointer-events: none; }
	body.im-rebuild .et_pb_toggle.im-faq .et_pb_toggle_title:before { display: none; }
}

/* Side tabs title + back link */
body.im-rebuild .im-sidetabs-title { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 16px 8px; }
body.im-rebuild .im-sidetabs-title a { text-decoration: none; color: var(--im-muted); }
body.im-rebuild .im-back a { font-weight: 500; text-decoration: none; }
body.im-rebuild .im-form-note { color: var(--im-muted); font-size: 15px; margin-top: 12px; }

/* Department tiles 01–06 */
body.im-rebuild ul.im-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	list-style: none;
	padding: 0;
	margin: 24px 0 0;
}
/* The whole tile is clickable through the h3 link's ::after (stretched link) */
body.im-rebuild ul.im-cards li.im-card {
	position: relative;
	margin: 0;
	padding: 28px;
	border: 1px solid #DDDDDD;
	border-top: 4px solid var(--im-red);
	transition: border-color 0.2s ease;
}
body.im-rebuild .im-card:hover,
body.im-rebuild .im-card:focus-within { border-color: var(--im-ink); border-top-color: var(--im-red); }
body.im-rebuild .im-card-num { font-family: var(--im-font-head); font-size: 28px; line-height: 1; color: var(--im-red); padding-bottom: 12px; }
body.im-rebuild .im-card h3 { font-size: 22px; }
body.im-rebuild .im-card h3 a { color: var(--im-ink); text-decoration: none; }
body.im-rebuild .im-card h3 a::after { content: ""; position: absolute; inset: 0; }
body.im-rebuild .im-card:hover h3 a { text-decoration: underline; text-decoration-color: var(--im-red); text-underline-offset: 4px; }
body.im-rebuild .im-card p { padding-bottom: 0; }

/* Home: three doors, logos, featured work, closing questions */
body.im-rebuild .im-door-title { font-size: clamp(26px, 2.6vw, 34px); }
body.im-rebuild .im-door-tag { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--im-muted); }
body.im-rebuild .im-door-services { color: var(--im-muted); font-size: 15px; }
body.im-rebuild .im-door-link a { font-weight: 500; }
body.im-rebuild ul.im-logo-wall {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 12px;
	list-style: none;
	padding: 0;
	margin: 0;
}
body.im-rebuild ul.im-logo-wall li { padding: 0; }
body.im-rebuild .im-feature { position: relative; }
body.im-rebuild .im-feature .im-placeholder { min-height: 380px; }
body.im-rebuild .im-feature .im-num { position: absolute; top: 16px; left: 16px; }
body.im-rebuild .im-feature h3 { margin-top: 20px; }
body.im-rebuild .im-callout-lg { padding: 40px; }
body.im-rebuild .im-callout-lg h2 { font-size: clamp(26px, 3vw, 34px); }
body.im-rebuild ul.im-questions { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 12px; }
body.im-rebuild ul.im-questions li { padding: 0; }
body.im-rebuild ul.im-questions-inline li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
body.im-rebuild .im-callout-dark {
	background: var(--im-ink);
	border-left: 4px solid var(--im-red);
	padding: 40px;
}

/* Who you work with / team */
body.im-rebuild .im-person { display: flex; gap: 32px; align-items: center; margin-top: 16px; }
body.im-rebuild .im-person .im-placeholder-portrait { flex: 0 0 220px; }
@media (max-width: 767px) {
	body.im-rebuild .im-person { flex-direction: column; align-items: flex-start; }
	body.im-rebuild .im-person .im-placeholder-portrait { flex-basis: auto; }
}
body.im-rebuild ul.im-team {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
	list-style: none;
	padding: 0;
}
body.im-rebuild ul.im-team li { padding: 0; }
body.im-rebuild ul.im-team p { font-weight: 500; padding: 12px 0 8px; }

/* "Also from Indirect Media" as its own quiet grey strip */
body.im-rebuild .im-also { border-top: 0; padding-top: 0; }
body.im-rebuild .im-also-label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: 4px;
}

/* Work: filter + case cards */
body.im-rebuild .im-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
body.im-rebuild .im-filter-btn {
	font-family: var(--im-font-body);
	font-weight: 500;
	font-size: 16px;
	padding: 10px 20px;
	border: 1px solid var(--im-ink);
	background: var(--im-white);
	color: var(--im-ink);
	cursor: pointer;
}
body.im-rebuild .im-filter-btn[aria-pressed="true"] { background: var(--im-ink); color: var(--im-white); }
body.im-rebuild ul.im-cases {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 40px 32px;
	list-style: none;
	padding: 0;
	margin: 24px 0 0;
}
body.im-rebuild ul.im-cases li { padding: 0; }
body.im-rebuild .im-case[hidden] { display: none; }
body.im-rebuild .im-case .im-placeholder { min-height: 240px; }
body.im-rebuild .im-case-dept { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--im-muted); margin-top: 16px; padding-bottom: 4px; }
body.im-rebuild .im-case p { padding-bottom: 6px; }
body.im-rebuild .im-draft-note { background: var(--im-blush); padding: 12px 16px; font-size: 15px; }

/* Contact: details + form tabs */
body.im-rebuild dl.im-details { display: grid; grid-template-columns: 120px 1fr; gap: 10px 24px; margin-top: 16px; }
body.im-rebuild dl.im-details dt { font-weight: 500; color: var(--im-ink); }
body.im-rebuild dl.im-details dd { margin: 0; }
@media (max-width: 767px) {
	body.im-rebuild dl.im-details { grid-template-columns: 1fr; gap: 2px; }
	body.im-rebuild dl.im-details dd { margin-bottom: 12px; }
}
body.im-rebuild .et_pb_tabs.im-form-tabs { border: 0; }
body.im-rebuild .im-form-tabs .et_pb_tabs_controls { background: transparent; border-bottom: 1px solid #DDDDDD; }
body.im-rebuild .im-form-tabs .et_pb_tabs_controls li { background: transparent; border: 0; }
body.im-rebuild .im-form-tabs .et_pb_tabs_controls li a {
	color: var(--im-ink) !important;
	font-family: var(--im-font-body);
	font-weight: 500;
	font-size: 16px;
	padding: 14px 24px;
}
body.im-rebuild .im-form-tabs .et_pb_tabs_controls li.et_pb_tab_active { border-bottom: 3px solid var(--im-red); }
body.im-rebuild .im-form-tabs .et_pb_all_tabs { padding: 24px 0 0; }

body.im-rebuild .im-tile:hover .im-tile-name,
body.im-rebuild .im-tile:focus .im-tile-name {
	text-decoration: underline;
	text-decoration-color: var(--im-red);
	text-underline-offset: 4px;
}
