/*
Theme Name: Court Records
Description: County public-records theme with county statistics, court details, recurring freshness copy, and an automatic table of contents.
Author: Local Team
Version: 2.0.7
Template: msai-base
Text Domain: court-records
Requires at least: 6.0
Requires PHP: 7.4
*/

:root {
	--records-primary-dark: #112e51;
	--records-primary: #1a4480;
	--records-primary-light: #2378c3;
	--records-primary-lighter: #d9e8f6;
	--records-accent-red: #b50909;
	--records-gold: #ffbe2e;
	--records-ink: #1b1b1b;
	--records-ink-2: #3d4551;
	--records-base: #565c65;
	--records-muted: #71767a;
	--records-line: #dfe1e2;
	--records-line-2: #edeff0;
	--records-bg: #fff;
	--records-bg-alt: #f7f7f7;
	--records-bg-alt-2: #f0f4f8;
	--records-max: 1280px;
	--records-max-narrow: 1120px;
	--logo-state: #1c2b78;
	--logo-domain: #1c2b78;
	--records-serif: "Merriweather", Georgia, serif;
	--records-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 140px;
}

body.court-records-theme {
	background: var(--records-bg);
	color: var(--records-ink);
	font-family: var(--records-sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.court-records-theme a {
	color: var(--records-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.court-records-theme a:hover {
	color: var(--records-primary-dark);
}

.court-records-theme button,
.court-records-theme input {
	font: inherit;
}

.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	clip: auto;
	padding: 12px 16px;
	background: #fff;
	color: #000;
}

.records-container {
	width: min(100% - 64px, var(--records-max));
	margin-inline: auto;
}

/* Masthead */
.records-masthead {
	border-bottom: 1px solid var(--records-line);
	background: #fff;
}

.records-masthead-inner {
	display: flex;
	max-width: var(--records-max);
	align-items: center;
	justify-content: flex-start;
	gap: 32px;
	margin: 0 auto;
	padding: 20px 32px;
}

.records-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none !important;
}

.records-brand-seal {
	display: grid;
	width: 52px;
	height: 52px;
	flex: 0 0 52px;
	place-items: center;
	border-radius: 50%;
	background: var(--records-primary-dark);
	box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--records-gold);
	color: var(--records-gold);
}

.records-brand-seal svg {
	width: 26px;
	height: 26px;
}

.records-brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.records-brand-title {
	color: var(--records-primary-dark);
	font-family: var(--records-serif);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -.005em;
}

.records-brand-subtitle {
	margin-top: 3px;
	color: var(--records-base);
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.records-menu-toggle {
	display: none;
	margin-left: auto;
}

.records-menu-toggle svg {
	width: 22px;
	height: 22px;
}

/* Primary navigation */
.records-primary-nav {
	border-bottom: 4px solid var(--records-gold);
	background: var(--records-primary);
}

.records-nav-inner {
	display: flex;
	max-width: var(--records-max);
	align-items: stretch;
	margin: 0 auto;
	padding: 0 32px;
}

.records-primary-nav .records-menu,
.records-primary-nav .menu {
	display: flex;
	align-items: stretch;
	margin: 0;
	padding: 0;
	list-style: none;
}

.records-primary-nav li {
	display: flex;
}

.records-primary-nav a {
	display: flex;
	align-items: center;
	padding: 14px 20px;
	border-right: 1px solid rgba(255, 255, 255, .08);
	color: #fff;
	font-size: 14.5px;
	font-weight: 500;
	text-decoration: none;
	transition: background .15s;
}

.records-primary-nav li:first-child a {
	border-left: 1px solid rgba(255, 255, 255, .08);
}

.records-primary-nav a:hover {
	background: var(--records-primary-dark);
	color: #fff;
}

.records-primary-nav .current-menu-item > a,
.records-primary-nav .current_page_item > a {
	background: var(--records-primary-dark);
	box-shadow: inset 0 -3px 0 var(--records-gold);
	color: #fff;
}

/* Breadcrumbs */
.records-breadcrumb-wrap {
	border-bottom: 1px solid var(--records-line);
	background: var(--records-bg-alt);
}

.records-breadcrumb {
	max-width: var(--records-max);
	margin: 0 auto;
	padding: 12px 32px;
	color: var(--records-base);
	font-size: 13.5px;
}

.records-breadcrumb a {
	color: var(--records-primary);
	text-decoration: none;
}

.records-breadcrumb a:hover {
	text-decoration: underline;
}

.records-breadcrumb-separator {
	margin: 0 8px;
	color: var(--records-muted);
}

.records-breadcrumb-current {
	color: var(--records-ink-2);
	font-weight: 500;
}

/* Records search */
.records-search-banner {
	border-bottom: 1px solid var(--records-line);
	background: var(--records-bg-alt-2);
}

.records-search-inner {
	max-width: var(--records-max);
	margin: 0 auto;
	padding: 44px 32px;
}

.records-search-lead {
	margin-bottom: 24px;
	text-align: center;
}

.records-search-title {
	margin: 0 0 8px;
	padding: 0;
	border: 0;
	color: var(--records-primary-dark);
	font-family: var(--records-serif);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
}

.records-search-subtitle {
	margin: 0;
	color: var(--records-base);
	font-size: 15px;
	line-height: 1.5;
}

.records-lead-form {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr auto;
	gap: 12px;
	padding: 20px;
	border: 1px solid var(--records-line);
	border-left: 4px solid var(--records-primary-dark);
	border-radius: 2px;
	background: #fff;
}

.records-form-field {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 6px;
}

.records-form-field label {
	color: var(--records-ink-2);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0;
}

.records-form-field input {
	width: 100%;
	height: 42px;
	padding: 0 12px;
	border: 1px solid #a9aeb1;
	border-radius: 2px;
	outline: none;
	background: #fff;
	color: var(--records-ink);
	font-size: 15px;
	transition: border-color .15s, box-shadow .15s;
}

.records-form-field input::placeholder {
	color: #a0a4a7;
}

.records-form-field input:focus {
	border-color: var(--records-primary);
	box-shadow: 0 0 0 2px rgba(26, 68, 128, .25);
}

.records-submit {
	display: inline-flex;
	height: 42px;
	align-self: end;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 24px;
	border: 0;
	border-radius: 2px;
	background: var(--records-primary-dark);
	color: #fff;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}

.records-submit:hover {
	background: var(--records-primary);
}

.records-submit svg {
	width: 14px;
	height: 14px;
}

/* Page title */
.records-main {
	padding: 0;
}

.records-title-section {
	max-width: var(--records-max);
	margin: 0 auto;
	padding: 44px 32px 28px;
}

.records-title-kicker {
	margin-bottom: 12px;
	color: var(--records-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.records-entry-title {
	margin: 0;
	color: var(--records-primary-dark);
	font-family: var(--records-serif);
	font-size: clamp(32px, 4vw, 44px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.015em;
}

.records-title-underline {
	width: 60px;
	height: 4px;
	margin: 20px 0 0;
	background: var(--records-gold);
}

/* Courthouse banner */
.records-courthouse-wrap {
	max-width: var(--records-max);
	margin: 0 auto;
	padding: 16px 32px 28px;
}

.records-courthouse-card {
	display: block;
	border: 1px solid var(--records-line);
	border-top: 4px solid var(--records-primary-dark);
	background: #fff;
}

.records-courthouse-image {
	position: relative;
	height: 120px;
	overflow: hidden;
	background: var(--records-primary-dark);
}

.records-courthouse-image > img,
.records-courthouse-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: brightness(.45) saturate(.85);
}

.records-courthouse-placeholder {
	background: linear-gradient(135deg, #57728f, var(--records-primary-dark));
}

.records-courthouse-image::after {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(17, 46, 81, .35) 0%, rgba(17, 46, 81, .75) 100%);
	content: "";
	pointer-events: none;
}

.records-courthouse-image-title {
	position: absolute;
	z-index: 2;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 8px 20px;
	text-align: center;
}

.records-courthouse-tag {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 6px;
	color: var(--records-gold);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.records-courthouse-tag::before {
	display: inline-block;
	width: 14px;
	height: 1.5px;
	background: var(--records-gold);
	content: "";
}

.records-courthouse-image-title h2 {
	margin: 0;
	padding: 0;
	border: 0;
	color: #fff;
	font-family: var(--records-serif);
	font-size: clamp(16px, 1.7vw, 20px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.records-courthouse-image-title h2 a {
	color: inherit;
	text-decoration: none;
}

.records-courthouse-info {
	display: block;
	padding: 14px 24px;
}

.records-courthouse-details {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 32px;
}

.records-detail-row {
	display: flex;
	flex: 0 1 auto;
	align-items: center;
	gap: 5px;
	padding: 0;
	border: 0;
}

.records-detail-icon {
	display: grid;
	place-items: center;
	color: var(--records-primary);
}

.records-detail-icon svg {
	width: 16px;
	height: 16px;
}

.records-detail-label {
	color: var(--records-base);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.records-detail-value {
	color: var(--records-ink);
	font-size: 15px;
	font-weight: 500;
}

.records-detail-value a {
	color: inherit;
	text-decoration: none;
}

/* Main article and left sidebar */
.records-page-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	align-items: start;
	gap: 48px;
	max-width: var(--records-max);
	margin: 0 auto;
	padding: 0 32px 80px;
}

.records-article {
	min-width: 0;
}

.records-sidebar {
	position: sticky;
	top: 24px;
	align-self: start;
	padding: 0;
}

.admin-bar .records-sidebar {
	top: 56px;
}

.records-toc-box {
	border: 1px solid var(--records-line);
	border-top: 3px solid var(--records-primary-dark);
	background: var(--records-bg-alt);
}

.records-toc-title {
	margin: 0;
	padding: 14px 18px;
	border-bottom: 1px solid var(--records-line);
	color: var(--records-primary-dark);
	font-family: var(--records-serif);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -.005em;
}

.records-toc-list {
	margin: 0;
	padding: 8px 0;
	list-style: none;
}

.records-toc-list:empty::before {
	display: block;
	padding: 8px 18px;
	color: var(--records-muted);
	font-size: 13px;
	content: "Headings appear here automatically.";
}

.records-toc-list a {
	display: block;
	margin-left: -1px;
	padding: 8px 18px;
	border-left: 3px solid transparent;
	color: var(--records-ink-2);
	font-size: 13.5px;
	line-height: 1.4;
	text-decoration: none;
	transition: color .15s, background .15s, border-color .15s;
}

.records-toc-list a:hover {
	background: rgba(26, 68, 128, .05);
	color: var(--records-primary);
}

.records-toc-list li.is-active a {
	border-left-color: var(--records-primary-dark);
	background: #fff;
	color: var(--records-primary-dark);
	font-weight: 600;
}

/* Article typography */
.records-entry-content h2 {
	position: relative;
	margin: 48px 0 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--records-line);
	color: var(--records-primary-dark);
	font-family: var(--records-serif);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	scroll-margin-top: 140px;
}

.records-entry-content h2::after {
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 60px;
	height: 2px;
	background: var(--records-primary-dark);
	content: "";
}

.records-entry-content h2:first-child,
.records-entry-content .seo-content .container > h2:first-child {
	margin-top: 8px;
}

.records-entry-content h3 {
	margin: 32px 0 10px;
	color: var(--records-primary-dark);
	font-family: var(--records-sans);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0;
	scroll-margin-top: 140px;
}

.records-entry-content h4 {
	margin: 20px 0 8px;
	color: var(--records-ink-2);
	font-family: var(--records-sans);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.records-entry-content p {
	margin: 0 0 14px;
	color: var(--records-ink-2);
}

.records-entry-content > p:first-child,
.records-entry-content .seo-content .container > p:first-child {
	margin-bottom: 24px;
	padding: 18px 20px;
	border-left: 4px solid var(--records-primary-dark);
	background: var(--records-bg-alt);
	color: var(--records-ink);
	font-size: 17px;
	line-height: 1.6;
}

.records-entry-content ul,
.records-entry-content ol {
	margin: 0 0 18px;
	padding-left: 22px;
	color: var(--records-ink-2);
}

.records-entry-content li {
	margin-bottom: 6px;
}

.records-entry-content ol {
	padding-left: 0;
	list-style: none;
	counter-reset: records-item;
}

.records-entry-content ol > li {
	position: relative;
	padding-left: 36px;
	margin-bottom: 10px;
	counter-increment: records-item;
}

.records-entry-content ol > li::before {
	position: absolute;
	top: 1px;
	left: 0;
	display: grid;
	width: 24px;
	height: 24px;
	place-items: center;
	border-radius: 2px;
	background: var(--records-primary-dark);
	color: #fff;
	font-family: var(--records-sans);
	font-size: 12px;
	font-weight: 700;
	content: counter(records-item);
}

.records-entry-content a {
	color: var(--records-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.records-entry-content a:hover {
	color: var(--records-primary-dark);
	text-decoration-thickness: 2px;
}

.records-entry-content ul li strong {
	color: var(--records-primary-dark);
	font-weight: 700;
}

.records-entry-content table {
	width: 100%;
	margin: 22px 0;
	border-collapse: collapse;
}

.records-entry-content th,
.records-entry-content td {
	padding: 10px 12px;
	border: 1px solid var(--records-line);
	text-align: left;
}

.records-entry-content th {
	background: var(--records-bg-alt);
	color: var(--records-primary-dark);
}

.court-block {
	margin: 14px 0;
	padding: 18px 22px;
	border-left: 4px solid var(--records-primary);
	background: var(--records-bg-alt);
}

.court-block .court-name {
	margin-bottom: 8px;
	color: var(--records-primary-dark);
	font-family: var(--records-sans);
	font-size: 15.5px;
	font-weight: 700;
}

.court-block .court-meta {
	color: var(--records-ink-2);
	font-size: 14px;
	line-height: 1.7;
}

.court-block .court-meta span {
	display: block;
}

.court-block .court-meta strong {
	display: inline-block;
	min-width: 68px;
	color: var(--records-base);
	font-weight: 600;
}

.resource-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 12px;
	margin-top: 20px;
}

.records-entry-content .resource {
	display: block;
	padding: 16px 18px;
	border: 1px solid var(--records-line);
	border-left: 3px solid var(--records-primary);
	background: #fff;
	text-decoration: none;
	transition: border-color .15s, background .15s;
}

.records-entry-content .resource:hover {
	border-left-color: var(--records-primary-dark);
	background: var(--records-bg-alt);
	text-decoration: none;
}

.resource-title {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
	color: var(--records-primary-dark);
	font-size: 14.5px;
	font-weight: 700;
}

.resource-title::after {
	margin-left: auto;
	color: var(--records-primary);
	font-size: 12px;
	content: "↗";
	opacity: .6;
}

.resource-desc {
	color: var(--records-base);
	font-size: 13px;
	line-height: 1.5;
}

/* Dynamic county statistics */
.records-statistics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0 0 28px;
}

.records-stat {
	padding: 16px 18px;
	border: 1px solid var(--records-line);
	border-top: 3px solid var(--records-primary-dark);
	background: var(--records-bg-alt);
}

.records-stat-value {
	display: block;
	color: var(--records-primary-dark);
	font-family: var(--records-serif);
	font-size: 23px;
	font-weight: 700;
	line-height: 1.2;
}

.records-stat-label {
	display: block;
	margin-top: 5px;
	color: var(--records-base);
	font-size: 13px;
	line-height: 1.4;
}

.records-stat-source {
	display: inline-block;
	margin-top: 7px;
	font-size: 12px;
	font-weight: 600;
}

/* Archive and error fallbacks */
.records-simple-page {
	max-width: var(--records-max-narrow);
	padding-block: 52px 80px;
}

.records-simple-page .records-entry-content > article {
	padding: 20px 0;
	border-top: 1px solid var(--records-line);
}

.records-empty {
	padding: 40px;
	border: 1px solid var(--records-line);
	border-top: 4px solid var(--records-primary-dark);
	background: var(--records-bg-alt);
	text-align: center;
}

/* Footer */
.records-footer {
	margin-top: 40px;
	background: var(--records-primary-dark);
	color: var(--records-primary-lighter);
}

.records-footer-top {
	max-width: var(--records-max);
	margin: 0 auto;
	padding: 32px;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.records-footer-column {
	max-width: 720px;
}

.records-footer-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	color: #fff !important;
	font-family: var(--records-serif);
	font-size: 16px;
	font-weight: 700;
	text-decoration: none !important;
}

.records-footer-seal {
	display: grid;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	place-items: center;
	border-radius: 50%;
	background: var(--records-primary-dark);
	box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--records-gold);
	color: var(--records-gold);
}

.records-footer-seal svg {
	width: 22px;
	height: 22px;
}

.records-footer-column p {
	margin: 0 0 8px;
	color: #a3b8d1;
	font-size: 13.5px;
	line-height: 1.6;
}

.records-footer-bottom {
	display: flex;
	max-width: var(--records-max);
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	margin: 0 auto;
	padding: 20px 32px;
	color: #8ba4c5;
	font-size: 12.5px;
}

.records-footer .records-menu,
.records-footer .menu {
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.records-footer a,
.records-footer a:visited {
	color: #a3b8d1;
	text-decoration: none !important;
}

.records-footer a:hover,
.records-footer a:focus {
	color: #fff;
	text-decoration: none !important;
}

.records-footer a:focus-visible {
	outline: 2px solid var(--records-gold);
	outline-offset: 4px;
}

@media (max-width: 1024px) {
	.records-page-layout {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.records-sidebar {
		position: static;
	}

	.records-statistics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.records-lead-form {
		grid-template-columns: 1fr 1fr;
	}

	.records-submit {
		grid-column: 1 / -1;
	}
}

@media (max-width: 720px) {
	.records-masthead-inner,
	.records-nav-inner,
	.records-breadcrumb,
	.records-search-inner,
	.records-title-section,
	.records-courthouse-wrap,
	.records-page-layout,
	.records-footer-top,
	.records-footer-bottom {
		padding-right: 20px;
		padding-left: 20px;
	}

	.records-masthead-inner {
		padding-top: 16px;
		padding-bottom: 16px;
	}

	.records-brand-title {
		font-size: 16px;
	}

	.records-brand-seal {
		width: 44px;
		height: 44px;
		flex-basis: 44px;
	}

	.records-brand-seal svg {
		width: 22px;
		height: 22px;
	}

	.records-primary-nav {
		display: none;
	}

	.records-primary-nav.is-open {
		position: absolute;
		z-index: 40;
		right: 0;
		left: 0;
		display: block;
	}

	.records-primary-nav.is-open .records-nav-inner {
		padding: 0;
	}

	.records-primary-nav.is-open .records-menu,
	.records-primary-nav.is-open .menu {
		width: 100%;
		flex-direction: column;
	}

	.records-primary-nav.is-open li {
		display: block;
	}

	.records-primary-nav.is-open a {
		display: block;
		border-right: 0;
		border-bottom: 1px solid rgba(255, 255, 255, .1);
		border-left: 0 !important;
	}

	.records-menu-toggle {
		display: grid;
		width: 42px;
		height: 42px;
		place-items: center;
		padding: 0;
		border: 0;
		border-radius: 2px;
		background: var(--records-primary-dark);
		color: #fff;
		cursor: pointer;
	}

	.records-lead-form {
		grid-template-columns: 1fr;
	}

	.records-submit {
		grid-column: auto;
	}

	.records-courthouse-info {
		padding: 24px;
	}

	.records-courthouse-details {
		align-items: flex-start;
		flex-direction: column;
	}

	.records-statistics {
		grid-template-columns: 1fr;
	}

	.records-footer .records-menu,
	.records-footer .menu {
		flex-wrap: wrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	* {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
