/*
 * Mary H. Weir Public Library — hand-coded structure (header, navigation, footer)
 * These parts are the "locked structure" tier: edited in code, not the block editor.
 * Colors and fonts are aliased to theme.json so it stays the single source of truth.
 */

/* --- Brand tokens, aliased to theme.json presets (defined on body so they resolve
       whether WordPress emits its preset vars on :root or on body) --- */
body {
	--mill-forest: var(--wp--preset--color--mill-forest);
	--river-navy: var(--wp--preset--color--river-navy);
	--river-navy-rgb: 24, 48, 89;
	--burnished-amber: var(--wp--preset--color--burnished-amber);
	--burnished-dark: var(--wp--preset--color--burnished-dark);
	--vellum-cream: var(--wp--preset--color--vellum-cream);
	--slag-gray: var(--wp--preset--color--slag-gray);
	--white: var(--wp--preset--color--white);
	--white-rgb: 255, 255, 255;
	--steel-charcoal: var(--wp--preset--color--steel-charcoal);
	--text-dark: var(--wp--preset--color--text-dark);
	--text-muted: var(--wp--preset--color--text-muted);
	--font-heading: var(--wp--preset--font-family--heading);
	--font-body: var(--wp--preset--font-family--body);
	--radius-solid: 4px;
	--shadow-subtle: 0 4px 20px rgba(var(--river-navy-rgb), 0.04);
	--shadow-hover: 0 12px 30px rgba(var(--river-navy-rgb), 0.08);
	--transition: all 0.25s ease-in-out;
}

/* Scoped reset so the hand-coded parts lay out predictably inside WordPress */
header, header *, .site-footer, .site-footer *, #navOverlay, #navOverlay * { box-sizing: border-box; }
.wp-block-template-part { margin: 0; }
/* Page content starts flush under the header (WordPress adds a block gap here by default). */
.wp-site-blocks > main { margin-block-start: 0; }

html { scroll-behavior: smooth; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }

/* --- HEADER & NAVIGATION SYSTEM --- */
header {
	background-color: var(--white);
	border-bottom: 1px solid var(--slag-gray);
	box-shadow: 0 4px 14px rgba(var(--river-navy-rgb), 0.07);
	position: sticky;
	top: 0;
	z-index: 100;
}
/* WordPress wraps the header template part in its own <header> element, so the
   rule above lands twice. The outer one does the sticking; keep the inner one plain. */
header header { position: static; border-bottom: 0; box-shadow: none; }
/* Keep the sticky header below the WordPress admin bar for logged-in users */
@media screen and (min-width: 601px) { body.admin-bar header { top: 32px; } }
@media screen and (max-width: 600px) { body.admin-bar header { top: 46px; } }

.header-top-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 78px;
	transition: height .25s ease;
}
.header-nav-row { border-top: 1px solid var(--slag-gray); }
.header-nav-row > .container { display: flex; justify-content: center; }
.header-utils { display: flex; align-items: center; gap: 18px; }

.logo-block {
	display: flex;
	align-items: center;
	text-decoration: none;
	gap: 14px;
	transform-origin: left center;
	transition: transform .25s ease;
}
.logo-mark { flex: none; display: block; line-height: 0; }
.logo-mark img { display: block; width: 52px; height: 52px; }
@media (max-width: 600px) { .logo-mark img { width: 44px; height: 44px; } .logo-block { gap: 10px; } }
.logo-text { display: flex; flex-direction: column; }
.logo-main {
	font-family: var(--font-heading);
	font-size: 22px;
	font-weight: 700;
	color: var(--river-navy);
	line-height: 1.2;
	letter-spacing: -0.5px;
}
.logo-sub {
	font-family: var(--font-body);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var(--mill-forest);
	font-weight: 700;
	margin-top: 2px;
}

.desktop-nav { display: flex; justify-content: center; }
.nav-menu { display: flex; align-items: center; gap: 18px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-trigger {
	display: inline-flex; align-items: center; gap: 6px;
	text-decoration: none; color: var(--river-navy); font-weight: 600; font-size: 16px;
	padding: 16px 0; transition: var(--transition), padding .25s ease;
}
.caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: var(--transition); }
/* Each heading is a link to its section page; the arrow next to it is a
   separate button that opens the menu (click, tap or keyboard). On devices
   with a mouse, hovering also opens it. */
.nav-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 26px; height: 32px; margin: 0 0 0 1px; padding: 0;
	background: none; border: 0; border-radius: 3px; cursor: pointer; color: var(--river-navy);
}
.nav-toggle:hover { background: rgba(var(--river-navy-rgb), 0.07); }
.nav-toggle:focus-visible, .nav-trigger:focus-visible { outline: 3px solid rgba(var(--river-navy-rgb), 0.3); outline-offset: 2px; }
.nav-item.is-open .nav-trigger, .nav-item.is-open .nav-toggle { color: var(--burnished-dark); }
.nav-item.is-open .caret { transform: rotate(-135deg); margin-top: 2px; }
@media (hover: hover) {
	.nav-item:hover .nav-trigger, .nav-item:hover .nav-toggle { color: var(--burnished-dark); }
	.nav-item:hover .caret { transform: rotate(-135deg); margin-top: 2px; }
}
.dropdown {
	position: absolute; top: 100%; left: 0; min-width: 232px;
	background: var(--white); border: 1px solid var(--slag-gray); border-top: 3px solid var(--river-navy);
	border-radius: 0 0 var(--radius-solid) var(--radius-solid); box-shadow: var(--shadow-hover);
	list-style: none; margin: 0; padding: 8px 0; z-index: 200;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-item.is-open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
@media (hover: hover) {
	.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
}
/* The last two menus open leftward so they can't hang off the right edge
   (which caused sideways scrolling on tablet-width screens). */
.nav-item:nth-last-child(-n+2) .dropdown { left: auto; right: 0; }
.dropdown a { display: block; padding: 9px 18px; text-decoration: none; color: var(--text-dark); font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: var(--transition); }
.dropdown a:hover, .dropdown a:focus { background: var(--vellum-cream); color: var(--river-navy); }
.dropdown-label {
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
	color: var(--river-navy); background: rgba(var(--river-navy-rgb), 0.07);
	padding: 7px 18px; margin-top: 4px;
}
.dropdown-label:first-child { margin-top: 0; }

/* Menus with groups (Research, Services, About) open as side-by-side columns,
   one per group, so they stay short enough to fit on screen. */
.dropdown-columns {
	display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(190px, auto));
	gap: 0 6px; padding: 14px 8px 10px; min-width: 0; width: max-content;
}
.dropdown-col { min-width: 0; }
.dropdown-col + .dropdown-col { border-left: 1px solid var(--slag-gray); padding-left: 6px; }
.dropdown-col ul { list-style: none; margin: 0; padding: 4px 0 0; }
.dropdown-col ul + .dropdown-label { margin-top: 10px; }
.dropdown-columns .dropdown-label {
	display: block; background: none; margin: 0 12px 2px; padding: 2px 0 6px;
	color: var(--mill-forest); letter-spacing: 1px;
	border-bottom: 2px solid var(--burnished-amber);
}
.dropdown-columns a { padding: 8px 12px; border-radius: 3px; }
.nav-account {
	display: inline-flex; align-items: center;
	border: 1px solid var(--river-navy); color: var(--river-navy);
	padding: 9px 16px; border-radius: var(--radius-solid);
	font-weight: 700; font-size: 15px; text-decoration: none;
	transition: var(--transition);
}
.nav-account:hover { background: var(--river-navy); color: var(--white); }
.btn-card {
	background: var(--river-navy); color: var(--white); text-decoration: none; font-weight: 700;
	border-radius: var(--radius-solid); white-space: nowrap; transition: var(--transition);
	font-size: 15px; padding: 10px 18px;
}
.btn-card:hover { background: var(--mill-forest); color: var(--white); }

/* Mobile accordion drawer */
.m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-btn-outline, .m-btn-fill { text-align: center; padding: 12px; border-radius: var(--radius-solid); text-decoration: none; font-weight: 700; font-size: 15px; }
.m-btn-outline { border: 1px solid var(--river-navy); color: var(--river-navy); }
.m-btn-fill { background: var(--river-navy); color: var(--white); }
.m-btn-quiet {
	display: flex; align-items: center; justify-content: center; gap: 6px;
	padding: 12px; border-radius: var(--radius-solid);
	background: var(--vellum-cream); border: 1px solid var(--slag-gray);
	color: var(--mill-forest); text-decoration: none; font-weight: 700; font-size: 15px;
}
.m-divider { border: 0; border-top: 1px solid var(--slag-gray); margin: 8px 0; width: 100%; }
.m-acc { display: flex; flex-direction: column; }
.m-acc-item { border-bottom: 1px solid var(--slag-gray); }
.m-acc-trigger {
	width: 100%; background: none; border: none; cursor: pointer;
	display: flex; justify-content: space-between; align-items: center;
	padding: 15px 4px; font-family: var(--font-heading); font-weight: 700; font-size: 19px;
	color: var(--river-navy); text-align: left;
}
.m-caret { width: 9px; height: 9px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: var(--transition); }
.m-acc-trigger[aria-expanded="true"] .m-caret { transform: rotate(-135deg); }
.m-acc-panel { display: flex; flex-direction: column; padding: 0 4px 12px 8px; }
.m-acc-panel[hidden] { display: none; }
.m-acc-panel a { padding: 9px 6px; text-decoration: none; color: var(--text-dark); font-size: 15px; font-weight: 500; }
.m-acc-panel a:hover { color: var(--river-navy); }
.m-group-label {
	display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
	color: var(--river-navy); background: rgba(var(--river-navy-rgb), 0.07);
	padding: 7px 8px; margin: 8px 0 2px; border-radius: 3px;
}

/* Responsive Mobile Hamburger Trigger */
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-toggle span { display: block; width: 24px; height: 3px; background-color: var(--river-navy); margin: 4px 0; transition: var(--transition); }
.mobile-toggle.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -5px); }

/* Header responsive behavior */
@media (min-width: 768px) {
	header.scrolled .header-top-inner { height: 50px; }
	header.scrolled .logo-block { transform: scale(0.82); }
	header.scrolled .nav-trigger { padding: 9px 0; }
}
@media (max-width: 767px) {
	.header-nav-row { display: none; }
	.header-utils { display: none; }
	.mobile-toggle { display: block; }
}

/* --- Closure / announcement banner (Settings -> Library Hours) --- */
.mhw-alert {
	background: var(--burnished-amber);
	color: var(--steel-charcoal);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.mhw-alert[hidden] { display: none; }
.mhw-alert-inner {
	/* Icon + message centered as a group; the X sits at the right edge. Equal
	   side padding keeps the message truly centered around the X's space. */
	position: relative;
	max-width: 1200px; margin: 0 auto; padding: 10px 64px;
	display: flex; align-items: center; justify-content: center; gap: 12px;
	box-sizing: border-box;
}
.mhw-alert-icon { flex: none; }
.mhw-alert p { margin: 0; flex: 0 1 auto; text-align: center; font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.45; }
.mhw-alert a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; margin-left: 4px; }
.mhw-alert a:hover { color: var(--river-navy); }
.mhw-alert-close {
	flex: none; display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; margin: 0;
	position: absolute; top: 50%; right: 16px; transform: translateY(-50%);
	background: none; border: 0; border-radius: 50%; cursor: pointer;
	color: inherit; font-size: 26px; line-height: 1;
}
.mhw-alert-close:hover { background: rgba(0, 0, 0, 0.08); }
.mhw-alert-close:focus-visible { outline: 2px solid var(--steel-charcoal); outline-offset: 1px; }
@media (max-width: 600px) {
	/* Phones: left-aligned, as before; the X stays at the right edge. */
	.mhw-alert-inner { padding: 10px 48px 10px 16px; align-items: flex-start; justify-content: flex-start; }
	.mhw-alert p { text-align: left; flex: 1 1 auto; }
	.mhw-alert-close { right: 6px; }
	.mhw-alert-icon { margin-top: 3px; }
	.mhw-alert p { font-size: 15px; }
}
@media print { .mhw-alert-close { display: none; } }

/* --- "Back to top" button (added by mhw-header.js on long pages) --- */
.mhw-to-top {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 90; /* below the header and mobile menu */
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 44px; padding: 10px 16px;
	background: var(--river-navy); color: var(--white);
	border: 2px solid var(--white); border-radius: 999px;
	box-shadow: 0 6px 18px rgba(var(--river-navy-rgb), 0.25);
	font-family: var(--font-body); font-size: 15px; font-weight: 700; line-height: 1;
	cursor: pointer;
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s, background .2s ease;
}
.mhw-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.mhw-to-top:hover { background: var(--mill-forest); }
.mhw-to-top:focus-visible { outline: 3px solid var(--burnished-amber); outline-offset: 2px; }
main h1:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .mhw-to-top { transition: none; } }
@media print { .mhw-to-top { display: none; } }

/* --- FOOTER --- */
.site-footer {
	background: var(--steel-charcoal);
	color: var(--slag-gray);
	border-top: 4px solid var(--river-navy);
	padding: 48px 24px 24px 24px;
}
.footer-columns-container {
	max-width: 1200px; margin: 0 auto;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 32px; padding-bottom: 32px;
	border-bottom: 1px solid rgba(var(--white-rgb), 0.12);
}
.footer-column h5 { color: var(--white); font-family: var(--font-heading); font-size: 16px; margin: 0 0 16px 0; }
.footer-column p { font-size: 14px; line-height: 1.7; margin: 0; }
.footer-contact-line { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.footer-contact-line svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--burnished-amber); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 10px; font-size: 14px; }
.site-footer a { color: var(--slag-gray); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-social { display: flex; gap: 12px; margin-top: 4px; }
.footer-social a {
	width: 40px; height: 40px; border-radius: var(--radius-solid);
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(var(--white-rgb), 0.06);
	transition: background 0.2s ease, color 0.2s ease;
}
.footer-social a:hover { background: var(--river-navy); color: var(--white); text-decoration: none; }
.footer-social svg { width: 20px; height: 20px; }
/* Newsletter signup (submits to Wowbrary in a new tab) */
.footer-newsletter { margin-top: 24px; }
.footer-newsletter label { display: block; font-size: 14px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.footer-newsletter-row { display: flex; gap: 8px; }
.footer-newsletter input[type="email"] {
	flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 8px 12px;
	font: inherit; font-size: 15px; color: var(--text-dark); background: var(--white);
	border: 1px solid var(--slag-gray); border-radius: var(--radius-solid);
}
.footer-newsletter button {
	flex: 0 0 auto; min-height: 44px; padding: 8px 16px; cursor: pointer;
	font: inherit; font-size: 15px; font-weight: 700; color: var(--river-navy);
	background: var(--burnished-amber); border: 0; border-radius: var(--radius-solid);
}
.footer-newsletter button:hover { background: var(--white); }
.footer-newsletter :where(input, button):focus-visible { outline: 2px solid var(--burnished-amber); outline-offset: 2px; }
.site-footer .footer-newsletter-note { font-size: 12px; line-height: 1.5; margin-top: 8px; opacity: 0.85; }
/* Affiliations (City of Weirton, West Virginia Library Network) */
.footer-affiliations {
	max-width: 1200px; margin: 0 auto; padding: 22px 0;
	display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center;
	border-bottom: 1px solid rgba(var(--white-rgb), 0.12);
}
.footer-affiliation {
	display: inline-flex; align-items: center; gap: 12px;
	color: rgba(var(--white-rgb), 0.85); text-decoration: none;
	font-size: 14px; line-height: 1.4;
}
.footer-affiliation strong { color: var(--white); font-weight: 700; }
.footer-affiliation:hover span, .footer-affiliation:focus-visible span { text-decoration: underline; }
.footer-affiliation:focus-visible { outline: 3px solid var(--burnished-amber); outline-offset: 4px; border-radius: 2px; }
.footer-affiliation picture { display: contents; }
.footer-affiliation img { display: block; flex: none; height: auto; }
.footer-affiliation img.is-seal { width: 48px; margin: 0 8px; }
.footer-affiliation img.is-wvln { width: 65px; filter: brightness(0) invert(1); opacity: 0.9; }

.footer-bottom-row {
	max-width: 1200px; margin: 0 auto; padding-top: 24px;
	font-size: 12px; line-height: 1.6; color: rgba(var(--white-rgb), 0.6);
}
.footer-bottom-row p { margin: 0; }
.footer-bottom-row .accessibility { margin-bottom: 10px; }
.footer-bottom-row a { color: rgba(var(--white-rgb), 0.85); }

/* ============================================================
   Research A–Z page ([mhw_databases] + page-research template)
   ============================================================ */
.page-title-band { background: var(--white); border-bottom: 1px solid var(--slag-gray); padding: 40px 0 44px; }
.page-title-band .breadcrumb { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.page-title-band .breadcrumb a { color: var(--text-muted); text-decoration: none; }
.page-title-band .breadcrumb a:hover { color: var(--river-navy); }
.page-title-band h1 { font-family: var(--font-heading); color: var(--river-navy); font-size: 40px; font-weight: 700; line-height: 1.15; margin: 0 0 16px; }
.page-title-band .lede { font-size: 18px; color: var(--text-dark); max-width: 680px; line-height: 1.6; margin: 0; }

.mhw-research { padding: 40px 24px 60px; }

.subject-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.subject-chip { border: 1px solid var(--slag-gray); background: var(--white); color: var(--text-dark); font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: var(--transition); }
.subject-chip:hover { border-color: var(--river-navy); }
.subject-chip.is-active { background: var(--river-navy); border-color: var(--river-navy); color: var(--white); }

.alpha-bar { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 36px; padding-bottom: 20px; border-bottom: 1px solid var(--slag-gray); }
.alpha-link { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: var(--radius-solid); text-decoration: none; font-weight: 700; font-size: 14px; color: var(--river-navy); background: rgba(var(--river-navy-rgb), 0.08); transition: var(--transition); }
.alpha-link:hover { background: var(--river-navy); color: var(--white); }
.alpha-link.is-disabled, .alpha-link.is-empty { color: var(--text-muted); font-weight: 400; background: transparent; pointer-events: none; }

.letter-group { margin-bottom: 28px; scroll-margin-top: 150px; }
.letter-heading { font-family: var(--font-heading); color: var(--burnished-dark); font-size: 22px; font-weight: 800; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--slag-gray); scroll-margin-top: 150px; }
@media (max-width: 767px) { .letter-group, .letter-heading { scroll-margin-top: 90px; } }

.db-entry { display: flex; align-items: flex-start; gap: 18px; background: var(--white); border: 1px solid var(--slag-gray); border-radius: var(--radius-solid); padding: 16px 20px; margin-bottom: 12px; box-shadow: var(--shadow-subtle); }
.db-logo { flex: 0 0 120px; height: 60px; display: flex; align-items: center; justify-content: center; }
.db-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.db-logo .db-icon { color: var(--mill-forest); }
.db-main { flex: 1 1 auto; min-width: 0; }
.db-name { font-family: var(--font-heading); color: var(--river-navy); font-weight: 700; font-size: 18px; text-decoration: none; }
.db-name:hover { color: var(--burnished-dark); }
.db-desc { font-size: 14px; color: var(--text-muted); margin: 4px 0 0; }
.db-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.subject-tag { font-size: 12px; font-weight: 600; color: var(--river-navy); background: rgba(var(--river-navy-rgb), 0.08); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.db-source { font-size: 12px; font-style: italic; color: var(--text-muted); white-space: nowrap; }
/* Free public websites (government or nonprofit): a small building icon before the words */
.db-source-free::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; background-color: currentColor; -webkit-mask: var(--mhw-free-icon) center / contain no-repeat; mask: var(--mhw-free-icon) center / contain no-repeat; }
.db-source-free { --mhw-free-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 18v-7M9.5 18v-7M14.5 18v-7M19 18v-7M12 3l9 5H3z'/%3E%3C/svg%3E"); }
.db-badge { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--slag-gray); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

@media (max-width: 560px) {
	.db-logo { flex-basis: 96px; height: 48px; justify-content: flex-start; }
	.db-entry { flex-wrap: wrap; }
	.db-meta { flex-direction: row; align-items: center; width: 100%; }
}

/* ============================================================
   Single news post (templates/single.html)
   ============================================================ */
.page-title-band > .container > * { margin-block-start: 0; }
.page-title-band .post-meta { font-size: 15px; color: var(--text-muted); margin: 0; }
.mhw-article { max-width: 1200px; margin: 0 auto; padding: 40px 24px 60px; box-sizing: border-box; }
.mhw-article > * { max-width: 720px; }
.mhw-article .back-link { margin-top: 40px; font-size: 15px; font-weight: 700; }
.mhw-article .back-link a { color: var(--river-navy); text-decoration: none; }
.mhw-article .back-link a:hover { color: var(--burnished-dark); text-decoration: underline; }

/* ============================================================
   Shared: screen-reader-only text + Resource cards
   (homepage "Digital Resources" and [mhw_resource_cards] on pages)
   ============================================================ */
.mhw-sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.resource-card {
	display: flex; flex-direction: column;
	background: var(--white);
	border: 1px solid var(--slag-gray);
	border-top: 4px solid var(--mill-forest);
	border-radius: var(--radius-solid);
	padding: 24px;
	box-shadow: var(--shadow-subtle);
}
.resource-card.accent-2 { border-top-color: var(--river-navy); }
.resource-card.accent-3 { border-top-color: var(--burnished-amber); }
.resource-card-media { display: flex; align-items: center; height: 40px; margin-bottom: 12px; color: var(--mill-forest); }
.resource-card.accent-2 .resource-card-media { color: var(--river-navy); }
.resource-card.accent-3 .resource-card-media { color: var(--burnished-dark); }
.resource-card-media img { display: block; max-width: 160px; max-height: 40px; width: auto; height: auto; object-fit: contain; }
.resource-card-media .db-icon { width: 28px; height: 28px; }
/* A real logo gets a taller band: a 2:1 logo shows at 160 × 80. */
.resource-card-media.has-logo { height: 80px; margin-bottom: 16px; }
.resource-card-media.has-logo img { max-width: min(100%, 240px); max-height: 80px; }
.resource-card h3 {
	font-family: var(--font-heading); font-size: 20px; line-height: 1.6;
	color: var(--river-navy);
	margin-bottom: 8px;
}
.resource-card p { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }
.resource-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: auto; }
.resource-card .card-link { color: var(--burnished-dark); font-weight: 700; font-size: 15px; text-decoration: none; }
.resource-card .card-link:hover { color: var(--river-navy); text-decoration: underline; }

/* Inside page content: keep the card's own type, not the page's h3/p styles. */
.wp-block-post-content .mhw-resource-cards { margin: 1.6em 0; }
.wp-block-post-content .mhw-resource-cards .resource-card h3 {
	margin: 0 0 8px; font-size: 20px; line-height: 1.35;
}
.wp-block-post-content .mhw-resource-cards .resource-card p {
	font-size: 15px; line-height: 1.6; margin: 0 0 20px;
}
.wp-block-post-content .mhw-resource-cards .resource-card p:last-child { margin-bottom: 20px; }
.mhw-staff-note {
	font-size: 15px; background: #fff8e6; border: 1px dashed var(--burnished-dark);
	border-radius: var(--radius-solid); padding: 12px 16px;
}

/* ============================================================
   Library News listing ([mhw_news_list]: Posts page, categories, search)
   ============================================================ */
.mhw-news { max-width: 1200px; margin: 0 auto; padding: 44px 24px 64px; box-sizing: border-box; }
.mhw-news .news-list,
.mhw-news .news-empty,
.mhw-news .news-pagination { max-width: 800px; }
.news-empty { font-size: 18px; color: var(--text-muted); }
.news-empty a { color: var(--burnished-dark); }

.news-item {
	display: grid; grid-template-columns: 1fr; gap: 18px;
	background: var(--white);
	border: 1px solid var(--slag-gray);
	border-radius: var(--radius-solid);
	padding: 24px;
	margin: 0 0 20px;
	box-shadow: var(--shadow-subtle);
	box-sizing: border-box;
}
.news-item.is-sticky { border-left: 4px solid var(--burnished-amber); }
.news-item-thumb { display: block; }
.news-item-thumb img {
	display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
	border-radius: var(--radius-solid);
}
@media (min-width: 768px) {
	.news-item.has-thumb { grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
}
.news-item-body > * { margin: 0; }
.news-item-meta {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
	font-size: 13px; line-height: 1.6;
}
.news-tag {
	font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
	color: var(--mill-forest); text-decoration: none;
}
a.news-tag:hover { color: var(--river-navy); text-decoration: underline; }
.news-item-meta time { color: var(--text-muted); }
.news-pinned {
	font-size: 12px; font-weight: 700; color: var(--burnished-dark);
	background: rgba(212, 163, 115, 0.18); padding: 1px 10px; border-radius: 999px;
}
.news-item-title {
	font-family: var(--font-heading); font-size: 23px; font-weight: 700; line-height: 1.3;
	margin: 6px 0 8px !important;
}
.news-item-title a { color: var(--river-navy); text-decoration: none; }
.news-item-title a:hover { color: var(--burnished-dark); text-decoration: underline; }
.news-item-excerpt { font-size: 16px; line-height: 1.6; color: var(--text-dark); }

.news-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.news-pagination .page-numbers {
	display: inline-block; min-width: 44px; padding: 9px 14px; box-sizing: border-box; text-align: center;
	font-size: 15px; font-weight: 700; line-height: 1.4;
	color: var(--river-navy); background: var(--white);
	border: 1px solid var(--slag-gray); border-radius: var(--radius-solid); text-decoration: none;
}
.news-pagination a.page-numbers:hover { border-color: var(--river-navy); }
.news-pagination .page-numbers.current { background: var(--river-navy); border-color: var(--river-navy); color: var(--white); }
.news-pagination .page-numbers.dots { border-color: transparent; background: transparent; }
@media (max-width: 600px) {
	.mhw-news { padding-top: 32px; }
	.news-item { padding: 20px; }
	.news-item-title { font-size: 21px; }
}

/* Tags line ("Topics: Teens · STEM") on news cards and single posts */
.news-tags { font-size: 14px; line-height: 1.6; color: var(--text-muted); margin: 10px 0 0 !important; }
.news-tags-label { font-weight: 600; margin-right: 2px; }
.news-tags a { color: var(--river-navy); font-weight: 600; text-decoration: none; }
.news-tags a:hover { color: var(--burnished-dark); text-decoration: underline; }
.mhw-article .news-tags { margin-top: 32px !important; padding-top: 16px; border-top: 1px solid var(--slag-gray); font-size: 15px; }
.mhw-article .news-tags + .back-link { margin-top: 20px; }

/* ============================================================
   Catalog search box ([mhw_catalog_search], homepage hero)
   ============================================================ */
/* --- Catalog search --- */
.search-card {
	background: var(--white);
	border: 1px solid var(--slag-gray);
	border-left: 4px solid var(--mill-forest);
	border-radius: var(--radius-solid);
	padding: 8px;
	box-shadow: var(--shadow-subtle);
	transition: var(--transition);
}
.search-card:focus-within {
	box-shadow: var(--shadow-hover);
	border-color: var(--river-navy);
	border-left-color: var(--burnished-amber);
}
.search-row { display: flex; align-items: center; }
.search-select-wrapper { padding: 0 16px; }
.search-select {
	font-family: var(--font-body); font-weight: 600; font-size: 16px;
	color: var(--river-navy);
	border: none; background: transparent; cursor: pointer; outline: none;
}
.search-divider { width: 1px; height: 30px; background-color: var(--slag-gray); }
.search-input {
	flex: 1; width: 100%; min-width: 0;
	padding: 16px;
	font-family: var(--font-body); font-size: 16px;
	border: none; outline: none;
	color: var(--text-dark); background: transparent;
	-webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--text-muted); opacity: 1; }
.search-select:focus-visible { outline: 2px solid var(--river-navy); outline-offset: 4px; border-radius: 2px; }
.search-btn {
	display: flex; align-items: center; gap: 8px;
	background-color: var(--mill-forest); color: var(--white);
	border: none; border-radius: var(--radius-solid);
	padding: 16px 28px;
	font-family: var(--font-body); font-weight: 600; font-size: 16px;
	cursor: pointer;
	transition: var(--transition);
}
.search-btn:hover { background-color: var(--river-navy); }

@media (max-width: 768px) {
	.search-row { flex-direction: column; align-items: stretch; }
	.search-select-wrapper { padding: 12px; }
	.search-divider { width: 100%; height: 1px; }
	.search-btn { justify-content: center; margin-top: 4px; }
}

/* Accessibility + Website Privacy links on the footer's last line */
.footer-legal { margin-left: 10px; white-space: nowrap; }
.footer-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-legal a:hover { color: var(--burnished-amber); }
