/* ==========================================================================
   Reli Academy — article.css
   Single article (single.php) + plain pages (page.php: legal etc.). Also loaded in the block editor
   (inc/blocks.php), so the prose rules (:is(.c-prose, .is-root-container) — the latter is the editor canvas) style every block allowed in articles — core wp-block-library is not loaded.
   Mockups: design-reference/Article*.dc.html. Mobile-first; breakpoints 640 / 960 / 1280.
   ========================================================================== */

/* 1. Article header
   ========================================================================== */
.c-article-header__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	padding-block: 24px 28px;
}

/* The trail ends at the category (mockup); the article crumb stays for screen readers only. */
.c-article-header .c-breadcrumbs__sep:has(+ .breadcrumb_last),
.c-article-header .c-breadcrumbs .breadcrumb_last {
	display: none;
}

.c-pill {
	padding: 5px 12px;
	border-radius: var(--r-pill);
	background: var(--c-light);
	color: var(--c-primary);
	font-size: var(--fs-caption);
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
}

.c-pill:hover {
	background: var(--c-light-hover);
}

.c-article-header__title {
	max-width: 900px;
}

.c-article-header__excerpt {
	max-width: 760px;
	color: var(--c-muted);
	font-size: clamp(1.0625rem, .891rem + .761vw, 1.3125rem); /* 17 → 21 */
	line-height: 1.6;
}

.c-article-header__author {
	display: flex;
	align-items: center;
	gap: 12px;
	line-height: 1.4;
}

.c-article-header__photo {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

.c-article-header__name {
	font-size: var(--fs-small);
	font-weight: 600;
}

.c-article-header__meta {
	color: var(--c-muted);
	font-size: var(--fs-caption);
}

/* 2. Featured image
   ========================================================================== */
.c-article__image {
	width: 100%;
	aspect-ratio: 3 / 2;
	border-radius: var(--r-soft);
	background: var(--c-media);
	object-fit: cover;
}

/* 3. Body + sidebar
   ========================================================================== */
.c-article__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 56px;
	padding-block: 28px var(--section-y);
}

.c-article__aside {
	display: none;
}

@media (min-width: 960px) {
	.c-article-header__inner {
		gap: 22px;
		padding-block: 56px 48px;
	}

	.c-article-header__photo {
		width: 48px;
		height: 48px;
	}

	.c-article-header__name {
		font-size: 1rem;
	}

	.c-article__image {
		aspect-ratio: 1200 / 520;
		border-radius: var(--r-media);
	}

	.c-article__layout {
		grid-template-columns: minmax(0, 740px) 300px;
		justify-content: space-between;
		gap: 48px;
		padding-block-start: 72px;
	}

	/* Sidebar: TOC + course promo stay in view (sticky inside their zone); the lead magnet sits at the end of the
	   column, so the sticky part never covers it. Short screens: only the TOC list scrolls — nothing is cut off. */
	.c-article__aside,
	.c-article__sticky {
		display: flex;
		flex-direction: column;
		gap: 24px;
	}

	.c-article__sticky-zone {
		flex: 1;
	}

	.c-article__sticky {
		position: sticky;
		inset-block-start: calc(var(--header-h) + 24px);
		max-height: calc(100vh - var(--header-h) - 48px);
	}

	.c-article__sticky > * {
		flex-shrink: 0;
	}

	.c-article__sticky > .c-toc {
		display: flex;
		flex-direction: column;
		flex-shrink: 1;
		min-height: 0;
	}

	.c-article__sticky .c-toc__list {
		min-height: 3.5rem;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}

	.c-toc--details {
		display: none;
	}
}

@media (min-width: 1280px) {
	.c-article__layout {
		grid-template-columns: minmax(0, 740px) 340px;
		gap: 80px;
	}
}

/* 4. Table of contents
   ========================================================================== */
.c-toc {
	border-radius: var(--r-card);
	background: var(--c-cream);
}

.c-toc--nav {
	padding: 28px;
}

.c-toc--details {
	margin-block-end: 28px;
	padding-inline: 18px;
	border-radius: var(--r-bar);
}

.c-toc__title {
	color: var(--c-primary);
	font-family: var(--ff-head);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}

.c-toc--nav .c-toc__title {
	margin-block-end: 14px;
}

.c-toc--details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 56px;
	list-style: none;
	cursor: pointer;
}

.c-toc--details summary::-webkit-details-marker {
	display: none;
}

.c-toc__chevron {
	color: var(--c-accent);
	transition: transform .2s ease;
}

.c-toc--details[open] .c-toc__chevron {
	transform: rotate(180deg);
}

.c-toc--details nav {
	padding-block-end: 14px;
}

.c-toc__list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0;
	list-style: none;
	font-size: var(--fs-small);
}

.c-toc__link {
	display: block;
	padding: 8px 14px;
	border-radius: 10px;
	color: var(--c-muted);
	line-height: 1.45;
	text-decoration: none;
}

.c-toc__link:hover {
	color: var(--c-primary);
	text-decoration: underline;
}

.c-toc__link.is-active {
	background: var(--c-white);
	color: var(--c-primary);
	font-weight: 600;
}

/* 5. Prose — every block allowed in articles (inc/blocks.php)
   ========================================================================== */
:is(.c-prose, .is-root-container) {
	font-size: var(--fs-article);
	line-height: 1.85;
}

:is(.c-prose, .is-root-container) > * + * {
	margin-block-start: 24px;
}

:is(.c-prose, .is-root-container) > :first-child {
	margin-block-start: 0;
}

:is(.c-prose, .is-root-container) :is(h2, h3, h4) {
	line-height: 1.25;
}

:is(.c-prose, .is-root-container) h2 {
	margin-block: 48px 18px;
	font-size: var(--fs-h2-article);
}

:is(.c-prose, .is-root-container) h3 {
	margin-block: 36px 14px;
	font-size: var(--fs-h3);
	font-weight: 600;
}

:is(.c-prose, .is-root-container) h4 {
	margin-block: 28px 10px;
	font-size: var(--fs-body);
	font-weight: 600;
}

:is(.c-prose, .is-root-container) :is(h2, h3, h4) + * {
	margin-block-start: 0;
}

:is(.c-prose, .is-root-container) a:not(.c-btn, .wp-block-button__link) {
	color: var(--c-primary);
	text-decoration: underline;
	text-underline-offset: 4px;
}

:is(.c-prose, .is-root-container) a:not(.c-btn, .wp-block-button__link):hover {
	text-decoration-thickness: 2px;
}

:is(.c-prose, .is-root-container) strong {
	font-weight: 600;
}

/* Lists: accent check marks (ul), primary numbers (ol) */
:is(.c-prose, .is-root-container) :is(ul, ol) {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0;
}

:is(.c-prose, .is-root-container) ul {
	list-style: none;
}

:is(.c-prose, .is-root-container) ul > li {
	position: relative;
	padding-inline-start: 34px;
}

:is(.c-prose, .is-root-container) ul > li::before {
	content: "";
	position: absolute;
	inset-block-start: .35em;
	inset-inline-start: 0;
	width: 22px;
	height: 22px;
	background: var(--c-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(.c-prose, .is-root-container) ol {
	padding-inline-start: 1.4em;
}

:is(.c-prose, .is-root-container) ol > li::marker {
	color: var(--c-primary);
	font-family: var(--ff-head);
	font-weight: 600;
}

:is(.c-prose, .is-root-container) li :is(ul, ol) {
	margin-block-start: 12px;
}

/* Image */
:is(.c-prose, .is-root-container) .wp-block-image img {
	width: 100%;
	border-radius: var(--r-soft);
}

:is(.c-prose, .is-root-container) .wp-block-image :is(.aligncenter, .alignleft, .alignright),
:is(.c-prose, .is-root-container) .wp-block-image.aligncenter {
	margin-inline: auto;
}

:is(.c-prose, .is-root-container) figcaption,
:is(.c-prose, .is-root-container) .wp-element-caption {
	margin-block-start: 10px;
	color: var(--c-muted);
	font-size: var(--fs-caption);
	line-height: 1.5;
	text-align: center;
}

/* Quote = pull quote (48×3 accent line on top, no side borders) */
:is(.c-prose, .is-root-container) blockquote {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-block: 40px;
	padding: 0;
	border: 0;
}

:is(.c-prose, .is-root-container) blockquote::before {
	content: "";
	width: 40px;
	height: 3px;
	border-radius: 3px;
	background: var(--c-accent);
}

:is(.c-prose, .is-root-container) blockquote p {
	color: var(--c-primary);
	font-family: var(--ff-head);
	font-size: clamp(1.4375rem, 1.139rem + 1.326vw, 1.875rem); /* 23 → 30 */
	font-weight: 500;
	line-height: 1.4;
}

:is(.c-prose, .is-root-container) blockquote cite {
	color: var(--c-muted);
	font-size: var(--fs-small);
	font-style: normal;
}

/* Separator */
:is(.c-prose, .is-root-container) hr {
	height: 1px;
	margin-block: 40px;
	border: 0;
	background: var(--c-line);
}

:is(.c-prose, .is-root-container) hr.is-style-dots {
	height: auto;
	background: none;
	color: var(--c-accent);
	text-align: center;
}

:is(.c-prose, .is-root-container) hr.is-style-dots::before {
	content: "···";
	font-size: 1.5rem;
	letter-spacing: 1em;
}

/* Buttons (core/buttons + core/button, filled = primary, outline = secondary) */
:is(.c-prose, .is-root-container) .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

:is(.c-prose, .is-root-container) .wp-block-buttons.is-content-justification-center {
	justify-content: center;
}

:is(.c-prose, .is-root-container) .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding-inline: 30px;
	border-radius: var(--r-btn);
	background: var(--c-primary);
	color: var(--c-white);
	font-family: var(--ff-head);
	font-size: var(--fs-btn);
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
}

:is(.c-prose, .is-root-container) .wp-block-button__link:hover {
	background: var(--c-primary-hover);
}

:is(.c-prose, .is-root-container) .is-style-outline .wp-block-button__link {
	background: var(--c-light);
	color: var(--c-primary);
}

:is(.c-prose, .is-root-container) .is-style-outline .wp-block-button__link:hover {
	background: var(--c-light-hover);
}

/* Table (scrolls sideways on small screens) */
:is(.c-prose, .is-root-container) .wp-block-table {
	overflow-x: auto;
}

:is(.c-prose, .is-root-container) table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-small);
	line-height: 1.5;
}

:is(.c-prose, .is-root-container) :is(th, td) {
	padding: 12px 14px;
	text-align: start;
	vertical-align: top;
	box-shadow: inset 0 -1px 0 var(--c-line);
}

:is(.c-prose, .is-root-container) thead th {
	background: var(--c-light);
	color: var(--c-primary);
	font-family: var(--ff-head);
	font-weight: 600;
}

:is(.c-prose, .is-root-container) thead th:first-child {
	border-start-start-radius: var(--r-btn);
}

:is(.c-prose, .is-root-container) thead th:last-child {
	border-start-end-radius: var(--r-btn);
}

:is(.c-prose, .is-root-container) .is-style-stripes tbody tr:nth-child(odd) {
	background: var(--c-cream);
}

/* 6. ACF blocks: reli/tip, reli/course-cta
   ========================================================================== */
.c-tip {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 6px 10px;
	margin-block: 28px;
	padding: 20px;
	border-radius: var(--r-soft);
	background: var(--c-light);
}

.c-tip__icon {
	display: inline-flex;
	color: var(--c-accent);
}

.c-tip__icon .c-icon {
	width: 20px;
	height: 20px;
}

.c-tip__body {
	display: contents;
}

.c-tip__title {
	align-self: center;
	color: var(--c-primary);
	font-family: var(--ff-head);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
}

.c-tip__text {
	grid-column: 1 / -1;
	font-size: 1rem;
	line-height: 1.7;
}

.c-course-cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	margin-block: 28px;
	padding: 22px;
	border-radius: var(--r-soft);
	background: var(--c-cream);
}

.c-course-cta__icon {
	display: none;
}

.c-course-cta__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.c-course-cta__title {
	color: var(--c-primary);
	font-family: var(--ff-head);
	font-size: clamp(1.1875rem, 1.160rem + .109vw, 1.25rem); /* 19 → 20 */
	font-weight: 600;
	line-height: 1.35;
}

.c-course-cta__text {
	color: var(--c-muted);
	font-size: var(--fs-small);
	line-height: 1.6;
}

.c-course-cta .c-btn {
	align-self: stretch;
	min-height: 48px;
}

@media (min-width: 640px) {
	.c-tip {
		display: flex;
		gap: 16px;
		padding: 26px 28px;
	}

	.c-tip__icon {
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		border-radius: var(--r-icon);
		background: var(--c-white);
	}

	.c-tip__icon .c-icon {
		width: 24px;
		height: 24px;
	}

	.c-tip__body {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.c-tip__title {
		font-size: 1.125rem;
	}

	.c-tip__text {
		font-size: 1.0625rem;
	}

	.c-course-cta {
		flex-direction: row;
		align-items: center;
		gap: 24px;
		padding: 32px;
		border-radius: var(--r-card);
	}

	.c-course-cta__icon {
		display: inline-flex;
		width: 64px;
		height: 64px;
		border-radius: var(--r-bar);
	}

	.c-course-cta__icon .c-icon {
		width: 30px;
		height: 30px;
	}

	.c-course-cta__body {
		flex: 1 1 0;
	}

	.c-course-cta__text {
		font-size: 1rem;
	}

	.c-course-cta .c-btn {
		align-self: center;
		padding-inline: 22px;
	}
}

/* 7. Article footer: tags + share, author box
   ========================================================================== */
.c-article-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-block-start: 32px;
	padding-block-start: 20px;
	box-shadow: 0 -1px 0 var(--c-line);
}

.c-article-footer__tags,
.c-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	list-style: none;
}

.c-article-footer__tags {
	display: none;
}

.c-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.c-share__label,
.c-share__status {
	color: var(--c-muted);
	font-size: var(--fs-small);
}

.c-tag {
	display: inline-flex;
	align-items: center;
	min-height: 44px; /* touch target */
	padding-inline: 14px;
	border-radius: var(--r-pill);
	background: var(--c-light);
	color: var(--c-primary);
	font-size: var(--fs-caption);
	font-weight: 500;
	text-decoration: none;
}

.c-tag:hover {
	background: var(--c-light-hover);
}

.c-author-box {
	margin-block-start: 32px;
}

.c-author-box__head {
	display: flex;
	align-items: center;
	gap: 14px;
}

.c-author-box__photo {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
}

.c-author-box__label {
	color: var(--c-muted);
	font-size: var(--fs-caption);
}

.c-author-box__name {
	color: var(--c-primary);
	font-family: var(--ff-head);
	font-size: clamp(1.1875rem, 1.106rem + .326vw, 1.375rem); /* 19 → 22 */
	font-weight: 600;
	line-height: 1.3;
}

.c-author-box__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.c-author-box__bio {
	color: var(--c-muted);
	font-size: var(--fs-small);
	line-height: 1.65;
}

@media (min-width: 960px) {
	.c-article-footer {
		margin-block-start: 40px;
		padding-block-start: 28px;
	}

	.c-article-footer__tags {
		display: flex;
	}

	.c-author-box {
		display: grid;
		grid-template-columns: 88px minmax(0, 1fr);
		column-gap: 24px;
		margin-block-start: 48px;
	}

	.c-author-box__head {
		display: contents;
	}

	.c-author-box__photo {
		grid-row: span 2;
		width: 88px;
		height: 88px;
	}

	.c-author-box__bio {
		font-size: 1rem;
	}
}

/* 8. Sidebar cards: course promo, lead magnet
   ========================================================================== */
.c-course-promo {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	padding: 28px;
	border-radius: var(--r-card);
}

.c-course-promo__label {
	color: var(--c-on-primary-muted);
	font-size: var(--fs-caption);
}

.c-course-promo__title {
	font-family: var(--ff-head);
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.3;
}

.c-course-promo__text {
	color: var(--c-on-primary-muted);
	font-size: var(--fs-small);
	line-height: 1.6;
}

.c-lead-mini {
	gap: 12px;
	padding: 28px;
}

.c-lead-mini__title {
	font-size: 1.125rem;
}

.c-lead-mini__text {
	color: var(--c-muted);
	font-size: var(--fs-small);
	line-height: 1.6;
}

.c-lead-form--mini {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.c-lead-form--mini .c-field input {
	height: 48px;
}

/* 9. Plain pages (page.php — legal etc.)
   ========================================================================== */
.c-page__inner {
	max-width: calc(740px + 2 * var(--gutter));
}

.c-page__header {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-block-end: var(--gap-lg);
}

.c-page__updated {
	color: var(--c-muted);
	font-size: var(--fs-small);
}
