/* Grade theme */

:root {
	--grade-primary: #2563eb;
	--grade-secondary: #7c3aed;
	--grade-text: #1f2933;
	--grade-heading: #0b1220;
	--grade-muted: #6b7280;
	--grade-surface: #ffffff;
	--grade-border: #e5e7eb;
	/* No --grade-body-bg default here. Declared on :root it would beat the value
	   the options emit whenever the theme stylesheet loads last, which is how a
	   set page background silently stayed white. The fallback lives in var(). */
	--grade-content-width: 1200px;
	--grade-radius: 8px;
	--grade-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--grade-font-heading: var(--grade-font-body);
	--grade-font-size: 17px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.grade-theme {
	margin: 0;
	font-family: var(--grade-font-body);
	font-size: var(--grade-font-size);
	line-height: 1.65;
	color: var(--grade-text);
	/* Long-hand: the shorthand resets background-image, which wipes any
	   page-background layers set in the options. */
	background-color: var(--grade-body-bg, #ffffff);
	-webkit-font-smoothing: antialiased;
}

body.grade-layout-boxed .grade-site {
	max-width: calc(var(--grade-site-width, var(--grade-content-width)) + 160px);
	margin: 0 auto;
	background: var(--grade-boxed-bg, var(--grade-surface));
	box-shadow: 0 0 40px rgba(0,0,0,.06);
}

img, video, iframe { max-width: 100%; height: auto; }
img { display: block; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--grade-font-heading);
	color: var(--grade-heading);
	line-height: 1.22;
	margin: 0 0 .6em;
	font-weight: 700;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.6rem); }
h4 { font-size: 1.2rem; }

p { margin: 0 0 1.15em; }
a { color: var(--grade-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--grade-secondary); }

blockquote {
	margin: 1.6em 0; padding: 1em 1.4em; border-left: 4px solid var(--grade-primary);
	background: rgba(0,0,0,.02); font-size: 1.05em;
}
code, pre { font-family: Menlo, Consolas, monospace; font-size: .9em; }
pre { padding: 1em; background: #0f172a; color: #e2e8f0; border-radius: var(--grade-radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
th, td { padding: .65em .8em; border: 1px solid var(--grade-border); text-align: left; }
th { background: rgba(0,0,0,.03); font-weight: 600; }

/* ---------- Layout ---------- */
.grade-site { display: flex; flex-direction: column; min-height: 100vh; }
.grade-main-content {
	flex: 1;
	background: var(--grade-content-bg, transparent);
	padding: var(--grade-content-padding, 0);
}

/*
 * With the header and footer hidden - a coming-soon page, or a page that has
 * switched them off - the content is the whole page, so it gets the whole
 * window rather than sitting in a column with empty space above and below.
 */
body.grade-no-chrome .grade-main-content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
}

body.grade-no-chrome .grade-main-content > * { width: 100%; }
.grade-wrap {
	width: 100%;
	/* Grade > Options > Layout owns this; the Customizer value is the fallback. */
	max-width: var(--grade-site-width, var(--grade-content-width));
	margin: 0 auto;
	padding: 0 var(--grade-gutter, 20px);
}

.grade-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 48px;
	padding-top: 48px;
	padding-bottom: 64px;
	align-items: start;
}
.grade-layout--full, body.grade-no-sidebar .grade-layout { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 900px) {
	.grade-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

/* ---------- Header ---------- */
.grade-header {
	background: var(--grade-header-bg, var(--grade-surface));
	border-bottom: var(--grade-header-border-size, 1px) solid var(--grade-header-border, var(--grade-border));
}
.grade-header.is-sticky { position: sticky; top: 0; z-index: 100; }
.grade-header.is-sticky.is-scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.07); }
.grade-header.is-sticky.is-scrolled { background: var(--grade-header-sticky-bg, var(--grade-header-bg, var(--grade-surface))); }
.grade-header.is-sticky.is-scrolled .grade-header__inner { min-height: var(--grade-header-sticky-height, var(--grade-header-height, 76px)); }
body.admin-bar .grade-header.is-sticky { top: 32px; }
@media (max-width: 782px) { body.admin-bar .grade-header.is-sticky { top: 46px; } }

.grade-header__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	min-height: var(--grade-header-height, 76px);
	padding: var(--grade-header-padding, 12px 0);
}
.grade-header__brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.grade-header__brand .custom-logo-link { display: inline-block; }
.grade-header__brand .custom-logo {
	max-height: var(--grade-logo-max-height, 56px);
	width: var(--grade-logo-width, auto);
	margin: var(--grade-logo-margin, 0);
}
.grade-header__title { font-size: 1.4rem; font-weight: 800; color: var(--grade-heading); text-decoration: none; }
.grade-header__tagline { margin: 0; font-size: .8125rem; color: var(--grade-muted); }

.grade-header__toggle {
	display: none; background: transparent; border: 0; padding: 10px; cursor: pointer;
	color: var(--grade-mobile-toggle-color, var(--grade-heading));
}
.grade-header__bars, .grade-header__bars::before, .grade-header__bars::after {
	display: block; width: 24px; height: 2px; background: currentColor; position: relative;
}
.grade-header__bars::before, .grade-header__bars::after { content: ''; position: absolute; left: 0; }
.grade-header__bars::before { top: -7px; }
.grade-header__bars::after { top: 7px; }

.grade-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--grade-menu-gap, 28px); }
.grade-menu li { position: relative; }
.grade-menu a { color: var(--grade-menu-color, var(--grade-text)); text-decoration: none; font-weight: 500; }
.grade-menu a:hover { color: var(--grade-menu-hover, var(--grade-primary)); }
.grade-menu .current-menu-item > a,
.grade-menu .current-menu-ancestor > a { color: var(--grade-menu-active, var(--grade-primary)); }
.grade-menu .current-menu-item > a { box-shadow: inset 0 -2px 0 var(--grade-menu-highlight, transparent); }
.grade-menu .sub-menu {
	list-style: none; margin: 0; padding: .5em 0; position: absolute; top: calc(100% + 10px); left: 0;
	min-width: var(--grade-submenu-width, 210px);
	background: var(--grade-submenu-bg, var(--grade-surface));
	border: 1px solid var(--grade-submenu-divider, var(--grade-border));
	border-radius: var(--grade-submenu-radius, var(--grade-radius));
	box-shadow: 0 10px 30px rgba(0,0,0,.09);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 60;
}
.grade-menu li:hover > .sub-menu, .grade-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.grade-menu .sub-menu a {
	display: block;
	padding: var(--grade-submenu-padding, .5em 1.2em);
	color: var(--grade-submenu-color, var(--grade-text));
}
.grade-menu .sub-menu a:hover { background: var(--grade-submenu-hover-bg, transparent); }
.grade-menu .sub-menu .sub-menu { top: 0; left: 100%; }
.grade-menu__sub-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 4px 8px; color: inherit; }

/*
 * The header's mobile rules are NOT here. They live in
 * Grade_Theme::header_breakpoint_css(), because the width they switch at is
 * the "Header Breakpoint" setting and a media query cannot read a custom
 * property. This block used to be hard-coded at 860px, which is why that
 * setting did nothing.
 */

/* ---------- Page title ---------- */
.grade-page-title {
	background: var(--grade-ptb-bg, rgba(0,0,0,.025));
	border-bottom: 1px solid var(--grade-ptb-border, var(--grade-border));
	padding: var(--grade-ptb-padding, 44px 0);
	min-height: var(--grade-ptb-height, auto);
	text-align: var(--grade-ptb-align, left);
	position: relative;
}
.grade-page-title::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--grade-ptb-overlay, transparent);
	pointer-events: none;
}
.grade-page-title > * { position: relative; }

/*
 * A transparent header is drawn over the page, not above it, so on a page with
 * no hero this band is what it lands on. The band owns the clearance: adding it
 * to the page instead would push the hero pages down too, and they are the ones
 * the setting is for.
 *
 * The clearance is a transparent top border rather than padding. Padding is set
 * from `ptb_padding` as a shorthand, so adding to it means either overwriting
 * whatever the site chose or inventing a second variable that has to be kept in
 * step with the first. A border composes with any padding, and a background
 * paints under a transparent border, so the band's colour still runs the full
 * height behind the header.
 */
.grade-ptb--under-header {
	border-top: var(--grade-header-height, 76px) solid transparent;
}

/*
 * Any top padding on the content wrapper would open a gap above the band, and
 * the header - which is drawn over the page, not inside the wrapper - would
 * float across it. The band is the top of the page in this arrangement, so the
 * wrapper yields its top padding to it.
 */
.grade-main-content:has(> .grade-ptb--under-header) { padding-top: 0; }

.grade-page-title__heading { margin: 0; color: var(--grade-ptb-title-color, inherit); }
.grade-page-title__desc { color: var(--grade-ptb-subtitle-color, var(--grade-muted)); margin-top: .5em; }
.grade-breadcrumbs { margin-top: .8em; font-size: .875rem; color: var(--grade-breadcrumb-color, var(--grade-muted)); display: flex; flex-wrap: wrap; gap: .5em; align-items: center; }
.grade-breadcrumbs a { color: var(--grade-breadcrumb-link, var(--grade-muted)); text-decoration: none; }
.grade-breadcrumbs a:hover { color: var(--grade-primary); }
.grade-breadcrumbs__sep { opacity: .5; }

/* ---------- Entries ---------- */
.grade-entry__thumb { margin-bottom: 28px; border-radius: var(--grade-radius); overflow: hidden; }
.grade-entry__content > *:first-child { margin-top: 0; }
.grade-entry__tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: .5em; }
.grade-entry__tags a {
	font-size: .8125rem; padding: .3em .8em; background: rgba(0,0,0,.04);
	border-radius: 100px; text-decoration: none; color: var(--grade-muted);
}
.entry-meta { display: flex; flex-wrap: wrap; gap: .5em; font-size: .875rem; color: var(--grade-muted); margin-bottom: 1em; }

/* Columns come from Blog > Columns; auto-fill is only the fallback. */
.grade-archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }
.grade-card {
	background: var(--grade-surface); border: 1px solid var(--grade-border);
	border-radius: var(--grade-radius); overflow: hidden; display: flex; flex-direction: column;
	transition: transform .2s ease, box-shadow .2s ease;
}
.grade-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.grade-card__thumb img { width: 100%; height: 210px; object-fit: cover; }
.grade-card__body { padding: 22px; display: flex; flex-direction: column; gap: .5em; flex: 1; }
.grade-card__title { margin: 0; font-size: 1.2rem; }
.grade-card__title a { color: var(--grade-heading); text-decoration: none; }
.grade-card__title a:hover { color: var(--grade-primary); }
.grade-card__excerpt { color: var(--grade-text); font-size: .9375rem; }
.grade-card__excerpt p { margin: 0; }
.grade-card__more { margin-top: auto; font-weight: 600; text-decoration: none; font-size: .9375rem; }

/* ---------- Sidebar & widgets ---------- */
.grade-sidebar-area { display: flex; flex-direction: column; gap: 32px; }
.widget { background: var(--grade-surface); border: 1px solid var(--grade-border); border-radius: var(--grade-radius); padding: 22px; }
.widget-title { margin: 0 0 .8em; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5em; }
.widget ul a { text-decoration: none; color: var(--grade-text); }
.widget ul a:hover { color: var(--grade-primary); }

/* ---------- Search ---------- */
.grade-search { display: flex; gap: 8px; }
.grade-search__field {
	flex: 1; padding: .7em .9em; border: 1px solid var(--grade-border);
	border-radius: var(--grade-radius); font: inherit; font-size: .9375rem;
}
.grade-search__field:focus { outline: none; border-color: var(--grade-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.grade-search__submit {
	padding: .7em 1.1em; background: var(--grade-primary); border: 0;
	border-radius: var(--grade-radius); color: #fff; cursor: pointer; font-size: 1rem;
}

/* ---------- Footer ---------- */
.grade-footer {
	margin-top: auto;
	background: var(--grade-footer-bg, #0f1420);
	color: var(--grade-footer-color, #b7c0d0);
	border-top: 1px solid var(--grade-footer-border, transparent);
}
.grade-footer a { color: var(--grade-footer-link, #dbe3f0); }
.grade-footer a:hover { color: var(--grade-footer-link-hover, #fff); }
.grade-footer .widget { background: transparent; border: 0; padding: 0; }
.grade-footer .widget-title { color: #fff; }
.grade-footer .widget ul a { color: var(--grade-footer-link, #b7c0d0); }
.grade-footer__widgets {
	display: grid;
	grid-template-columns: repeat(var(--grade-footer-columns, 4), minmax(0, 1fr));
	gap: 40px;
	padding: var(--grade-footer-padding, 56px 0 40px);
}
.grade-footer__bar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	padding: var(--grade-copyright-padding, 24px 0);
	border-top: 1px solid var(--grade-footer-divider, rgba(255,255,255,.09));
	background: var(--grade-copyright-bg, transparent);
	color: var(--grade-copyright-color, inherit);
	justify-content: var(--grade-copyright-align, space-between);
	font-size: .875rem;
}
.grade-menu--footer { gap: 20px; }
.grade-menu--footer a { color: var(--grade-footer-link, #b7c0d0); }

/* ---------- 404 & none ---------- */
.grade-404 { text-align: center; padding: 90px 20px 110px; max-width: 620px; }
.grade-404__code { font-size: clamp(4rem, 3rem + 8vw, 8rem); margin: 0; line-height: 1; font-weight: 800; color: var(--grade-primary); }
.grade-404__title { margin-top: .2em; }
.grade-404__text { color: var(--grade-muted); }
.grade-404 .grade-search { max-width: 420px; margin: 28px auto; }
.grade-none { padding: 40px 0; }

.grade-btn-link {
	display: inline-block; padding: .75em 1.6em; background: var(--grade-primary);
	color: #fff; border: 0; border-radius: var(--grade-radius);
	text-decoration: none; font-weight: 600; cursor: pointer;
}
.grade-btn-link:hover { background: var(--grade-secondary); color: #fff; }

/* ---------- Comments ---------- */
.grade-comments { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--grade-border); }
.grade-comments__list { list-style: none; margin: 0 0 32px; padding: 0; }
.grade-comments__list .children { list-style: none; padding-left: 32px; }
.grade-comments__list li { margin-bottom: 24px; }
.comment-body { background: rgba(0,0,0,.02); border-radius: var(--grade-radius); padding: 18px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: .8125rem; color: var(--grade-muted); margin: .4em 0 .8em; }
.comment-form { display: flex; flex-direction: column; gap: 14px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: .7em .9em; border: 1px solid var(--grade-border);
	border-radius: var(--grade-radius); font: inherit;
}
.comment-form label { font-weight: 600; font-size: .875rem; display: block; margin-bottom: .3em; }

/* ---------- Pagination ---------- */
.pagination, .comments-pagination { margin-top: 48px; }
.pagination .nav-links, .comments-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers, .comments-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
	padding: 0 12px; border: 1px solid var(--grade-border); border-radius: var(--grade-radius);
	text-decoration: none; color: var(--grade-text);
}
.pagination .page-numbers.current { background: var(--grade-primary); border-color: var(--grade-primary); color: #fff; }

.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 48px; }
.post-navigation a { display: block; padding: 18px; border: 1px solid var(--grade-border); border-radius: var(--grade-radius); text-decoration: none; color: var(--grade-heading); }
.post-navigation .nav-next { text-align: right; }
.post-navigation .nav-label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grade-muted); margin-bottom: .3em; }
@media (max-width: 640px) { .post-navigation .nav-links { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
	.grade-card:hover { transform: none; }
}

/* ---------- Top bar ---------- */
.grade-topbar {
	background: var(--grade-topbar-bg, var(--grade-heading));
	color: var(--grade-topbar-color, #fff);
	font-size: .8125rem;
}

.grade-topbar a { color: inherit; }

.grade-topbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 8px;
	padding-bottom: 8px;
}

.grade-topbar__side--right { margin-left: auto; text-align: right; }

@media (max-width: 600px) {
	.grade-topbar__inner { justify-content: center; }
	.grade-topbar__side--right { margin-left: 0; text-align: center; }
}


/* ---------- Focus ---------- */
/*
 * Only the search field had a focus style; everything else fell back to the
 * user agent's, which is invisible against several of the theme's surfaces.
 * :focus-visible keeps it off mouse clicks and on for keyboard users.
 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--grade-primary);
	outline-offset: 2px;
	border-radius: 2px;
}

.grade-footer :where(a, button):focus-visible,
.grade-topbar :where(a, button):focus-visible {
	outline-color: currentColor;
}

/* ---------- Read more ---------- */
/*
 * Every card ended in an identical "Read more", which is meaningless read out
 * of context. The title is appended for screen readers only.
 */
.grade-card__more .screen-reader-text { position: absolute; }

/* The brand line is an h1 on the front page and a div elsewhere; neither
   should inherit heading sizing. */
.grade-header__brandline { margin: 0; font-size: inherit; font-weight: inherit; line-height: 1; }

/* ==========================================================================
   Settings that previously had no implementation
   --------------------------------------------------------------------------
   Everything below backs a control in Grade > Options that saved a value and
   changed nothing. Grouped by the section it belongs to.
   ========================================================================== */

/* ---------- Header: layout ---------- */
.grade-header--centred .grade-header__inner { flex-wrap: wrap; justify-content: center; text-align: center; }
.grade-header--centred .grade-header__brand { align-items: center; }
.grade-header--centred .grade-header__nav { flex-basis: 100%; display: flex; justify-content: center; }

.grade-header--split .grade-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.grade-header--split .grade-header__brand { grid-column: 2; align-items: center; text-align: center; }
.grade-header--split .grade-header__nav { grid-column: 1; grid-row: 1; }
.grade-header--split .grade-header__actions { grid-column: 3; grid-row: 1; justify-self: end; }

.grade-header--stacked .grade-header__inner { flex-direction: column; align-items: center; gap: 12px; text-align: center; }

/* ---------- Header: transparent ---------- */
/* Sits over the first section rather than above it. Only meaningful at the top
   of the page, so the scrolled state hands the background back. */
.grade-header.is-transparent {
	position: absolute; left: 0; right: 0; z-index: 100;
	background: transparent; border-bottom-color: transparent;
}
.grade-header.is-transparent.is-scrolled {
	position: fixed;
	background: var(--grade-header-sticky-bg, var(--grade-header-bg, var(--grade-surface)));
	border-bottom-color: var(--grade-header-border, var(--grade-border));
}
body.admin-bar .grade-header.is-transparent { top: 32px; }

/* ---------- Header: shrink and solid-on-scroll ---------- */
.grade-header.is-shrink .grade-header__inner { transition: min-height .2s ease, padding .2s ease; }
.grade-header.is-shrink.is-scrolled .grade-header__inner {
	min-height: var(--grade-header-sticky-height, 60px);
	padding-top: 0; padding-bottom: 0;
}
.grade-header.is-shrink .grade-logo__img { transition: max-height .2s ease; }
.grade-header.is-shrink.is-scrolled .grade-logo__img { max-height: calc(var(--grade-logo-max-height, 56px) * .78); }
.grade-header.is-solid-on-scroll.is-scrolled {
	background: var(--grade-header-sticky-bg, var(--grade-header-bg, var(--grade-surface)));
	border-bottom-color: var(--grade-header-border, var(--grade-border));
}

/* ---------- Logo: variants ---------- */
.grade-logo { display: inline-flex; align-items: center; }
.grade-logo__img {
	display: block;
	max-height: var(--grade-logo-max-height, 56px);
	width: var(--grade-logo-width, auto);
	height: auto;
	margin: var(--grade-logo-margin, 0);
}
/*
 * Scoped under .grade-logo on purpose. The builder's Site Logo element uses the
 * same .grade-logo wrapper and carries ".grade-logo img { display: block }",
 * which is more specific than a lone class - so an unscoped rule here lost, and
 * every logo variant rendered at once, stacked next to each other.
 */
.grade-logo .grade-logo__img--mobile,
.grade-logo .grade-logo__img--sticky { display: none; }
.grade-header.is-scrolled .grade-logo--has-sticky .grade-logo__img--main { display: none; }
.grade-header.is-scrolled .grade-logo--has-sticky .grade-logo__img--sticky { display: block; }

/* ---------- Menu: current-item highlight ---------- */
.grade-menu-hl-underline  .grade-menu .current-menu-item > a { box-shadow: inset 0 -2px 0 var(--grade-menu-highlight, currentColor); }
.grade-menu-hl-overline   .grade-menu .current-menu-item > a { box-shadow: inset 0 2px 0 var(--grade-menu-highlight, currentColor); }
.grade-menu-hl-background .grade-menu .current-menu-item > a { background: var(--grade-menu-highlight, rgba(0,0,0,.06)); padding: .35em .7em; }
.grade-menu-hl-pill       .grade-menu .current-menu-item > a { background: var(--grade-menu-highlight, rgba(0,0,0,.06)); padding: .35em .9em; border-radius: 999px; }

/* ---------- Menu: submenu indicator ---------- */
.grade-has-submenu-indicator .grade-menu .menu-item-has-children > a::after {
	content: ''; display: inline-block; width: .4em; height: .4em; margin-left: .45em;
	border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
	transform: translateY(-.15em) rotate(45deg); opacity: .7;
}

/* ---------- Menu: submenu animation ---------- */
.grade-submenu-none  .grade-menu .sub-menu { transition: none; transform: none; }
.grade-submenu-slide .grade-menu .sub-menu { transform: translateY(-8px); }
.grade-submenu-slide .grade-menu li:hover > .sub-menu,
.grade-submenu-slide .grade-menu li:focus-within > .sub-menu { transform: translateY(0); }

/* ---------- Menu: search ---------- */
.grade-menu-search { display: inline-flex; align-items: center; margin-left: 8px; }
.grade-menu-search__toggle { background: none; border: 0; padding: 6px; cursor: pointer; color: inherit; line-height: 0; }
.grade-menu-search__panel {
	display: none; position: absolute; right: 0; top: 100%; z-index: 70; padding: 12px;
	min-width: 280px;
	background: var(--grade-submenu-bg, var(--grade-surface));
	border: 1px solid var(--grade-border);
	border-radius: var(--grade-radius);
	box-shadow: 0 10px 30px rgba(0,0,0,.09);
}
.grade-menu-search.is-open .grade-menu-search__panel { display: block; }
.grade-menu-search__panel input[type="search"] { width: 100%; }

/* ---------- Footer ---------- */
.grade-footer--full .grade-footer__inner { max-width: none; }
.grade-footer__divider { border: 0; border-top: 1px solid var(--grade-footer-divider, var(--grade-footer-border, var(--grade-border))); margin: 0; }

/* ---------- Page title bar ---------- */
.grade-ptb--full .grade-ptb__inner { max-width: none; }
.grade-ptb--parallax { background-attachment: fixed; }
/* A fixed attachment is ignored on most mobile browsers and causes janky
   repaints on the ones that honour it, so it is desktop-only on purpose. */
@media (max-width: 1024px) { .grade-ptb--parallax { background-attachment: scroll; } }

/* ---------- Blog layouts ---------- */
/* .grade-archive is the post list the templates render; .grade-posts is the
   related-posts grid. Both follow Blog > Layout and Blog > Columns. */
.grade-posts { display: grid; gap: 32px; grid-template-columns: repeat(var(--grade-blog-columns, 3), minmax(0, 1fr)); }

.grade-blog-grid .grade-archive { grid-template-columns: repeat(var(--grade-blog-columns, 3), minmax(0, 1fr)); }
.grade-blog-list .grade-archive { grid-template-columns: minmax(0, 1fr); }
.grade-blog-list .grade-card { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.grade-blog-list .grade-card__thumb { margin: 0; }
.grade-blog-large .grade-archive { grid-template-columns: minmax(0, 1fr); }
.grade-blog-large .grade-card__thumb img { width: 100%; }

@media (max-width: 1024px) {
	.grade-blog-grid .grade-archive,
	.grade-posts { grid-template-columns: repeat(var(--grade-blog-columns-tablet, 2), minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.grade-blog-grid .grade-archive,
	.grade-posts { grid-template-columns: repeat(var(--grade-blog-columns-mobile, 1), minmax(0, 1fr)); }
	.grade-blog-list .grade-card { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Extras: fluid type ---------- */
/* Scales the root size between the mobile and desktop breakpoints instead of
   stepping at them. Everything sized in rem follows automatically. */
body.grade-fluid-type {
	font-size: clamp(
		calc(var(--grade-font-size, 16px) * .875),
		calc(var(--grade-font-size, 16px) * .8 + 0.35vw),
		var(--grade-font-size, 16px)
	);
}

/* ---------- Extras: smooth scroll ---------- */
/* Honouring prefers-reduced-motion is not optional here: smooth scrolling is a
   common migraine and vestibular trigger. */
html:has(body.grade-smooth-scroll) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html:has(body.grade-smooth-scroll) { scroll-behavior: auto; }
}

/* ---------- Extras: back to top ---------- */
.grade-to-top {
	position: fixed; right: 22px; bottom: 22px; z-index: 90;
	width: 42px; height: 42px; padding: 0; cursor: pointer;
	border: 1px solid var(--grade-border);
	border-radius: var(--grade-radius);
	background: var(--grade-surface);
	color: var(--grade-heading);
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.grade-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.grade-to-top__arrow {
	display: block; width: 9px; height: 9px; margin: 0 auto;
	border-left: 2px solid currentColor; border-top: 2px solid currentColor;
	transform: translateY(2px) rotate(45deg);
}
@media (prefers-reduced-motion: reduce) { .grade-to-top { transition: none; } }
