/*
 * MFW — zine / xerox overlays on top of Twenty Twenty-Five + theme.json.
 * Intent: restrained. The palette + fonts do 80% of the work. This file adds:
 *  - smooth scroll
 *  - full-site film-grain overlay
 *  - selection color
 *  - hero underline positioning
 *  - narrow mobile gutters
 *  - action-tile hover state
 */

html { scroll-behavior: smooth; }

/* Whole-site film grain */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	background-image: url("../svg/noise.svg");
	background-size: 240px 240px;
	opacity: 0.06;
	mix-blend-mode: overlay;
}

.wp-site-blocks { position: relative; z-index: 2; }

::selection {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-text);
}

/* Tighten headings to feel printed rather than polished */
h1, h2, h3 {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

/* Hero: ensure full-viewport cover and crisp overlay contrast */
.mfw-hero.wp-block-cover {
	min-height: 100dvh;
}
.mfw-hero.wp-block-cover .wp-block-cover__inner-container {
	max-width: 1100px;
}

/* Hand-drawn underline under "GO FUR FREE" */
.mfw-underline {
	display: block;
	width: min(80%, 560px);
	height: 1.1rem;
	margin: -0.15em auto 0;
	color: var(--wp--preset--color--accent);
}

/* Precedent band — hairlines and large display type */
.mfw-precedent {
	border-top: 1px solid var(--wp--preset--color--hairline);
	border-bottom: 1px solid var(--wp--preset--color--hairline);
	padding-block: clamp(1.5rem, 5vw, 3rem);
}
.mfw-precedent .wp-block-group {
	gap: clamp(1rem, 5vw, 3rem);
}

/* Action tiles — sharp-edged boxes, accent on hover */
.mfw-action-tile {
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border: 1px solid var(--wp--preset--color--hairline);
	background: var(--wp--preset--color--bg);
	transition: border-color 180ms ease, background-color 180ms ease;
	height: 100%;
}
.mfw-action-tile:hover,
.mfw-action-tile:focus-within {
	border-color: var(--wp--preset--color--accent);
}

/* Typewriter fallback line */
.mfw-email-fallback {
	font-family: var(--wp--preset--font-family--mono), monospace;
	font-size: clamp(1rem, 1.6vw, 1.2rem);
	opacity: 0.88;
	letter-spacing: -0.01em;
	margin-top: 1rem;
	line-height: 1.5;
}
.mfw-email-fallback a {
	text-decoration: underline;
	color: var(--wp--preset--color--accent);
}
.mfw-email-fallback a:hover { color: var(--wp--preset--color--fg); }

/* Case-against-fur paragraph: slight measure control for readability */
.mfw-case .wp-block-paragraph,
.mfw-case p {
	max-width: 62ch;
	font-size: 1.0625rem;
	line-height: 1.65;
}

/* Narrow side gutters on small screens */
@media (max-width: 781px) {
	.has-global-padding,
	.wp-site-blocks > * {
		padding-inline: 16px !important;
	}
	.mfw-hero.wp-block-cover {
		padding-inline: 16px !important;
	}
}

/* Respect reduced-motion users */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}

/* Footer subdued */
.mfw-footer {
	border-top: 1px solid var(--wp--preset--color--hairline);
	padding-block: 3rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
}
.mfw-footer a {
	color: var(--wp--preset--color--muted);
	text-decoration: underline;
}
.mfw-footer a:hover { color: var(--wp--preset--color--accent); }

/* --- Map section --- */
.mfw-map-section {
	border-top: 1px solid var(--wp--preset--color--hairline);
}
.mfw-map-wrap {
	width: 100%;
	margin: 0;
}
#mfw-map {
	width: 100%;
	height: clamp(380px, 65vh, 640px);
	background: #0a0a0a;
	z-index: 1;
}
.mfw-map-error {
	padding: 1rem 1.5rem;
	color: var(--wp--preset--color--fg);
	background: #1a1a1a;
	border: 1px solid var(--wp--preset--color--accent);
}

/* Leaflet overrides — dark + CAFT orange */
.leaflet-container {
	background: #0a0a0a;
	font-family: var(--wp--preset--font-family--body), sans-serif;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: #111;
	color: var(--wp--preset--color--fg);
	border-radius: 0;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.leaflet-popup-content {
	margin: 14px 16px;
	font-size: 0.9375rem;
	line-height: 1.5;
	min-width: 200px;
	color: var(--wp--preset--color--fg);
}
.leaflet-popup-content .mfw-popup-title {
	display: block;
	font-size: 1.05rem;
	letter-spacing: 0.01em;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.25rem;
}
.leaflet-popup-content .mfw-popup-desc,
.leaflet-popup-content .mfw-popup-link {
	word-break: break-word;
}
.leaflet-popup-content .mfw-popup-link {
	margin-top: 0.35rem;
}
.leaflet-popup-content a {
	color: var(--wp--preset--color--accent) !important;
	text-decoration: underline;
}
.leaflet-popup-content a:hover {
	color: var(--wp--preset--color--fg) !important;
}
.leaflet-popup-close-button {
	color: var(--wp--preset--color--muted) !important;
}
.leaflet-popup-close-button:hover {
	color: var(--wp--preset--color--fg) !important;
}
.leaflet-container a.leaflet-popup-close-button {
	padding: 6px 8px 0 0;
}

.leaflet-bar a,
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #111;
	border-color: var(--wp--preset--color--hairline);
	color: var(--wp--preset--color--fg);
}
.leaflet-bar a:hover {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-text);
}
.leaflet-bar {
	box-shadow: none;
}

.leaflet-container .leaflet-control-attribution {
	background: rgba(0, 0, 0, 0.6);
	color: var(--wp--preset--color--muted);
	font-size: 0.7rem;
	padding: 2px 6px;
}
.leaflet-container .leaflet-control-attribution a {
	color: var(--wp--preset--color--muted);
}
.leaflet-container .leaflet-control-attribution a:hover {
	color: var(--wp--preset--color--accent);
}
