/* ============================================================================
 * tti-course-overview.css
 *
 * Course Overview accordion injected between the curriculum eyebrow
 * ("COURSE SYLLABUS") and the syllabus heading row ("Curriculum") inside
 * the dp436lui flex container. Built by `tti_course_overview_html()` in
 * mu-plugins/tti-course-materials.php and inserted at render time by the
 * template_redirect ob_start handler in droipbase/functions.php.
 *
 * Native <details>/<summary> — no JS, no Droip interaction collisions.
 * The wrapper claims a full flex line via flex:1 1 100% so it sits on its
 * own row inside the flex-wrap curriculum card.
 * ============================================================================ */

main.tti-course .tti-course-overview {
	flex: 1 1 100%;
	width: 100%;
	box-sizing: border-box;
	/* Top margin separates the accordion from the description block
	   above; bottom margin separates it from the "Curriculum" h2
	   that follows. Both read as deliberate section breaks across
	   all three breakpoints. Mobile/tablet trim slightly via the
	   media queries below. */
	margin: 22px 0 40px;
	padding: 16px 18px;
	background: #ffffff;
	border: 1px solid var(--tti-cream-line, #e8e1d6);
	border-radius: 12px;
	box-shadow: 0 4px 14px -10px rgba(14, 10, 8, 0.20);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* Each <details> row */
main.tti-course .tti-course-overview__row {
	margin: 0;
	border-bottom: 1px solid rgba(122, 0, 18, 0.08);
}
main.tti-course .tti-course-overview__row:last-of-type {
	border-bottom: 0;
}

/* Summary (the always-visible header bar) */
main.tti-course .tti-course-overview__summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 8px 12px 14px;
	min-height: 44px;
	border-left: 3px solid transparent;
	border-radius: 6px;
	transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
	color: var(--tti-ink, #0f0f10);
	font-weight: 600;
	font-size: 0.98rem;
	letter-spacing: 0.005em;
	user-select: none;
}
main.tti-course .tti-course-overview__summary::-webkit-details-marker { display: none; }
main.tti-course .tti-course-overview__summary::marker { content: ''; }

main.tti-course .tti-course-overview__summary:hover,
main.tti-course .tti-course-overview__summary:focus-visible {
	background: rgba(122, 0, 18, 0.04);
	border-left-color: var(--tti-maroon, #7a0012);
	color: var(--tti-maroon, #7a0012);
}
main.tti-course .tti-course-overview__summary:focus-visible {
	outline: 2px solid var(--tti-maroon, #7a0012);
	outline-offset: 2px;
}

main.tti-course .tti-course-overview__row[open] > .tti-course-overview__summary {
	background: rgba(122, 0, 18, 0.05);
	border-left-color: var(--tti-maroon, #7a0012);
	color: var(--tti-maroon, #7a0012);
}

main.tti-course .tti-course-overview__label {
	flex: 1 1 auto;
	min-width: 0;
}

/* Chevron — rotates 180° when row is open */
main.tti-course .tti-course-overview__chevron {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	color: currentColor;
	transition: transform 180ms ease;
}
main.tti-course .tti-course-overview__row[open] > .tti-course-overview__summary .tti-course-overview__chevron {
	transform: rotate(180deg);
}

/* Body — visible only when [open] */
main.tti-course .tti-course-overview__body {
	padding: 4px 18px 16px 18px;
	color: var(--tti-ink-2, #2b2b2e);
	font-size: 0.95rem;
	line-height: 1.6;
}
main.tti-course .tti-course-overview__body p,
main.tti-course .tti-course-overview__body ul,
main.tti-course .tti-course-overview__body ol,
main.tti-course .tti-course-overview__body li {
	/* Course-page CSS clamps in-content paragraphs to ~569px (a measure
	   chosen for outcomes lists). Inside the overview body we want the
	   full row width — beat the ancestor rule with !important. */
	max-width: 100% !important;
	width: auto !important;
}
main.tti-course .tti-course-overview__body p {
	margin: 0 0 10px 0;
}
main.tti-course .tti-course-overview__body p:last-child {
	margin-bottom: 0;
}
main.tti-course .tti-course-overview__body ul,
main.tti-course .tti-course-overview__body ol {
	margin: 4px 0 10px 1.25em;
	padding: 0;
}
main.tti-course .tti-course-overview__body li {
	margin: 0 0 4px 0;
}
main.tti-course .tti-course-overview__body strong { color: var(--tti-ink, #0f0f10); }

/* Tablet polish (600–1023px) — slightly tighter padding, full-quality typography */
@media (min-width: 600px) and (max-width: 1023px) {
	main.tti-course .tti-course-overview {
		margin: 18px 0 36px;
		padding: 14px 16px;
		border-radius: 12px;
	}
	main.tti-course .tti-course-overview__summary {
		font-size: 0.96rem;
		padding: 12px 10px 12px 14px;
		min-height: 46px;
	}
	main.tti-course .tti-course-overview__body {
		font-size: 0.94rem;
		line-height: 1.6;
		padding: 6px 18px 16px 18px;
	}
	main.tti-course .tti-course-overview__body p { margin-bottom: 12px; }
}

/* Mobile polish (≤599px) — comfortable touch targets, generous spacing
   between the accordion and the heading row that follows. */
@media (max-width: 599px) {
	main.tti-course .tti-course-overview {
		margin: 16px 0 32px;
		padding: 12px 14px;
		border-radius: 10px;
	}
	main.tti-course .tti-course-overview__summary {
		font-size: 0.94rem;
		padding: 12px 8px 12px 12px;
		min-height: 48px;
		gap: 12px;
	}
	main.tti-course .tti-course-overview__body {
		font-size: 0.92rem;
		line-height: 1.6;
		padding: 6px 14px 14px 14px;
	}
	main.tti-course .tti-course-overview__body p { margin-bottom: 12px; }
	main.tti-course .tti-course-overview__chevron {
		width: 24px;
		height: 24px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	main.tti-course .tti-course-overview__summary,
	main.tti-course .tti-course-overview__chevron {
		transition: none;
	}
}

/* ============================================================================
 * Key Outcomes ("What You'll Learn?") section — hidden globally on every
 * viewport. The same content is now surfaced inside the Course Overview
 * accordion (`tti_course_overview_html` -> "What Will I Learn?" row) so a
 * separate top-of-page outcomes block is redundant. We target the h2
 * element + the sibling `dpad2ibs` Droip wrapper that holds the outcomes
 * UL/grid. Other sections inside the multi-topic dp8h97bx wrapper
 * (Certificate, Instructor, Reviews, Similar Courses) stay visible.
 * ============================================================================ */
main.tti-course [class*="dp8h97bx"] > h2.tti-h-learn,
main.tti-course [class*="dp8h97bx"]:has(> h2.tti-h-learn) > [class*="dpad2ibs"] {
	display: none !important;
}

/* ============================================================================
 * Instructor logo — horizontally center on mobile + tablet.
 * On <1024px the instructor card stacks logo on top of bio (single
 * column). The dp97md4s logo wrapper is left-aligned by default; auto
 * left/right margin centers it within the bio column. Desktop layout
 * stays untouched (logo + bio sit side-by-side via the dpbuia8v grid).
 * ============================================================================ */
@media (max-width: 1023px) {
	/* Beat mobile.css L203 (`.tti-instructor-card [dpad2ibs] [dp97md4s]:first-child`,
	   specificity 0,4,1) and the desktop EOF avatar rule (0,3,4). Add an
	   extra attribute selector + :first-child to push specificity to
	   (0,5,2), which wins both. The wrapper is the dp97md4s `:has(> img)`
	   which is also `:first-child` of its parent (the bio dp97md4s
	   sibling renders second). Center via auto margins on the wrapper
	   AND on the img inside — covers cases where wrapper itself is
	   forced to width:100% by a higher rule. */
	html body main.tti-course .tti-instructor-card [class*="dpbuia8v"] [class*="dpad2ibs"] [class*="dp97md4s"]:first-child:has(> img),
	html body main.tti-course .tti-instructor-card [class*="dpad2ibs"] [class*="dp97md4s"]:first-child:has(> img),
	html body main.tti-course .tti-instructor-card [class*="dpbuia8v"] [class*="dp97md4s"]:first-child:has(> img) {
		display: block !important;
		margin-left: auto !important;
		margin-right: auto !important;
		float: none !important;
		align-self: center !important;
		justify-content: center !important;
		width: 132px !important;
		max-width: 132px !important;
	}
	html body main.tti-course .tti-instructor-card [class*="dpbuia8v"] [class*="dpad2ibs"] [class*="dp97md4s"]:first-child:has(> img) > img,
	html body main.tti-course .tti-instructor-card [class*="dpad2ibs"] [class*="dp97md4s"]:first-child:has(> img) > img,
	html body main.tti-course .tti-instructor-card [class*="dpbuia8v"] [class*="dp97md4s"]:first-child:has(> img) > img {
		display: block !important;
		/* Reset tablet's `position: absolute; left: 30px; top: 30px`
		   (tti-course-tablet.css L1593) so the img stays inside the
		   now-centered wrapper instead of escaping to a fixed offset. */
		position: static !important;
		left: auto !important;
		top: auto !important;
		margin-left: auto !important;
		margin-right: auto !important;
		/* Make the logo (not a circular avatar) — fill the wrapper
		   with the full landscape logo. Mobile.css L215-228 forces
		   140×140 + border-radius:50% + white border + maroon ring,
		   which produces a doubled-border circular crop. The
		   wrapper itself already carries the maroon outline + cream
		   bg; the img should just paint the logo inside it. */
		width: 100% !important;
		height: 100% !important;
		min-width: 0 !important;
		min-height: 0 !important;
		max-width: 100% !important;
		max-height: 100% !important;
		object-fit: contain !important;
		object-position: center !important;
		border: 0 !important;
		border-radius: 0 !important;
		outline: 0 !important;
		box-shadow: none !important;
		padding: 0 !important;
	}
}

/* ============================================================================
 * Course Description block — sits ABOVE the overview accordion in the
 * curriculum card. Sourced from wp_posts.post_excerpt (same source the
 * hero used); 2026-05-04 relocated from .tti-hero__lede so the hero can
 * feature the course image instead. Long-form text is run through
 * wp_kses_post + wpautop so paragraphs render as the editor laid them out.
 * ============================================================================ */

main.tti-course .tti-course-description {
	flex: 1 1 100%;
	width: 100%;
	box-sizing: border-box;
	margin: 6px 0 18px;
	padding: 0;
	color: var(--tti-ink, #0f0f10);
	font-size: 1rem;
	line-height: 1.65;
	letter-spacing: 0.005em;
}
/* Beat the course-page paragraph-clamp rule that limits in-content
   <p> to ~569px (it's tuned for outcomes lists). Inside the
   description block we want the full row width on every block. */
main.tti-course .tti-course-description p,
main.tti-course .tti-course-description ul,
main.tti-course .tti-course-description ol,
main.tti-course .tti-course-description li,
main.tti-course .tti-course-description h2,
main.tti-course .tti-course-description h3,
main.tti-course .tti-course-description h4,
main.tti-course .tti-course-description blockquote {
	max-width: 100% !important;
	width: auto !important;
}
main.tti-course .tti-course-description p {
	margin: 0 0 14px 0;
	color: var(--tti-ink, #0f0f10);
}
main.tti-course .tti-course-description p:last-child {
	margin-bottom: 0;
}
/* Section headings inside the description — match the syllabus card
   eyebrow tone (maroon, semibold, slight letter-spacing) without
   competing with the page-level "COURSE SYLLABUS" eyebrow above. */
main.tti-course .tti-course-description h2 {
	margin: 22px 0 10px 0;
	padding: 0 0 6px 0;
	font-size: 1.18rem;
	line-height: 1.35;
	font-weight: 700;
	color: var(--tti-maroon, #7a0012);
	letter-spacing: 0.01em;
	border-bottom: 1px solid rgba(122, 0, 18, 0.14);
}
main.tti-course .tti-course-description h2:first-child { margin-top: 0; }
main.tti-course .tti-course-description h3 {
	margin: 18px 0 8px 0;
	font-size: 1.06rem;
	line-height: 1.4;
	font-weight: 700;
	color: var(--tti-ink, #0f0f10);
}
main.tti-course .tti-course-description h4 {
	margin: 14px 0 6px 0;
	font-size: 1rem;
	font-weight: 700;
	color: var(--tti-ink, #0f0f10);
}
/* List reset — desktop.css L381 (and similar at L1292/1701/1880) sets
   `main.tti-course [class*="dp8h97bx"]:not(:has(> h2.tti-h-instructor)) ul`
   to display:grid with 3 cols (intended for the Key-Outcomes ul). That
   rule also catches our description's <ul> because dp436lui sits inside
   dp8h97bx. We need an attribute selector in our chain to beat (0,3,3)
   specificity → use `[class*="dp8h97bx"] .tti-course-description ul`
   = (0,3,4). */
body main.tti-course [class*="dp8h97bx"] .tti-course-description ul,
body main.tti-course [class*="dp8h97bx"] .tti-course-description ol,
body main.tti-course .tti-course-description ul,
body main.tti-course .tti-course-description ol {
	display: block !important;
	flex: 0 1 auto !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
	margin: 6px 0 14px 1.4em !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	list-style: disc outside !important;
	column-count: auto !important;
	grid-template-columns: none !important;
	grid-template-rows: none !important;
	grid-auto-rows: auto !important;
}
body main.tti-course [class*="dp8h97bx"] .tti-course-description ol,
body main.tti-course .tti-course-description ol {
	list-style: decimal outside !important;
}
body main.tti-course [class*="dp8h97bx"] .tti-course-description li,
body main.tti-course .tti-course-description li {
	display: list-item !important;
	flex: 0 1 auto !important;
	margin: 0 0 6px 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	counter-increment: none !important;
	grid-column: auto !important;
	grid-row: auto !important;
}
/* Remove any pseudo-bullets (e.g. ::before red dots / numbered chips) the
   curriculum tile rules add to <li> descendants. */
body main.tti-course [class*="dp8h97bx"] .tti-course-description li::before,
body main.tti-course [class*="dp8h97bx"] .tti-course-description li::after,
body main.tti-course .tti-course-description li::before,
body main.tti-course .tti-course-description li::after {
	content: none !important;
	display: none !important;
}
body main.tti-course [class*="dp8h97bx"] .tti-course-description li > ul,
body main.tti-course [class*="dp8h97bx"] .tti-course-description li > ol,
body main.tti-course .tti-course-description li > ul,
body main.tti-course .tti-course-description li > ol {
	margin-top: 4px !important;
	margin-bottom: 4px !important;
	margin-left: 1.4em !important;
}
main.tti-course .tti-course-description strong {
	color: var(--tti-ink, #0f0f10);
	font-weight: 700;
}
main.tti-course .tti-course-description a {
	color: var(--tti-maroon, #7a0012);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}
main.tti-course .tti-course-description a:hover,
main.tti-course .tti-course-description a:focus-visible {
	text-decoration-thickness: 2px;
}
main.tti-course .tti-course-description blockquote {
	margin: 14px 0;
	padding: 10px 18px;
	border-left: 3px solid var(--tti-maroon, #7a0012);
	background: rgba(122, 0, 18, 0.04);
	color: var(--tti-ink-2, #2b2b2e);
	font-style: italic;
}

/* Tablet description polish */
@media (min-width: 600px) and (max-width: 1023px) {
	main.tti-course .tti-course-description {
		font-size: 0.97rem;
		line-height: 1.6;
		margin: 4px 0 16px;
	}
	main.tti-course .tti-course-description h2 {
		font-size: 1.12rem;
		margin: 18px 0 8px 0;
	}
	main.tti-course .tti-course-description h3 { font-size: 1.02rem; }
}

/* Mobile description polish */
@media (max-width: 599px) {
	main.tti-course .tti-course-description {
		font-size: 0.94rem;
		line-height: 1.6;
		margin: 4px 0 14px;
	}
	main.tti-course .tti-course-description p { margin-bottom: 12px; }
	main.tti-course .tti-course-description h2 {
		font-size: 1.06rem;
		margin: 16px 0 8px 0;
	}
	main.tti-course .tti-course-description h3 { font-size: 1rem; }
	main.tti-course .tti-course-description ul,
	main.tti-course .tti-course-description ol { margin-left: 1.2em; }
}

/* ============================================================================
 * Hero media (course featured image) — replaces the description slot.
 *
 * Strategy: hide the existing absolutely-positioned <img class="…dpg8khjp">
 * (it lived deep inside Droip's post_content section and was lifted into
 * the hero via CSS at `position: absolute; right: …`). Render a clean
 * <figure class="tti-hero__media"> emitted by the hero PHP instead, so
 * the image participates in the hero's natural grid flow.
 *
 * The hero is a 2-col CSS grid (col 1 = title/facts/proof, col 2 = CTA).
 * tti-hero__media sits in col 1, between the title and the facts list.
 * ============================================================================ */

/* 1) Hide the legacy lifted image at every breakpoint.
   Mobile/tablet css scope this image with `[class*="dptbqvj2"] [class*="dpg8khjp"]`
   at specificity (0,3,0). We need to beat that — use body + same chain to
   reach (0,3,2) so the hide rule wins on every viewport. */
body main.tti-course img[class*="dpg8khjp"],
body main.tti-course [class*="dptbqvj2"] img[class*="dpg8khjp"],
body main.tti-course [class*="dptbqvj2"] [class*="dpg8khjp"] {
	display: none !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
}
/* CTA no longer needs image-clearance margin. */
main.tti-course .tti-hero__cta {
	margin-top: 0 !important;
}

/* 2) New <figure class="tti-hero__media"> in the hero (col 1, below title). */
main.tti-course .tti-hero__media {
	margin: 8px 0 18px;
	padding: 0;
	max-width: 100%;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 14px 36px -14px rgba(15, 15, 16, 0.30), 0 4px 10px rgba(15, 15, 16, 0.08);
	/* 2026-05-04: bottom accent in maroon to match site palette;
	   sides + top remain the subtle cream hairline. Aspect-ratio
	   moved here so the figure matches the image height exactly —
	   no cream background leak below the image. */
	border: 1px solid var(--tti-cream-line, #e8e1d6);
	border-bottom: 3px solid var(--tti-maroon, #7a0012);
	background: #f6efe1;
	line-height: 0;
	aspect-ratio: 16 / 9;
}
main.tti-course .tti-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Desktop ≥1024: keep the figure inside col 1 of the hero grid */
@media (min-width: 1024px) {
	main.tti-course .tti-hero__media {
		max-width: min(560px, 100%);
		margin: 14px 0 20px;
		border-radius: 16px;
	}
}
/* Tablet 600–1023 */
@media (min-width: 600px) and (max-width: 1023px) {
	main.tti-course .tti-hero__media {
		max-width: 560px;
		margin: 10px 0 16px;
		border-radius: 14px;
	}
}
/* Mobile ≤599 */
@media (max-width: 599px) {
	main.tti-course .tti-hero__media {
		margin: 8px 0 14px;
		border-radius: 12px;
	}
}
