/*
 * Awareness That Heals — module.css
 *
 * Styles for the single-module page: the `taxonomy-ath_module` template and
 * the `ath/module-*` blocks it composes (hero, continue, overview,
 * teachings, aside). Loaded on `is_tax('ath_module')` only, AFTER theme.css
 * (reuses .ath-eyebrow / .ath-on-dark / the brand tokens).
 *
 * Net-new surface, scoped to `.athm-*`. References the same token layer as
 * library.css: --wp--preset--color--*, --wp--preset--font-family--*,
 * --wp--preset--spacing--*, and the --ath-radius-* / --ath-shadow-* aliases.
 *
 * Composition (top → bottom):
 *   hero (teal band + lotus) → continue banner → two-column body
 *   [ overview + grouped teaching sections | sticky aside: resume · in-this-
 *     module · saved ]
 */

:root {
	--athm-shadow-card:       0 1px 2px rgba(19, 50, 63, 0.04), 0 8px 24px rgba(19, 50, 63, 0.05);
	--athm-shadow-card-hover: 0 2px 4px rgba(19, 50, 63, 0.06), 0 16px 36px rgba(19, 50, 63, 0.09);
}

.athm { font-family: var(--wp--preset--font-family--body-sans); }
.athm *, .athm *::before, .athm *::after { box-sizing: border-box; }

/* =========================================================
 * Hero — teal band + lotus watermark (design C)
 * ========================================================= */
.athm-hero {
	position: relative;
	overflow: hidden;
	background: var(--wp--preset--color--deep-teal);
	color: #fff;
	padding: 4.5rem 1.5rem;
}
.athm-hero__lotus {
	position: absolute;
	width: 520px; height: auto;
	right: -90px; top: 50%;
	transform: translateY(-50%);
	color: rgba(255, 255, 255, 0.06);
	pointer-events: none;
}
.athm-hero__inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; }
.athm-crumb {
	display: flex; gap: 0.5rem; align-items: center; white-space: nowrap;
	font-size: 0.78rem; letter-spacing: 0.04em;
	color: var(--wp--preset--color--teal-soft);
	margin-bottom: 1.4rem;
}
.athm-crumb a { color: var(--wp--preset--color--teal-pale); text-decoration: none; }
.athm-crumb a:hover { color: #fff; }
.athm-hero__eyebrow { color: var(--wp--preset--color--sage-light); margin-bottom: 0.7rem; }
.athm-hero__title {
	font-family: var(--wp--preset--font-family--display-serif);
	font-weight: 400;
	font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.5rem);
	line-height: 1.05; letter-spacing: 0.005em;
	color: #fff; margin: 0 0 1.1rem;
}
.athm-hero__copy {
	max-width: 52ch; margin: 0;
	font-size: 1.12rem; font-weight: 300; line-height: 1.65;
	color: var(--wp--preset--color--teal-pale);
}

/* =========================================================
 * Continue banner — full-width, overlaps hero (design C)
 * ========================================================= */
.athm-bandwrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.athm-continue {
	position: relative; z-index: 2; margin-top: -2.4rem;
	display: flex; align-items: center; gap: 1.4rem;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--teal-faint);
	border-radius: var(--ath-radius-lg);
	padding: 1.1rem 1.4rem;
	box-shadow: var(--athm-shadow-card-hover);
}
.athm-continue__label {
	flex: 0 0 auto; align-self: center;
	font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
	color: var(--wp--preset--color--teal-mid);
}
.athm-continue .athm-resume__card { flex: 1 1 auto; }
.athm-continue .athm-resume__thumb { width: 86px; height: 60px; }
.athm-continue .athm-btn { flex: 0 0 auto; }

/* =========================================================
 * Body layout — two columns
 * ========================================================= */
.athm-body {
	max-width: 1180px; margin: 0 auto;
	padding: 3.25rem 1.5rem 5rem;
	display: grid; grid-template-columns: 1fr 340px; gap: 3rem;
	align-items: start;
}
.athm-main { min-width: 0; display: flex; flex-direction: column; gap: 2.6rem; }
.athm-aside__sticky { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }

@media (max-width: 900px) {
	.athm-body { grid-template-columns: 1fr; }
	.athm-aside { order: -1; }
	.athm-aside__sticky { position: static; }
}

/* =========================================================
 * Overview — Robert's orientation (design C intro)
 * ========================================================= */
.athm-overview {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--teal-faint);
	border-left: 3px solid var(--wp--preset--color--sage);
	border-radius: var(--ath-radius-lg);
	padding: 1.75rem 2rem;
	box-shadow: var(--athm-shadow-card);
}
.athm-overview .ath-eyebrow { color: var(--wp--preset--color--sage-dark, #5C6049); margin-bottom: 0.6rem; }
.athm-overview__body {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading-serif);
	font-size: 1.32rem; font-weight: 400; line-height: 1.55;
	color: var(--wp--preset--color--deep-teal);
}
.athm-overview__body + .athm-overview__body { margin-top: 1rem; }

/* =========================================================
 * Teaching sections — grouped rows (designs A + D)
 * ========================================================= */
.athm-group { display: flex; flex-direction: column; scroll-margin-top: 1.5rem; }
.athm-group__head {
	display: flex; align-items: baseline; gap: 0.75rem;
	padding-bottom: 0.85rem; margin-bottom: 1.25rem;
	border-bottom: 1px solid var(--wp--preset--color--teal-soft);
}
.athm-group__title {
	margin: 0; white-space: nowrap;
	font-family: var(--wp--preset--font-family--heading-serif);
	font-size: 1.6rem; font-weight: 500; line-height: 1.1;
	color: var(--wp--preset--color--deep-teal);
}
.athm-group__count {
	font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
	color: var(--wp--preset--color--teal-muted);
}

.athm-rows { display: flex; flex-direction: column; gap: 0.6rem; }
.athm-row {
	display: flex; align-items: flex-start; gap: 1.1rem;
	padding: 1rem 1.1rem;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--teal-faint);
	border-radius: var(--ath-radius-lg);
	text-decoration: none;
	box-shadow: var(--athm-shadow-card);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.athm-row:hover { transform: translateY(-2px); box-shadow: var(--athm-shadow-card-hover); border-color: var(--wp--preset--color--teal-soft); }
.athm-row.is-visited { background: color-mix(in srgb, var(--wp--preset--color--teal-faint) 60%, #fff); }

.athm-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.athm-row__top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.athm-row__title {
	font-family: var(--wp--preset--font-family--heading-serif);
	font-size: 1.3rem; font-weight: 500; line-height: 1.2;
	color: var(--wp--preset--color--deep-teal);
}
.athm-row:hover .athm-row__title { color: var(--wp--preset--color--teal-mid); }
.athm-row__viewed {
	display: none; /* shown by JS via .is-visited */
	font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
	color: var(--wp--preset--color--sage-dark, #5C6049);
	background: var(--wp--preset--color--sage-pale, #E6EDD6);
	padding: 0.18rem 0.5rem; border-radius: var(--ath-radius-pill);
}
.athm-row.is-visited .athm-row__viewed { display: inline-block; }
.athm-row__excerpt { margin: 0; font-size: 0.95rem; font-weight: 300; line-height: 1.5; color: var(--wp--preset--color--teal-muted); }
.athm-row__meta { display: flex; align-items: center; gap: 0.85rem; margin-top: 0.15rem; }
.athm-row__dur { font-size: 0.78rem; color: var(--wp--preset--color--teal-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Thumbnail (tonal placeholder w/ type glyph) */
.athm-thumb {
	position: relative; flex: 0 0 auto;
	width: 84px; height: 64px;
	display: flex; align-items: center; justify-content: center;
	border-radius: var(--ath-radius-md);
	background: linear-gradient(150deg, var(--wp--preset--color--teal-mid), var(--wp--preset--color--deep-teal));
	color: rgba(255, 255, 255, 0.92);
	overflow: hidden;
}
.athm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.athm-thumb__glyph { width: 26px; height: 26px; }
.athm-thumb__glyph svg { width: 100%; height: 100%; }
.athm-thumb__check {
	position: absolute; top: -7px; right: -7px;
	width: 22px; height: 22px; border-radius: var(--ath-radius-pill);
	background: var(--wp--preset--color--sage); color: #fff;
	display: none; align-items: center; justify-content: center;
	box-shadow: 0 0 0 2px var(--wp--preset--color--white);
}
.athm-row.is-visited .athm-thumb__check { display: flex; }
.athm-thumb__check svg { width: 13px; height: 13px; }

/* Type badge */
.athm-type {
	display: inline-flex; align-items: center; gap: 0.32rem;
	font-size: 0.66rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
	color: var(--wp--preset--color--teal-mid);
}
.athm-type__glyph { width: 14px; height: 14px; }
.athm-type__glyph svg { width: 100%; height: 100%; }

/* Save (heart) toggle */
.athm-save {
	flex: 0 0 auto;
	display: inline-flex; align-items: center; gap: 0.4rem;
	border: 0; background: transparent; cursor: pointer; padding: 0.35rem;
	color: var(--wp--preset--color--teal-soft); border-radius: var(--ath-radius-pill);
	transition: color .15s ease, background .15s ease;
}
.athm-save svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.athm-save:hover { color: var(--wp--preset--color--sage); background: var(--wp--preset--color--sage-pale, #E6EDD6); }
.athm-save.is-saved { color: var(--wp--preset--color--sage); }
.athm-save.is-saved svg { fill: currentColor; }

/* =========================================================
 * Resume card (shared by continue banner + sidebar)
 * ========================================================= */
.athm-resume__card { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.athm-resume__thumb {
	position: relative; flex: 0 0 auto; width: 70px; height: 56px;
	border-radius: var(--ath-radius-md);
	background: linear-gradient(150deg, var(--wp--preset--color--teal-mid), var(--wp--preset--color--deep-teal));
	display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.85);
	overflow: hidden;
}
.athm-resume__thumb img { width: 100%; height: 100%; object-fit: cover; }
.athm-resume__glyph { width: 22px; height: 22px; }
.athm-resume__glyph svg { width: 100%; height: 100%; }
.athm-resume__body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.athm-resume__eyebrow { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wp--preset--color--teal-muted); }
.athm-resume__title { font-family: var(--wp--preset--font-family--heading-serif); font-size: 1.08rem; font-weight: 500; line-height: 1.2; color: var(--wp--preset--color--deep-teal); }

/* Sidebar resume panel */
.athm-resume {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--teal-faint);
	border-radius: var(--ath-radius-lg);
	padding: 1.4rem; box-shadow: var(--athm-shadow-card);
	display: flex; flex-direction: column; gap: 1rem;
}
.athm-resume__label {
	font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
	color: var(--wp--preset--color--teal-mid);
}
.athm-resume .athm-resume__card { flex-direction: column; align-items: stretch; gap: 0.8rem; }
.athm-resume .athm-resume__thumb { width: 100%; height: 130px; }
.athm-resume .athm-resume__glyph { width: 32px; height: 32px; }
.athm-resume .athm-btn { width: 100%; }

/* =========================================================
 * Button (mirror theme.css .wp-block-button, pill on this page)
 * ========================================================= */
.athm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	font-family: var(--wp--preset--font-family--body-sans);
	font-weight: 500; font-size: 0.95rem; letter-spacing: 0.06em;
	padding: 0.8rem 1.75rem; border: 0; cursor: pointer; text-decoration: none;
	border-radius: var(--ath-radius-pill);
	background: var(--wp--preset--color--sage); color: #fff;
	box-shadow: 0 8px 24px rgba(20, 40, 48, 0.18);
	transition: background-color .15s ease, transform .15s ease;
}
.athm-btn:hover { background: var(--wp--preset--color--sage-light); color: var(--wp--preset--color--ink); transform: translateY(-1px); }
.athm-btn__arrow { width: 16px; height: 16px; display: inline-flex; }
.athm-btn__arrow svg { width: 100%; height: 100%; }

/* =========================================================
 * In This Module — TOC (server-rendered anchors)
 * ========================================================= */
.athm-toc {
	display: flex; flex-direction: column;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--teal-faint);
	border-radius: var(--ath-radius-lg);
	padding: 0.7rem; box-shadow: var(--athm-shadow-card);
}
.athm-toc__label { padding: 0.5rem 0.7rem 0.6rem; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wp--preset--color--teal-mid); }
.athm-toc__link {
	display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
	padding: 0.55rem 0.7rem; border-radius: var(--ath-radius-sm);
	text-decoration: none; color: var(--wp--preset--color--deep-teal); font-size: 0.95rem;
	transition: background .15s ease;
}
.athm-toc__link:hover { background: var(--wp--preset--color--teal-faint); }
.athm-toc__n { font-size: 0.72rem; color: var(--wp--preset--color--teal-muted); font-variant-numeric: tabular-nums; }

/* =========================================================
 * Saved in This Module (client-hydrated)
 * ========================================================= */
.athm-saved {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--teal-faint);
	border-radius: var(--ath-radius-lg);
	padding: 1.3rem 1.4rem; box-shadow: var(--athm-shadow-card);
}
.athm-saved__label {
	display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.9rem;
	font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--wp--preset--color--sage-dark, #5C6049);
}
.athm-saved__label svg { width: 15px; height: 15px; fill: var(--wp--preset--color--sage); }
.athm-saved__empty { margin: 0; font-size: 0.86rem; font-weight: 300; line-height: 1.5; color: var(--wp--preset--color--teal-muted); }
.athm-saved__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.athm-saved__list:empty { display: none; }
.athm-saved__item { display: flex; align-items: center; gap: 0.4rem; }
.athm-saved__item > a { flex: 1 1 auto; display: flex; align-items: center; gap: 0.6rem; min-width: 0; text-decoration: none; }
.athm-saved__glyph { flex: 0 0 auto; width: 28px; height: 28px; border-radius: var(--ath-radius-sm); background: var(--wp--preset--color--teal-faint); color: var(--wp--preset--color--deep-teal); display: flex; align-items: center; justify-content: center; }
.athm-saved__glyph svg { width: 15px; height: 15px; }
.athm-saved__title { font-family: var(--wp--preset--font-family--heading-serif); font-size: 1rem; color: var(--wp--preset--color--deep-teal); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.athm-saved__item .athm-save svg { width: 17px; height: 17px; }

@media (prefers-reduced-motion: reduce) {
	.athm-row, .athm-btn { transition: none; }
}
