/* ==========================================================================
   Itemize Blog Template
   Fills in what templates/single.html + assets/itemize-fse.css do not cover.
   It loads after itemize-fse.css, so it can adjust without !important except
   where the theme already uses !important.
   ========================================================================== */

/* On pages these variables come from the page manifest's inline CSS, and on a
   post they do not exist. They are repeated here with the site's values. */
.itemize-post-template {
	--ink: #17233b;
	--muted: #5d6879;
	--line: #cfd7e3;
	--panel: #f4f7fa;
	--white: #ffffff;
	--accent: #14589d;
	--max: 1180px;
}

/* --------------------------------------------------------------------------
   1. Heading hierarchy inside the body
   itemize-fse.css defines h2 and h3; the site's posts also use h4.
   -------------------------------------------------------------------------- */
.itemize-post-body-wrap .wp-block-post-content h4 {
	margin: 1.6em 0 .5em !important;
	color: var(--itemize-navy, #0a1830) !important;
	font-size: 20px !important;
	font-weight: 700 !important;
	line-height: 1.35 !important;
	letter-spacing: -.01em !important;
}

.itemize-post-body-wrap .wp-block-post-content h5,
.itemize-post-body-wrap .wp-block-post-content h6 {
	margin: 1.5em 0 .5em !important;
	color: var(--itemize-ink, #17233b) !important;
	font-size: 17px !important;
	font-weight: 700 !important;
}

.itemize-post-body-wrap .wp-block-post-content strong {
	color: var(--itemize-navy, #0a1830);
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   2. Lists
   -------------------------------------------------------------------------- */
.itemize-post-body-wrap .wp-block-post-content ul,
.itemize-post-body-wrap .wp-block-post-content ol {
	padding-left: 1.35em !important;
}

.itemize-post-body-wrap .wp-block-post-content li {
	margin-bottom: .55em;
}

.itemize-post-body-wrap .wp-block-post-content li::marker {
	color: var(--itemize-blue, #1268e7);
}

.itemize-post-body-wrap .wp-block-post-content li > ul,
.itemize-post-body-wrap .wp-block-post-content li > ol {
	margin-top: .55em;
}

/* --------------------------------------------------------------------------
   3. Tables  (the theme has no rule at all for wp-block-table)
   -------------------------------------------------------------------------- */
.itemize-post-body-wrap .wp-block-table {
	margin: 2.4em 0 !important;
}

.itemize-post-body-wrap .wp-block-table > table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--line);
	border-radius: 14px;
	overflow: hidden;
	font-size: 15.5px;
	line-height: 1.5;
	background: #fff;
	box-shadow: 0 10px 30px rgba(10, 24, 48, .05);
}

.itemize-post-body-wrap .wp-block-table thead th,
.itemize-post-body-wrap .wp-block-table thead td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--line);
	background: linear-gradient(180deg, #f6f9fc 0%, #eef4fa 100%);
	color: var(--itemize-navy, #0a1830);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .02em;
	text-align: left;
	vertical-align: bottom;
}

.itemize-post-body-wrap .wp-block-table tbody td {
	padding: 14px 16px;
	border-bottom: 1px solid #e8eef6;
	color: #34425a;
	vertical-align: top;
}

.itemize-post-body-wrap .wp-block-table tbody tr:last-child td {
	border-bottom: 0;
}

.itemize-post-body-wrap .wp-block-table tbody tr:nth-child(even) td {
	background: #fafcfe;
}

/* first column as the row label */
.itemize-post-body-wrap .wp-block-table tbody td:first-child {
	color: var(--itemize-navy, #0a1830);
	font-weight: 650;
}

.itemize-post-body-wrap .wp-block-table figcaption,
.itemize-post-body-wrap .wp-block-post-content figcaption {
	margin-top: 12px;
	color: #74839a;
	font-size: 13.5px;
	line-height: 1.5;
	text-align: left;
}

/* on mobile the table scrolls instead of breaking the width */
@media (max-width: 720px) {
	.itemize-post-body-wrap .wp-block-table {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.itemize-post-body-wrap .wp-block-table > table {
		min-width: 560px;
		font-size: 14.5px;
	}
}

/* --------------------------------------------------------------------------
   4. Video / embeds  (the theme has no rules for these either)
   -------------------------------------------------------------------------- */
.itemize-post-body-wrap .wp-block-embed,
.itemize-post-body-wrap .itemize-embed {
	margin: 2.4em 0 !important;
}

.itemize-post-body-wrap .wp-block-embed__wrapper,
.itemize-post-body-wrap .itemize-embed {
	position: relative;
	border-radius: 18px;
	overflow: hidden;
	background: #0a1830;
	box-shadow: 0 22px 60px rgba(10, 24, 48, .18);
}

.itemize-post-body-wrap .wp-block-embed.wp-embed-aspect-16-9 .wp-block-embed__wrapper,
.itemize-post-body-wrap .itemize-embed {
	aspect-ratio: 16 / 9;
}

.itemize-post-body-wrap .wp-block-embed__wrapper > iframe,
.itemize-post-body-wrap .itemize-embed > iframe,
.itemize-post-body-wrap .wp-block-post-content iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* raw YouTube link with no oEmbed resolved: so it is not left as bare text */
.itemize-post-body-wrap .wp-block-embed__wrapper > a[href*="youtube.com"],
.itemize-post-body-wrap .wp-block-embed__wrapper > a[href*="youtu.be"] {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #fff !important;
	font-weight: 700;
	text-decoration: none !important;
}

/* --------------------------------------------------------------------------
   5. Images inside the body
   itemize-fse.css already sets radius and margins; we add width and caption.
   -------------------------------------------------------------------------- */
.itemize-post-body-wrap .wp-block-post-content figure.wp-block-image img {
	width: 100%;
	height: auto;
	box-shadow: 0 16px 44px rgba(10, 24, 48, .10);
}

.itemize-post-body-wrap .wp-block-post-content .alignwide {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 1180px;
	margin-inline: auto;
}

/* if the post has no featured image, the 54px gap must not be left behind */
.itemize-post-featured-wrap:not(:has(img)) {
	display: none !important;
}

/* --------------------------------------------------------------------------
   6. Buttons
   The site uses .button/.button.primary (defined in each page's inline CSS)
   and the blocks use .wp-block-button__link. A post has no inline CSS, so it
   is defined here with the site's own values.
   -------------------------------------------------------------------------- */
.itemize-post-template .wp-block-buttons {
	gap: 12px !important;
}

.itemize-post-body-wrap .wp-block-post-content .wp-block-button__link,
.itemize-post-template .wp-block-button__link,
.itemize-post-template .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid var(--ink);
	border-radius: 10px;
	background: var(--ink);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none !important;
	text-decoration-line: none !important;
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.itemize-post-body-wrap .wp-block-post-content .wp-block-button.primary .wp-block-button__link,
.itemize-post-template .wp-block-button.primary .wp-block-button__link,
.itemize-post-template .button.primary {
	border-color: #1267e8;
	background: #1267e8;
	color: #fff !important;
	box-shadow: 0 10px 22px rgba(18, 103, 232, .18);
}

.itemize-post-template .wp-block-button.primary .wp-block-button__link:hover,
.itemize-post-template .button.primary:hover {
	border-color: #0f5dcc;
	background: #0f5dcc;
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(18, 103, 232, .26);
}

.itemize-post-body-wrap .wp-block-post-content .wp-block-button.secondary .wp-block-button__link,
.itemize-post-template .wp-block-button.secondary .wp-block-button__link,
.itemize-post-template .button.secondary {
	border-color: var(--line);
	background: #fff;
	color: var(--itemize-navy, #0a1830) !important;
	box-shadow: 0 8px 20px rgba(10, 24, 48, .06);
}

.itemize-post-template .wp-block-button.secondary .wp-block-button__link:hover,
.itemize-post-template .button.secondary:hover {
	border-color: #1267e8;
	color: #1267e8 !important;
	transform: translateY(-2px);
}

/* action button group above the body (replay / download deck) */
.itemize-post-body-wrap .itemize-post-actions {
	margin: 0 0 2.2em !important;
	padding-bottom: 2em;
	border-bottom: 1px solid #e8eef6;
}

/* --------------------------------------------------------------------------
   7. HubSpot forms embedded in the body
   -------------------------------------------------------------------------- */
.itemize-post-body-wrap .itemize-hs-form {
	margin: 1.6em 0 .5em;
	padding: 30px 32px;
	border: 1px solid rgba(18, 104, 231, .16);
	border-radius: 18px;
	background: linear-gradient(135deg, #f6f9fc 0%, #f9fbfd 55%, #eff8ff 100%);
	box-shadow: 0 18px 48px rgba(10, 24, 48, .06);
}

.itemize-post-body-wrap .itemize-hs-form form {
	max-width: 100%;
}

.itemize-post-body-wrap .itemize-hs-form .hs-form-field {
	margin-bottom: 16px;
}

.itemize-post-body-wrap .itemize-hs-form label {
	display: block;
	margin-bottom: 6px;
	color: var(--itemize-navy, #0a1830);
	font-size: 13px;
	font-weight: 650;
}

.itemize-post-body-wrap .itemize-hs-form input[type="text"],
.itemize-post-body-wrap .itemize-hs-form input[type="email"],
.itemize-post-body-wrap .itemize-hs-form input[type="tel"],
.itemize-post-body-wrap .itemize-hs-form input[type="number"],
.itemize-post-body-wrap .itemize-hs-form select,
.itemize-post-body-wrap .itemize-hs-form textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--itemize-text, #263750);
	font-family: inherit;
	font-size: 15px;
}

.itemize-post-body-wrap .itemize-hs-form input:focus,
.itemize-post-body-wrap .itemize-hs-form select:focus,
.itemize-post-body-wrap .itemize-hs-form textarea:focus {
	border-color: #1267e8;
	outline: 2px solid rgba(18, 103, 232, .18);
	outline-offset: 1px;
}

.itemize-post-body-wrap .itemize-hs-form input[type="submit"],
.itemize-post-body-wrap .itemize-hs-form .hs-button {
	min-height: 44px;
	padding: 12px 22px;
	border: 1px solid #1267e8;
	border-radius: 10px;
	background: #1267e8;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 10px 22px rgba(18, 103, 232, .18);
	transition: background .2s ease, transform .2s ease;
}

.itemize-post-body-wrap .itemize-hs-form input[type="submit"]:hover,
.itemize-post-body-wrap .itemize-hs-form .hs-button:hover {
	background: #0f5dcc;
	transform: translateY(-2px);
}

.itemize-post-body-wrap .itemize-hs-form .hs-error-msg,
.itemize-post-body-wrap .itemize-hs-form .hs-error-msgs label {
	color: #c0392b;
	font-size: 12.5px;
	font-weight: 600;
}

.itemize-post-body-wrap .itemize-hs-form ul {
	margin: 4px 0 0 !important;
	padding-left: 0 !important;
	list-style: none;
}

/* --------------------------------------------------------------------------
   8. Post header details
   -------------------------------------------------------------------------- */
/* if the post has no category, we do not show an empty kicker */
.itemize-post-kicker:empty {
	display: none !important;
}

.itemize-post-taxonomy:not(:has(a)) {
	display: none !important;
}

/* spacing for the previous/next navigation block */
.itemize-post-navigation .post-navigation-link-previous a::before {
	content: "\2190\00a0";
}

.itemize-post-navigation .post-navigation-link-next {
	text-align: right;
}

.itemize-post-navigation .post-navigation-link-next a::after {
	content: "\00a0\2192";
}

/* --------------------------------------------------------------------------
   9. Odds and ends
   -------------------------------------------------------------------------- */
.itemize-post-body-wrap .wp-block-post-content hr {
	margin: 2.4em 0 !important;
	border: 0;
	border-top: 1px solid var(--line);
}

.itemize-post-body-wrap .wp-block-post-content code {
	padding: 2px 6px;
	border: 1px solid #e3eaf3;
	border-radius: 6px;
	background: #f6f9fc;
	font-size: .92em;
}

.itemize-post-body-wrap .wp-block-post-content > *:last-child {
	margin-bottom: 0 !important;
}

@media (max-width: 720px) {
	.itemize-post-body-wrap .itemize-hs-form {
		padding: 22px 18px;
	}

	.itemize-post-template .wp-block-buttons .wp-block-button {
		width: 100%;
	}

	.itemize-post-template .wp-block-buttons .wp-block-button__link {
		width: 100%;
	}
}

/* ------------------------------------------------------------------ *
 * v1.1.0 - Featured image inside the post (client request)
 *
 * The reference post the client sent does not show the featured image in the
 * post body: the content starts right below the header. The mode is decided in
 * PHP (itemize_blog_featured_mode filter) and arrives as a <body> class.
 * ------------------------------------------------------------------ */

/* 'hidden' (default): no image. PHP no longer renders the block; this closes
 * the empty container's gap and tunes the space between the header and the
 * first paragraph, so no huge void is left. */
body.itemize-featured-hidden .itemize-post-featured-wrap {
	display: none !important;
}

body.itemize-featured-hidden .itemize-post-hero {
	padding-bottom: 68px !important;
}

body.itemize-featured-hidden .itemize-post-body-wrap {
	padding-top: 48px !important;
}

/* 'compact': the image is shown, small and centered, without pushing content. */
body.itemize-featured-compact .itemize-post-featured-wrap {
	padding: 38px 24px 0 !important;
}

body.itemize-featured-compact .itemize-post-featured {
	max-width: 620px;
	margin: 0 auto !important;
	border-radius: 16px !important;
	box-shadow: 0 14px 40px rgba(10, 24, 48, .1) !important;
}

body.itemize-featured-compact .itemize-post-body-wrap {
	padding-top: 52px !important;
}

@media (max-width: 720px) {
	body.itemize-featured-hidden .itemize-post-hero {
		padding-bottom: 46px !important;
	}

	body.itemize-featured-hidden .itemize-post-body-wrap {
		padding-top: 34px !important;
	}

	body.itemize-featured-compact .itemize-post-featured-wrap {
		padding: 26px 18px 0 !important;
	}
}

/* ------------------------------------------------------------------ *
 * v1.4.0 - Post header aligned left
 *
 * Client request: "make all the text in the header section left aligned".
 * Two things center the header and both have to be beaten:
 *
 *   1. the theme, in itemize-fse.css:
 *        .itemize-post-hero-inner { text-align: center }
 *        .itemize-post-title, .itemize-post-deck { margin: 0 auto !important }
 *        .itemize-post-meta { justify-content: center !important }
 *   2. WordPress, because the group uses the 'constrained' layout and gives
 *      every child  margin-left: auto !important; margin-right: auto !important.
 *
 * Hence the !important and the extra specificity (body.itemize-hero-left).
 *
 * The detail that matters: the header column was 900px and the body column is
 * 780px, both centered, so the title started 60px to the left of the first
 * paragraph. Centered you could not tell; left aligned you can. That is why
 * the header moves to 780px: title, standfirst and byline share the body's
 * left edge exactly. The background band (.itemize-post-hero) stays full
 * width.
 * ------------------------------------------------------------------ */
body.itemize-hero-left .itemize-post-hero-inner {
	max-width: 780px !important; /* = contentSize de .itemize-post-body-wrap */
	text-align: left !important;
}

/* Every child sits on the column's left edge. margin-left and margin-right are
 * written separately, never the 'margin' shorthand, so the top margin the theme
 * gives the standfirst and the byline is not wiped out. */
body.itemize-hero-left .itemize-post-hero-inner > * {
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	text-align: left !important;
}

/* The byline (date • author) is a flex container: text-align is not enough. */
body.itemize-hero-left .itemize-post-meta {
	justify-content: flex-start !important;
}

/* The 'center' mode needs no rules: without the itemize-hero-left class the
 * theme's original centering applies. */
