/*
Theme Name: Rawz
Description: Multisite theme with internal Submissions CPT and funnel shell.
Version: 1.0.0
Text Domain: rawz
*/

/* -------------------------------------------------------------------------
   Design tokens — fallbacks only; Theme Options inject overrides on :root
   (#rawz-theme-css-vars in wp_head).
   ------------------------------------------------------------------------- */
:root {
	/* Brand palette */
	--color-page-bg:    #6A9C80;   /* sage green */
	--color-surface:    #ffffff;
	--color-text:       #1a1d26;
	--color-text-muted: #4a5568;
	--color-accent:     #D94035;   /* red — submit & selected states */
	--color-accent-soft:#fde8e6;
	--color-border:     rgba(255 255 255 / 0.22);

	/* Page typography (override via Theme Options) */
	--color-heading:    #ffffff;
	--color-body:       #1a1d26;

	/* Pill / textarea brand tones */
	--color-pill-bg:       #fdd7bb;   /* resting rating / chips */
	--color-pill-hover:    #fbc9a8;   /* hover state */
	--color-pill-selected: #D94035;   /* red — active pill / rating */
	--color-pill-text:     #1a1d26;
	--color-pill-text-sel: #ffffff;
	--color-textarea-bg:    #fdd7bb;   /* textarea fill */
	--color-form-question:  #3b6d4c;   /* funnel question legend (ex–form card title look) */

	/* Typography: Ruddy headings + prose; Inter for form chips / textarea / ratings + submit */
	--font-body:    'Ruddy', Georgia, 'Times New Roman', serif;
	--font-display: 'Ruddy', Georgia, 'Times New Roman', serif;
	--font-heading-size: 24px;
	--font-inter:   'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	/* Radii */
	--radius-sm:   0.5rem;
	--radius-md:   0.875rem;
	--radius-lg:   1.125rem;
	--radius-pill: 9999px;

	/* Shadows (form card uses black-based lift; see --shadow-form) */
	--shadow-card:       0 2px 12px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(0 0 0 / 0.04);
	--radius-form-card: clamp(1.375rem, 4.5vw, 1.875rem);
	--shadow-form:      0 4px 6px rgb(0 0 0 / 0.07),
		0 12px 24px rgb(0 0 0 / 0.12),
		0 24px 48px rgb(0 0 0 / 0.14);

	/* Spacing */
	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2rem;
	--space-xl: clamp(2rem, 6vw, 3rem);

	--tap-min: 2.75rem;

	/* Motion */
	--ease-out-soft:  cubic-bezier(0.22, 1, 0.36, 1);
	--duration-step:  0.28s;
	--duration-fast:  0.15s;
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--duration-step: 0.01ms;
		--duration-fast: 0.01ms;
	}
}

/* -------------------------------------------------------------------------
   Ruddy — Regular + Bold (assets/fonts/Ruddy-Regular, Ruddy-Bold)
   ------------------------------------------------------------------------- */
@font-face {
	font-family: 'Ruddy';
	src:
		url('assets/fonts/Ruddy-Regular/Ruddy-Regular.woff2') format('woff2'),
		url('assets/fonts/Ruddy-Regular/Ruddy-Regular.woff')  format('woff'),
		url('assets/fonts/Ruddy-Regular/Ruddy-Regular.ttf') format('truetype');
	font-weight: 400;
	font-style:  normal;
	font-display: swap;
}

@font-face {
	font-family: 'Ruddy';
	src:
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.woff2') format('woff2'),
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.woff')  format('woff'),
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.ttf') format('truetype');
	font-weight: 700;
	font-style:  normal;
	font-display: swap;
}

@font-face {
	font-family: 'Ruddy';
	src:
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.woff2') format('woff2'),
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.woff')  format('woff'),
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.ttf') format('truetype');
	font-weight: 800;
	font-style:  normal;
	font-display: swap;
}

@font-face {
	font-family: 'Ruddy';
	src:
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.woff2') format('woff2'),
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.woff')  format('woff'),
		url('assets/fonts/Ruddy-Bold/Ruddy-Bold.ttf') format('truetype');
	font-weight: 900;
	font-style:  normal;
	font-display: swap;
}

/* -------------------------------------------------------------------------
   Inter — form UI (SemiBold numeric/chips; Black button)
   assets/fonts/Inter/static/
   ------------------------------------------------------------------------- */
@font-face {
	font-family: 'Inter';
	src: url('assets/fonts/Inter/static/Inter_18pt-SemiBold.ttf') format('truetype');
	font-weight: 600;
	font-style:  normal;
	font-display: swap;
}

@font-face {
	font-family: 'Inter';
	src: url('assets/fonts/Inter/static/Inter_18pt-Black.ttf') format('truetype');
	font-weight: 900;
	font-style:  normal;
	font-display: swap;
}

/* -------------------------------------------------------------------------
   Global reset / base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 1rem;
	color: var(--color-body);
	min-height: 100dvh;
	background-color: var(--color-page-bg);
}

img {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

/* -------------------------------------------------------------------------
   Site header
   ------------------------------------------------------------------------- */
.site-header {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: var(--space-md) var(--space-sm) var(--space-xs);
}

.site-branding {
	text-align: center;
}

.site-logo-link {
	display: inline-block;
	text-decoration: none;
	transition: opacity var(--duration-fast) var(--ease-out-soft);
}

.site-logo-link:hover   { opacity: 0.88; }
.site-logo-link:focus-visible {
	outline: 2px solid var(--color-surface);
	outline-offset: 0.35rem;
	border-radius: var(--radius-sm);
}

.site-logo-link .site-logo {
	display: block;
	max-height: clamp(3rem, 10vw, 5rem);
	width: auto;
	margin-inline: auto;
}

/* text fallback when no logo image */
.site-brand-name {
	display: inline-block;
	text-decoration: none;
	font-family: var(--font-display);
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: clamp(2rem, 9vw, 4rem);
	line-height: 1;
	color: var(--color-heading);
}

/* -------------------------------------------------------------------------
   Funnel layout
   ------------------------------------------------------------------------- */
/*
 * main#primary: specificity over generic resets + Theme Options --color-page-bg.
 */
main#primary.site-main.funnel-host {
	padding: var(--space-sm);
	padding-bottom: var(--space-xl);
	max-width: 566px;
	margin-inline: auto;
	background-color: var(--color-page-bg);
	transition: background-color var(--duration-step) var(--ease-out-soft);
}
.funnel-root {
	position: relative;
	min-height: 60vh;
}

/* -------------------------------------------------------------------------
   Funnel step
   ------------------------------------------------------------------------- */
.funnel-step {
	position: relative;
	border-radius: var(--radius-lg);
	padding: 0;
	padding-block-end: var(--space-md);
	transition:
		opacity  var(--duration-step) var(--ease-out-soft),
		transform var(--duration-step) var(--ease-out-soft);
	will-change: opacity;
	transform: translateZ(0);
	backface-visibility: hidden;
}

.funnel-step:focus-within { outline: none; }

.funnel-step__title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--font-heading-size);
	line-height: 1.25;
	letter-spacing: 0.04em;
	text-align: center;
	margin: 0 0 var(--space-md);
	color: var(--color-heading);
	text-transform: uppercase;
}

.funnel-step__content {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

/* -------------------------------------------------------------------------
   Text block
   ------------------------------------------------------------------------- */
.funnel-block--text .funnel-block__heading {
	margin: 0 0 var(--space-xs);
	font-family: var(--font-display);
	font-size: var(--font-heading-size);
	font-weight: 700;
	line-height: 1.25;
	color: var(--color-heading);
	text-transform: uppercase;
}

.funnel-block--text .funnel-block__body {
	color: var(--color-body);
	font-size: 0.96rem;
	line-height: 1.6;
	margin: 0;
}

/* -------------------------------------------------------------------------
   Image block
   ------------------------------------------------------------------------- */
.funnel-block--image {
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.funnel-block__image {
	width: 100%;
	display: block;
}

/* -------------------------------------------------------------------------
   Form block: transparent stack — one white card per question (fieldset).
   ------------------------------------------------------------------------- */
.funnel-block--form {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	min-inline-size: 0;
}

.funnel-block--form fieldset.funnel-field {
	position: relative;
	box-sizing: border-box;
	background-color: var(--color-surface);
	border: 0;
	border-radius: var(--radius-form-card);
	box-shadow: var(--shadow-form);
	margin: 0;
	min-width: 0;
	padding: clamp(1rem, 3.5vw, 1.4rem);
}

/* Visible question heading (legend is sr-only — avoids UA drawing legend outside the card) */
.funnel-block--form .funnel-field__label {
	float: none;
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 clamp(0.75rem, 2vw, 1rem);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--font-heading-size);
	line-height: 1.25;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	text-align: left;
	color: var(--color-form-question);
}

/* -------------------------------------------------------------------------
   Rating — 1-10 pill strip
   ------------------------------------------------------------------------- */
.funnel-field__control--rating {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.funnel-field__rating-option {
	position: relative;
	cursor: pointer;
	flex: 1 1 2rem;
	min-width: 2.2rem;
}

.funnel-field__rating-option input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
}

.funnel-field__rating-option span[aria-hidden="true"] {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 2.4rem;
	border-radius: var(--radius-pill);
	background: var(--color-pill-bg);
	color: var(--color-pill-text);
	font-family: var(--font-inter);
	font-size: 0.875rem;
	font-weight: 600;
	transition:
		background-color var(--duration-fast) ease,
		color var(--duration-fast) ease;
}

.funnel-field__rating-option:hover span[aria-hidden="true"],
.funnel-field__rating-option:focus-within span[aria-hidden="true"] {
	background-color: var(--color-pill-hover);
}

.funnel-field__rating-option input:checked + .screen-reader-text + span[aria-hidden="true"] {
	background: var(--color-pill-selected);
	color: var(--color-pill-text-sel);
}

/* hint text below rating */
.funnel-field__rating-hint {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-pill-selected);
	text-align: center;
	margin-top: 0.5rem;
}

/* -------------------------------------------------------------------------
   Pills (radio / multi-choice)
   ------------------------------------------------------------------------- */
.funnel-field__control--pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.funnel-field__pill {
	display: block;
	flex: 0 1 auto;
	cursor: pointer;
}

.funnel-field__pill input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.funnel-field__pill-text {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.45rem 1.05rem;
	border-radius: var(--radius-pill);
	background-color: var(--color-pill-bg);
	font-family: var(--font-inter);
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-pill-text);
	line-height: 1.2;
	transition:
		background-color var(--duration-fast) ease,
		color var(--duration-fast) ease,
		transform var(--duration-fast) ease;
	white-space: nowrap;
}

.funnel-field__pill:hover .funnel-field__pill-text,
.funnel-field__pill:focus-within .funnel-field__pill-text {
	background-color: var(--color-pill-hover);
}

.funnel-field__pill input:checked + .funnel-field__pill-text {
	background-color: var(--color-pill-selected);
	color: var(--color-pill-text-sel);
	transform: translateY(-1px);
}

.funnel-field--pills .funnel-field__pill-followup {
	margin-top: var(--space-md);
}

/* -------------------------------------------------------------------------
   Textarea
   ------------------------------------------------------------------------- */
textarea.funnel-field__control {
	width: 100%;
	min-height: 7rem;
	border-radius: var(--radius-md);
	border: none;
	background: var(--color-textarea-bg);
	padding: var(--space-sm) var(--space-md);
	font-family: var(--font-inter);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.55;
	resize: vertical;
	color: var(--color-text);
	transition: box-shadow var(--duration-fast) ease;
}

textarea.funnel-field__control::placeholder {
	color: rgba(26 29 38 / 0.45);
}

textarea.funnel-field__control:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgb(217 64 53 / 0.22);
}

/* -------------------------------------------------------------------------
   Step footer — submit + GDPR
   ------------------------------------------------------------------------- */
.funnel-step__footer {
	margin-top: var(--space-md);
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

/* GDPR consent block */
.funnel-gdpr-consent {
	font-size: 0.76rem;
	line-height: 1.55;
	color: rgba(255 255 255 / 0.8);
	padding-inline-start: 0.75rem;
	border-left: 2px solid rgba(255 255 255 / 0.35);
}

.funnel-gdpr-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
}

.funnel-gdpr-checkbox {
	appearance: none;
	-webkit-appearance: none;
	width: 1.05rem;
	height: 1.05rem;
	margin: 0.15rem 0 0;
	flex-shrink: 0;
	border-radius: var(--radius-sm);
	border: 1.5px solid rgba(255 255 255 / 0.5);
	background: transparent;
	transition:
		border-color var(--duration-fast) ease,
		background-color var(--duration-fast) ease;
}

.funnel-gdpr-checkbox:checked {
	background-color: var(--color-accent);
	border-color: var(--color-accent);
	box-shadow: inset 0 0 0 2px #fff;
}

.funnel-gdpr-checkbox:focus-visible {
	outline: 2px solid rgba(255 255 255 / 0.6);
	outline-offset: 2px;
}

.funnel-gdpr-text {
	color: rgba(255 255 255 / 0.8);
}

/* Submit button */
.funnel-step__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	min-height: 3.25rem;
	padding: var(--space-sm) var(--space-md);
	border: none;
	border-radius: var(--radius-pill);
	font-family: var(--font-inter);
	font-size: 1.05rem;
	font-weight: 900;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	color: #ffffff;
	background: var(--color-accent);
	box-shadow: 0 4px 16px rgb(217 64 53 / 0.35);
	transition:
		transform var(--duration-fast) var(--ease-out-soft),
		box-shadow var(--duration-fast) ease,
		opacity var(--duration-fast) ease;
}

.funnel-step__submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(255 255 255 / 0.4), 0 4px 16px rgb(217 64 53 / 0.35);
}

.funnel-step__submit:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgb(217 64 53 / 0.45);
}

.funnel-step__submit:active:not(:disabled) {
	transform: translateY(0);
}

.funnel-step__submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   Completion / thank-you screen
   ------------------------------------------------------------------------- */
.funnel-complete {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 60vh;
	padding: var(--space-xl) var(--space-sm);
	gap: var(--space-sm);
}

.funnel-complete__title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--font-heading-size);
	line-height: 1.25;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-heading);
	margin: 0;
}

.funnel-complete__subtitle {
	font-family: var(--font-body);
	font-weight: 700;
	font-size: clamp(0.9rem, 2.5vw, 1.1rem);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-body);
	margin: 0;
}

/* -------------------------------------------------------------------------
   Screen-reader only
   ------------------------------------------------------------------------- */
.screen-reader-text {
	clip-path: inset(50%);
	overflow: hidden;
	position: absolute;
	width: 1px;
	height: 1px;
	white-space: nowrap;
}
