/*
 * Union Federal Blog
 * Matches the Union-Federal theme: Roboto, navy titles, square outline buttons,
 * 1140px Bootstrap container. Everything is scoped to .uf-blog.
 */

.uf-blog {
	--uf-navy: #002458;
	--uf-title: #153877;
	--uf-slate: #364662;
	--uf-red: #941d28;
	--uf-gray: #eeeeee;
	--uf-text: #000000;
	--uf-muted: #5b6577;

	font-family: Roboto, sans-serif;
	color: var(--uf-text);
	padding: 50px 0 90px;
}

.uf-blog--no-banner {
	padding-top: 50px;
}

/* Banner: height comes from the theme's own .banner-section rules
   (60% of screen height on desktop, like every other inner page). */
.uf-blog-banner .banner-inner-section {
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* ---------- Listing header ---------- */

.uf-blog__header {
	margin-bottom: 44px;
}

.uf-blog__title,
.uf-post__title {
	font-family: Roboto, sans-serif;
	color: var(--uf-title);
	font-weight: 600;
	margin: 0 0 14px;
}

.uf-blog__title {
	font-size: 40px;
	line-height: 1.3;
	text-transform: uppercase;
}

.uf-blog__title::after {
	content: "";
	display: block;
	width: 60px;
	height: 3px;
	margin-top: 14px;
	background: var(--uf-red);
}

.uf-blog__intro,
.uf-blog__intro p {
	font-size: 18px;
	line-height: 1.7;
	max-width: 760px;
	margin: 0;
}

.uf-blog__empty {
	font-size: 18px;
	line-height: 1.7;
}

/* ---------- Cards ---------- */

.uf-blog__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
}

.uf-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(0, 36, 88, 0.17);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.uf-card:hover {
	box-shadow: 0 10px 28px rgba(0, 36, 88, 0.12);
	transform: translateY(-2px);
}

.uf-card__image {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--uf-gray);
}

/* The theme (Twenty Twenty-One based) puts an inline height on every
   featured image, so !important is needed to make the photo fill the frame. */
.uf-blog .uf-card__image img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.uf-card:hover .uf-card__image img {
	transform: scale(1.03);
}

.uf-card__placeholder {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--uf-navy) 0%, var(--uf-slate) 100%);
}

.uf-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 24px 24px 28px;
}

.uf-card__date {
	display: block;
	font-size: 13px;
	line-height: 1.4;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--uf-red);
	margin-bottom: 10px;
}

.uf-card__title {
	font-size: 22px;
	line-height: 1.35;
	font-weight: 600;
	margin: 0 0 12px;
}

.uf-card__title a {
	color: var(--uf-title);
	text-decoration: none;
}

.uf-card__title a:hover,
.uf-card__title a:focus {
	color: var(--uf-navy);
	text-decoration: underline;
}

.uf-card__excerpt,
.uf-card__excerpt p {
	font-size: 16px;
	line-height: 1.65;
	color: var(--uf-text);
	margin: 0 0 22px;
}

.uf-card .uf-btn {
	align-self: flex-start;
	margin-top: auto;
}

/* ---------- Buttons (theme's .common-border-btn look, as a fallback) ---------- */

.uf-blog .uf-btn {
	display: inline-block;
	font-family: Roboto, sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
	text-transform: capitalize;
	text-decoration: none;
	color: var(--uf-navy);
	background: transparent;
	border: 1px solid var(--uf-navy);
	border-radius: 0;
	padding: 8px 15px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.uf-blog .uf-btn:hover,
.uf-blog .uf-btn:focus {
	color: #fff;
	background: var(--uf-navy);
}

/* ---------- Pagination ---------- */

.uf-blog .uf-pagination {
	margin-top: 56px;
}

.uf-blog .uf-pagination .nav-links,
.uf-pagination--inline {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.uf-blog .uf-pagination .page-numbers,
.uf-pagination--inline > a,
.uf-pagination--inline > span {
	display: inline-block;
	min-width: 40px;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	text-align: center;
	text-decoration: none;
	color: var(--uf-navy);
	border: 1px solid var(--uf-navy);
}

.uf-blog .uf-pagination .page-numbers.current,
.uf-blog .uf-pagination a.page-numbers:hover,
.uf-pagination--inline > a:hover {
	color: #fff;
	background: var(--uf-navy);
}

.uf-blog .uf-pagination .page-numbers.dots {
	border-color: transparent;
}

/* ---------- Single post ---------- */

.uf-post__article {
	max-width: 820px;
	margin: 0 auto;
}

.uf-post__header {
	padding-bottom: 24px;
	margin-bottom: 36px;
	border-bottom: 1px solid var(--uf-gray);
}

.uf-post__back {
	display: inline-block;
	margin-bottom: 18px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	color: var(--uf-navy);
}

.uf-post__back:hover,
.uf-post__back:focus {
	text-decoration: underline;
}

.uf-post__title {
	font-size: 38px;
	line-height: 1.25;
}

.uf-post__content {
	font-size: 18px;
	line-height: 1.7;
}

.uf-post__content > * {
	margin-top: 0;
	margin-bottom: 1.25em;
}

.uf-post__content h2,
.uf-post__content h3,
.uf-post__content h4 {
	font-family: Roboto, sans-serif;
	color: var(--uf-title);
	font-weight: 600;
	text-transform: none;
	line-height: 1.3;
	margin-top: 1.6em;
	margin-bottom: 0.6em;
}

.uf-post__content h2 { font-size: 28px; }
.uf-post__content h3 { font-size: 23px; }
.uf-post__content h4 { font-size: 20px; }

.uf-post__content a {
	color: var(--uf-title);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.uf-post__content a:hover {
	color: var(--uf-red);
}

.uf-post__content ul,
.uf-post__content ol {
	padding-left: 1.4em;
}

.uf-post__content li {
	margin-bottom: 0.4em;
}

.uf-post__content blockquote {
	margin-left: 0;
	margin-right: 0;
	padding: 18px 24px;
	border-left: 4px solid var(--uf-red);
	background: #f6f7f9;
	font-size: 19px;
}

.uf-post__content blockquote p:last-child {
	margin-bottom: 0;
}

.uf-post__content img,
.uf-post__content figure {
	max-width: 100%;
	height: auto;
}

.uf-post__content figcaption {
	font-size: 14px;
	color: var(--uf-muted);
	margin-top: 8px;
}

.uf-post__content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
}

.uf-post__content th,
.uf-post__content td {
	padding: 10px 12px;
	border: 1px solid #d8dde5;
	text-align: left;
}

.uf-post__content th {
	background: var(--uf-navy);
	color: #fff;
}

.uf-post__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid var(--uf-gray);
}

/* ---------- Homepage section ---------- */

.uf-blog.uf-home-blog {
	padding: 60px 0;
}

.uf-home-blog__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: 36px;
}

.uf-home-blog .uf-home-blog__title {
	font-family: Roboto, sans-serif;
	font-size: 40px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
	color: #000;
	margin: 0;
}

/* Two posts: two wide cards instead of two-thirds of a row. */
.uf-blog__grid--count-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* One post: a single wide feature card, image left and text right,
   matching the image-and-text sections elsewhere on the homepage. */
.uf-blog__grid--count-1 {
	grid-template-columns: 1fr;
}

.uf-blog__grid--count-1 .uf-card {
	flex-direction: row;
	align-items: stretch;
}

.uf-blog__grid--count-1 .uf-card__image {
	flex: 0 0 50%;
	aspect-ratio: auto;
	min-height: 340px;
}

.uf-blog__grid--count-1 .uf-card__body {
	justify-content: center;
	padding: 40px 48px;
}

.uf-blog__grid--count-1 .uf-card__title {
	font-size: 30px;
}

.uf-blog__grid--count-1 .uf-card__excerpt {
	font-size: 18px;
	line-height: 1.7;
}

/* Keep theme heading rules (uppercase, 40px) off the card titles. */
.uf-blog .uf-card__title {
	font-family: Roboto, sans-serif;
	text-transform: none;
	letter-spacing: normal;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.uf-blog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}
	.uf-blog__grid--count-1 {
		grid-template-columns: 1fr;
	}
	.uf-blog__grid--count-1 .uf-card__body {
		padding: 28px 32px;
	}
	.uf-blog__title { font-size: 32px; }
	.uf-post__title { font-size: 30px; }
}

@media (max-width: 575px) {
	.uf-blog {
		padding: 32px 0 60px;
	}
	.uf-blog__grid,
	.uf-blog__grid--count-2 {
		grid-template-columns: 1fr;
	}
	.uf-blog__grid--count-1 .uf-card {
		flex-direction: column;
	}
	.uf-blog__grid--count-1 .uf-card__image {
		flex-basis: auto;
		aspect-ratio: 16 / 10;
		min-height: 0;
	}
	.uf-blog__grid--count-1 .uf-card__body {
		padding: 24px 24px 28px;
	}
	.uf-blog__grid--count-1 .uf-card__title {
		font-size: 22px;
	}
	.uf-blog__title,
	.uf-home-blog .uf-home-blog__title { font-size: 28px; }
	.uf-blog.uf-home-blog { padding: 44px 0; }
	.uf-post__title { font-size: 26px; }
	.uf-post__content { font-size: 17px; }
}

/* Screen-reader text, in case the theme doesn't define it. */
.uf-blog .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
