/*
Theme Name: Flathead Farm Mutual
Theme URI: https://ledgermarketing.com
Author: Ledger Marketing
Author URI: https://ledgermarketing.com
Description: Custom block theme for Flathead Farm Mutual Insurance Company — Kalispell, Montana. Serving Montana homeowners, farms, and ranches since 1907.
Version: 1.0.6
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flathead-farm-mutual
*/

/* ---------------------------------------------------------------------------
   Layout resets — kill block-gap strips between full-width sections
--------------------------------------------------------------------------- */
.wp-site-blocks > * { margin-block: 0; }
.wp-site-blocks main .alignfull { margin-block: 0; }
/* block-gap INSIDE header/footer parts (topline + logo bar stacked groups) */
.ffm-header > *, .ffm-footer > * { margin-block: 0 !important; }

body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
.ffm-header { box-shadow: 0 1px 0 rgba(255,255,255,.06); }
/* core gives .has-background groups default padding — kill it on the header shell */
.wp-block-group.ffm-header.has-background { padding: 0; }
.ffm-topline { font-size: .82rem; letter-spacing: .02em; }
.ffm-topline p { color: #C9D5E1; }
.ffm-topline a { color: #E4ECF3 !important; text-decoration: none; }
.ffm-topline a:hover { color: #fff !important; }
@media (max-width: 640px) {
	.ffm-topline .ffm-topline-extra, .ffm-topline .ffm-topline-agent { display: none; }
}
.ffm-logo img { height: 58px; width: auto; display: block; }
@media (max-width: 781px) { .ffm-logo img { height: 44px; } }

/* nav link color — explicit, core defaults won't win */
body .ffm-header nav.wp-block-navigation a { color: #EDF2F7 !important; font-weight: 500; font-size: .98rem; text-decoration: none; }
body .ffm-header nav.wp-block-navigation a:hover { color: #C89245 !important; }

/* pay button in header: wheat on dark ink */
.ffm-pay-btn a {
	background: #C89245 !important; color: #1C2D42 !important;
	font-weight: 700 !important; border-radius: 6px;
	padding: .55em 1.15em !important; text-decoration: none;
	white-space: nowrap;
}
.ffm-pay-btn a:hover { background: #fff !important; color: #1C2D42 !important; }
@media (max-width: 480px) { .ffm-pay-btn a { padding: .5em .8em !important; font-size: .88rem; } }

/* mobile nav overlay */
body .wp-block-navigation__responsive-container.is-menu-open {
	background: #14202F !important; padding: 5rem 2rem 2rem !important;
}
body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: center; justify-content: flex-start;
}
body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	align-items: center; margin: .35rem 0;
}
/* the ul itself inherits flex-end from items-justified-right — center it */
body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: center !important;
}
/* overlay link color must out-specify the desktop header rule */
body .ffm-header .wp-block-navigation__responsive-container.is-menu-open a {
	color: #fff !important; font-size: 1.35rem; font-family: var(--wp--preset--font-family--display);
}
body .ffm-header .wp-block-navigation__responsive-container.is-menu-open a:hover { color: #C89245 !important; }
body .ffm-header .wp-block-navigation__responsive-container-open,
body .ffm-header .wp-block-navigation__responsive-container-close { color: #fff; }

/* ---------------------------------------------------------------------------
   Hero & page bands
--------------------------------------------------------------------------- */
.ffm-hero :where(h1,h2,h3,h4,p,li) { color: #fff; }
.ffm-hero .ffm-eyebrow { color: #E7C98F; }
.ffm-band :where(h1,h2,h3,h4,p,li) { color: #fff; }
.ffm-band .ffm-eyebrow { color: #E7C98F; }
/* non-button links on dark/colored bands must be white, underlined for affordance */
.ffm-hero a:not(.wp-block-button__link),
.ffm-band a:not(.wp-block-button__link) { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ffm-hero a:not(.wp-block-button__link):hover,
.ffm-band a:not(.wp-block-button__link):hover { color: #E7C98F; }

.ffm-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	font-size: .82rem; font-weight: 700; letter-spacing: .16em;
	text-transform: uppercase; color: #2A6787;
}

/* outline (ghost) button on dark surfaces */
.ffm-btn-ghost a {
	background: transparent !important; color: #fff !important;
	border: 1.5px solid rgba(255,255,255,.65) !important; border-radius: 6px;
}
.ffm-btn-ghost a:hover { background: rgba(255,255,255,.12) !important; border-color: #fff !important; }

/* white button (for colored bands) */
.ffm-btn-white a { background: #fff !important; color: #1C2D42 !important; font-weight: 700 !important; border-radius: 6px; }
.ffm-btn-white a:hover { background: #1C2D42 !important; color: #fff !important; }

/* wheat button on light surfaces */
.ffm-btn-wheat a { background: #C89245 !important; color: #1C2D42 !important; font-weight: 700 !important; border-radius: 6px; }
.ffm-btn-wheat a:hover { background: #1C2D42 !important; color: #fff !important; }

/* pay band: white button with glacier text */
.ffm-payband .wp-block-button a { background: #fff !important; color: #1C2D42 !important; font-weight: 700 !important; }
.ffm-payband .wp-block-button a:hover { background: #1C2D42 !important; color: #fff !important; }

/* ---------------------------------------------------------------------------
   Cards & grids — real CSS grid, never wp-block-columns for many items
--------------------------------------------------------------------------- */
.ffm-grid {
	display: grid; gap: 1.5rem;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.ffm-grid > * { margin: 0 !important; }

.ffm-card {
	background: #fff; border: 1px solid #E5DCC8; border-radius: 10px;
	overflow: hidden; box-shadow: 0 1px 3px rgba(28,45,66,.07);
	display: flex; flex-direction: column;
}
.ffm-card img { width: 100%; height: 210px; object-fit: cover; display: block; }
.ffm-card .ffm-card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .6rem; flex: 1 1 auto; }
.ffm-card .ffm-card-body > * { margin: 0; }
.ffm-card h3 { font-size: 1.28rem; }
.ffm-card .ffm-card-link { margin-top: auto; padding-top: .5rem; font-weight: 600; }

/* equal-height card columns without height:100% overflow trap */
.wp-block-column:has(> .ffm-card:only-child) { display: flex; }
.wp-block-column > .ffm-card:only-child { flex: 1 1 auto; height: auto; }

/* checklist */
.ffm-check { list-style: none; padding-left: 0; }
.ffm-check li { padding-left: 1.9rem; position: relative; margin-bottom: .55rem; }
.ffm-check li::before {
	content: ""; position: absolute; left: 0; top: .28em;
	width: 1.15em; height: 1.15em; border-radius: 50%;
	background: #2A6787 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" d="M3.5 8.5l3 3 6-7"/></svg>') center/68% no-repeat;
}
.ffm-band .ffm-check li::before, .ffm-hero .ffm-check li::before { background-color: #C89245; }

/* stat chips */
.ffm-stat { border-left: 3px solid #C89245; padding-left: 1.1rem; }
.ffm-stat strong { display: block; font-family: var(--wp--preset--font-family--display); font-size: 1.7rem; color: #1C2D42; line-height: 1.2; }

/* contact info blocks */
.ffm-infobox { background: #fff; border: 1px solid #E5DCC8; border-radius: 10px; padding: 1.6rem 1.7rem; }
.ffm-infobox > * { margin: 0 0 .5rem; }
.ffm-infobox h3 { font-size: 1.15rem; }

/* FAQ */
.ffm-faq details { background: #fff; border: 1px solid #E5DCC8; border-radius: 8px; padding: 1rem 1.3rem; margin-bottom: .8rem; }
.ffm-faq summary { font-weight: 600; color: #1C2D42; cursor: pointer; font-size: 1.02rem; }
.ffm-faq details p { margin: .7rem 0 0; }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.ffm-footer { font-size: .95rem; }
.ffm-footer, .ffm-footer p, .ffm-footer li { color: #B9C6D2; }
.ffm-footer h3 { color: #fff; font-size: 1.02rem; font-family: var(--wp--preset--font-family--body); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ffm-footer a { color: #D8E2EA; text-decoration: none; }
.ffm-footer a:hover { color: #E7C98F; }
.ffm-footer .ffm-footer-logo img { height: 56px; width: auto; }
.ffm-footer ul { list-style: none; padding-left: 0; margin: 0; }
.ffm-footer ul li { margin-bottom: .45rem; }
.ffm-chip {
	display: inline-block; background: #fff; border-radius: 8px;
	padding: .7rem 1rem; color: #1C2D42 !important; line-height: 1.35;
	font-size: .85rem;
}
.ffm-chip strong { color: #1C2D42; }
/* the footer margin reset above zeroes this bar's margin-top — restore the gap
   (same specificity + !important, declared later, so it wins) */
.ffm-footer > .ffm-bottombar { margin-block-start: clamp(2.2rem, 4vw, 3.25rem) !important; }
.ffm-bottombar { border-top: 1px solid rgba(255,255,255,.12); font-size: .84rem; padding-top: 1.4rem !important; }
.ffm-bottombar p { color: #8FA0B0; margin: 0; }
.ffm-bottombar a { color: #B9C6D2; }

/* ---------------------------------------------------------------------------
   Misc
--------------------------------------------------------------------------- */
.ffm-rule { border: none; border-top: 2px solid #C89245; width: 64px; margin: 0; }
.entry-content a { text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
.ffm-phone-lg { font-family: var(--wp--preset--font-family--display); font-size: 1.9rem; font-weight: 600; }
.ffm-phone-lg a { text-decoration: none; }
