/*
Theme Name: River Valley Mutual
Theme URI: https://rivervalleymutual.com
Author: Ledger Marketing
Author URI: https://ledgermarketing.com
Description: Custom full-site-editing block theme for River Valley Mutual Insurance Company, Whitehall, Wisconsin. Warm, small-town, mutual-owned brand with prominent online bill-pay. Self-building on activation.
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: river-valley-mutual
*/

/* ============================================================
   RIVER VALLEY MUTUAL — component & fix CSS
   (theme.json is the design source of truth; this file only
   handles layout, components, and FSE quirks.)
   ============================================================ */

:root {
	--rvm-ink: #1F2D2A;
	--rvm-ink-deep: #16211E;
	--rvm-green: #5C9A2E;
	--rvm-green-bright: #6DB33F;
	--rvm-river: #2E6DA4;
	--rvm-paper: #F5F2EA;
	--rvm-cream: #FBF9F3;
	--rvm-line: #E4DFD2;
	--rvm-shadow: 0 14px 40px rgba(22,33,30,.10);
}

/* ---- Kill block-gap strips (body bg showing between sections) ---- */
.wp-site-blocks > * { margin-block: 0; }
.wp-site-blocks main .alignfull { margin-block: 0; }
.wp-site-blocks main > .wp-block-group.alignfull + .wp-block-group.alignfull { margin-block: 0; }

/* ---- Base ---- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { text-underline-offset: 2px; }
.rvm-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	text-transform: uppercase;
	letter-spacing: .16em;
	font-weight: 700;
	font-size: .78rem;
	color: var(--rvm-green);
}
.rvm-eyebrow.is-light { color: var(--rvm-green-bright); }

/* ============================================================
   HEADER
   ============================================================ */
.rvm-topbar {
	background: var(--rvm-ink-deep);
	color: #E7ECE6;
	font-size: .86rem;
}
.rvm-topbar a { color: #E7ECE6; text-decoration: none; }
.rvm-topbar a:hover { color: var(--rvm-green-bright); }

.rvm-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255,255,255,.96);
	border-bottom: 1px solid var(--rvm-line);
	/* no backdrop-filter: it traps the fixed mobile menu */
}
.rvm-brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.rvm-brand img { height: 46px; width: auto; display: block; }
.rvm-brand .rvm-wordmark {
	font-family: var(--wp--preset--font-family--display);
	line-height: 1.02;
	color: var(--rvm-ink);
}
.rvm-brand .rvm-wordmark b { display: block; font-weight: 600; font-size: 1.18rem; }
.rvm-brand .rvm-wordmark span { display: block; font-family: var(--wp--preset--font-family--body); font-weight: 600; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rvm-green); }

/* nav */
.rvm-header .wp-block-navigation { font-family: var(--wp--preset--font-family--body); font-weight: 600; }
.rvm-header .wp-block-navigation a { color: var(--rvm-ink); }
.rvm-header .wp-block-navigation a:hover { color: var(--rvm-green); }

/* header pay button — always visible, even on mobile */
.rvm-pay-btn a,
.rvm-pay-btn .wp-block-button__link {
	background: var(--rvm-green) !important;
	color: #fff !important;
	border-radius: 8px;
	font-weight: 700;
	padding: .6rem 1.15rem;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(92,154,46,.32);
}
.rvm-pay-btn a:hover { background: var(--rvm-green-bright) !important; }

/* ============================================================
   HERO
   ============================================================ */
.rvm-hero { position: relative; overflow: hidden; }
.rvm-hero::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(90deg, rgba(22,33,30,.82) 0%, rgba(22,33,30,.55) 45%, rgba(22,33,30,.15) 100%);
}
.rvm-hero > * { position: relative; z-index: 2; }
/* force all overlay text white (theme.json colors headings ink) */
.rvm-hero :where(h1,h2,h3,h4,p,li,.rvm-eyebrow) { color: #fff; }
.rvm-hero .rvm-eyebrow { color: var(--rvm-green-bright); }
.rvm-hero-lede { font-size: 1.2rem; max-width: 34rem; color: #EEF1EC !important; }

/* white CTA on dark hero */
.rvm-hero .rvm-cta-ghost a {
	background: transparent !important;
	color: #fff !important;
	border: 1.5px solid rgba(255,255,255,.6);
}
.rvm-hero .rvm-cta-ghost a:hover { border-color: #fff; background: rgba(255,255,255,.1) !important; }

/* ============================================================
   VALUE TRIO / ICON CARDS
   ============================================================ */
.rvm-valuecard {
	background: #fff;
	border: 1px solid var(--rvm-line);
	border-radius: 14px;
	padding: 2rem 1.6rem;
	box-shadow: var(--rvm-shadow);
	height: auto; /* never height:100% — it under-computes and lets content overflow onto the next block */
}
/* Equal-height cards without the overflow trap: let the column flex and the single
   card grow to fill it. Columns with multiple stacked cards are left as content-height. */
.wp-block-column:has(> .rvm-valuecard:only-child) { display: flex; }
.wp-block-column:has(> .rvm-valuecard:only-child) > .rvm-valuecard { flex: 1 1 auto; }
.rvm-valuecard .rvm-ico {
	width: 54px; height: 54px; border-radius: 12px;
	display: grid; place-items: center;
	background: rgba(92,154,46,.12); color: var(--rvm-green);
	margin-bottom: 1rem;
}
.rvm-valuecard .rvm-ico svg { width: 28px; height: 28px; }
.rvm-valuecard.is-river .rvm-ico { background: rgba(46,109,164,.12); color: var(--rvm-river); }

/* ============================================================
   FEATURE ROWS (alternating)
   ============================================================ */
.rvm-featimg img { border-radius: 16px; box-shadow: var(--rvm-shadow); width: 100%; height: auto; display:block; }

/* ============================================================
   PAY BAND (focal — river blue)
   ============================================================ */
.rvm-payband { background: var(--rvm-river); position: relative; }
.rvm-payband :where(h1,h2,h3,p,li) { color: #fff; }
.rvm-payband .rvm-eyebrow { color: #CFE4F6; }
/* white button w/ brand text on the colored band */
.rvm-payband .rvm-pay-lg a,
.rvm-payband .rvm-pay-lg .wp-block-button__link {
	background: #fff !important;
	color: var(--rvm-river-deep, #234F77) !important;
	font-weight: 700;
	border-radius: 10px;
	padding: 1rem 2rem;
	font-size: 1.05rem;
	box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.rvm-payband .rvm-pay-lg a:hover { background: #EAF3FB !important; }

/* ============================================================
   PAGE HEADER BAND (ink, interior pages)
   ============================================================ */
.rvm-pagehead { background: var(--rvm-ink); position: relative; overflow: hidden; }
.rvm-pagehead::before {
	content: ""; position: absolute; inset: 0;
	background-image: url(assets/photos/pageheader.jpg);
	background-size: cover; background-position: center;
	opacity: .18;
}
.rvm-pagehead > * { position: relative; z-index: 2; }
.rvm-pagehead :where(h1,h2,p,.rvm-eyebrow) { color: #fff; }
.rvm-pagehead .rvm-eyebrow { color: var(--rvm-green-bright); }
.rvm-pagehead p { color: #D8DEDA; }

/* ============================================================
   COUNTY MAP SECTION
   ============================================================ */
.rvm-mapwrap { background: #fff; border: 1px solid var(--rvm-line); border-radius: 16px; padding: 1rem; box-shadow: var(--rvm-shadow); }
.rvm-mapwrap img { display:block; width: 100%; height: auto; border-radius: 8px; }

/* ============================================================
   AGENT DIRECTORY
   ============================================================ */
.rvm-agentbar {
	display: flex; gap: .75rem; flex-wrap: wrap; align-items: center;
	background: #fff; border: 1px solid var(--rvm-line); border-radius: 12px;
	padding: .9rem 1rem; box-shadow: var(--rvm-shadow); margin-bottom: 1.5rem;
}
.rvm-agentbar input {
	flex: 1 1 320px; min-width: 220px;
	border: 1px solid var(--rvm-line); border-radius: 8px;
	padding: .7rem .9rem; font-size: 1rem; font-family: var(--wp--preset--font-family--body);
	background: var(--rvm-cream); color: var(--rvm-ink);
}
.rvm-agentbar input:focus { outline: 2px solid var(--rvm-green); border-color: var(--rvm-green); }
.rvm-agentbar .rvm-count { color: var(--rvm-muted,#5C6560); font-size: .9rem; font-weight: 600; }

.rvm-agentgrid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(255px,1fr));
	gap: 1rem; align-items: start; /* cards size to content, no stretched empties */
}
.rvm-agentcard {
	background: #fff; border: 1px solid var(--rvm-line); border-radius: 12px;
	padding: 1.2rem 1.25rem; height: auto;
}
.rvm-agentcard h3 { font-size: 1.08rem; margin: 0 0 .15rem; }
.rvm-agentcard .rvm-town { color: var(--rvm-green-ink,#3F6E1E); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.rvm-agentcard address { font-style: normal; color: var(--rvm-muted,#5C6560); font-size: .95rem; margin-top: .5rem; line-height: 1.5; }
.rvm-agentcard a { color: var(--rvm-river); font-weight: 600; text-decoration: none; }
.rvm-agentcard a:hover { text-decoration: underline; }
.rvm-agent-empty { display:none; padding: 2rem; text-align: center; color: var(--rvm-muted,#5C6560); }

/* ============================================================
   FOOTER
   ============================================================ */
.rvm-footer { background: var(--rvm-ink); color: #C9D1CC; }
.rvm-footer :where(h2,h3,h4) { color: #fff; }
.rvm-footer a { color: #C9D1CC; text-decoration: none; }
.rvm-footer a:hover { color: var(--rvm-green-bright); }
.rvm-footer .rvm-foot-logo { height: 58px; width: auto; }
.rvm-footer .rvm-eyebrow { color: var(--rvm-green-bright); }
.rvm-reinsure-chip {
	background: #fff; border-radius: 10px; padding: .7rem .9rem;
	display: inline-flex; align-items: center; justify-content: center;
}
.rvm-reinsure-chip img { display:block; max-height: 40px; width: auto; }
.rvm-footer-legal { border-top: 1px solid rgba(255,255,255,.12); color: #9AA6A0; font-size: .85rem; }
.rvm-footer-legal a { color: #B8C2BC; }

/* ============================================================
   MOBILE NAV OVERLAY FIX
   ============================================================ */
@media (max-width: 781px) {
	body .wp-block-navigation__responsive-container.is-menu-open {
		background: var(--rvm-ink) !important;
		padding: 5rem 1.5rem 3rem !important;
	}
	body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		width: 100%;
	}
	body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content > .wp-block-navigation__container,
	body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation {
		justify-content: center !important;
		align-items: stretch !important;
		width: 100%;
	}
	body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		align-items: center !important; /* items inherit flex-end from justified-right */
		width: 100%;
		border-bottom: 1px solid rgba(255,255,255,.12);
		padding-block: .35rem;
	}
	body .wp-block-navigation__responsive-container.is-menu-open a { color: #fff !important; font-size: 1.3rem; }
	body .wp-block-navigation__responsive-container-close { color: #fff !important; }
	.rvm-brand .rvm-wordmark b { font-size: 1rem; }
	.rvm-brand img { height: 40px; }
}

/* small helpers */
.rvm-round { border-radius: 16px; }
.has-text-align-center .rvm-hero-lede { margin-inline: auto; }
