/*
 * Montezuma Modern Overrides
 * Loaded after montezuma-style to fix mobile overflow, pure-CSS grayscale thumbnails,
 * accessibility focus styles, responsive embeds, and layout polish.
 */

/* Never hide body before JS runs */
body {
	opacity: 1 !important;
}

/* Pure-CSS thumbnail centering and grayscale hover without JS cloning */
.post-thumb a {
	text-align: center;
}

.post-thumb img {
	opacity: 1 !important;
	position: static;
	margin: 0 auto;
	filter: none;
	-webkit-filter: none;
	transition: filter 0.5s ease;
}

@media only screen and (min-width: 960px) {
	.post-thumb img {
		filter: grayscale(100%);
	}
	.hentry:hover .post-thumb img,
	.post-thumb a:focus img {
		filter: grayscale(0);
	}
}

/* Clean .post-date alignment so long excerpts don't wrap awkwardly under the date column */
.post-list .post-bodycopy:has(> .post-date) {
	position: relative;
	padding-left: 62px;
	min-height: 58px;
}

.post-list .post-bodycopy:has(> .post-date) > .post-date {
	position: absolute;
	left: 0;
	top: 4px;
	width: 48px;
	float: none;
	margin: 0;
}

/* Keyboard and touch-friendly submenu support */
.menu li:focus-within > ul,
.menu li.sub-open > ul {
	left: auto;
	z-index: 100000;
}

/* Responsive embeds & Gutenberg blocks */
iframe,
video,
embed,
object {
	max-width: 100%;
}

.wp-block-image img {
	height: auto;
}

.wp-block-embed__wrapper iframe {
	width: 100%;
}

/* Accessibility utilities & focus styles */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 14px;
	font-weight: bold;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid #0090d3;
	outline-offset: 2px;
}

/* Mobile layout fixes */
@media only screen and (max-width: 767px) {
	html,
	body {
		overflow-x: clip;
	}

	.row,
	.row5,
	.lw {
		box-sizing: border-box !important;
		max-width: 100%;
	}

	#breadcrumbs1,
	.breadcrumbs.lw {
		box-sizing: border-box !important;
		width: 100% !important;
		padding: 5px 15px !important;
	}

	#breadcrumbs1 ol {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	#breadcrumbs1 ol li {
		float: none;
	}

	/* Prevent RSS icon from overlapping site title on narrow viewports */
	#rss-link,
	a.rsslink {
		display: none !important;
	}

	#logo-area {
		margin-left: 0 !important;
		padding: 0 15px;
		text-align: center;
	}

	/* Replace legacy <select> mobile menu with clean flex pill/tab bar */
	select.menu1-mobile {
		display: none !important;
	}

	ul#menu1 {
		display: flex !important;
		flex-wrap: wrap;
		justify-content: center;
		gap: 4px;
		width: 100%;
		padding: 0 10px 8px 10px;
		box-sizing: border-box;
	}

	#menu1 > li {
		float: none;
		background: none;
		box-shadow: none;
	}

	#menu1 > li > a {
		min-height: 44px;
		padding: 8px 12px 10px 12px;
		font-size: 19px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	#menu1 .sub-menu {
		position: static;
		left: auto;
		display: none;
		box-shadow: none;
	}

	#menu1 li.sub-open > .sub-menu {
		display: block;
	}

	/* Larger mobile tap targets in sidebar widgets */
	.widget > ul > li {
		padding: 0 0 0 10px;
	}

	.widget > ul > li a {
		display: inline-block;
		padding: 9px 4px;
		min-height: 40px;
		line-height: 1.4;
		box-sizing: border-box;
	}
}

@media only screen and (max-width: 480px) {
	.post-list .post-bodycopy:has(> .post-date) {
		padding-left: 54px;
	}

	.post-list .post-bodycopy:has(> .post-date) > .post-date {
		width: 44px;
	}
}
