/* Safety net: prevent any content from triggering horizontal scroll.
   Long titles, oversized embeds, and WP inline widths can all push past the
   viewport; clip them at html/body so the page always fits the device width. */
html,
body {
	max-width: 100vw;
	overflow-x: hidden;
}

/* WordPress migration compatibility overrides */

/* WP [caption] shortcode wraps images in <dl class="wp-caption"> with an inline
   width (often 1024px) that overflows narrower content columns. */
.wp-caption,
figure.wp-caption {
	max-width: 100% !important;
	width: auto !important;
	height: auto;
	margin: 0 0 1em;
}

.wp-caption img {
	max-width: 100%;
	height: auto;
	display: block;
}

.wp-caption-dt,
.wp-caption-dd {
	margin: 0;
}

.wp-caption-dd {
	font-size: 0.875em;
	color: #666;
	padding: 0.5em 0 0;
	text-align: center;
}

/* WP alignment classes */
.alignleft {
	float: left;
	margin: 0.25em 1.5em 1em 0;
}
.alignright {
	float: right;
	margin: 0.25em 0 1em 1.5em;
}
.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}
.alignnone {
	display: block;
}

/* Catch-all: any img or video inside post content stays within its column */
.post__content img,
.post__content video,
.post__content iframe,
.post__content embed {
	max-width: 100%;
	height: auto;
}

/* Newsletter widget (Mailchimp embed) */
.widget-newsletter .newsletter-form label {
	display: block;
	font-size: 0.875em;
	margin-bottom: 0.25em;
}
.widget-newsletter .newsletter-form input[type="email"] {
	width: 100%;
	padding: 0.5em;
	margin-bottom: 0.5em;
	border: 1px solid #ccc;
	box-sizing: border-box;
}
.widget-newsletter .newsletter-form__submit {
	background: #222;
	color: #fff;
	border: 0;
	padding: 0.5em 1em;
	cursor: pointer;
	font-weight: bold;
}
.widget-newsletter .newsletter-form__submit:hover {
	background: #c1272d;
}
.widget-newsletter .newsletter-form__placeholder {
	font-size: 0.875em;
	color: #888;
}

/* =========================================================================
   Typography
   ========================================================================= */
body {
	font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
	font-size: 17px;
	line-height: 1.65;
	color: #222;
}

h1, h2, h3, h4, h5, h6,
.post__title,
.widget__title,
.logo__title {
	font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.post__title {
	font-size: 2.25rem;
	line-height: 1.2;
	margin-bottom: 0.5rem;
}

.post__content p,
.post__content li {
	font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.7;
}

.post__content blockquote,
.post__content .td_quote_box {
	border-left: 4px solid #c1272d;
	padding: 0.5em 1.25em;
	margin: 1.5em 0;
	font-style: italic;
	color: #555;
	background: #f9f9f9;
}

/* =========================================================================
   Header: centered logo + nav below, WP-style
   ========================================================================= */
.header {
	padding: 1.5rem 0 0;
	border-bottom: 0;
}

.header__container {
	display: block;
	text-align: center;
}

.logo {
	padding: 1rem 0;
	text-align: center;
}

.logo__link {
	display: inline-block;
	text-decoration: none;
	border: 0;
}

.logo__text {
	text-transform: none; /* Mainroad default is uppercase — we want title case */
	display: block;
}

.logo__title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 3.75rem;
	font-weight: 700;
	line-height: 1.1;
	color: #111;
	letter-spacing: -0.02em;
	margin: 0;
}

.logo__tagline {
	display: block;
	padding-top: 0.25rem;
	margin-top: 0.25rem;
	border-top: 0;
	font-family: 'Playfair Display', Georgia, serif;
	font-style: italic;
	font-weight: 400;
	font-size: 0.95rem;
	color: #888;
	text-transform: none;
	letter-spacing: 0.02em;
}

/* Horizontal centered menu bar, separated from logo by a thin rule.
   Overrides Mainroad's dark-bar menu styling with a light WP-style bar. */
.menu {
	border-top: 1px solid #e5e5e5;
	border-bottom: 1px solid #e5e5e5 !important; /* beat Mainroad's red 5px border */
	margin-top: 1rem;
	background: #fff;
}

/* Mainroad sets background: #2a2a2a on .menu__list — override to transparent.
   Desktop layout rules are scoped to min-width: 768px below. */
.menu__list,
.js .menu__list {
	justify-content: center;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	background: transparent !important;
}

.menu__item {
	border: 0 !important;
	margin: 0;
	background: transparent !important;
}

.menu__item:hover,
.menu__item--active {
	background: transparent !important;
}

.menu__item--active .menu__link,
.menu__item:hover .menu__link {
	color: #c1272d;
}

.menu__link {
	display: inline-block;
	padding: 1rem 1.25rem;
	color: #222;
	text-decoration: none;
	font-family: 'Source Sans 3', sans-serif;
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border: 0;
	transition: color 0.2s ease;
}

.menu__link:hover {
	color: #c1272d;
}

.menu__chevron {
	display: inline-block;
	margin-left: 0.35em;
	font-size: 0.75em;
	color: #999;
	transition: color 0.2s ease, transform 0.2s ease;
}

.menu__item:hover .menu__chevron,
.menu__link:hover .menu__chevron {
	color: #c1272d;
}

/* Dropdown submenu */
.menu__item--has-children {
	position: relative;
}

.menu__submenu {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	min-width: 200px;
	padding: 0.5rem 0;
	margin: 0;
	list-style: none;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-top: 2px solid #c1272d;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
	z-index: 100;
}

.menu__item--has-children:hover > .menu__submenu,
.menu__item--has-children:focus-within > .menu__submenu {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.menu__subitem {
	margin: 0;
	padding: 0;
}

.menu__sublink {
	display: block;
	padding: 0.6rem 1.25rem;
	color: #222;
	text-decoration: none;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.05em;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.menu__sublink:hover,
.menu__subitem--active .menu__sublink {
	background: #f8f8f8;
	color: #c1272d;
}

/* =========================================================================
   Desktop-only rules (>= 768px)
   ========================================================================= */
@media screen and (min-width: 768px) {
	.menu__btn {
		display: none;
	}
	.menu__list,
	.js .menu__list {
		display: flex;
		visibility: visible;
	}
}

/* =========================================================================
   Mobile (< 768px)
   ========================================================================= */
@media screen and (max-width: 767px) {
	.logo {
		padding: 0.5rem 0;
	}
	.logo__title {
		font-size: 2rem;
		line-height: 1.15;
	}
	.logo__tagline {
		font-size: 0.85rem;
	}

	/* Tighter wrapper padding so content doesn't bleed off */
	.wrapper {
		padding: 15px;
	}

	/* Menu: always visible, stacked, no hamburger */
	.menu {
		margin-top: 0.5rem;
	}
	.menu__btn {
		display: none;
	}
	.menu__list,
	.js .menu__list {
		display: flex !important;
		flex-direction: column;
		visibility: visible !important;
		position: static !important;
		transform: none !important;
		width: 100%;
	}
	.menu__item {
		width: 100%;
		text-align: center;
	}
	.menu__link {
		padding: 0.75rem 1rem;
		border-bottom: 1px solid #f0f0f0;
	}

	/* Mobile submenus: static indented list, not absolute dropdown */
	.menu__submenu {
		position: static;
		transform: none;
		opacity: 1;
		visibility: visible;
		border: 0;
		box-shadow: none;
		background: #fafafa;
		padding: 0;
		min-width: 0;
	}
	.menu__sublink {
		padding: 0.5rem 1rem;
		border-bottom: 1px solid #f0f0f0;
		text-align: center;
	}

	/* Primary column: full width when wrapper becomes display:block on mobile.
	   Mainroad's flex-basis doesn't apply when parent isn't flex, but we
	   explicitly constrain here to avoid edge cases. */
	.primary,
	.sidebar {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		flex: none;
	}
	.container,
	.container--outer {
		max-width: 100%;
	}

	/* Post title smaller + body constraint so nothing overflows */
	.post__title {
		font-size: 1.65rem;
	}
	.post,
	.post__content,
	.list__excerpt {
		max-width: 100%;
		/* Break long unbreakable tokens (URLs, tags) but don't split normal words */
		overflow-wrap: break-word;
		word-wrap: break-word;
	}
	/* Kill any WP inline width constraints that exceed viewport */
	.post__content [style*="width:"] {
		max-width: 100% !important;
		width: auto !important;
	}
	/* Images and media inside posts MUST fit */
	.post__content img,
	.post__content video,
	.post__content iframe,
	.post__content figure,
	.post__content dl {
		max-width: 100% !important;
		height: auto;
	}
}
