/**
 * Franchesco — services, gallery, hours, CTA band and contact form.
 * Every value comes from assets/css/design-tokens.css.
 */

/* ---------- Page hero intro ---------- */

.franchesco-page-hero__intro {
	max-width: 62ch;
	margin: 0;
	color: var(--color-neutral-100);
	font-size: var(--text-lg);
	line-height: var(--leading-normal);
}

/* ---------- Services ---------- */

.franchesco-section--services {
	background-color: var(--color-neutral-100);
}

.franchesco-service-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--space-6);
}

.franchesco-service-card {
	display: flex;
	flex-direction: column;
	background-color: var(--color-neutral-50);
	border: 1px solid var(--color-neutral-200);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	transition: transform var(--duration-normal) var(--ease-default),
		box-shadow var(--duration-normal) var(--ease-default);
}

.franchesco-service-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}

.franchesco-service-card__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.franchesco-service-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--duration-slow) var(--ease-default);
}

.franchesco-service-card:hover .franchesco-service-card__media img {
	transform: scale(1.04);
}

.franchesco-service-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	padding: var(--space-5);
}

.franchesco-service-card__title {
	margin: 0;
	font-size: var(--text-lg);
}

.franchesco-service-card__desc {
	margin: 0;
	color: var(--color-neutral-600);
	font-size: var(--text-sm);
}

.franchesco-link-cta {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding-top: var(--space-3);
	font-weight: 600;
	font-size: var(--text-sm);
	color: var(--color-primary-600);
}

.franchesco-link-cta:hover {
	color: var(--color-primary-700);
	gap: var(--space-3);
}

/* ---------- Gallery ---------- */

.franchesco-section--gallery {
	background-color: var(--color-neutral-900);
}

.franchesco-section--gallery .franchesco-section__title,
.franchesco-section--gallery .franchesco-section__intro {
	color: var(--color-neutral-50);
}

.franchesco-section--gallery .franchesco-eyebrow {
	color: var(--color-primary-300);
}

.franchesco-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-4);
}

.franchesco-gallery-item {
	position: relative;
	margin: 0;
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

.franchesco-gallery-item--wide {
	grid-column: span 2;
	grid-row: span 2;
}

.franchesco-gallery-item img {
	width: 100%;
	height: 100%;
	min-height: 200px;
	object-fit: cover;
	transition: transform var(--duration-slow) var(--ease-default);
}

.franchesco-gallery-item:hover img {
	transform: scale(1.05);
}

.franchesco-gallery-item__caption {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: var(--space-4);
	background: linear-gradient(180deg, rgba(26, 21, 18, 0) 0%, rgba(26, 21, 18, 0.85) 100%);
	color: var(--color-neutral-50);
	font-size: var(--text-sm);
	font-weight: 600;
}

/* ---------- Split (mirrored for the hours band) ---------- */

.franchesco-split--reverse {
	grid-template-columns: 4fr 6fr;
}

.franchesco-split--reverse .franchesco-split__media {
	order: -1;
}

@media (max-width: 1024px) {
	.franchesco-split--reverse {
		grid-template-columns: minmax(0, 1fr);
	}

	.franchesco-split--reverse .franchesco-split__media {
		order: 0;
	}
}

/* ---------- Opening hours ---------- */

.franchesco-section--hours {
	background-color: var(--color-neutral-50);
}

.franchesco-hours-list {
	list-style: none;
	margin: 0 0 var(--space-4);
	padding: 0;
	border-top: 1px solid var(--color-neutral-200);
}

.franchesco-hours-list__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-4);
	padding: var(--space-3) 0;
	border-bottom: 1px solid var(--color-neutral-200);
}

.franchesco-hours-list__day {
	font-weight: 600;
	color: var(--color-neutral-800);
}

.franchesco-hours-list__time {
	font-family: var(--font-heading);
	color: var(--color-primary-600);
}

.franchesco-hours-list__row.is-closed .franchesco-hours-list__day,
.franchesco-hours-list__row.is-closed .franchesco-hours-list__time {
	color: var(--color-neutral-600);
	font-family: var(--font-body);
}
/* The weekly schedule itself is rendered by template-parts/location-info.php and
   styled in assets/css/location-info.css — the old .franchesco-hours-list rules
   that used to live here had no markup left to style. */

.franchesco-hours-note {
	color: var(--color-neutral-600);
	font-size: var(--text-sm);
}

/* ---------- Closing CTA band ---------- */

.franchesco-cta-band {
	background: linear-gradient(120deg, var(--color-primary-700) 0%, var(--color-primary-500) 100%);
	padding-block: var(--space-16);
}

.franchesco-cta-band__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-8);
	flex-wrap: wrap;
}

.franchesco-cta-band__text {
	max-width: 58ch;
}

.franchesco-cta-band__title {
	margin: 0 0 var(--space-3);
	color: var(--color-neutral-50);
	font-size: var(--text-3xl);
}

.franchesco-cta-band__body {
	margin: 0;
	color: var(--color-neutral-100);
}

.franchesco-cta-band__actions {
	display: flex;
	gap: var(--space-3);
	flex-wrap: wrap;
}

.franchesco-btn--light {
	background-color: var(--color-neutral-50);
	color: var(--color-primary-700);
}

.franchesco-btn--light:hover {
	background-color: var(--color-neutral-100);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

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

.franchesco-section--form {
	background-color: var(--color-neutral-100);
}

.franchesco-form-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
	gap: var(--space-8);
	align-items: start;
}

.franchesco-form-card {
	background-color: var(--color-neutral-50);
	border: 1px solid var(--color-neutral-200);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-md);
	padding: var(--space-8);
}

.franchesco-form-card__title {
	margin: 0 0 var(--space-2);
	font-size: var(--text-2xl);
}

.franchesco-form-card__intro {
	color: var(--color-neutral-600);
}

.franchesco-form-notice {
	margin: 0 0 var(--space-5);
	padding: var(--space-3) var(--space-4);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	font-weight: 600;
}

.franchesco-form-notice--success {
	background-color: var(--color-accent-100);
	color: var(--color-accent-800);
}

.franchesco-form-notice--error {
	background-color: var(--color-primary-100);
	color: var(--color-primary-800);
}

/*
 * The neutral "we kept what you typed" note. Defined once here, next to the
 * other notice modifiers, so the checkout and the order pages render it in the
 * same grey instead of each carrying their own copy.
 */
.franchesco-form-notice--kept {
	background-color: var(--color-neutral-200);
	color: var(--color-neutral-800);
	font-weight: 500;
}

.franchesco-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-4);
}

.franchesco-form__field {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0;
	/* A grid/flex child defaults to min-width:auto — without this a long value
	   or a long error message stretches the column instead of wrapping. */
	min-width: 0;
}

.franchesco-form__field--wide,
.franchesco-form__hint,
.franchesco-form__actions {
	grid-column: 1 / -1;
}

.franchesco-form__label {
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-neutral-800);
}

/*
 * Every text control in the theme.
 *
 * font-size is never allowed below 1rem (16px): mobile Safari zooms the whole
 * page in when a focused field is smaller than that, and the visitor is then
 * left panning a zoomed layout for the rest of the form. max() keeps the token
 * if it ever grows past 16px without ever letting it fall under.
 * min-height keeps the tap target at the WCAG 2.5.8 size on a phone.
 */
.franchesco-form__input {
	width: 100%;
	min-height: 44px;
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--color-neutral-300);
	border-radius: var(--radius-md);
	background-color: var(--color-neutral-50);
	color: var(--color-neutral-900);
	font-family: var(--font-body);
	font-size: max(1rem, var(--text-base));
	transition: border-color var(--duration-fast) var(--ease-default),
		box-shadow var(--duration-fast) var(--ease-default);
}

/* Selects and textareas carrying the theme's own input class inherit the same
   floor (pick-up slots, order notes). Controls owned by another component —
   the cart's variant select and quantity stepper — declare the floor in
   assets/css/cart.css, next to the rest of their styling, so it is never
   stated twice or made to depend on stylesheet enqueue order. */
select.franchesco-form__input,
textarea.franchesco-form__input {
	font-size: max(1rem, var(--text-base));
}

.franchesco-form__input:focus {
	outline: none;
	border-color: var(--color-primary-500);
	box-shadow: var(--shadow-glow);
}

.franchesco-form__input--area {
	resize: vertical;
	min-height: 140px;
}

.franchesco-form__hint {
	margin: 0;
	color: var(--color-neutral-500);
	font-size: var(--text-xs);
}

/*
 * Localised validation messages printed by assets/js/form-validation.js.
 *
 * The message is a block inside the field it belongs to, so it always renders
 * directly under that input. It wraps rather than overflowing and nothing in
 * the chain clips it, which is what keeps it readable at 320px.
 */
.franchesco-form__error {
	display: none;
	max-width: 100%;
	color: var(--color-primary-700);
	font-size: var(--text-xs);
	font-weight: 600;
	line-height: var(--leading-normal, 1.5);
	overflow-wrap: anywhere;
}

.franchesco-form__error.is-visible {
	display: block;
}

.franchesco-form__input.is-invalid {
	border-color: var(--color-primary-600);
}

.franchesco-form__input.is-invalid:focus {
	box-shadow: none;
	outline: 2px solid var(--color-primary-600);
	outline-offset: 2px;
}

.franchesco-form__actions {
	margin: var(--space-2) 0 0;
}

.franchesco-form-aside {
	background-color: var(--color-neutral-50);
	border: 1px solid var(--color-neutral-200);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-sm);
	padding: var(--space-6);
}

.franchesco-form-aside__value {
	color: var(--color-neutral-600);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.franchesco-service-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.franchesco-form-layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 768px) {
	.franchesco-gallery-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.franchesco-service-grid,
	.franchesco-form {
		grid-template-columns: minmax(0, 1fr);
	}

	.franchesco-gallery-item--wide {
		grid-column: span 2;
		grid-row: span 1;
	}

	.franchesco-cta-band__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	/* ---- Forms on a phone ----
	   One column, full-width controls, thumb-sized targets. Two templates opt
	   into these classes today: the checkout contact details
	   (template-parts/content-contact-details.php) and the pick-up order form
	   (template-parts/content-order-form.php). The generic .franchesco-form
	   card styling above is kept for a contact form that the theme does not
	   currently render — template-parts/content-contact.php prints the address
	   block only, no <form>. */

	.franchesco-form__field,
	.franchesco-form__field--wide {
		grid-column: 1 / -1;
	}

	.franchesco-form__input,
	select.franchesco-form__input,
	textarea.franchesco-form__input {
		width: 100%;
		min-height: 48px;
	}

	/* When client-side validation moves focus to the offending field, leave
	   room under it so the sticky action bar cannot cover it. */
	.franchesco-form__field {
		scroll-margin-block-end: 6rem;
	}

	.franchesco-form__actions {
		display: flex;
	}

	.franchesco-form__actions .franchesco-btn {
		width: 100%;
		min-height: 48px;
	}

	/*
	 * The primary action of a long form follows the visitor down the page
	 * instead of waiting at the bottom of it. It is sticky inside the form, so
	 * it pins to the bottom of the viewport while there is still form below
	 * and settles into place at the end — it never floats over other sections.
	 */
	.franchesco-form__actions--sticky {
		position: sticky;
		bottom: 0;
		z-index: 5;
		margin: var(--space-6) 0 0;
		padding-block: var(--space-3);
		padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
		background-color: var(--color-neutral-50);
		border-top: 1px solid var(--color-neutral-200);
	}
}

@media (max-width: 480px) {
	.franchesco-gallery-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.franchesco-gallery-item--wide {
		grid-column: span 1;
	}

	.franchesco-form-card {
		padding: var(--space-5);
	}
}

@media (prefers-reduced-motion: reduce) {
	.franchesco-service-card,
	.franchesco-service-card__media img,
	.franchesco-gallery-item img,
	.franchesco-btn--light {
		transition: none;
	}

	.franchesco-service-card:hover,
	.franchesco-btn--light:hover {
		transform: none;
	}

	.franchesco-service-card:hover .franchesco-service-card__media img,
	.franchesco-gallery-item:hover img {
		transform: none;
	}
}

/* Honeypot: off-screen for visitors, still reachable for bots. */
.franchesco-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Language selection form (no-JS fallback for the header switcher). */
.franchesco-lang-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin-top: var(--space-3);
}

.franchesco-lang-form__label {
	flex: 1 1 100%;
	font-size: var(--text-sm);
	color: var(--color-neutral-300, inherit);
}

.franchesco-lang-form__select {
	flex: 1 1 auto;
	min-width: 9rem;
	padding: var(--space-2) var(--space-3);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	color: inherit;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: var(--radius-sm);
}

.franchesco-lang-form__submit {
	padding: var(--space-2) var(--space-4);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	color: inherit;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background-color var(--duration-normal) var(--ease-default), color var(--duration-normal) var(--ease-default);
}

.franchesco-lang-form__submit:hover,
.franchesco-lang-form__submit:focus-visible {
	background: currentColor;
	color: var(--color-neutral-900, #1a1a1a);
}

@media (prefers-reduced-motion: reduce) {
	.franchesco-lang-form__submit {
		transition: none;
	}
}
