/*
Theme Name: Surprise Firefighters Charities
Theme URI: https://surprisefc.org/
Template: ssb-base
Author: Super Site Bros
Author URI: https://supersitebros.com/
Description: Client child theme of SSB Base for Surprise Firefighters Charities. Adds the three things the base theme does not provide — a contact form, a map, and staff as editable content rather than a hardcoded array. All design is inherited: there are no token overrides.
Version: 1.5.2
Requires at least: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ssb-surprisefc
Tags: block-theme, full-site-editing, non-profit, charity
*/

/*
 * Deliberately small. Colour, type, spacing and section layout all come from
 * SSB Base — this file styles only the blocks this child adds. Utility classes
 * the parent already provides (.ssb-rule, .ssb-card, .ssb-section)
 * are used as-is and never redefined here.
 */

/* --------------------------------------------------------------- Staff ---
   Five equal cells split by vertical rules, matching the parent's own
   ssb-base/staff pattern so the CPT-backed block and the hardcoded one are
   visually identical.
   ------------------------------------------------------------------------ */

.sfc-staff {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0;
}

.sfc-staff__card {
	text-align: left;
	padding: 2rem 1.5rem;
	border-right: 2px solid var(--wp--preset--color--ink);
}

.sfc-staff__card:first-child { padding-left: 0; }
.sfc-staff__card:last-child { border-right: 0; padding-right: 0; }

.sfc-staff__photo {
	max-width: 132px;
	margin-inline: 0;
	overflow: hidden;
	border-radius: 0;
	background: var(--wp--preset--color--surface-deep);
}

/* height:auto is load-bearing. the_post_thumbnail() and the fallback both emit
   width/height attributes, which become presentational hints setting a definite
   height — and aspect-ratio is only consulted when one axis is auto. Without
   this the portraits rendered 132x340 instead of the design's 132x165. */
.sfc-staff__photo img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: 50% 14%;
	display: block;
}

.sfc-staff__name {
	margin: 1.125rem 0 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 1.125rem;
	line-height: 1.1;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink);
}

.sfc-staff__role {
	margin: 0.375rem 0 0;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
}

/* The president reads in the accent; everyone else in muted ink. Bound to the
   "Feature on About page" flag, never to document order. */
.sfc-staff__role--lead { color: var(--wp--preset--color--engine); }

.sfc-staff--featured { display: block; max-width: 260px; margin-inline: 0; }

@media (max-width: 1024px) {
	.sfc-staff { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
	.sfc-staff__card { border-right: 0; padding-left: 0; padding-right: 0; }
}

/* Phones stay two-up, per the client — the portraits are small, and a single
   column left every row mostly empty. */

/* ---------------------------------------------------------------- Form ---
   Fields are rules, not boxes: no fill, no radius, a 2px baseline.
   ------------------------------------------------------------------------ */

.sfc-form { display: flex; flex-direction: column; gap: 2.125rem; }

.sfc-field { margin-bottom: 0; }

.sfc-field label {
	display: block;
	margin-bottom: 0.625rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
}

.sfc-field input,
.sfc-field textarea {
	width: 100%;
	padding: 0.75rem 0.125rem;
	font: inherit;
	font-size: 1.125rem;
	font-weight: 300;
	color: var(--wp--preset--color--ink);
	background: transparent;
	border: 0;
	border-bottom: 2px solid var(--wp--preset--color--ink);
	border-radius: 0;
}

.sfc-field input:focus-visible,
.sfc-field textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--engine);
	outline-offset: 2px;
}

.sfc-field textarea { resize: vertical; min-height: 7rem; }
.sfc-field .required { color: var(--wp--preset--color--engine); }

.sfc-form__hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }

.sfc-btn {
	align-self: flex-start;
	min-width: 250px;
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
}

.sfc-btn::after {
	content: "\2192";
	font-family: var(--wp--preset--font-family--display);
}

.sfc-btn[aria-busy="true"] { opacity: 0.45; pointer-events: none; }

.sfc-form__status {
	margin-top: 0;
	padding: 1rem 1.25rem;
	border-radius: 0;
	display: none;
	font-size: 0.9375rem;
}

.sfc-form__status.is-visible { display: block; }

.sfc-form__status.is-success {
	background: var(--wp--preset--color--base);
	border: 2px solid var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink);
}

.sfc-form__status.is-error {
	background: var(--wp--preset--color--base);
	border: 2px solid var(--wp--preset--color--engine);
	color: var(--wp--preset--color--engine-deep);
}

/* ----------------------------------------------------------------- Map --- */

.sfc-map {
	margin-top: 1.5rem;
	border: 2px solid var(--wp--preset--color--ink);
}

.sfc-map iframe { width: 100%; height: 320px; border: 0; display: block; }
.sfc-map--small iframe { height: 240px; }

/* No API key set: print the address on the design's ruled ground rather than
   showing Google's error tile, which is what the original site did. */
.sfc-map__fallback {
	padding: 1.625rem;
	min-height: 230px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	text-align: left;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 1.375rem;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink);
	border: 0;
	background-color: var(--wp--preset--color--surface-deep);
	background-image:
		repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.08) 0 1px, transparent 1px 34px),
		repeating-linear-gradient(90deg, rgba(26, 26, 26, 0.08) 0 1px, transparent 1px 34px);
}

/* --------------------------------------------------------- Social chips --- */

.sfc-chips { display: flex; gap: 0.625rem; margin-top: 0.875rem; }

.sfc-chip {
	padding: 0.625rem 1rem;
	border: 2px solid var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink);
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-decoration: none;
}

.sfc-chip:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
}

/* --- Donate pop-up -------------------------------------------------------- */
/* Server-rendered in wp_footer by inc/donate.php; assets/js/donate.js only
   toggles [hidden]. Design language: flat panel, 2px ink rule, flush type. */

.sfc-donate-modal {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.sfc-donate-modal[hidden] { display: none; }

.sfc-donate-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 16, 16, 0.72);
}

.sfc-donate-modal__panel {
	position: relative;
	background: var(--wp--preset--color--base);
	border: 2px solid var(--wp--preset--color--ink);
	padding: 40px 36px 36px;
	width: min(420px, 100%);
	max-height: min(88vh, 100%);
	overflow-y: auto;
}

.sfc-donate-modal__close {
	position: absolute;
	top: 0;
	right: 0;
	width: 44px;
	height: 44px;
	border: 0;
	border-left: 2px solid var(--wp--preset--color--ink);
	border-bottom: 2px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.sfc-donate-modal__close:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
}

.sfc-donate-modal__title {
	margin: 0 0 20px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 2rem;
	line-height: 1;
	text-transform: uppercase;
	text-shadow: 2px 2px 0 #fff, 3px 3px 0 rgba(0, 0, 0, 0.18);
}

.sfc-donate-modal__venmo img {
	display: block;
	width: min(280px, 100%);
	margin: 0 auto;
	border: 2px solid var(--wp--preset--color--line-soft);
}

.sfc-donate-modal__handle {
	margin: 12px 0 0;
	text-align: center;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.sfc-donate-modal__handle a { color: var(--wp--preset--color--engine); text-decoration: none; }
.sfc-donate-modal__handle a:hover { text-decoration: underline; }

.sfc-donate-modal__option {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 2px solid var(--wp--preset--color--ink);
}

.sfc-donate-modal__option h3 {
	margin: 0 0 6px;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.sfc-donate-modal__link {
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.8125rem;
	color: var(--wp--preset--color--engine);
	text-decoration: none;
}

.sfc-donate-modal__link:hover { text-decoration: underline; }

.sfc-donate-modal__address { margin: 0; line-height: 1.6; }

body.sfc-donate-open { overflow: hidden; }
