/*
Theme Name: Happiness Beat
Description: Editorial theme for Happiness Beat — news, events, podcasts and books on the science of happiness. Works with the Happiness Beat Core plugin.
Version: 0.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Author: Happiness Beat
Text Domain: happiness-beat
*/

/* Layout pieces that blocks can't express on their own. Colors come from theme.json. */

:root {
	--hb-kicker: var(--wp--preset--color--kicker);
	--hb-muted: var(--wp--preset--color--muted);
	--hb-line: var(--wp--preset--color--line);
}

/* Sunrise bar at the top of every page */
.hb-sunrise { height: 5px; background: var(--wp--preset--gradient--sunrise); }

/* Section heading with the sun before it */
.hb-sec-head {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding-bottom: 14px; margin-bottom: 28px !important;
	border-bottom: 2px solid #F0E3D6;
}
.hb-sec-title {
	display: flex; align-items: center; gap: 10px; margin: 0;
	color: var(--wp--preset--color--heading);
}
.hb-sec-title::before {
	content: ""; flex: none; width: 26px; height: 26px;
	background: url("assets/img/happiness-beat-sun.svg") center / contain no-repeat;
}
.hb-more { margin: 0; font-size: 15px; font-weight: 700; color: var(--hb-kicker); white-space: nowrap; }
.hb-more a::after { content: " →"; }

/* Card text */
.hb-kick {
	margin: 0; font-size: 12.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
	color: var(--hb-kicker); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
.hb-kick.is-plain { text-transform: none; letter-spacing: 0; font-size: 14px; }
.hb-pill {
	font-size: 12px; letter-spacing: 0.04em; text-transform: none; font-weight: 700;
	color: #7A3A12; background: #FCE7D6; border-radius: 999px; padding: 2px 9px;
}
.hb-card-title { margin: 0; font-size: 18.5px !important; font-weight: 700 !important; line-height: 1.3; letter-spacing: 0; }
.hb-desc { margin: 0; font-size: 15px; line-height: 1.55; color: var(--hb-muted); }
.hb-desc, .hb-desc p {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0;
}
.hb-meta { margin: 0; font-size: 13px; color: var(--hb-muted); }
.hb-by { margin: 0; font-size: 15px; font-style: italic; color: #4A443E; }

/* Cards: the whole card is one link (the title's), image on the left */
.hb-card { position: relative; display: flex; gap: 18px; align-items: flex-start; }
.hb-card > .hb-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.hb-card > .hb-txt > * { margin: 0 !important; }
.hb-card .hb-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hb-card:hover .hb-card-title a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.hb-card .wp-block-post-featured-image { flex: none; max-width: 42%; margin: 0; }
.hb-card .wp-block-post-featured-image img { border-radius: var(--wp--custom--radius--card); background: #EFE7DC; }
.hb-card.is-stacked { flex-direction: column; gap: 8px; }
.hb-card.is-stacked .wp-block-post-featured-image { max-width: none; width: 100% !important; margin-bottom: 6px; }
.hb-card.is-stacked .hb-desc, .hb-card.is-stacked .hb-desc p { -webkit-line-clamp: 3; }
.hb-card .hb-desc.hb-desc-whole, .hb-card .hb-desc.hb-desc-whole p { display: block; -webkit-line-clamp: unset; overflow: visible; }
.hb-cover img { border-radius: 3px !important; box-shadow: 0 8px 18px rgba(43, 39, 36, 0.18); }

/* Image placeholder when a post has no featured image */
.hb-noimg {
	flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
	container-type: inline-size; border-radius: var(--wp--custom--radius--card);
	background: linear-gradient(135deg, #FDE8D7, #FBDDE0); text-decoration: none;
}
.hb-card .hb-noimg { max-width: 42%; }
.hb-card.is-stacked .hb-noimg { max-width: none; }
.hb-noimg-sun { width: 20%; height: auto; }
.hb-noimg-name {
	margin-top: 5cqi; padding: 0 8%; text-align: center; line-height: 1.15; text-wrap: balance;
	font-weight: 800; font-size: clamp(11px, 9.5cqi, 44px); color: var(--wp--preset--color--heading);
}
.hb-noimg.is-hero .hb-noimg-sun { width: 9%; }
.hb-noimg.is-hero .hb-noimg-name { margin-top: 2.5cqi; font-size: clamp(24px, 5cqi, 52px); }
@container (max-width: 110px) {
	.hb-noimg-name { display: none; }
	.hb-noimg-sun { width: 40%; }
}

/* Grids for post lists */
.wp-block-post-template.hb-grid-2,
.wp-block-post-template.hb-grid-3,
.wp-block-post-template.hb-grid-4 { display: grid; list-style: none; padding: 0; margin: 0; }
.wp-block-post-template.hb-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 36px; }
.wp-block-post-template.hb-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.wp-block-post-template.hb-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 28px; }
.wp-block-post-template.hb-grid-2 > li,
.wp-block-post-template.hb-grid-3 > li,
.wp-block-post-template.hb-grid-4 > li { margin: 0; }

/* Homepage: news beside Editor's Picks */
.hb-lead { display: grid !important; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.hb-lead > * { margin: 0 !important; }
.hb-picks { background: var(--wp--preset--color--tint); border-radius: var(--wp--custom--radius--box); padding: 24px 24px 10px; }
.hb-picks .hb-sec-title { font-size: 23px; }
.hb-picks .wp-block-post-template { list-style: none; margin: 8px 0 0; padding: 0; }
.hb-picks .wp-block-post-template > li { margin: 0; }
.hb-picks .wp-block-post-template > li + li { border-top: 1px solid #E8D9CA; }
.hb-picks .hb-card { align-items: center; gap: 14px; padding: 14px 0; }
.hb-picks .hb-card-title { font-size: 16px !important; }

.hb-section { padding-top: 56px; padding-bottom: 8px; }
.hb-section > * { margin-block-start: 0; }
.hb-section:last-child { padding-bottom: 72px; } /* room above the footer now that the newsletter band is hidden */

/* Masthead and menu */
.hb-utility { font-size: 14px; color: var(--hb-muted); }
.hb-utility .wp-block-button__link { padding: 7px 18px; }
.hb-tagline { margin: 0; font-size: 16px; color: var(--hb-muted); }
.hb-navbar { border-top: 1px solid var(--hb-line); border-bottom: 1px solid var(--hb-line); background: var(--wp--preset--color--surface); }
.hb-navbar .wp-block-navigation-item__content { padding: 13px 0; white-space: nowrap; }
.wp-block-navigation .wp-block-navigation-item.hb-current > .wp-block-navigation-item__content,
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--accent) !important; }
.hb-header { border-bottom: 1px solid #E4DDD3; }
.hb-header .wp-block-navigation { font-size: 15px; }
.hb-header .wp-block-navigation-item__content { padding: 10px 0; }

/* Single posts */
.hb-crumb { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.hb-crumb a, .hb-crumb .wp-block-post-terms a { color: var(--wp--preset--color--accent); }
.hb-crumb .hb-crumb-sep { color: #A79E92; }
.hb-byline { margin: 0; font-size: 14px; color: #5E574F; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hb-byline > *:not(:first-child)::before { content: "·"; margin-right: 14px; }
.hb-hero img { border-radius: var(--wp--custom--radius--card); }
.hb-facts { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 32px; padding: 18px 0; border-top: 1px solid #1F1C19; border-bottom: 1px solid #E4DDD3; font-size: 14px; }
.hb-facts.is-boxed { border: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); font-size: 15px; }
/* Inside the boxed stack, a set width stops the browser sizing the grid as one tall column (empty space above the button). */
.hb-box > .hb-facts { width: 100%; }
.hb-facts > * { margin: 0 !important; }
.hb-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5E574F; }
.hb-facts.is-boxed .hb-label { font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--wp--preset--color--contrast); }
.hb-value { margin: 4px 0 0 !important; }
.hb-facts.is-boxed .hb-value { margin-top: 2px !important; color: #3D3832; }
.hb-box { background: var(--wp--preset--color--tint-strong); border-radius: 4px; }
.hb-listen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.hb-listen .wp-block-button__link::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; background: currentColor; clip-path: polygon(10% 0, 100% 50%, 10% 100%); vertical-align: -1px; }
.hb-textlink { margin: 0; font-size: 15px; font-weight: 700; color: var(--wp--preset--color--accent); }
.hb-more-section { border-top: 1px solid #1F1C19; }
.hb-more-section .hb-more-title { font-size: 20px; line-height: 1.25; font-weight: 600 !important; margin: 0; }
.hb-more-section .wp-block-post-template { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px 40px; list-style: none; padding: 0; }

/* Book hero */
.hb-book-hero .hb-cover-lg img { box-shadow: 0 18px 40px rgba(31, 28, 25, 0.25); }
.hb-book-hero article > :first-child { flex: 0 1 340px !important; min-width: 220px; }
.hb-book-hero article > :last-child { flex: 1 1 400px !important; min-width: 0; }
/* Cover beside the title, staying in view while a long description scrolls by */
@media (min-width: 900px) { .hb-book-hero article > :first-child { position: sticky; top: 32px; } }

/* Archive pages */
.hb-archive-head .wp-block-query-title { margin: 0; }
.hb-pager { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--hb-line); gap: 12px; font-size: 15px; font-weight: 700; }
.hb-pager .wp-block-query-pagination-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; }
.hb-pager .page-numbers,
.hb-pager .wp-block-query-pagination-previous,
.hb-pager .wp-block-query-pagination-next {
	display: inline-flex; align-items: center; justify-content: center; height: 42px; margin: 0;
	color: var(--wp--preset--color--contrast); text-decoration: none; border-radius: 999px;
	transition: background-color .15s, color .15s, border-color .15s;
}
.hb-pager .page-numbers { min-width: 42px; padding: 0 2px; box-sizing: border-box; }
.hb-pager a.page-numbers:hover { background: var(--wp--preset--color--tint-strong); color: var(--wp--preset--color--accent); }
.hb-pager .page-numbers.current { background: var(--wp--preset--color--accent); color: #fff; }
.hb-pager .page-numbers.dots { min-width: 24px; color: var(--hb-muted); }
.hb-pager .wp-block-query-pagination-previous,
.hb-pager .wp-block-query-pagination-next { gap: 8px; padding: 0 20px; border: 1px solid var(--hb-line); background: var(--wp--preset--color--surface); }
.hb-pager .wp-block-query-pagination-previous:hover,
.hb-pager .wp-block-query-pagination-next:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); }
.hb-pager a:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
/* Keyboard focus everywhere: a 2px brick ring (about 5.5:1 on cream) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* Newsletter band */
.hb-newsletter { background: var(--wp--preset--gradient--blush); }
.hb-nl-form { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 360px; max-width: 480px; }
.hb-nl-form input[type=email] { flex: 1 1 220px; min-width: 0; font: inherit; padding: 13px 18px; border: 1px solid #E3C9B8; border-radius: 999px; background: #fff; color: var(--wp--preset--color--contrast); }
.hb-nl-form button { font: inherit; font-weight: 700; color: #fff; background: var(--wp--preset--color--accent); border: 0; padding: 13px 26px; border-radius: 999px; cursor: pointer; }
.hb-nl-form button:hover { background: #8F2F20; }
.screen-reader-text:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Footer */
.hb-footer { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--footer-text); font-size: 15px; }
.hb-footer a { color: inherit; }
.hb-footer .hb-copy { color: #ADA397; margin: 0; }
.hb-footer > * { margin-block: 0 !important; }
.hb-footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 24px 48px; padding: 40px 0 28px; }
.hb-footer-top > *, .hb-footer-bottom > *, .hb-footer-brand > * { margin: 0 !important; }
.hb-footer-brand a { display: inline-block; }
.hb-footer-tagline { margin-top: 10px !important; color: #ADA397; }
.hb-footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; max-width: 760px; justify-content: flex-end; }
.hb-footer-nav a { display: inline-block; padding: 6px 0; text-decoration: none; }
.hb-footer a:hover { color: #fff; text-decoration: underline; }
.hb-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding: 18px 0 28px; border-top: 1px solid rgba(217, 208, 197, .18); font-size: 14px; }
@media (max-width: 720px) {
	.hb-footer-top { flex-direction: column; gap: 20px; padding-top: 32px; }
	.hb-footer-nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; justify-content: start; }
	.hb-footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 1020px) {
	.hb-lead { grid-template-columns: 1fr; }
	.wp-block-post-template.hb-grid-4,
	.wp-block-post-template.hb-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
	.wp-block-post-template.hb-grid-2,
	.wp-block-post-template.hb-grid-3 { grid-template-columns: 1fr; }
	/* Home on phones: fewer items per section, each with its "All …" link. */
	.hb-more { font-size: 14px; }
	.home .hb-query-news .wp-block-post-template > li:nth-child(n+5),
	.home .hb-query-picks .wp-block-post-template > li:nth-child(n+4),
	.home .hb-query-events .wp-block-post-template > li:nth-child(n+4),
	.home .hb-query-podcasts .wp-block-post-template > li:nth-child(n+5),
	.home .hb-query-books .wp-block-post-template > li:nth-child(n+4),
	.home .hb-query-misc .wp-block-post-template > li:nth-child(n+5) { display: none; }
	/* Home menu: two centred rows, so every section is visible without swiping. */
	.hb-navbar .wp-block-navigation__container { flex-wrap: wrap; justify-content: center !important; gap: 0 20px !important; padding: 4px 0; }
	.hb-navbar .wp-block-navigation-item__content { padding: 8px 0; }
	/* Other pages: logo and menu button on one row, the button easy to tap. */
	.hb-header > .wp-block-group { flex-wrap: nowrap !important; align-items: center; gap: 16px !important; }
	.hb-header .wp-block-image img { height: 40px !important; }
	.hb-header .wp-block-navigation__responsive-container-open { padding: 6px; margin-right: -6px; }
	.hb-header .wp-block-navigation__responsive-container-open svg { width: 30px; height: 30px; }
	.hb-masthead img { max-height: 64px; width: auto !important; }
}
@media (max-width: 440px) {
	.hb-pager { gap: 10px; }
	.hb-pager .wp-block-query-pagination-numbers { order: -1; flex-basis: 100%; }
	.hb-pager .page-numbers { min-width: 38px; height: 38px; }
	.wp-block-post-template.hb-grid-4 { gap: 24px 16px; }
	.hb-card { gap: 14px; }
	.hb-card-title { font-size: 17px !important; }
	.hb-card.is-stacked .hb-card-title { font-size: 16px !important; }
	.hb-card.is-stacked .hb-desc, .hb-card.is-stacked .hb-desc p { -webkit-line-clamp: 2; font-size: 14px; }
	.hb-card .hb-desc.hb-desc-whole, .hb-card .hb-desc.hb-desc-whole p { -webkit-line-clamp: unset; }
	.hb-card.is-stacked .hb-kick { font-size: 11px; }
	:root { --wp--style--root--padding-left: 16px; --wp--style--root--padding-right: 16px; }
}

/* Button styled as a plain text link ("Listen on … →") */
.wp-block-button.is-style-hb-text .wp-block-button__link { background: none; color: var(--wp--preset--color--accent); padding: 0; border-radius: 0; }
.wp-block-button.is-style-hb-text .wp-block-button__link:hover { background: none; text-decoration: underline; }
.hb-crumb .wp-block-buttons { margin: 0; }
.hb-crumb .wp-block-button__link, .hb-crumb p { font-size: inherit !important; letter-spacing: inherit; text-transform: inherit; font-weight: inherit; margin: 0; }
.hb-crumb .hb-crumb-show { color: #5E574F; }
.hb-more-heading { margin: 0 0 24px; font-size: 26px; }
.hb-date-big { margin: 0; font-size: var(--wp--preset--font-size--x-large); color: var(--wp--preset--color--accent); }
.hb-release { display: flex; flex-direction: column; gap: 2px; padding: 16px 0; margin-top: 8px !important; border-top: 1px solid #DCCBBC; border-bottom: 1px solid #DCCBBC; }
.hb-release > * { margin: 0 !important; }
.hb-release .hb-release-date { font-size: 26px; font-weight: 500; }
.hb-book-author { margin: 0; font-style: italic; font-size: 24px; color: #3D3832; }
.wp-block-post-content { overflow-wrap: anywhere; }
.hb-more-section .wp-block-post-template > li { margin: 0; }
.hb-crumb + .wp-block-post-title { margin-top: 0; }
.hb-card > * { margin-block: 0 !important; }
.hb-card.is-stacked > .wp-block-post-featured-image { margin-bottom: 6px !important; }
.wp-site-blocks > * { margin-block-start: 0 !important; }
/* Short pages: keep the footer at the bottom of the screen. */
.wp-site-blocks { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wp-site-blocks > * { flex-shrink: 0; }
.wp-site-blocks > :last-child { margin-top: auto !important; }
.admin-bar .wp-site-blocks { min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px)); }
/* Search with no matches */
.hb-no-results { font-size: 17px; }
.hb-no-results-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: var(--wp--preset--color--contrast); }
.hb-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hb-pills .hb-pill { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border: 1px solid var(--hb-line); border-radius: 999px; background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); font-weight: 700; font-size: 15px; text-decoration: none; }
.hb-pills .hb-pill:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); }
.hb-footer-links { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.hb-hero-art { background: var(--wp--preset--color--tint-strong); border-radius: var(--wp--custom--radius--card); }
.hb-hero-art img { border-radius: 0 !important; }
.hb-hero-whole { text-align: center; }
.hb-hero-whole img { width: auto !important; max-width: 100%; max-height: 80vh; height: auto !important; margin: 0 auto; }
.hb-facts { align-content: start; align-items: start; }

/* Podcast player */
.hb-player-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--wp--custom--radius--card); overflow: hidden; background: #000; }
.hb-player-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hb-player-audio { max-width: 720px; margin: 16px auto 0; }
.hb-player-audio audio { width: 100%; }

/* "More in this section": small picture beside each title (shape follows the section) */
.hb-more-section .hb-more-card { gap: 14px; }
.hb-more-section .hb-more-thumb { width: 112px !important; max-width: none; }
.hb-more-section .hb-more-thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px !important; }
.hb-section-podcast .hb-more-section .hb-more-thumb { width: 84px !important; }
.hb-section-podcast .hb-more-section .hb-more-thumb img { aspect-ratio: 1; }
.hb-section-book .hb-more-section .hb-more-thumb { width: 64px !important; }
.hb-section-book .hb-more-section .hb-more-thumb img { aspect-ratio: 2 / 3; }
.hb-more-section .hb-more-title { font-size: 17px !important; }

/* Search: a rounded field with the button inside; in the menu bar an icon that opens into one */
.hb-search .wp-block-search__inside-wrapper { border: 1px solid #D9CFC3 !important; border-radius: 999px; background: #fff; padding: 3px !important; }
.hb-search .wp-block-search__input { border: 0 !important; background: transparent; padding: 6px 4px 6px 14px; font: inherit; font-size: 15px; min-width: 0; color: var(--wp--preset--color--contrast); }
.hb-search .wp-block-search__input::placeholder { color: #8A8178; opacity: 1; }
.hb-search .wp-block-search__input:focus { outline: none; }
.hb-search .wp-block-search__inside-wrapper:focus-within { border-color: var(--wp--preset--color--accent) !important; box-shadow: 0 0 0 2px rgba(178, 60, 42, .25); }
.hb-search .wp-block-search__button { margin: 0 !important; padding: 7px 11px; border-radius: 999px; background: var(--wp--preset--color--accent); color: #fff; border: 0; }
.hb-search .wp-block-search__button svg { width: 18px; height: 18px; fill: currentColor; }
.hb-utility { align-items: center; }
.hb-utility .hb-search { width: 300px; max-width: 60%; }
.hb-header .hb-search.wp-block-search__searchfield-hidden .wp-block-search__inside-wrapper { border-color: transparent !important; background: transparent; }
.hb-header .hb-search.wp-block-search__searchfield-hidden .wp-block-search__button { background: transparent; color: var(--wp--preset--color--contrast); }
.hb-header .hb-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input { width: 150px; }
.hb-header .hb-search-menu { display: none; }

/* Phone menu: full-width, left-aligned rows with room to tap, and the search field on top */
.hb-header .wp-block-navigation__responsive-container.is-menu-open { padding: 20px 24px 32px; background: var(--wp--preset--color--base, #FBF7F1); }
.hb-header .is-menu-open .wp-block-navigation__responsive-container-content { align-items: stretch !important; padding-top: 44px; }
.hb-header .is-menu-open .wp-block-navigation__container { flex-direction: column; align-items: stretch !important; gap: 0 !important; width: 100%; }
.hb-header .is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid var(--hb-line); }
.hb-header .is-menu-open .wp-block-navigation-item__content { display: block; width: 100%; padding: 12px 0 !important; font-size: 19px; text-align: left; }
.hb-header .is-menu-open .hb-search:not(.hb-search-menu) { display: none; }
.hb-header .is-menu-open .hb-search-menu { display: block; order: -1; width: 100%; margin-bottom: 8px; }
.hb-header .is-menu-open .hb-search-menu .wp-block-search__input { font-size: 16px; font-weight: 400; padding-block: 9px; }

/* Article byline: a small outline button to the original, in the first screen */
.hb-byline .hb-byline-link { flex-basis: 100%; margin: 6px 0 0 !important; }
.hb-byline .hb-byline-link::before { content: none; }
.hb-byline-link .wp-block-button__link { padding: 6px 14px !important; font-size: 14px; border: 1.5px solid var(--wp--preset--color--accent) !important; color: var(--wp--preset--color--accent) !important; background: transparent !important; }
.hb-byline-link .wp-block-button__link:hover { background: var(--wp--preset--color--accent) !important; color: #fff !important; }

/* Phones: square podcast art in a square box, smaller book covers */
@media (max-width: 720px) {
	.hb-hero-art { max-width: 280px; margin-inline: auto !important; }
	.hb-hero-art img { aspect-ratio: 1 !important; }
	.hb-book-hero article > :first-child { flex-basis: 100% !important; display: flex; justify-content: center; }
	.hb-book-hero .hb-cover-lg { width: 190px !important; max-width: 190px; }
	.hb-book-hero article { padding-top: 32px !important; row-gap: 28px !important; }
}

/* Lead story: the big card at the top of the home page (picture left, text right; stacked on phones) */
.hb-lead-list { list-style: none; margin: 0 0 40px; padding: 0 0 36px; border-bottom: 1px solid var(--hb-line); }
.hb-lead-card { gap: 28px; align-items: center; }
.hb-lead-card .wp-block-post-featured-image { flex: 0 0 50%; width: 50%; max-width: none; }
.hb-lead-card .wp-block-post-featured-image img { width: 100% !important; }
.hb-lead-card .wp-block-post-featured-image img { border-radius: var(--wp--custom--radius--card); }
.hb-lead-card > .hb-txt { gap: 10px; }
.hb-lead-list .category-latest-podcast-episodes .wp-block-post-featured-image img,
.hb-lead-list .category-new-book-releases .wp-block-post-featured-image img { object-fit: contain !important; background: var(--wp--preset--color--tint-strong); padding: 12px; box-sizing: border-box; }
.hb-lead-card .hb-card-title { font-size: 30px !important; line-height: 1.2; }
.hb-lead-card .hb-desc { font-size: 17px; color: #4A443E; }
.hb-flag { display: inline-block; align-self: flex-start; margin: 0; padding: 3px 10px; border-radius: 999px; background: var(--wp--preset--color--accent); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 720px) {
	.hb-lead-list { margin-bottom: 28px; padding-bottom: 28px; }
	.hb-lead-card { flex-direction: column; align-items: stretch; gap: 14px; }
	.hb-lead-card .wp-block-post-featured-image { flex-basis: auto; width: 100% !important; }
	.hb-lead-card .hb-card-title { font-size: 24px !important; }
	.hb-lead-card .hb-desc { font-size: 16px; }
}

/* Show buttons on the Podcasts page and show pages */
.hb-shows { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 32px; position: relative; }
.hb-show-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid #DDD2C6; border-radius: 999px; background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.hb-show-pill:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); }
.hb-show-pill.is-current { background: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); color: #fff; }
.hb-shows-more { position: relative; }
.hb-shows-more summary { list-style: none; }
.hb-shows-more summary::-webkit-details-marker { display: none; }
.hb-shows-more summary::after { content: "▾"; font-size: 12px; }
.hb-shows-more[open] summary { border-color: var(--wp--preset--color--accent); }
.hb-shows-more ul { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 280px; max-height: 360px; overflow: auto; margin: 0; padding: 6px 0; list-style: none; background: #fff; border: 1px solid #DDD2C6; border-radius: 14px; box-shadow: 0 14px 34px rgba(43, 39, 36, .16); }
.hb-shows-more li a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; color: var(--wp--preset--color--contrast); text-decoration: none; font-size: 15px; }
.hb-shows-more li a:hover { background: var(--wp--preset--color--tint); color: var(--wp--preset--color--accent); }
.hb-shows-more li span, .hb-show-pill span { color: var(--hb-muted); font-weight: 400; font-size: 13px; }
@media (max-width: 720px) {
	/* Phones: "All shows", the top show (or the current one) and "More shows", which lists them all */
	.hb-shows { gap: 8px; }
	.hb-shows:not(.hb-search-tabs) > .hb-show-pill:nth-of-type(n+3):not(.is-current) { display: none; }
	.hb-show-pill { min-height: 38px; padding: 0 14px; font-size: 14px; }
	.hb-shows-more { position: static; }
	.hb-shows-more ul { left: 0; right: 0; width: auto; }
}

/* Source pages */
.hb-source-intro { margin: -12px 0 28px; color: var(--hb-muted); font-size: 15px; }
.hb-source-intro a { color: var(--wp--preset--color--accent); }
.hb-source-intro a { display: inline-block; padding-block: 6px; }
.hb-source-link .wp-block-button__link { padding-block: 6px !important; font-style: italic; font-weight: 400 !important; text-decoration: underline; text-underline-offset: 3px; }

/* Home page header: the masthead on wider screens, the standard header (logo + menu button with search) on phones */
.hb-home-phone { display: none; }
.hb-home-desktop > *, .hb-home-phone > *, .hb-home-desktop, .hb-home-phone { margin-block: 0 !important; }
@media (max-width: 720px) {
	.hb-home-desktop { display: none; }
	.hb-home-phone { display: block; }
	/* The tagline sits under the logo row; the dividing line moves below it */
	.hb-home-phone .hb-header { border-bottom: 0; }
	.hb-home-phone .hb-header > .wp-block-group { padding-bottom: 6px !important; }
	.hb-phone-tagline { margin: 0 !important; padding: 0 var(--wp--style--root--padding-left, 16px) 14px; text-align: left !important; font-size: 14px; color: var(--hb-muted); border-bottom: 1px solid #E4DDD3; }
}

/* Search: suggestions while typing */
.hb-search .wp-block-search__inside-wrapper { position: relative; }
.hb-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.hb-suggest { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: max(100%, 360px); max-width: calc(100vw - 32px); max-height: min(70vh, 460px); overflow: auto; margin: 0; padding: 6px 0; list-style: none; background: #fff; border: 1px solid #DDD2C6; border-radius: 14px; box-shadow: 0 16px 38px rgba(43, 39, 36, .18); text-align: left; }
.hb-suggest[hidden] { display: none; }
.hb-suggest-item a { display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: var(--wp--preset--color--contrast); text-decoration: none; }
.hb-suggest-item[aria-selected="true"] a, .hb-suggest-item a:hover { background: var(--wp--preset--color--tint); }
.hb-suggest-item img, .hb-suggest-noimg { flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #EFE7DC; }
.hb-suggest-text { display: flex; flex-direction: column; min-width: 0; }
.hb-suggest-title { font-size: 15px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hb-suggest-meta { font-size: 13px; color: var(--hb-muted); }
.hb-suggest-item.is-source a { padding-block: 10px; }
.hb-suggest-item.is-source .hb-suggest-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--wp--preset--color--accent); vertical-align: 2px; }
.hb-suggest-item.is-all { border-top: 1px solid var(--hb-line); margin-top: 4px; }
.hb-suggest-item.is-all .hb-suggest-title { color: var(--wp--preset--color--accent); font-weight: 700; }
.hb-suggest-empty { padding: 10px 14px; color: var(--hb-muted); font-size: 14px; }
.hb-header .is-menu-open .hb-suggest { left: 0; right: 0; width: auto; max-width: none; }

/* Search results: section tabs, matching sources, help when nothing matches */
.hb-search-tabs { margin: 0 0 20px; }
.hb-source-hits { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 28px; }
.hb-source-hit { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border: 1px solid #DDD2C6; border-radius: 14px; background: var(--wp--preset--color--tint); color: var(--wp--preset--color--contrast); text-decoration: none; }
.hb-source-hit strong { font-size: 17px; }
.hb-source-hit span { font-size: 14px; color: var(--wp--preset--color--accent); font-weight: 700; }
.hb-source-hit:hover { border-color: var(--wp--preset--color--accent); }
.hb-did-you-mean { font-size: 18px; }
.hb-did-you-mean a { font-weight: 700; color: var(--wp--preset--color--accent); }
.hb-archive-head .hb-search { flex: 0 1 360px; }
.hb-show-pill.is-current span { color: rgba(255, 255, 255, .85); }
@media (max-width: 720px) {
	.hb-archive-head .hb-search { flex: 1 1 100%; width: 100% !important; }
	.hb-archive-head .hb-search .wp-block-search__inside-wrapper { width: 100% !important; box-sizing: border-box; }
}

/* Comfortable tap areas for small links */
.hb-footer-links a, .hb-more a { display: inline-block; padding: 6px 0; }
.hb-meta a, .hb-crumb a, .hb-crumb .wp-block-button__link { display: inline-block; padding-block: 6px !important; }

/* Small pictures: centred instead of stretched (see functions.php) */
.hb-img-small { text-align: center; }
.hb-img-small img { margin-inline: auto; }
.hb-hero-framed { aspect-ratio: 2 / 1; display: flex; align-items: center; justify-content: center; background: var(--wp--preset--color--tint-strong); border-radius: var(--wp--custom--radius--card); overflow: hidden; padding: 12px; box-sizing: border-box; }
.hb-hero-framed img { border-radius: 6px !important; }
