/**
 * Eximia — Therapeutic Area page restructure
 * v4.8.0 (Nov 2026). Full-width alternating sections, ribbon CTA bands,
 * card grids generated from definition-style lists, table styling,
 * and editor-managed indication lists on Therapeutic Area archive cards
 * with "See all X" expand-in-place toggle.
 * Loaded after theme.min.css via functions.php.
 */

/* ------------------------------------------------------------------
   1. FULL-WIDTH SECTIONS WITH ALTERNATING BACKGROUNDS
   ------------------------------------------------------------------ */
.ta-content-wrapper .ta-section {
	padding: 2.5rem 0;
}

.ta-content-wrapper .ta-section--alt {
	background-color: #eeeaf4;
}

.ta-content-wrapper .ta-article {
	max-width: 820px;
	margin-left: auto;
	margin-right: auto;
	width: 100%;
}

.ta-content-wrapper .ta-section:first-child {
	padding-top: 2rem;
}

/* No gaps between sections and ribbons — they sit flush
   so there are no visible color layer strips between them. */
.ta-content-wrapper .ta-section + .ta-ribbon,
.ta-content-wrapper .ta-ribbon + .ta-section {
	margin-top: 0;
}

/* Kill any trailing gap after the last section before the footer */
.ta-content-wrapper .ta-section:last-child {
	padding-bottom: 0;
}

.ta-content-wrapper {
	margin-bottom: 0;
	padding-bottom: 0;
}

/* ------------------------------------------------------------------
   2. RIBBON CTA — DARK (navy, mid-page)
   ------------------------------------------------------------------ */
.ta-ribbon {
	position: relative;
	background-color: #26215D;
	padding: 2.5rem 1rem;
	text-align: center;
}

.ta-ribbon .ta-ribbon__accent {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #eed231 0%, #ffe65b 50%, #eed231 100%);
}

.ta-ribbon .ta-ribbon__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	max-width: 820px;
	margin: 0 auto;
}

.ta-ribbon .ta-ribbon__text {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.4;
	color: #ffffff;
}

.ta-ribbon .ta-ribbon__btn {
	display: inline-block;
	background-color: #eed231;
	color: #26215D;
	border: 2px solid #eed231;
	border-radius: 50px;
	font-weight: 700;
	font-size: 1rem;
	padding: .75rem 2rem;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s, border-color .2s;
}

.ta-ribbon .ta-ribbon__btn:hover,
.ta-ribbon .ta-ribbon__btn:focus {
	background-color: #ffe65b;
	border-color: #ffe65b;
	color: #26215D;
	text-decoration: none;
}

/* ------------------------------------------------------------------
   3. RIBBON CTA — SOFT (light purple, closing)
   ------------------------------------------------------------------ */
.ta-ribbon.ta-ribbon--soft {
	background-color: #C2B4D8;
}

.ta-ribbon.ta-ribbon--soft .ta-ribbon__accent {
	background: linear-gradient(90deg, #8E78B7 0%, #C2B4D8 50%, #8E78B7 100%);
}

.ta-ribbon.ta-ribbon--soft .ta-ribbon__text {
	color: #26215D;
}

.ta-ribbon.ta-ribbon--soft .ta-ribbon__btn {
	background-color: #26215D;
	border-color: #26215D;
	color: #ffffff;
}

.ta-ribbon.ta-ribbon--soft .ta-ribbon__btn:hover,
.ta-ribbon.ta-ribbon--soft .ta-ribbon__btn:focus {
	background-color: #8E78B7;
	border-color: #8E78B7;
	color: #ffffff;
}

/* ------------------------------------------------------------------
   4. CARD GRIDS
   Generated by ContentCards.php from "Label: description" bullet lists.
   An unordered list becomes plain cards, an ordered list becomes
   numbered cards — editors choose with the WYSIWYG list buttons.
   ------------------------------------------------------------------ */
.ta-content-wrapper .ta-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin: 1.75rem 0;
	padding: 0;
	list-style: none;
}

/* 4 items read better as 2x2 than as 3 + 1 orphan. */
.ta-content-wrapper .ta-cards[data-count="4"] {
	grid-template-columns: repeat(2, 1fr);
}

.ta-content-wrapper .ta-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 1.25rem 1.25rem 1.375rem;
	background-color: #ffffff;
	border: 1px solid #d4d3df;
	border-radius: 8px;
	border-top: 3px solid #C2B4D8;
	transition: transform .2s ease, box-shadow .2s ease, border-top-color .2s ease;
}

/* On the light purple sections the white card still needs separation. */
.ta-content-wrapper .ta-section--alt .ta-card {
	border-color: #ffffff;
	border-top-color: #8E78B7;
}

.ta-content-wrapper .ta-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(38, 33, 93, .12);
	border-top-color: #eed231;
}

.ta-content-wrapper .ta-card__title {
	margin: 0 0 .5rem;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	color: #26215D;
}

.ta-content-wrapper .ta-card__text {
	margin: 0;
	font-size: .9375rem;
	line-height: 1.6;
	color: #495057;
}

/* Numbered variant */
.ta-content-wrapper .ta-cards--numbered .ta-card {
	padding-top: 1.5rem;
}

.ta-content-wrapper .ta-card__num {
	position: absolute;
	top: .625rem;
	right: .875rem;
	font-size: 2.25rem;
	font-weight: 800;
	line-height: 1;
	color: #26215D;
	opacity: .12;
	pointer-events: none;
}

/* ------------------------------------------------------------------
   5. CONTENT TABLES (e.g. the eligibility criteria table)
   ------------------------------------------------------------------ */
.ta-content-wrapper .ta-article table {
	width: 100%;
	margin: 1.5rem 0;
	border-collapse: separate;
	border-spacing: 0;
	background-color: #ffffff;
	border: 1px solid #d4d3df;
	border-radius: 8px;
	overflow: hidden;
	font-size: .9375rem;
}

/* Navy header — only inside <thead>, or the very first row when no <thead>
   exists. Using :has(thead) / :not(:has(thead)) avoids painting two rows
   blue when the editor outputs <thead> + <tbody>.                        */
.ta-content-wrapper .ta-article table thead td,
.ta-content-wrapper .ta-article table thead th,
.ta-content-wrapper .ta-article table:not(:has(thead)) > tr:first-child td,
.ta-content-wrapper .ta-article table:not(:has(thead)) > tbody:first-child > tr:first-child td {
	background-color: #26215D;
	color: #ffffff;
	font-weight: 700;
}

.ta-content-wrapper .ta-article table td,
.ta-content-wrapper .ta-article table th {
	padding: .75rem 1rem;
	vertical-align: top;
	text-align: left;
	border-bottom: 1px solid #e9ecef;
	line-height: 1.5;
}

.ta-content-wrapper .ta-article table tr:last-child td {
	border-bottom: 0;
}

/* Bold left column — skip the header row(s) */
.ta-content-wrapper .ta-article table tbody td:first-child {
	font-weight: 700;
	color: #26215D;
	width: 34%;
}

/* ------------------------------------------------------------------
   6. SHARE ACTIONS + FAQ
   ------------------------------------------------------------------ */
.ta-content-wrapper .ta-share {
	max-width: 620px;
	margin: 0 auto;
	padding-top: 2rem;
	border-top: 1px solid #d4d3df;
	text-align: center;
}

.ta-content-wrapper .ta-share .share-page-actions,
.ta-content-wrapper .ta-share .share {
	display: flex;
	flex-direction: column;
	gap: .75rem;
}

/* ------------------------------------------------------------------
   7. THERAPEUTIC AREA LISTING CARDS — INDICATION PEEK
   Only applies to cards rendered by AreaLoopWithIndications. The
   original AreaLoop (no modifier class) is untouched.

   Strategy: override the parent theme's card layout entirely for this
   variant so the result is predictable at every breakpoint. The card
   drops its fixed 320px height, grows to fit content, and gets a solid
   background color so the SVG shape (which doesn't stretch) isn't the
   only thing providing fill.

   Layout: icon on top, indications below, title anchored to the bottom.
   ------------------------------------------------------------------ */
.area-list-item--with-indications {
	height: auto !important;
	min-height: 320px;
	background-color: #CEC2E1;
	border-radius: 10px;
	/* overflow:hidden removed — it was clipping the title when the card
	   grew to fit expanded indications. The SVG background is constrained
	   by its own dimensions so it doesn't visually spill. */
}

.area-list-item--with-indications .c {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	height: auto !important;
	min-height: 320px;
}

/* When expanded, the card needs to grow unbounded — strip any inherited
   max-height and let the grid row stretch to fit. */
.area-list-item--with-indications.is-expanded,
.area-list-item--with-indications.is-expanded .c {
	max-height: none !important;
	height: auto !important;
}

/* SVG background must stretch to the card's actual height when the card
   grows past its initial 320px. The SVG's own width/height HTML
   attributes get overridden so viewBox scaling fills the card. */
.area-list-item--with-indications .bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: hidden;
	border-radius: 10px;
}

.area-list-item--with-indications .bg svg {
	width: 100% !important;
	height: 100% !important;
	display: block;
}

.area-list-item--with-indications .ico {
	margin: 0 0 .75rem 0 !important;
	float: none !important;
	flex-shrink: 0;
	width: 72px;
	height: 72px;
}

/* Preserve icon size in the flex column — without explicit dimensions the
   SVG shrinks to fit the narrower card at tablet/mobile widths. */
.area-list-item--with-indications .ico svg {
	width: 72px !important;
	height: 72px !important;
}

.area-list-item--with-indications .indications {
	position: relative;
	margin: 0 0 auto;
	padding: 0;
	list-style: none;
	text-align: left;
	z-index: 2;
	pointer-events: none;
}

.area-list-item--with-indications .indications li {
	display: block;
	margin: 0 0 .375rem;
	padding: 0 0 .375rem;
	border-bottom: 1px solid rgba(38, 33, 93, .18);
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.3;
	color: #26215D;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.area-list-item--with-indications .indications li:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

/* Title sits at the bottom with its own top border so it's always
   visually separated from the indications above it. */
.area-list-item--with-indications .title {
	margin-top: 1.25rem !important;
	flex-shrink: 0;
}

/* Lift on hover to match the existing card interaction. */
.area-list-item--with-indications:hover .indications li {
	border-bottom-color: rgba(38, 33, 93, .32);
}

/* ------------------------------------------------------------------
   8. TABLET
   ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
	.ta-content-wrapper .ta-cards,
	.ta-content-wrapper .ta-cards[data-count="4"] {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 991.98px) {
	.area-list-item--with-indications .ico {
		width: 56px;
		height: 56px;
		margin-bottom: 1rem !important;
	}
	.area-list-item--with-indications .ico svg {
		width: 56px !important;
		height: 56px !important;
	}
	.area-list-item--with-indications .indications li {
		font-size: .8125rem;
	}
}

/* ------------------------------------------------------------------
   9. MOBILE
   ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
	/* Mobile cards are narrow (2-col grid). Shrink the indication font
	   and let the card drop its 320px floor so it can be as tight as
	   its content needs. */
	.area-list-item--with-indications {
		min-height: 220px;
	}

	.area-list-item--with-indications .c {
		min-height: 220px;
	}

	.area-list-item--with-indications .ico {
		width: 48px;
		height: 48px;
		margin-bottom: 1rem !important;
	}
	.area-list-item--with-indications .ico svg {
		width: 48px !important;
		height: 48px !important;
	}
	.area-list-item--with-indications .indications li {
		font-size: .75rem;
		line-height: 1.25;
		margin-bottom: .25rem;
		padding-bottom: .25rem;
	}

	.ta-content-wrapper .ta-cards,
	.ta-content-wrapper .ta-cards[data-count="4"] {
		grid-template-columns: 1fr;
		gap: .75rem;
		margin: 1.25rem 0;
	}

	.ta-content-wrapper .ta-card {
		padding: 1rem 1rem 1.125rem;
	}

	.ta-content-wrapper .ta-card:hover {
		transform: none;
		box-shadow: none;
	}

	/* Tables scroll horizontally rather than squashing. */
	.ta-content-wrapper .ta-article table {
		display: block;
		overflow-x: auto;
		white-space: normal;
	}

	.ta-content-wrapper .ta-section {
		padding: 1.75rem 0;
	}

	.ta-content-wrapper .ta-section:first-child {
		padding-top: 2.5rem;
	}

	.ta-ribbon {
		padding: 2rem 1rem;
	}

	.ta-ribbon .ta-ribbon__inner {
		flex-direction: column;
		gap: 1rem;
	}

	.ta-ribbon .ta-ribbon__text {
		font-size: 1.0625rem;
	}
}

/* ==================================================================
   v4.8.0 — EDITOR-MANAGED INDICATIONS (expand-in-place)
   ==================================================================
   The TA listing card changed from a wrapping <a> to an <article> so
   the "See all X" <button> is not nested inside an interactive
   element. The whole card remains clickable via a stretched link on
   the title. Hidden indications are revealed in place; the card
   grows to fit; CSS Grid handles row-height.
   ================================================================== */

/* The outer card is now <article>, not <a>. Must be a positioning
   context so the title's ::after stretched link covers the full card. */
.area-list-item--with-indications {
	position: relative;
	display: block;
}

/* Override parent-theme absolute positioning that pulls the title out
   of flex flow and causes it to overlap the toggle on desktop. */
.area-list-item--with-indications .title {
	position: relative !important;
	bottom: auto !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	z-index: 1;
	width: 100%;
}

.area-list-item--with-indications .title-link {
	color: inherit;
	text-decoration: none;
	position: relative;
}

/* Stretched link — covers the full card bounds so a click anywhere
   (except on the toggle button, which sits above) navigates to the
   TA detail page, matching the original wrapping-<a> behavior. */
.area-list-item--with-indications .title-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: auto;
}

/* Keyboard focus — ring the whole card so the invisible stretched
   link's focus state is visible to keyboard users. */
.area-list-item--with-indications:focus-within {
	outline: 2px solid #26215D;
	outline-offset: 2px;
	border-radius: 10px;
}

.area-list-item--with-indications .title-link:focus,
.area-list-item--with-indications .title-link:focus-visible {
	outline: none;
}

/* Hidden indications — collapsed by default; the toggle removes the
   hidden attribute which brings them back into flow. */
.area-list-item--with-indications .indications__item[hidden] {
	display: none;
}

/* Expanded state — allow long names to wrap instead of ellipsing,
   so the full name is readable when the user asked to see them all. */
.area-list-item--with-indications.is-expanded .indications li {
	white-space: normal;
	overflow: visible;
	text-overflow: unset;
}

/* "See all X →" toggle — sits above the stretched link so clicks
   on it toggle the list instead of navigating. The containing <ul>
   keeps its pointer-events: none from v4.7.x; this button is a
   sibling, not nested, so its pointer-events are the default (auto). */
.area-list-item--with-indications .indications-toggle {
	position: relative;
	z-index: 2;
	display: inline-block;
	margin: .5rem 0 .75rem;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1.2;
	color: #26215D;
	text-decoration: underline;
	text-decoration-color: rgba(38, 33, 93, .35);
	text-underline-offset: 3px;
	cursor: pointer;
	text-align: left;
	appearance: none;
	align-self: flex-start;
	pointer-events: auto;
}

.area-list-item--with-indications .indications-toggle:hover {
	text-decoration-color: #26215D;
}

.area-list-item--with-indications .indications-toggle:focus-visible {
	outline: 2px solid #26215D;
	outline-offset: 2px;
	border-radius: 2px;
	text-decoration-color: #26215D;
}

/* Tablet */
@media (max-width: 991.98px) {
	.area-list-item--with-indications .indications-toggle {
		font-size: .6875rem;
	}
}

/* Mobile */
@media (max-width: 767.98px) {
	.area-list-item--with-indications .indications-toggle {
		font-size: .625rem;
		margin-top: .375rem;
	}
}

/* ==================================================================
   v4.8.0 — TAKE OVER THE LISTING GRID (indications variant only)
   ==================================================================
   The child theme's compiled CSS lays .area-list out as a grid with
   fixed-height rows. When a card grows after "See all" is clicked,
   the row height does not change, so expanded text overflows into
   the row below.

   Fix: when the grid holds at least one indications card, force a
   plain CSS grid whose rows auto-size to their tallest card. The
   grid-template-rows reset is critical — it clears any explicit row
   template from the compiled stylesheet so that grid-auto-rows: auto
   governs every row. This also normalises the column count at every
   breakpoint — including 1 column on mobile, which fixes the
   cut-off second-column problem.

   Scoped with :has() so it only touches an .area-list that actually
   contains indication cards; the tags grid and empty-state grids are
   left on the compiled layout untouched.
   ================================================================== */
.area-list:has(.area-list-item--with-indications) {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	grid-template-rows: none !important;    /* clear explicit row template */
	grid-auto-rows: auto !important;        /* rows size to tallest card  */
	align-items: start !important;
	gap: 1.5rem !important;
	position: static !important;
	height: auto !important;
	max-height: none !important;
	min-height: 0 !important;
	overflow: visible !important;
	float: none !important;
}

/* Neutralize any compiled-CSS or inline positioning/sizing so cards
   flow in the grid and each grows to fit its own content.
   Both child (>) and descendant selectors for robustness in case a
   wrapper element sits between .area-list and .area-list-item. */
.area-list:has(.area-list-item--with-indications) > .area-list-item,
.area-list:has(.area-list-item--with-indications) .area-list-item {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	width: auto !important;
	height: auto !important;
	max-height: none !important;
	margin: 0 !important;
	transform: none !important;
	float: none !important;
	min-width: 0;
}

/* v5.0.0 — FIX CARD INTERNAL LAYOUT
   The compiled card uses position: absolute on both .bg (decorative
   background SVG) and .c (content wrapper). This takes the content
   out of normal flow, so the ARTICLE can never size to it — it stays
   at a fixed height (≈320 px) and expanded indications overflow into
   the row below.

   Fix: put .c back in flow (position: relative) so the ARTICLE sizes
   to its content. The .bg stays absolute and stretches to fill
   whatever height the card reaches via top/bottom: 0.               */

.area-list:has(.area-list-item--with-indications) .area-list-item .c {
	position: relative !important;
	height: auto !important;
	width: 100% !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	z-index: 1;                     /* stay above the .bg layer */
}

/* Decorative background — stretch to fill card height.
   overflow: hidden + border-radius clip the SVG edge artefacts that
   appear when the card is wider/taller than the SVG's native 322×320.
   The JS companion sets preserveAspectRatio="none" on the SVG so the
   viewBox stretches exactly to the card dimensions.                   */
.area-list:has(.area-list-item--with-indications) .area-list-item .bg {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 0;
	overflow: hidden !important;
	border-radius: 10px !important;
}

.area-list:has(.area-list-item--with-indications) .area-list-item .bg svg {
	width: 100% !important;
	height: 100% !important;
}

/* Title — allow wrapping for long therapeutic area names */
.area-list:has(.area-list-item--with-indications) .area-list-item .title {
	height: auto !important;
	overflow-wrap: break-word !important;
	word-wrap: break-word !important;
}

/* Tablet — 2 columns */
@media (max-width: 991.98px) {
	.area-list:has(.area-list-item--with-indications) {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

/* Mobile — 1 column */
@media (max-width: 767.98px) {
	.area-list:has(.area-list-item--with-indications) {
		grid-template-columns: 1fr !important;
		gap: 1rem !important;
	}
}
