/* ---- Single blog post -----------------------------------------------------
   Same tokens as blog.css and the Elementor kit: navy #1B3369, link #295FEA,
   accent #C2410C, hairline #E5E9F2, page bg #F8F9FC, muted #566B87.
   Poppins is already loaded by the kit, so nothing extra is fetched. */

.itst-post { background: #F8F9FC; font-family: "Poppins", sans-serif; }
.itst-post__wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Banner band ---- */
.itst-post__banner {
	background-image: linear-gradient(96deg, #1D4ED8 0%, #7E22CE 100%);
	padding: 52px 0 56px;
}
.itst-post__banner-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	align-items: center;
	gap: 48px;
}

.itst-post__cat {
	display: inline-block;
	margin-bottom: 16px;
	padding: 5px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .16);
	color: #FFFFFF;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}
.itst-post__cat:hover,
.itst-post__cat:focus-visible { background: #FFFFFF; color: #1B3369; }

.itst-post__title {
	margin: 0 0 22px;
	color: #FFFFFF;
	font-size: 40px;
	line-height: 1.22;
	font-weight: 700;
	letter-spacing: -.01em;
}

.itst-post__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	color: rgba(255, 255, 255, .9);
	font-size: 14.5px;
}
.itst-post__author { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.itst-post__avatar {
	width: 36px;
	height: 36px;
	border-radius: 999px;
	border: 2px solid rgba(255, 255, 255, .55);
	display: block;
}
.itst-post__sep {
	width: 1px;
	height: 16px;
	background: rgba(255, 255, 255, .38);
}

/* ---- Banner thumbnail ---- */
.itst-post__banner-media { display: block; }
.itst-post__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: 20px;
	border: 1px solid rgba(255, 255, 255, .28);
	box-shadow: 0 20px 44px rgba(10, 21, 48, .28);
	background: #EEF2FB;
}
/* Posts without a featured image get the same branded monogram the blog cards
   use, so the banner never shows an empty frame. */
.itst-post__thumb--ph {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .14);
	color: #FFFFFF;
	font-size: 62px;
	font-weight: 700;
}

/* ---- Body layout ---- */
.itst-post__body { padding: 52px 0 72px; }
.itst-post__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	align-items: start;
	gap: 40px;
}

.itst-post__article {
	background: #FFFFFF;
	border: 1px solid #E5E9F2;
	border-radius: 16px;
	box-shadow: 0 2px 8px rgba(27, 51, 105, .08);
	padding: 36px 40px 40px;
}

.itst-post__content { color: #374151; font-size: 16px; line-height: 1.75; }
.itst-post__content > *:first-child { margin-top: 0; }
.itst-post__content > *:last-child { margin-bottom: 0; }
.itst-post__content h2,
.itst-post__content h3,
.itst-post__content h4 {
	color: #1B3369;
	font-weight: 600;
	line-height: 1.3;
	margin: 34px 0 12px;
}
.itst-post__content h2 { font-size: 26px; }
.itst-post__content h3 { font-size: 20px; }
.itst-post__content h4 { font-size: 17px; }
.itst-post__content p { margin: 0 0 18px; }
.itst-post__content ul,
.itst-post__content ol { margin: 0 0 18px; padding-left: 22px; }
.itst-post__content li { margin-bottom: 8px; }
.itst-post__content a { color: #295FEA; text-decoration: underline; text-underline-offset: 2px; }
.itst-post__content a:hover,
.itst-post__content a:focus-visible { color: #C2410C; }
.itst-post__content img { max-width: 100%; height: auto; border-radius: 12px; display: block; }
.itst-post__content blockquote {
	margin: 24px 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid #C2410C;
	color: #1B3369;
	font-size: 17px;
}
.itst-post__content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 20px;
	font-size: 14.5px;
}
.itst-post__content th,
.itst-post__content td { border: 1px solid #E5E9F2; padding: 10px 12px; text-align: left; }
.itst-post__content th { background: #F5F7FB; color: #1B3369; font-weight: 600; }

/* ---- Tags ---- */
.itst-post__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #E5E9F2;
}
.itst-post__tags a {
	display: inline-block;
	padding: 5px 13px;
	border-radius: 999px;
	background: #FFF3EB;
	color: #9A3412;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}
.itst-post__tags a:hover,
.itst-post__tags a:focus-visible { background: #C2410C; color: #FFFFFF; }

/* ---- Prev / next ---- */
.itst-post__nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-top: 32px;
	padding-top: 26px;
	border-top: 1px solid #E5E9F2;
}
.itst-post__nav-link {
	display: block;
	padding: 16px 18px;
	border: 1px solid #E5E9F2;
	border-radius: 10px;
	text-decoration: none;
	transition: border-color .2s ease, background-color .2s ease;
}
.itst-post__nav-link:hover,
.itst-post__nav-link:focus-visible { border-color: #295FEA; background: #F5F7FB; }
.itst-post__nav-link--next { text-align: right; grid-column: 2; }
.itst-post__nav-label {
	display: block;
	margin-bottom: 5px;
	color: #566B87;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.itst-post__nav-title { display: block; color: #1B3369; font-size: 14.5px; font-weight: 600; line-height: 1.5; }

/* ---- Sidebar rail ----
   Offset matches the course-page sidebar in itst-site-support.php: the sticky
   #masthead is 72px tall, so 96px clears it with breathing room, and the fixed
   admin bar adds 32px on top of that when a logged-in user is viewing. */
.itst-post__rail { position: sticky; top: 96px; align-self: start; }
.admin-bar .itst-post__rail { top: 128px; }
.itst-post__rail > * {
	background: #FFFFFF;
	border: 1px solid #E5E9F2;
	border-radius: 16px;
	box-shadow: 0 2px 8px rgba(27, 51, 105, .08);
	padding: 22px 24px;
	margin-bottom: 20px;
}
.itst-post__rail h2,
.itst-post__rail h3,
.itst-post__rail .wp-block-heading {
	margin: 0 0 14px;
	color: #1B3369;
	font-size: 16px;
	font-weight: 600;
}
.itst-post__rail ul { list-style: none; margin: 0; padding: 0; }
.itst-post__rail li { padding: 8px 0; border-bottom: 1px solid #E5E9F2; font-size: 14.5px; line-height: 1.55; }
.itst-post__rail li:last-child { border-bottom: 0; padding-bottom: 0; }
.itst-post__rail a { color: #374151; text-decoration: none; transition: color .2s ease; }
.itst-post__rail a:hover,
.itst-post__rail a:focus-visible { color: #295FEA; }
.itst-post__rail input[type="search"],
.itst-post__rail input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #E5E9F2;
	border-radius: 10px;
	font-family: inherit;
	font-size: 14.5px;
	color: #374151;
	background: #FFFFFF;
}
.itst-post__rail input::placeholder { color: #566B87; }
.itst-post__rail input[type="search"]:focus,
.itst-post__rail input[type="text"]:focus { outline: 2px solid #295FEA; outline-offset: 1px; border-color: #295FEA; }
.itst-post__rail button,
.itst-post__rail .wp-block-search__button {
	margin-top: 10px;
	padding: 10px 18px;
	border: 0;
	border-radius: 10px;
	background: #C2410C;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .2s ease;
}
.itst-post__rail button:hover,
.itst-post__rail .wp-block-search__button:hover { background: #9A3412; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
	.itst-post__banner-grid { gap: 32px; }
	.itst-post__title { font-size: 32px; }
	.itst-post__layout { grid-template-columns: minmax(0, 1fr); }
	/* Below the desktop breakpoint the rail drops under the article, where
	   sticky would strand it mid-scroll. */
	.itst-post__rail,
	.admin-bar .itst-post__rail { position: static; top: auto; }
	.itst-post__article { padding: 30px 28px 32px; }
}
@media (max-width: 767px) {
	/* Banner stacks: text first, thumbnail beneath it. */
	.itst-post__banner { padding: 36px 0 40px; }
	.itst-post__banner-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.itst-post__title { font-size: 25px; margin-bottom: 18px; }
	.itst-post__meta { font-size: 13.5px; gap: 10px; }
	.itst-post__thumb { aspect-ratio: 16 / 9; border-radius: 16px; }
	.itst-post__thumb--ph { font-size: 46px; }
	.itst-post__body { padding: 32px 0 52px; }
	.itst-post__article { padding: 24px 20px 26px; border-radius: 14px; }
	.itst-post__content { font-size: 15.5px; }
	.itst-post__content h2 { font-size: 22px; }
	.itst-post__nav { grid-template-columns: minmax(0, 1fr); }
	.itst-post__nav-link--next { grid-column: 1; text-align: left; }
}
