/*
Theme Name: cd-child
Theme URI: 
Author: ssachan
Author URI: 
Description: Civilsdaily child theme of Twenty Twenty-Five (UPSC PYQs, current affairs, X-Factor notes).
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 5.7
Version: 
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: twentytwentyfive
Text Domain: cd-child
Tags: 
*/


/* ---------------------------------------------------------------------
 * Base: links have no underline by default and are underlined on hover.
 * Overrides TT5's link styles (same :root specificity, loaded later);
 * component rules below can still opt out, e.g. pills and tabs.
 * ------------------------------------------------------------------- */

:root :where(a:not(.wp-element-button)) {
	text-decoration: none;
}

:root :where(a:not(.wp-element-button):hover),
:root :where(a:not(.wp-element-button):focus-visible) {
	text-decoration: underline;
}

/* Bold text uses semi-bold. */
strong,
b {
	font-weight: 600;
}

/* Flow layouts: no default gap between stacked blocks (TT5's blockGap gives 1.2rem).
 * Same selector as WordPress's global styles; style.css loads later, so this wins. */
:root :where(.is-layout-flow) > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* ---------------------------------------------------------------------
 * Typography: article body in New York (H2 too); other headings stay Manrope.
 * Font files/presets are registered in theme.json.
 * ------------------------------------------------------------------- */

.wp-block-post-content {
	font-family: var(--wp--preset--font-family--new-york);
	font-weight: 400;
}

.wp-block-post-content :is(h1, h3, h4, h5, h6) {
	font-family: var(--wp--preset--font-family--manrope);
}

/* ---------------------------------------------------------------------
 * Layout: sidebar + content shell (all templates)
 * ------------------------------------------------------------------- */

.cd-shell {
	gap: 0;
	margin-top: 0;
}

.cd-sidebar {
	background-color: #f5f2ec;
}

/* Space between the top bar and the page content (all templates). */
.cd-shell > .cd-main > main {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* Column widths (desktop; WordPress stacks columns below 782px — breakpoints stay in px like core). */
@media (min-width: 782px) {
	.wp-block-columns > .wp-block-column.cd-sidebar {
		flex: 0 0 15.625rem;
	}

	.wp-block-columns > .wp-block-column.cd-col-70 {
		flex: 0 1 70%;
	}

	.wp-block-columns > .wp-block-column.cd-col-30 {
		flex: 0 1 30%;
	}
}

.cd-sidebar-nav {
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--50) 0 var(--wp--preset--spacing--30); /* No side padding: menu rows run edge to edge. */
}

.cd-shell > .cd-sidebar {
	align-self: stretch;
}

@media (min-width: 782px) {
	.cd-shell > .cd-sidebar {
		position: sticky;
		top: var(--wp-admin--admin-bar--height, 0px);
		align-self: flex-start;
		height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
		overflow-y: auto;
	}
}

@media (max-width: 781px) {
	.cd-shell > .cd-sidebar {
		order: 2;
	}
}

/* ---------------------------------------------------------------------
 * Subject colours. PHP adds .cd-subject-{slug} (sets --cd-subject) and
 * .cd-subject (colours the text). Microthemes use their parent's colour.
 * ------------------------------------------------------------------- */

.cd-subject-economics {
	--cd-subject: #6A0DAD;
}

.cd-subject-polity {
	--cd-subject: #009494;
}

.cd-subject-science-and-technology {
	--cd-subject: #165DA3;
}

.cd-subject-environment {
	--cd-subject: #228B22;
}

.cd-subject-geography {
	--cd-subject: #A16207;
}

.cd-subject-art-and-culture {
	--cd-subject: #B8860B;
}

.cd-subject-international-relations {
	--cd-subject: #D97300;
}

.cd-subject-governance {
	--cd-subject: #7A1F2B;
}

.cd-subject-agriculture {
	--cd-subject: #65A30D;
}

.cd-subject-modern-history {
	--cd-subject: #8B4513;
}

.cd-subject-indian-society {
	--cd-subject: #BE185D;
}

.cd-subject-internal-security {
	--cd-subject: #00008B;
}

.cd-subject-social-justice {
	--cd-subject: #B45309;
}

.cd-subject-disaster-management {
	--cd-subject: #1F8F2A;
}

.cd-subject-world-history {
	--cd-subject: #8B4513;
}

.cd-subject-post-independence {
	--cd-subject: #8B4513;
}

.cd-subject-ethics {
	--cd-subject: #4169E1;
}

.cd-subject-off-topics {
	--cd-subject: #6B7280;
}

.cd-subject-csat {
	--cd-subject: #374151;
}

.cd-subject {
	color: var(--cd-subject);
}

/* Subject and microtheme names in bold wherever the news-header pattern is used. */
.cd-news-block .cd-subject-path .cd-subject {
	font-weight: 700;
}

/* News item: left border in the article's subject colour. */
.cd-news-block {
	border-left: 4px solid var(--cd-subject, #c3c2b7);
	padding-left: 1rem;
}

.cd-news-block > * + * {
	margin-block-start: 0.375rem;
}

/* Single news page: the title block sits at the top of the article, without the subject border. */
.single-news .cd-news-block {
	border-left: 0;
	padding-left: 0;
}

/* Front page feed: black date strip above each day's news. */
.cd-day-strip {
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0.625rem var(--wp--preset--spacing--30);
	border-radius: 0.375rem;
	background-color: #111111;
	color: #ffffff;
	font-family: var(--wp--preset--font-family--new-york); /* The article body serif. */
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
}

/* End of the front page feed: strip linking to /news/ (pattern news-more). */
.cd-news-more {
	margin-top: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border-radius: 0.5rem;
	background-color: #f5f2ec;
}

.cd-news-more-link a {
	font-weight: 600;
}

/* X-Factor Notes download card after every news article (pattern xfactor-cta): the whole card is one link. */
.cd-xf-cta {
	display: block;
	box-sizing: border-box; /* Padding inside the content width, like the article above. */
	margin-top: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--40);
	border-radius: 0.75rem;
	background-color: #111111;
	color: #ffffff;
	text-align: center;
	text-decoration: none;
}

.cd-xf-cta:hover,
.cd-xf-cta:focus-visible {
	color: #ffffff;
	text-decoration: none;
}

.cd-xf-cta > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

.cd-xf-cta-text {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.cd-xf-cta-text strong {
	color: #e9b96e;
}

/* The button look comes from .cd-cta; inside the link it is a label, not a second link. */
.cd-xf-cta .wp-block-button__link {
	display: inline-block;
}

.cd-xf-cta:hover .wp-block-button__link {
	background-color: #dca24c;
}

.cd-xf-cta-image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0.5rem;
}

/* Date, then type pill(s). */
.cd-news-meta {
	gap: 0.5rem;
}

/* ---------------------------------------------------------------------
 * News type colours (--cd-type), used by the /news/ type filter pills.
 * ------------------------------------------------------------------- */


.cd-filter-type {
	color: var(--cd-type, inherit);
}


.cd-type-op-ed {
	--cd-type: #7C3AED;
}

.cd-type-explained {
	--cd-type: #0369A1;
}

.cd-type-bills-act-laws {
	--cd-type: #B45309;
}

.cd-type-iocr {
	--cd-type: #4F46E5;
}

.cd-type-states {
	--cd-type: #0F766E;
}

.cd-type-sc-judgements {
	--cd-type: #9F1239;
}

.cd-type-national-parks-ws {
	--cd-type: #15803D;
}

.cd-type-first-record {
	--cd-type: #C2410C;
}

.cd-type-indigenous-made-in-india {
	--cd-type: #A16207;
}

/* GS paper Post Terms block: regular weight (TT5 sets post-terms to 600); long syllabus topics may wrap (TT5 sets post-terms links to nowrap). */
.wp-block-post-terms.taxonomy-gspaper {
	font-weight: 400;
}

.wp-block-post-terms.taxonomy-gspaper a {
	white-space: normal;
}

/* ---------------------------------------------------------------------
 * Easy Notification Bar (plugin): borders. Colours, message and button are
 * set in Appearance → Customize → Easy Notification Bar.
 * ------------------------------------------------------------------- */

.easy-notification-bar {
	border-top: 1px solid light-dark(rgb(36, 36, 36), transparent);
	border-bottom: 1px solid light-dark(rgb(36, 36, 36), transparent);
}

/* Message text colour. Easy Notification Bar 1.7 derives its text colour from the background
 * setting (bug in parse_text_color( $bg_color )), so the message would match the background. */
.easy-notification-bar .easy-notification-bar-message {
	color: #000000;
	font-weight: 500;
}

/* ---------------------------------------------------------------------
 * Top bar (parts/header.html) and sidebar toggle (assets/sidebar.js).
 * Desktop: ☰ collapses the sidebar (.cd-sidebar-collapsed on <html>).
 * Mobile: ☰ opens the sidebar as a drawer (.cd-sidebar-open on <html>).
 * Drawer rules are scoped to .cd-js so the sidebar stays visible without JS.
 * ------------------------------------------------------------------- */

.cd-topbar {
	align-items: center;
	gap: 1rem;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}

.cd-topbar-start {
	align-items: center;
	gap: 0.5rem;
}

.cd-sidebar-toggle,
.cd-sidebar-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 0.5rem;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.cd-sidebar-toggle:hover,
.cd-sidebar-close:hover {
	background-color: #ebe6dc;
}

.cd-sidebar-toggle:focus-visible,
.cd-sidebar-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

html:not(.cd-js) .cd-sidebar-toggle,
.cd-sidebar-close {
	display: none;
}

.cd-sidebar-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.4);
}

@media (min-width: 782px) {
	.cd-sidebar-collapsed .cd-shell > .cd-sidebar {
		display: none;
	}
}

@media (max-width: 781px) {
	.cd-js .cd-shell > .cd-sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 100001;
		width: min(85vw, 20rem);
		overflow-y: auto;
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}

	.cd-sidebar-open .cd-shell > .cd-sidebar {
		transform: none;
		visibility: visible;
		box-shadow: 0.5rem 0 1.5rem rgba(0, 0, 0, 0.2);
		transition: transform 0.25s ease;
	}

	.cd-js .cd-sidebar-close {
		display: inline-flex;
		align-self: flex-end;
		margin-right: var(--wp--preset--spacing--30); /* The sidebar has no side padding. */
	}

	.cd-sidebar-open body {
		overflow: hidden;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cd-shell > .cd-sidebar {
		transition: none !important;
	}
}

/* ---------------------------------------------------------------------
 * Sidebar menu: Navigation block "Study menu" (class cd-side-menu).
 * Vertical, no bullets, small Manrope; collapsible submenus open in place
 * (WordPress's "click" mode) instead of as fly-outs. Icons are WordPress's
 * own Dashicons font, set per item class (cd-icon-*).
 * ------------------------------------------------------------------- */

.cd-sidebar .cd-side-menu {
	width: 100%;
	gap: 0.125rem;
	font-size: 0.9375rem;
	font-weight: 500;
}

.cd-sidebar .cd-side-menu .wp-block-navigation-item {
	flex-wrap: wrap;
	width: 100%;
}

.cd-sidebar .cd-side-menu .wp-block-navigation-item__content {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 0.625rem;
	box-sizing: border-box; /* Padding inside the 100% width; parent items (column layout) would otherwise overflow. */
	width: 100%;
	padding: 0.5rem 2rem; /* The sidebar's former 1.25rem side padding + the link's 0.75rem. */
	border-radius: 0;
	color: inherit;
	text-align: left;
	text-decoration: none;
}

.cd-sidebar .cd-side-menu .wp-block-navigation-item__content:hover {
	background-color: #ebe6dc;
	text-decoration: none;
}

.cd-sidebar .cd-side-menu .wp-block-navigation-item__content:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

/* Current page: the whole row, edge to edge. */
.cd-sidebar .cd-side-menu .current-menu-item > .wp-block-navigation-item__content {
	background-color: #ffffff;
	font-weight: 700;
}

/* Icons (Dashicons). */
.cd-sidebar .cd-side-menu li[class*="cd-icon-"] > .wp-block-navigation-item__content::before {
	flex: 0 0 1.25rem;
	width: 1.25rem;
	font-family: dashicons;
	font-size: 1.125rem;
	line-height: 1;
	color: #6b6a65;
	speak: never;
	-webkit-font-smoothing: antialiased;
}

.cd-sidebar .cd-side-menu .cd-icon-home > .wp-block-navigation-item__content::before {
	content: "\f102";
}

.cd-sidebar .cd-side-menu .cd-icon-heatmap > .wp-block-navigation-item__content::before {
	content: "\f239";
}

.cd-sidebar .cd-side-menu .cd-icon-news > .wp-block-navigation-item__content::before {
	content: "\f488";
}

.cd-sidebar .cd-side-menu .cd-icon-subjects > .wp-block-navigation-item__content::before {
	content: "\f318"; /* dashicons-category */
}

.cd-sidebar .cd-side-menu .cd-icon-microthemes > .wp-block-navigation-item__content::before {
	content: "\f323";
}

.cd-sidebar .cd-side-menu .cd-icon-xfactor > .wp-block-navigation-item__content::before {
	content: "\f331";
}

/* WordPress's .open-always rule adds a 1.2rem gap between the parent and its submenu. */
.cd-sidebar .cd-side-menu .has-child.open-always {
	gap: 0;
}

.cd-sidebar .cd-side-menu .has-child > .wp-block-navigation-item__content {
	padding-right: 3.75rem; /* Keeps long labels clear of the chevron (2rem wide, 1.5rem from the edge). */
}

/* Collapse/expand chevron added by assets/sidebar.js next to each parent item
 * (positioned against the item, which WordPress already sets to position: relative). */
.cd-submenu-toggle {
	position: absolute;
	z-index: 2; /* Above the full-width parent link (WordPress gives it z-index: 1). */
	top: 0.25rem;
	right: 1.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 0.375rem;
	background: transparent;
	color: #6b6a65;
	cursor: pointer;
}

.cd-submenu-toggle:hover {
	background-color: #ebe6dc;
}

.cd-submenu-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.cd-submenu-toggle svg {
	transition: transform 0.15s ease;
}

.cd-sidebar .cd-side-menu .has-child.is-collapsed > .cd-submenu-toggle svg {
	transform: rotate(-90deg);
}

.cd-sidebar .cd-side-menu .has-child.is-collapsed > .wp-block-navigation__submenu-container {
	display: none;
}

/* Submenus open in place, indented under their parent. */
.cd-sidebar .cd-side-menu .has-child.open-always > .wp-block-navigation__submenu-container {
	gap: 0.125rem;
	padding: 0 0 0.25rem;
}

.cd-sidebar .cd-side-menu .has-child.open-always > .wp-block-navigation__submenu-container > .wp-block-navigation-item {
	margin: 0;
}

.cd-sidebar .cd-side-menu .has-child.open-always > .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.375rem 2rem 0.375rem 3.875rem; /* Indent under the parent (2rem + 1.875rem). */
}

.cd-sidebar .cd-side-menu .wp-block-navigation__submenu-container {
	min-width: 0;
}

.cd-sidebar .cd-side-menu .has-child > .wp-block-navigation__submenu-container {
	width: 100%;
}

/* Same while the parent is hovered or focused: WordPress's fly-out rules (navigation/style.css,
 * ".has-child:not(.open-on-click):hover" / ":focus-within") would shrink the submenu to fit its labels
 * (min 200px), so short sections (Microthemes, X-Factor) got narrower rows. Equal specificity, loads later. */
.cd-sidebar .cd-side-menu.wp-block-navigation .has-child:is(:hover, :focus-within) > .wp-block-navigation__submenu-container {
	width: 100%;
	min-width: 0;
}

/* ---------------------------------------------------------------------
 * Lists, cards and page furniture (templates + patterns)
 * ------------------------------------------------------------------- */

/* Question / news item in archive and subject-page loops. */
.cd-list-item {
	padding-block: var(--wp--preset--spacing--50);
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}

.cd-pagination {
	margin-top: var(--wp--preset--spacing--60);
}

/* Rounded featured image on single posts. */
.cd-featured-image img {
	border-radius: 0.5rem;
}

/* News header pattern (civilsdaily/news-header). */
.cd-news-title {
	font-weight: 600;
}

/* Page title on every single view (news, posts, X-Factor, pages): same size and weight as the news title. */
h1.wp-block-post-title {
	font-weight: 600;
}

/* Homepage. */
.cd-home > * + * {
	margin-block-start: var(--wp--preset--spacing--60);
}

.cd-featured-card {
	background-color: #f5f2ec;
	border-radius: 0.5rem;
	padding: var(--wp--preset--spacing--40);
}

.cd-featured-card .wp-block-post-featured-image img {
	border-radius: 0.375rem;
}


.cd-news-item {
	padding-block: 1.125rem;
	border-bottom: 1px solid #ecebe6;
}

/* ---------------------------------------------------------------------
 * PYQ questions: subject line, year pill, options, answer, question link
 * ------------------------------------------------------------------- */

/* PYQ lists grouped by microtheme: a heading per group; the repeated subject line is dropped. */
.cd-mt-heading {
	margin-block: var(--wp--preset--spacing--40) 0;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

.cd-in-group .cd-subject-path {
	display: none;
}

.cd-subject-path {
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #6b6a65;
}

.cd-year a {
	display: inline-block;
	padding: 0.25rem 0.875rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	text-decoration: none;
}

.cd-year a:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Prelims options (pattern pyq-prelims): a column of rows, each "(a)" label beside its text. */
.cd-options {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--style--block-gap);
}

.cd-option {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--style--block-gap);
}

.cd-option-label {
	font-weight: 600;
	min-width: 2em;
}

.cd-answer {
	font-weight: 600;
}

.cd-question-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.cd-question-link:hover {
	text-decoration: underline;
}

/* ---------------------------------------------------------------------
 * Filters and tabs: [cd_pyq_filters], [cd_subject_tabs], [cd_subject_heading]
 * ------------------------------------------------------------------- */

.cd-filters {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.cd-filter-divider {
	margin: 0.25rem 0;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--accent-6);
}

/* Active filters: result count, removable chips, Clear all. */
.cd-filter-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
	font-size: var(--wp--preset--font-size--small);
}

.cd-filter-total {
	margin-right: 0.25rem;
	font-weight: 600;
}

.cd-filter-hint {
	color: var(--wp--preset--color--accent-4);
}

.cd-filter-chip {
	padding: 0.125rem 0.625rem;
	border-radius: 0.375rem;
	background-color: #f5f2ec;
	color: inherit;
}

.cd-filter-chip:hover,
.cd-filter-chip:focus-visible {
	background-color: #ece4d6;
	text-decoration: none;
}

.cd-filter-clear {
	margin-left: 0.25rem;
	text-decoration: underline;
}

/* Multi-select dropdown (news filters: microthemes, syllabus topics). */
.cd-multi {
	position: relative;
}

.cd-multi > summary {
	cursor: pointer;
	list-style: none;
}

.cd-multi > summary::-webkit-details-marker {
	display: none;
}

.cd-multi > summary::after {
	content: "▾";
	margin-left: 0.25rem;
}

.cd-multi-panel {
	position: absolute;
	z-index: 10;
	top: calc(100% + 0.375rem);
	width: min(28rem, 90vw);
	padding: 0.75rem;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 0.5rem;
	box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

.cd-multi-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	max-height: 18rem;
	overflow-y: auto;
}

.cd-multi-option {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	font-size: var(--wp--preset--font-size--small);
	cursor: pointer;
}

.cd-multi-option.is-empty {
	opacity: 0.4;
	cursor: default;
}

.cd-multi-label {
	flex: 1;
}

.cd-multi-actions {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--wp--preset--color--accent-6);
}

.cd-multi-actions button {
	cursor: pointer;
	font-family: inherit;
}

.cd-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cd-filter {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.cd-filter:hover {
	border-color: currentColor;
}

.cd-filter.is-active {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.cd-filter-count {
	opacity: .65;
	font-size: .9em;
}

.cd-filter.is-empty {
	opacity: .4;
	cursor: default;
}

.cd-tabs {
	display: flex;
	gap: 0.25rem;
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}

.cd-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.625rem 1rem;
	margin-bottom: -1px;
	border-bottom: 2px solid transparent;
	text-decoration: none;
	font-weight: 500;
}

.cd-tab:hover {
	border-bottom-color: var(--wp--preset--color--accent-6);
}

.cd-tab.is-active {
	border-bottom-color: currentColor;
	font-weight: 700;
}

.cd-tabs + .cd-filters,
.cd-tabs ~ p .cd-filters {
	margin-top: 1rem;
}

/* ---------------------------------------------------------------------
 * Microtheme bar chart: [cd_microtheme_chart], heat map panel
 * ------------------------------------------------------------------- */

.cd-bar-chart {
	margin: 1.5rem 0 0;
}

.cd-bar-chart figcaption {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	margin-bottom: 0.625rem;
}

.cd-bar-chart ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.cd-bar a {
	display: grid;
	grid-template-columns: minmax(7.5rem, 34%) 1fr 3ch;
	align-items: center;
	gap: 0.625rem;
	padding: 0.1875rem 0.25rem;
	border-radius: 0.25rem;
	color: inherit;
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.25;
}

.cd-bar a:hover {
	background: #f1efe9;
}

.cd-bar-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cd-bar-track {
	height: 0.875rem;
}

.cd-bar-fill {
	display: block;
	height: 100%;
	min-width: 2px;
	background: #2a78d6;
	border-radius: 0 0.25rem 0.25rem 0;
}

.cd-bar a:hover .cd-bar-fill {
	background: #1d5fae;
}

.cd-bar-value {
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: #52514e;
}

.cd-bar.is-current .cd-bar-label {
	font-weight: 700;
}

.cd-bar.is-current a {
	background: #f1efe9;
}

@media (max-width: 600px) {
	.cd-bar a {
		grid-template-columns: 40% 1fr 3ch;
	}
}

/* ---------------------------------------------------------------------
 * Heat map: [cd_heatmap] and assets/heatmap.js
 * ------------------------------------------------------------------- */

.cd-heat-hint {
	font-size: var(--wp--preset--font-size--small);
	opacity: .75;
	margin: 0.75rem 0;
}

.cd-heat-scroll {
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 0.25rem;
}

.cd-heat {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

.cd-heat th,
.cd-heat td {
	padding: 0;
	border-top: 1px solid #ecebe6;
	text-align: center;
	font-weight: 400;
}

.cd-heat thead th {
	padding: 0.5rem 0.125rem;
	font-size: 0.75rem;
	color: #52514e;
	border-top: 0;
}

.cd-heat .cd-heat-corner,
.cd-heat .cd-heat-subject {
	position: sticky;
	left: 0;
	z-index: 1;
	background: #fff;
	text-align: left;
	min-width: 10.625rem;
	border-right: 1px solid #ecebe6;
}

.cd-heat .cd-heat-corner {
	padding-left: 0.75rem;
}

.cd-heat-subject a {
	display: block;
	padding: 0.5rem 0.75rem;
	color: inherit;
	text-decoration: none;
	font-weight: 500;
}

.cd-heat-subject a:hover {
	text-decoration: underline;
}

.cd-heat td {
	border-left: 2px solid #fff;
	min-width: 2.125rem;
}

.cd-heat td a,
.cd-heat td span {
	display: block;
	line-height: 2.125rem;
	text-decoration: none;
}

.cd-heat td a:hover {
	outline: 2px solid #0b0b0b;
	outline-offset: -2px;
}

.cd-heat .is-zero {
	color: #c3c2b7;
}

/* .cd-heat parent: outranks ".cd-heat thead th" and ".cd-heat td" above. */
.cd-heat .cd-heat-total {
	font-weight: 700;
	padding: 0 0.75rem;
	text-align: right;
}

.cd-heat-legend {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: 0.75rem;
	font-size: 0.75rem;
	color: #52514e;
	flex-wrap: wrap;
}

.cd-heat-sw {
	min-width: 1.75rem;
	padding: 0.125rem 0.25rem;
	text-align: center;
	border-radius: 0.125rem;
	font-variant-numeric: tabular-nums;
}

.cd-heat-sw.is-zero {
	border: 1px solid #ecebe6;
}

.cd-heat-panel {
	margin-top: 2rem;
	scroll-margin-top: 1.5rem;
}

.cd-heat-panel-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.875rem;
}

.cd-heat-panel-head h2 {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
}

.cd-heat-panel-head p {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	opacity: .75;
}

.cd-heat-panel-head button {
	cursor: pointer;
	background: none;
}

.cd-heat-questions {
	margin-top: 1.75rem;
	scroll-margin-top: 1.5rem;
}

.cd-heat-questions-head {
	font-size: var(--wp--preset--font-size--large);
	margin: 0 0 0.5rem;
}

/* Questions at the reading width, aligned with the chart above (the panel itself is wider). */
.cd-heat-list {
	max-width: var(--wp--style--global--content-size);
}

.cd-heat-more {
	margin-top: 1.25rem;
	cursor: pointer;
	background: none;
}

.cd-heat tr.is-active .cd-heat-subject a {
	font-weight: 700;
}

.cd-heat tr.is-active .cd-heat-subject {
	box-shadow: inset 3px 0 0 #2a78d6;
}

.cd-heat td a.is-active {
	outline: 2px solid #0b0b0b;
	outline-offset: -2px;
}

/* Heat map shades, light to deep blue (cd-heat-l1 … l8, picked in PHP by share of the busiest cell). */

.cd-heat-l1 {
	background-color: #b2c5dc;
	color: #0b0b0b;
}

.cd-heat-l2 {
	background-color: #9ab1cd;
	color: #0b0b0b;
}

.cd-heat-l3 {
	background-color: #839dbe;
	color: #0b0b0b;
}

.cd-heat-l4 {
	background-color: #6b89af;
	color: #0b0b0b;
}

.cd-heat-l5 {
	background-color: #5475a0;
	color: #ffffff;
}

.cd-heat-l6 {
	background-color: #3c6291;
	color: #ffffff;
}

.cd-heat-l7 {
	background-color: #254e82;
	color: #ffffff;
}

.cd-heat-l8 {
	background-color: #0d3a73;
	color: #ffffff;
}

/* ---------------------------------------------------------------------
 * X-Factor notes: single-column boxes from the source document (PYQs, Quotes…).
 * ------------------------------------------------------------------- */

.cd-xf-box {
	margin-block: 1.5rem;
	padding: 1rem 1.25rem;
	background-color: #f5f2ec;
	border-left: 4px solid var(--cd-subject, #c3c2b7);
	border-radius: 0.5rem;
}

/* Table of contents (Details block, class cd-toc) at the top of X-Factor notes. */
.cd-toc {
	margin-block: 1.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 0.5rem;
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--small);
}

.cd-toc > summary {
	cursor: pointer;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium);
}

.cd-toc ul {
	margin: 0.5rem 0 0;
	padding-left: 1.25rem;
}

/* Headings jumped to from the contents clear the top bar. */
.wp-block-post-content :is(h2, h3)[id] {
	scroll-margin-top: 1.5rem;
}

/* ---------------------------------------------------------------------
 * X-Factor notes reading layout (single-x-factor-mains.html).
 * ------------------------------------------------------------------- */

.cd-xf {
	padding: 0 var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}

.cd-xf-layout {
	display: grid;
	grid-template-columns: minmax(0, 42rem);
	justify-content: center;
	gap: 3rem;
}

@media (min-width: 1100px) {
	.cd-xf-layout {
		grid-template-columns: 15rem minmax(0, 42rem);
		justify-content: start; /* panel flush left, article beside it */
	}
}

/* Header: subject line, title, reading time. */
.cd-xf-head {
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}

.cd-xf-head .wp-block-post-title {
	margin-top: 0.5rem;
}

.cd-xf-meta {
	margin-top: 0.5rem;
	color: #6b6a65;
	font-size: var(--wp--preset--font-size--small);
}

.cd-xf-head .cd-subject-path .cd-subject {
	font-weight: 700;
}

/* Body typography. */
.cd-xf-body {
	font-size: 1.1875rem;
	line-height: 1.65;
}

.cd-xf-body > * + * {
	margin-block-start: 1.1em;
}

.cd-xf-body h2 {
	margin-block-start: 3rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--wp--preset--color--accent-6);
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.25;
}

.cd-xf-body h3 {
	margin-block-start: 2rem;
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.3;
}

.cd-xf-body h4,
.cd-xf-body h5 {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.35;
}

.cd-xf-body :is(h2, h3, h4, h5) + * {
	margin-block-start: 0.5rem;
}

.cd-xf-body li {
	margin-top: 0.4rem;
}

.cd-xf-body li > ul,
.cd-xf-body li > ol {
	margin-top: 0.25rem;
	padding-left: 1.25rem;
}

.cd-xf-body strong {
	color: #1f1d1a;
}

/* Boxes (PYQs, Quotes…) read as asides. */
.cd-xf-body .cd-xf-box {
	font-size: 0.9375rem;
	line-height: 1.55;
}

.cd-xf-body .cd-xf-box > :is(h2, h3, h4):first-child {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--cd-subject, #6b6a65);
}

/* Tables: zebra rows and a sticky header on wider screens (WordPress's table block already scrolls sideways on phones). */
.cd-xf-body .wp-block-table {
	font-size: 0.9375rem;
	line-height: 1.5;
}

.cd-xf-body .wp-block-table th {
	background-color: #f5f2ec;
	text-align: left;
}

.cd-xf-body .wp-block-table tbody tr:nth-child(even) {
	background-color: #faf9f6;
}

@media (min-width: 782px) {
	.cd-xf-body .wp-block-table thead th {
		position: sticky;
		top: 0;
		z-index: 1;
	}
}

/* Images: centred, rounded. */
.cd-xf-body .wp-block-image img {
	border-radius: 0.375rem;
}

/* Back to top: small, right-aligned, after each section. */
.cd-xf-body .cd-back-top {
	margin-block-start: 1.5rem;
	text-align: right;
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--small);
}

.cd-xf-body .cd-back-top a {
	color: #6b6a65;
}

/* In-page contents: used on narrower screens; the side panel replaces it on wide ones. */
@media (min-width: 1100px) {
	.cd-xf-body > .cd-toc {
		display: none;
	}
}

/* Side panel: sticky "On this page" with the current section highlighted (assets/toc.js). */
.cd-xf-aside {
	display: none;
}

@media (min-width: 1100px) {
	.cd-xf-aside {
		display: block;
	}
}

.cd-toc-panel {
	position: sticky;
	top: 1.5rem;
	max-height: calc(100vh - 3rem);
	overflow-y: auto;
	padding-left: 1rem;
	border-left: 1px solid var(--wp--preset--color--accent-6);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.cd-toc-panel-title {
	margin: 0 0 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6b6a65;
}

.cd-toc-panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cd-toc-panel li {
	margin-top: 0.375rem;
}

.cd-toc-panel ul ul {
	margin-top: 0.25rem;
	padding-left: 0.75rem;
}

.cd-toc-panel a {
	display: block;
	color: #52514e;
}

.cd-toc-panel a.is-current {
	margin-left: calc(-1rem - 1px);
	padding-left: calc(1rem - 2px);
	border-left: 3px solid var(--cd-subject, #2a78d6);
	color: #1f1d1a;
	font-weight: 700;
}

/* Previous / next chapter. */
.cd-chapter-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--accent-6);
}

.cd-chapter-nav-link {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 0.5rem;
}

.cd-chapter-nav-link:hover {
	border-color: var(--cd-subject, currentColor);
	text-decoration: none;
}

.cd-chapter-nav-link.is-next {
	text-align: right;
}

.cd-chapter-nav-label {
	color: #6b6a65;
	font-size: var(--wp--preset--font-size--small);
}

.cd-chapter-nav-title {
	font-weight: 700;
	color: var(--cd-subject, inherit);
}

/* ---------------------------------------------------------------------
 * Landing page blocks (webinar post): hero cover, pills, CTA buttons,
 * theme cards, story, speaker, FAQ, closing panel. Class names are set on the blocks.
 * ------------------------------------------------------------------- */

.cd-landing > * + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

.cd-landing > h2 {
	margin-block-start: var(--wp--preset--spacing--60);
}

.cd-landing > h2 + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* Hero (Cover block). */
.cd-hero {
	border-radius: 0.75rem;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
	text-align: left;
}

.cd-hero .wp-block-cover__inner-container > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

.cd-hero-eyebrow {
	color: #e9b96e;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.cd-hero-title {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	line-height: 1.1;
}

.cd-hero-lead {
	max-width: 36rem;
	color: rgba(255, 255, 255, 0.85);
}

.cd-hero .cd-pill {
	background-color: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(233, 185, 110, 0.5);
}

.cd-hero .cd-cta-note {
	color: rgba(255, 255, 255, 0.75);
}

.cd-pills {
	gap: 0.5rem;
}

.cd-pill {
	padding: 0.375rem 0.875rem;
	border-radius: 999px;
	font-weight: 600;
}

.cd-cta .wp-block-button__link {
	background-color: #e9b96e;
	color: #111111;
	border-radius: 0.625rem;
	font-weight: 700;
}

.cd-cta .wp-block-button__link:hover {
	background-color: #dca24c;
	color: #111111;
}

.cd-cta-note {
	margin-top: 0.6rem;
}

.cd-landing .wp-block-list > li + li {
	margin-block-start: 0.4rem;
}

/* Three learning themes (Columns block). */
.cd-themes {
	gap: var(--wp--preset--spacing--30);
}

.cd-theme-card {
	background-color: #f5f2ec;
	border-radius: 0.75rem;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.cd-theme-card > * + * {
	margin-block-start: 0.75rem;
}

.cd-theme-card h3 {
	font-weight: 600;
	line-height: 1.25;
}

.cd-theme-card .wp-block-list {
	padding-left: 1.1rem;
	font-size: var(--wp--preset--font-size--small);
}

.cd-theme-num {
	color: #c48a2e;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1;
}

.cd-story {
	border-top: 2px solid #e9b96e;
	border-bottom: 2px solid #e9b96e;
	text-align: left;
	font-size: var(--wp--preset--font-size--x-large);
}

/* Speaker (Media & Text block). */
.wp-block-media-text.cd-speaker {
	grid-template-columns: 15rem 1fr;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--40);
	border: 1px solid #ece4d6;
	border-radius: 0.75rem;
}

.cd-speaker .wp-block-media-text__media img {
	border-radius: 0.5rem;
}

.cd-speaker .wp-block-media-text__content {
	padding: 0;
}

.cd-speaker .wp-block-media-text__content > * + * {
	margin-block-start: 0.6rem;
}

.cd-speaker-eyebrow {
	color: #c48a2e;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.cd-speaker h3 {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
}

.cd-speaker .cd-speaker-role {
	margin-block-start: 0;
	color: var(--wp--preset--color--accent-4);
}

/* FAQ (Details blocks). */
.cd-faq .wp-block-details {
	border-bottom: 1px solid #ece4d6;
	padding-block: 0.875rem;
}

.cd-faq .wp-block-details:first-child {
	border-top: 1px solid #ece4d6;
}

.cd-faq summary {
	font-weight: 600;
	cursor: pointer;
}

.cd-faq .wp-block-details > p {
	margin-block-start: 0.5rem;
}

.cd-final-cta {
	background-color: #111111;
	color: #ffffff;
	border-radius: 0.75rem;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	scroll-margin-top: 1.5rem;
}

.cd-final-when {
	color: #e9b96e;
}

/* ---------------------------------------------------------------------
 * Footer (patterns/footer.php): address, social icons, location map.
 * ------------------------------------------------------------------- */

.cd-footer-address {
	max-width: 22rem;
	color: var(--wp--preset--color--accent-4);
}

.cd-footer-map {
	width: min(100%, 20rem);
	margin: 0;
}

.cd-footer-map iframe {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 0.5rem;
}

.cd-footer-map figcaption {
	margin-top: 0.375rem;
	font-size: var(--wp--preset--font-size--small);
}

/* Main footer area (logo, address, map, links): its spacing, also what separates it from the page content. */
.cd-footer-main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
}

/* Social bar: dark, full width of the content column, white text and icons. */
.cd-footer-social-bar {
	padding-block: var(--wp--preset--spacing--30);
	background-color: #111111;
	color: #ffffff;
}

.cd-footer-social-bar .wp-block-social-links.is-style-logos-only .wp-social-link {
	color: #ffffff; /* Logos-only style colours each icon by brand; white on the dark bar. */
}

/* Copyright line below it. */
.cd-footer-bottom {
	padding-block: var(--wp--preset--spacing--30);
}
