/* Ironside Fitness — supplemental styles
 * Most styling comes from theme.json. This file handles things theme.json can't:
 * FAQ accordion, contact form, sticky header polish, scroll reveals.
 * Client-edits to colors/fonts in the Site Editor flow through automatically
 * because these styles use the CSS custom properties WordPress generates.
 */

:root {
	--ironside-ease: cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* ------------------------------ Body ------------------------------ */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* ----------------------------------------------------------------- *
 * Layout safety nets
 * 1. Headings must NEVER break mid-word (no "PROGR AMMING").
 * 2. Multi-column rows wrap to a new line instead of cramming every
 *    card into one row and shrinking them to a vertical letter stack.
 * ----------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6,
.wp-block-heading {
	overflow-wrap: normal;
	word-break: keep-all;
	hyphens: none;
}

/* Columns wrap when they run out of room. Each card holds a comfortable
 * minimum width (260px) and grows to fill the row; when there isn't space
 * for another 260px card, it wraps to the next line. This turns a 6-card
 * row into 3-and-3 or 4-and-2 instead of six slivers. */
.wp-block-columns {
	flex-wrap: wrap;
}
.wp-block-columns > .wp-block-column {
	flex: 1 1 260px;
	min-width: 260px;
}

/* On phones, let a single card take the full width. */
@media (max-width: 599px) {
	.wp-block-columns > .wp-block-column {
		flex-basis: 100%;
		min-width: 0;
	}
}

/* Card heading sizing — keep card titles from overpowering a narrow card.
 * Smaller and tighter than full section headings. */
.wp-block-column .wp-block-heading {
	font-size: clamp(1.15rem, 1.6vw, 1.5rem);
	line-height: 1.1;
}

/* Inside each card, let text use the full width. */
.wp-block-column .wp-block-group {
	min-width: 0;
}

/* Subtle grain for that physical, gym-poster feel */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	opacity: 0.025;
	background-image:
		radial-gradient(circle at 20% 30%, #000 0.5px, transparent 0.5px),
		radial-gradient(circle at 70% 70%, #000 0.5px, transparent 0.5px);
	background-size: 3px 3px;
	mix-blend-mode: multiply;
}

/* ------------------------------ Header ------------------------------ */

.ironside-header {
	transition: box-shadow 0.3s var(--ironside-ease), background-color 0.3s var(--ironside-ease);
	z-index: 50;
}
.ironside-header.is-scrolled {
	box-shadow: 0 1px 0 var(--wp--preset--color--line), 0 6px 24px rgba(0,0,0,0.04);
}

/* Tighter button on smaller screens */
@media (max-width: 600px) {
	.ironside-header .wp-block-buttons {
		display: none;
	}
}

/* ------------------------------ Buttons ------------------------------ */

/* Outline button variant — text color = current, border = current */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border: 2px solid currentColor;
	padding: calc(1rem - 2px) calc(2rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--paper);
	border-color: var(--wp--preset--color--primary);
}

/* All buttons get a tactile press */
.wp-block-button__link {
	transition: transform 0.15s var(--ironside-ease), background-color 0.2s var(--ironside-ease), color 0.2s var(--ironside-ease);
}
.wp-block-button__link:active {
	transform: translateY(1px);
}

/* ------------------------------ Headings ------------------------------ */

/* The display headings already use Bebas Neue via theme.json.
 * Add a decorative slash under H1/H2 for that gym-poster vibe.
 */
.wp-block-cover h1.wp-block-heading {
	position: relative;
	display: inline-block;
}

/* ------------------------------ FAQ ------------------------------ */

.ironside-faq {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ironside-faq__item {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	background: var(--wp--preset--color--paper);
	transition: border-color 0.2s var(--ironside-ease);
}
.ironside-faq__item[open] {
	border-color: var(--wp--preset--color--ink);
}

.ironside-faq__item > summary {
	cursor: pointer;
	padding: 1.25rem 1.5rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.15rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}
.ironside-faq__item > summary::-webkit-details-marker { display: none; }
.ironside-faq__item > summary::after {
	content: "+";
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--primary);
	transition: transform 0.25s var(--ironside-ease);
}
.ironside-faq__item[open] > summary::after {
	transform: rotate(45deg);
}

.ironside-faq__answer {
	padding: 0 1.5rem 1.25rem;
	color: var(--wp--preset--color--ink-soft);
}
.ironside-faq__answer p { margin: 0; }

/* ------------------------------ Contact form ------------------------------ */

.ironside-contact {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ironside-contact__heading {
	margin: 0 0 0.5rem;
}

.ironside-contact__row {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ironside-contact label {
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.85rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ironside-contact input[type="text"],
.ironside-contact input[type="email"],
.ironside-contact input[type="tel"],
.ironside-contact select,
.ironside-contact textarea {
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	background: var(--wp--preset--color--paper);
	font: inherit;
	color: var(--wp--preset--color--ink);
	transition: border-color 0.2s var(--ironside-ease);
}
.ironside-contact input:focus,
.ironside-contact select:focus,
.ironside-contact textarea:focus {
	border-color: var(--wp--preset--color--primary);
	outline: 2px solid color-mix(in srgb, var(--wp--preset--color--primary) 25%, transparent);
	outline-offset: 1px;
}

.ironside-contact__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ironside-contact__notice {
	padding: 0.85rem 1rem;
	border-radius: 2px;
}
.ironside-contact__notice--success {
	background: #E8F5E9;
	border-left: 3px solid #2E7D32;
}
.ironside-contact__notice--error {
	background: #FFEBEE;
	border-left: 3px solid var(--wp--preset--color--primary);
}

.ironside-contact__row--submit { margin-top: 0.5rem; }

/* ------------------------------ Scroll reveal ------------------------------ */

.wp-block-group.alignfull,
.wp-block-cover.alignfull {
	scroll-margin-top: 96px;
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-cover,
	.wp-block-group.alignfull > .wp-block-columns,
	.wp-block-group.alignfull > h2 {
		animation: ironside-rise 0.7s var(--ironside-ease) both;
		animation-timeline: view();
		animation-range: entry 0% entry 60%;
	}
}

@keyframes ironside-rise {
	from { opacity: 0; transform: translateY(28px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------ Cards hover ------------------------------ */

.wp-block-group[class*="has-line-border-color"] {
	transition: transform 0.25s var(--ironside-ease), border-color 0.25s var(--ironside-ease), box-shadow 0.25s var(--ironside-ease);
}
.wp-block-group[class*="has-line-border-color"]:hover {
	transform: translateY(-3px);
	border-color: var(--wp--preset--color--ink);
	box-shadow: 0 18px 40px -20px rgba(20,20,20,0.25);
}

/* ------------------------------ Cover ------------------------------ */

/* Background pattern overlay for hero covers */
.wp-block-cover .wp-block-cover__background {
	background-image:
		radial-gradient(circle at 90% 10%, rgba(230,48,39,0.18), transparent 40%),
		radial-gradient(circle at 0% 100%, rgba(230,48,39,0.12), transparent 50%);
}

/* ------------------------------ Quote ------------------------------ */

.wp-block-quote.is-style-large {
	border: none;
	padding: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	line-height: 1.25;
	letter-spacing: 0.01em;
}
.wp-block-quote.is-style-large cite {
	display: block;
	margin-top: 1.5rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.9rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	font-style: normal;
	color: var(--wp--preset--color--muted);
}

/* ------------------------------ Lists ------------------------------ */

.wp-block-list {
	padding-left: 1.25rem;
}
.wp-block-list li {
	margin-bottom: 0.5rem;
	position: relative;
}

/* ------------------------------ Print ------------------------------ */

@media print {
	.ironside-header,
	.wp-block-cover,
	footer { display: none; }
}
