/*
 * Town Page template (page-town.php). Loaded only on that template.
 * The Trade Gothic files are the ones already uploaded through Divi's font
 * manager; Divi only prints their @font-face on pages that use them in a module.
 */
@font-face {
	font-family: 'MIH Trade Gothic';
	src: url('/wp-content/uploads/et-fonts/TradeGothicNextLTPro-Rg-1.otf') format('opentype');
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'MIH Trade Gothic';
	src: url('/wp-content/uploads/et-fonts/TradeGothicNextLTPro-Bd-1.otf') format('opentype');
	font-weight: 700;
	font-display: swap;
}

.mih-town {
	--navy: #3a5b93;
	--ink: #535858;
	--green: #5e9f52;
	--gold: #f0b92d;
	font-family: 'MIH Trade Gothic', 'Trade Gothic Pro Reg', 'Arial Narrow', sans-serif;
	color: var(--ink);
	background: #fff;
	overflow: hidden;
}
.mih-town h1,
.mih-town h2 {
	font-family: inherit;
	font-weight: 700;
	padding: 0;
}

/* Hero */
.mih-town__hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 320px;
	padding: 40px 20px;
	background: var(--navy) center / cover no-repeat;
}
.mih-town__hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .18);
}
.mih-town__title {
	position: relative;
	z-index: 2;
	margin: 0;
	color: #fff;
	font-size: clamp(40px, 6vw, 72px);
	line-height: 1.05;
	text-align: center;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
/* Sized like the decal on the other pages: 80% wide, 95% tall, kept in proportion. */
.mih-town__arcs {
	position: absolute;
	z-index: 1;
	left: 50%;
	top: 0;
	width: 80%;
	height: 95%;
	transform: translateX(-50%);
	pointer-events: none;
	overflow: hidden;
}
.mih-town__arcs ellipse {
	fill: none;
	stroke: var(--gold);
	stroke-width: 2;
	vector-effect: non-scaling-stroke;
}

/* Town links */
.mih-town__nav {
	position: relative;
	z-index: 2;
	max-width: 1360px;
	margin: 0 auto;
	padding: 28px 20px 0;
}
.mih-town__nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 16px;
	margin: 0;
	padding: 0 0 6px;
	list-style: none;
	border-bottom: 2px solid var(--navy);
}
/* Divi sets list-style on content list items with an ID selector. */
#main-content.mih-town .mih-town__nav li {
	padding: 0;
	list-style: none;
}
.mih-town__nav li::before {
	content: none;
}
.mih-town__nav a {
	color: var(--navy);
	font-size: clamp(18px, 1.8vw, 28px);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}
.mih-town__nav a:hover,
.mih-town__nav a:focus-visible,
.mih-town__nav a[aria-current='page'] {
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-decoration-thickness: 3px;
	text-underline-offset: 6px;
}

/* Resource tiles */
.mih-town__resources {
	position: relative;
	margin-top: 16px;
}
.mih-town__tiles {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
}
.mih-town__tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 126px;
	margin: 0;
	padding: 16px;
	border: 0;
	border-radius: 0;
	background: var(--tile);
	color: var(--tile-text);
	font-family: inherit;
	font-size: clamp(20px, 2vw, 28px);
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	cursor: pointer;
	transition: filter .15s;
}
.mih-town__tile.is-large {
	font-size: clamp(48px, 5vw, 72px);
}
.mih-town__tile:hover,
.mih-town__tile[aria-expanded='true'] {
	filter: brightness(1.08);
}
.mih-town__tile:focus-visible {
	outline: 2px solid #000;
	outline-offset: -2px;
}

.mih-town__cards {
	position: relative;
	padding: 36px 20px 48px;
	background: #f4f6f9;
	box-shadow: inset 0 8px 12px -10px rgba(0, 0, 0, .35);
}
.mih-town__cards[hidden] {
	display: none;
}
.mih-town__close {
	position: absolute;
	top: 4px;
	/* clear of the site's fixed social bar on the right edge */
	right: max(48px, calc((100% - 1120px) / 2 - 56px));
	padding: 0 6px;
	border: 0;
	background: none;
	color: var(--navy);
	font-size: 40px;
	line-height: 1;
	cursor: pointer;
}
.mih-town__cards-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 32px;
	max-width: 1120px;
	margin: 0 auto;
}
/* One card shows at a time, under the tile that opened it. */
.mih-town__card {
	flex: 1 1 100%;
	max-width: 680px;
	box-sizing: border-box;
	padding: 18px 22px;
	border: 2px solid #000;
	background: var(--tile);
	color: var(--tile-text);
	font-size: 17px;
	line-height: 1.5;
	scroll-margin-top: 120px;
	animation: mih-town-pop .25s ease-out;
}
.mih-town__card[hidden] {
	display: none;
}
@keyframes mih-town-pop {
	from {
		opacity: 0;
		transform: translateY(-10px) scale(.98);
	}
}
@media (prefers-reduced-motion: reduce) {
	.mih-town__card {
		animation: none;
	}
}
.mih-town__card:focus {
	outline: 4px solid var(--navy);
	outline-offset: 4px;
}
.mih-town__card h2 {
	margin: 0 0 8px;
	color: inherit;
	font-size: 26px;
	line-height: 1.1;
}
.mih-town__card p {
	padding: 0 0 .8em;
}
.mih-town__card p:last-child {
	padding-bottom: 0;
}
.mih-town__card a {
	color: inherit;
	text-decoration: underline;
	word-break: break-word;
}

/* Intro */
.mih-town__intro {
	max-width: 960px;
	margin: 0 auto;
	padding: 48px 20px 40px;
	font-size: 20px;
	line-height: 1.6;
	text-align: left;
}
.mih-town__intro p {
	padding: 0 0 1em;
}
.mih-town__intro p:last-child {
	padding-bottom: 0;
}

/* Community photo links (region page) */
.mih-town__communities ul {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}
#main-content.mih-town .mih-town__communities li {
	padding: 0;
	list-style: none;
}
.mih-town__communities a {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--navy);
	color: #fff;
	text-decoration: none;
}
.mih-town__communities img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s;
}
.mih-town__communities span {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 10px 12px;
	background: rgba(58, 91, 147, .72);
	font-size: clamp(26px, 3vw, 46px);
	font-weight: 700;
	line-height: 1.15;
	text-align: center;
}
.mih-town__communities a:hover img,
.mih-town__communities a:focus-visible img {
	transform: scale(1.05);
}
.mih-town__communities a:hover span,
.mih-town__communities a:focus-visible span {
	background: rgba(58, 91, 147, .9);
	color:white;
}
.mih-town__communities a:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: -3px;
}

/* Content sections: half-width pairs, full-width rows, and slim banners */
.mih-town__sections {
	display: grid;
	grid-template-columns: 1fr 1fr;
}
.mih-town__section {
	position: relative;
	min-height: 330px;
	background: #eef2f6 center / cover no-repeat;
	border-top: 1px solid #dfe5ec;
}
.mih-town__section.is-full,
.mih-town__section.is-slim {
	grid-column: 1 / -1;
	min-height: 0;
}
.mih-town__section.is-left {
	border-right: 1px solid #dfe5ec;
}
.mih-town__section::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .9);
}
.mih-town__section-inner {
	position: relative;
	max-width: 620px;
	padding: 44px 40px 48px;
	font-size: 17px;
	line-height: 1.6;
}
.mih-town__section.is-left .mih-town__section-inner {
	margin-left: auto;
}
.mih-town__section.is-full .mih-town__section-inner {
	max-width: 1240px;
	margin: 0 auto;
}
.mih-town__section.is-slim .mih-town__section-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content:center;
	gap: 16px 36px;
	max-width: 1240px;
	margin: 0 auto;
	padding-top: 22px;
	padding-bottom: 22px;
}
.mih-town__section.is-slim .mih-town__heading {
	margin: 0;
}
.mih-town__section.is-slim .mih-town__images {
	margin: 0;
}
.mih-town__section.is-slim .mih-town__images .mih-town__image {
	max-height: 90px;
}

.mih-town__heading {
	margin: 0 0 22px;
	color: var(--navy);
	font-size: clamp(24px, 2.2vw, 30px);
	line-height: 1.15;
}
.mih-town__heading span {
	color: var(--ink);
}
.mih-town__body p {
	padding: 0 0 1em;
}
.mih-town__body p:last-child {
	padding-bottom: 0;
}
.mih-town__body ul {
	margin: 0 0 1em;
	padding: 0 0 0 1.2em;
	list-style: disc;
}
/* A list of four or more links goes in two columns (Community Features). */
.mih-town__body ul:has(> li:nth-child(4)) {
	display: grid;
padding-left:0;
	grid-template-columns: 1fr 1fr;
	column-gap: 2.4em;
}
.mih-town__body li {
	color: var(--green);
		list-style-type:none;
}
.mih-town__body li::marker {
	color: var(--green);
}
.mih-town__body li a {
	color: inherit;
	text-decoration:underline;
	font-weight:bold;

	transition: color .2s ease;
}
.mih-town__body li a:hover {
	color: #3a5b93;
}

.mih-town__image {
	display: block;
	max-width: 100%;
	height: auto;
}
.mih-town__section:not(.has-images-below) .mih-town__image {
	float: right;
	width: 42%;
	margin: 4px 0 12px 20px;
}
.mih-town__images {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 18px 0 4px;
}
.mih-town__images .mih-town__image {
	width: auto;
	max-height: 200px;
}
/* Two or more photos share one row and one height, spread across the section;
   a lone small image (a seal) keeps its own size. */
.mih-town__images:has(> :nth-child(2)) .mih-town__image {
	flex: 1 1 0;
	min-width: 0;
	width: auto;
	max-width: none;
	height: 200px;
	max-height: none;
	object-fit: cover;
}
.mih-town__section.is-full .mih-town__images:has(> :nth-child(3)) .mih-town__image {
	height: 220px;
}
/* A single link sits on the left, the same colour as the bulleted links. */
.mih-town__link {
	display: table;
	clear: both;
	margin-top: 14px;
	margin-bottom: 4px;
	color: var(--green);
	font-weight: 700;
	text-decoration: underline;
}

/* Pill button matching the Learn More buttons on the Focus Areas page */
.mih-town__button {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: 8px 8px 8px 26px;
	border-radius: 999px;
	background: var(--navy);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	transition: filter .15s;
}
.mih-town__button span {
	display: block;
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.mih-town__button:hover,
.mih-town__button:focus-visible {
	color: #fff;
	filter: brightness(1.12);
}

@media (max-width: 980px) {
	.mih-town__hero {
		min-height: 240px;
	}
	.mih-town__nav ul {
		justify-content: center;
	}
	.mih-town__tiles {
		grid-auto-flow: row;
		grid-template-columns: 1fr 1fr;
	}
	.mih-town__tile {
		min-height: 96px;
	}
	.mih-town__tile:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
	.mih-town__communities ul {
		grid-template-columns: 1fr 1fr;
	}
	.mih-town__sections {
		grid-template-columns: 1fr;
	}
	.mih-town__section.is-left {
		border-right: 0;
	}
	.mih-town__section {
		min-height: 0;
	}
	.mih-town__section-inner,
	.mih-town__section.is-left .mih-town__section-inner,
	.mih-town__section.is-full .mih-town__section-inner {
		max-width: none;
		margin: 0;
		padding: 36px 20px 40px;
	}
	.mih-town__section.is-slim .mih-town__section-inner {
		padding: 24px 20px;
	}
}
@media (max-width: 560px) {
	.mih-town__communities span {
		padding: 6px 8px;
		font-size: 22px;
	}
	.mih-town__section.is-slim .mih-town__button {
		margin-left: 0;
	}
	.mih-town__images:has(> :nth-child(2)) .mih-town__image,
	.mih-town__section.is-full .mih-town__images:has(> :nth-child(3)) .mih-town__image {
		flex-basis: calc(50% - 7px);
		height: 150px;
	}
	.mih-town__section:not(.has-images-below) .mih-town__image {
		float: none;
		width: 100%;
		margin: 0 0 16px;
	}
}
