/**
 * Blog: the posts page, single posts, blog category and tag archives, and the
 * blog search. Loaded on those views only (inc/blog.php).
 *
 * Colors and type come from variables.css. Breakpoints follow main.css: the
 * sidebar sits beside the posts from 1024px up and drops below them under it,
 * and every link or control a phone can tap is at least 44px tall there.
 */

/* ---------------------------------------------------------------- Layout */
.gatorpress-blog {
	padding-top: 32px;
	padding-bottom: 56px;
}

.gatorpress-blog__head {
	margin: 0 0 28px;
}
.gatorpress-blog__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: 32px;
	font-weight: 900;
	line-height: 1.15;
	color: var(--color-ink);
}
.gatorpress-blog__intro {
	margin: 8px 0 0;
	color: var(--color-secondary);
	font-size: 16px;
}

.gatorpress-blog__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 40px;
}
/* Grid items default to min-content width; without this a long word or a
   wide embed in a post would widen the column and scroll the page sideways. */
.gatorpress-blog__main,
.gatorpress-blog-sidebar {
	min-width: 0;
}

@media (min-width: 1024px) {
	.gatorpress-blog__layout {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 48px;
		align-items: start;
	}
}

/* ---------------------------------------------------------------- Cards */
.gatorpress-blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
	gap: 28px 24px;
}

.gatorpress-blog-card {
	display: flex;
	flex-direction: column;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: 4px;
	overflow: hidden;
}

.gatorpress-blog-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--color-surface);
	overflow: hidden;
}
.gatorpress-blog-card__media img.gatorpress-blog-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}
.gatorpress-blog-card:hover .gatorpress-blog-card__img {
	transform: scale(1.03);
}
.gatorpress-blog-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
.gatorpress-blog-card__placeholder img {
	width: 46%;
	height: auto;
	opacity: 0.35;
}

.gatorpress-blog-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 16px 18px 20px;
	flex: 1 1 auto;
}
.gatorpress-blog-card__title {
	margin: 2px 0 0;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
}
.gatorpress-blog-card__title a {
	color: var(--color-ink);
	text-decoration: none;
}
.gatorpress-blog-card__title a:hover,
.gatorpress-blog-card__title a:focus-visible {
	color: var(--color-brand-primary);
}
.gatorpress-blog-card__summary {
	margin: 0;
	color: var(--color-body-text);
	font-size: 15px;
	line-height: 1.55;
}

/* Category label and date, shared by cards and posts. */
.gatorpress-blog-label {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 0 10px;
	background: var(--color-brand-primary);
	color: #fff;
	border-radius: var(--radius-button);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
}
.gatorpress-blog-label:hover,
.gatorpress-blog-label:focus-visible {
	background: var(--color-brand-primary-hover);
	color: #fff;
}
.gatorpress-blog-date {
	color: var(--color-secondary);
	font-size: 13px;
}

/* ---------------------------------------------------------------- Pagination */
.gatorpress-blog-pagination {
	margin-top: 40px;
}
.gatorpress-blog-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.gatorpress-blog-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	color: var(--color-ink);
	font-weight: 600;
	text-decoration: none;
}
.gatorpress-blog-pagination a.page-numbers:hover,
.gatorpress-blog-pagination a.page-numbers:focus-visible,
.gatorpress-blog-pagination .page-numbers.current {
	background: var(--color-border);
	color: var(--color-ink);
}
.gatorpress-blog-pagination .page-numbers.dots {
	border-color: transparent;
}

.gatorpress-blog__empty {
	padding: 32px;
	background: var(--color-surface);
	border-radius: 4px;
}
.gatorpress-blog__empty p { margin: 0 0 8px; }

/* ---------------------------------------------------------------- Sidebar */
.gatorpress-blog-sidebar {
	display: flex;
	flex-direction: column;
	gap: 32px;
}
.gatorpress-blog-widget__title {
	margin: 0 0 12px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--color-ink);
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-ink);
}

.gatorpress-blog-search {
	display: flex;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	overflow: hidden;
}
.gatorpress-blog-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 0 12px;
	border: 0;
	font: inherit;
	font-size: 16px;
	color: var(--color-ink);
	background: var(--color-bg);
}
.gatorpress-blog-search button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	min-height: 44px;
	border: 0;
	background: var(--color-brand-primary);
	color: #fff;
	cursor: pointer;
}
.gatorpress-blog-search button:hover,
.gatorpress-blog-search button:focus-visible {
	background: var(--color-brand-primary-hover);
}

.gatorpress-blog-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.gatorpress-blog-list li {
	border-bottom: 1px solid var(--color-border);
}
.gatorpress-blog-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	padding: 8px 0;
	color: var(--color-ink);
	font-size: 15px;
	line-height: 1.35;
	text-decoration: none;
}
.gatorpress-blog-list a:hover,
.gatorpress-blog-list a:focus-visible,
.gatorpress-blog-list a[aria-current="page"] {
	color: var(--color-brand-primary);
}
.gatorpress-blog-list__count {
	color: var(--color-secondary);
	font-size: 13px;
}
.gatorpress-blog-list--posts a {
	font-weight: 600;
}

/* ---------------------------------------------------------------- Single post */
.gatorpress-blog-post__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 24px;
}
.gatorpress-blog-post__title {
	margin: 0;
	font-size: 36px;
	font-weight: 900;
	line-height: 1.15;
	color: var(--color-ink);
	overflow-wrap: anywhere;
}
.gatorpress-blog-post__image {
	margin: 0 0 28px;
}
/* Full column width when the file is that wide, never stretched past its own
   pixels: the width attribute carries the native width, and this only caps it
   at the column. */
.gatorpress-blog-post__image img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

/* Post typography. The old posts come from three editors (classic HTML,
   WPBakery and blocks), so this styles plain elements rather than block
   classes wherever it can. */
.gatorpress-blog-content {
	color: var(--color-body-text);
	font-size: 17px;
	line-height: 1.7;
	overflow-wrap: break-word;
}
.gatorpress-blog-content::after {
	content: "";
	display: table;
	clear: both;
}
.gatorpress-blog-content > *:first-child { margin-top: 0; }
.gatorpress-blog-content p,
.gatorpress-blog-content ul,
.gatorpress-blog-content ol,
.gatorpress-blog-content figure,
.gatorpress-blog-content blockquote,
.gatorpress-blog-content table {
	margin: 0 0 1.2em;
}
.gatorpress-blog-content h2,
.gatorpress-blog-content h3,
.gatorpress-blog-content h4,
.gatorpress-blog-content h5,
.gatorpress-blog-content h6 {
	margin: 1.6em 0 0.6em;
	color: var(--color-ink);
	font-weight: 800;
	line-height: 1.25;
}
.gatorpress-blog-content h2 { font-size: 26px; }
.gatorpress-blog-content h3 { font-size: 21px; }
.gatorpress-blog-content h4,
.gatorpress-blog-content h5,
.gatorpress-blog-content h6 { font-size: 18px; }
.gatorpress-blog-content ul,
.gatorpress-blog-content ol {
	padding-left: 1.4em;
}
.gatorpress-blog-content li { margin-bottom: 0.4em; }
.gatorpress-blog-content a {
	color: var(--color-brand-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.gatorpress-blog-content a:hover,
.gatorpress-blog-content a:focus-visible {
	color: var(--color-brand-primary-hover);
}
.gatorpress-blog-content blockquote {
	padding: 4px 0 4px 20px;
	border-left: 4px solid var(--color-brand-primary);
	color: var(--color-ink-soft);
	font-style: italic;
}
.gatorpress-blog-content hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--color-border);
}
.gatorpress-blog-content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
}
.gatorpress-blog-content td,
.gatorpress-blog-content th {
	padding: 6px 10px;
	border: 1px solid var(--color-border);
}

/* Images, galleries, captions. */
.gatorpress-blog-content img {
	max-width: 100%;
	height: auto;
}
.gatorpress-blog-content figure {
	max-width: 100%;
}
.gatorpress-blog-content figcaption,
.gatorpress-blog-content .wp-caption-text {
	margin-top: 6px;
	color: var(--color-secondary);
	font-size: 14px;
	line-height: 1.45;
}
.gatorpress-blog-content .wp-caption {
	max-width: 100%;
}
.gatorpress-blog-content .alignleft {
	float: left;
	margin: 0.3em 24px 16px 0;
}
.gatorpress-blog-content .alignright {
	float: right;
	margin: 0.3em 0 16px 24px;
}
.gatorpress-blog-content .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}
/* Wide and full blocks were sized for the old site's full-width template;
   here they stay inside the post column. */
.gatorpress-blog-content .alignwide,
.gatorpress-blog-content .alignfull {
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
	width: auto;
}

/* Embeds and videos fill the column at 16:9. */
.gatorpress-blog-content iframe,
.gatorpress-blog-content video {
	display: block;
	max-width: 100%;
}
.gatorpress-blog-content iframe[src*="youtube"],
.gatorpress-blog-content .wp-block-embed iframe {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}
.gatorpress-blog-content .wp-block-embed__wrapper::before {
	/* Core's padding-top ratio box would stack on top of aspect-ratio. */
	display: none;
}
.gatorpress-blog-content video {
	width: 100%;
	height: auto;
}

/* The old site's "Shop Now" buttons, converted from its theme shortcode. */
.gatorpress-blog-content .gatorco-blog-button {
	text-align: center;
}
.gatorpress-blog-content .gatorco-blog-button__link,
.gatorpress-blog-content .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 24px;
	background: var(--color-brand-primary);
	color: #fff;
	border-radius: var(--radius-button);
	font-weight: 700;
	text-decoration: none;
}
.gatorpress-blog-content .gatorco-blog-button__link:hover,
.gatorpress-blog-content .gatorco-blog-button__link:focus-visible,
.gatorpress-blog-content .wp-block-button__link:hover,
.gatorpress-blog-content .wp-block-button__link:focus-visible {
	background: var(--color-brand-primary-hover);
	color: #fff;
}

/* Tags */
.gatorpress-blog-post__tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 32px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--color-border);
}
.gatorpress-blog-post__tags-label {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-ink);
}
.gatorpress-blog-post__tags ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.gatorpress-blog-post__tags a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--color-border);
	border-radius: 16px;
	color: var(--color-ink);
	font-size: 14px;
	text-decoration: none;
}
.gatorpress-blog-post__tags a:hover,
.gatorpress-blog-post__tags a:focus-visible {
	border-color: var(--color-brand-primary);
	color: var(--color-brand-primary);
}

/* Previous and next */
.gatorpress-blog-nav {
	margin-top: 32px;
}
.gatorpress-blog-nav .nav-links {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}
@media (min-width: 640px) {
	.gatorpress-blog-nav .nav-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.gatorpress-blog-nav .nav-next { grid-column: 2; text-align: right; }
}
.gatorpress-blog-nav a {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 44px;
	padding: 14px 16px;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	color: var(--color-ink);
	text-decoration: none;
}
.gatorpress-blog-nav a:hover,
.gatorpress-blog-nav a:focus-visible {
	border-color: var(--color-brand-primary);
}
.gatorpress-blog-nav__label {
	color: var(--color-secondary);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.gatorpress-blog-nav__title {
	font-weight: 700;
	line-height: 1.35;
}

/* Related posts */
.gatorpress-blog-related {
	margin-top: 48px;
}
.gatorpress-blog-related__title {
	margin: 0 0 16px;
	font-size: 22px;
	font-weight: 900;
	color: var(--color-ink);
}

/* ---------------------------------------------------------------- Phones */
@media (max-width: 767px) {
	.gatorpress-blog {
		padding-top: 24px;
		padding-bottom: 40px;
	}
	.gatorpress-blog__title { font-size: 26px; }
	.gatorpress-blog-post__title { font-size: 27px; }
	.gatorpress-blog-content { font-size: 16px; }

	/* Floated images take the full width; a 300px float beside a 350px
	   column leaves a sliver of text. */
	.gatorpress-blog-content .alignleft,
	.gatorpress-blog-content .alignright {
		float: none;
		display: block;
		margin: 0 auto 16px;
	}

	/* 44px tap targets. The label keeps its look and gains an invisible
	   margin of touch area; the tags and title links grow. */
	.gatorpress-blog-label::before {
		content: "";
		position: absolute;
		inset: -9px -4px;
	}
	.gatorpress-blog-card__title a {
		display: inline-block;
		min-height: 44px;
		padding: 2px 0;
	}
	.gatorpress-blog-post__tags a {
		min-height: 44px;
		border-radius: 22px;
	}
	.gatorpress-blog-content .wp-block-media-text {
		display: block;
	}
	.gatorpress-blog-content .wp-block-media-text .wp-block-media-text__content {
		padding: 16px 0 0;
	}
}
