/**
 * Site footer — the four-column band rendered by footer.php, including the
 * opening-hours column (template-parts/business-hours.php).
 *
 * Enqueued by franchesco_scripts() in functions.php as 'franchesco-footer',
 * depending on 'franchesco-main'; main.css already paints the dark band and
 * its padding on `body > footer`, so this sheet only lays the columns out.
 * Colours come from assets/css/design-tokens.css.
 */

.franchesco-footer__inner {
	display: grid;
	gap: var(--space-8, 2rem);
	grid-template-columns: 1.3fr 1fr 1.1fr 0.8fr;
	align-items: start;
}

.franchesco-footer__title,
.franchesco-footer__brand {
	margin: 0 0 var(--space-3, 0.75rem);
	color: var(--color-on-dark, #fafaf9);
	font-family: var(--font-heading, Georgia, serif);
	font-size: var(--text-lg, 1.1rem);
	letter-spacing: var(--letter-tight, -0.01em);
}

.franchesco-footer__brand {
	font-size: var(--text-xl, 1.35rem);
}

.franchesco-footer__tagline {
	margin: 0 0 var(--space-4, 1rem);
	max-width: 34ch;
	line-height: 1.7;
}

.franchesco-footer__address {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	margin: 0 0 var(--space-3, 0.75rem);
	font-style: normal;
}

.franchesco-footer__list,
.franchesco-footer .franchesco-footer__col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-2, 0.5rem);
}

.franchesco-footer__col a {
	color: inherit;
	text-decoration: none;
	transition: color var(--duration-normal, 200ms) var(--ease-default, ease);
}

.franchesco-footer__col a:hover,
.franchesco-footer__col a:focus-visible {
	color: var(--color-accent-500, #d8a13a);
	text-decoration: underline;
}

.franchesco-footer a:focus-visible {
	outline: 2px solid var(--color-accent-500, #d8a13a);
	outline-offset: 3px;
}

.franchesco-footer__widgets {
	margin-top: var(--space-8, 2rem);
	display: grid;
	gap: var(--space-6, 1.5rem);
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.franchesco-footer__legal {
	margin-top: var(--space-8, 2rem);
	padding-top: var(--space-4, 1rem);
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	font-size: var(--text-xs, 0.8rem);
}

.franchesco-footer__legal p {
	margin: 0;
}

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

@media (max-width: 480px) {
	.franchesco-footer__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-6, 1.5rem);
	}
}

/**
 * Footer + header contact row — mobile-first refinements (US-005).
 *
 * Loaded on every view, after main.css, which it refines rather than
 * duplicates: main.css declares the footer grid at 4 columns (2 at 1024px),
 * this sheet collapses it to ONE column below 768px and turns every contact
 * detail into a 44x44 touch target.
 *
 * Shared breakpoints only — 1024px / 768px / 480px (see style.css).
 */

/* ---------- Header tap-to-call ---------- */

.franchesco-header__call {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	/* 44x44 minimum touch target (WCAG 2.5.5), icon-only or not. */
	min-width: 44px;
	min-height: 44px;
	padding: 0 var(--space-3);
	border: 1px solid var(--color-neutral-200);
	border-radius: var(--radius-md);
	color: var(--color-neutral-800);
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--duration-fast) var(--ease-default),
		border-color var(--duration-fast) var(--ease-default),
		color var(--duration-fast) var(--ease-default);
}

.franchesco-header__call:hover {
	background-color: var(--color-primary-500);
	border-color: var(--color-primary-500);
	color: var(--color-neutral-50);
}

.franchesco-header__call:focus-visible {
	outline: 2px solid var(--color-primary-600);
	outline-offset: 2px;
}

.franchesco-header__call-icon {
	flex: 0 0 auto;
}

/* ---------- Footer contact details ---------- */

/* Each detail is a stacked label + value block, so a long address wraps under
   its own label instead of pushing the column (and the page) wider. */
.franchesco-footer__contact {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	min-height: 44px;
	padding-block: var(--space-1);
	color: var(--color-neutral-200);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.franchesco-footer__contact-label {
	font-size: var(--text-xs);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
	color: var(--color-neutral-400);
}

.franchesco-footer__contact-value {
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
	color: var(--color-neutral-100);
}

a.franchesco-footer__contact:hover .franchesco-footer__contact-value,
a.franchesco-footer__contact:focus-visible .franchesco-footer__contact-value {
	color: var(--color-primary-200);
	text-decoration: underline;
}

a.franchesco-footer__contact:focus-visible {
	outline: 2px solid var(--color-primary-200);
	outline-offset: 3px;
	border-radius: var(--radius-sm);
}

/* ---------- Social icons ---------- */

.franchesco-social {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	list-style: none;
	margin: 0;
	padding: 0;
}

.franchesco-social__item {
	display: flex;
}

.franchesco-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* 44x44 even though the glyph is 22px — the padding is the target. */
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	border: 1px solid rgba(251, 249, 247, 0.22);
	border-radius: var(--radius-full);
	color: var(--color-neutral-200);
	transition: background-color var(--duration-fast) var(--ease-default),
		border-color var(--duration-fast) var(--ease-default),
		color var(--duration-fast) var(--ease-default);
}

.franchesco-social__link:hover {
	background-color: var(--color-primary-500);
	border-color: var(--color-primary-500);
	color: var(--color-neutral-50);
}

.franchesco-social__link:focus-visible {
	outline: 2px solid var(--color-primary-200);
	outline-offset: 3px;
}

.franchesco-social__icon {
	display: block;
	flex: 0 0 auto;
}

/* ---------- No-JS language form ----------
   Base styling lives in pages.css; the footer copy of the control only needs
   the 44px touch floor. style.css gives every <button> that floor site-wide,
   but a <select> is not covered there. */

.franchesco-footer .franchesco-lang-form__select,
.franchesco-footer .franchesco-lang-form__submit {
	min-height: 44px;
}

/* ---------- Room for the menu page's fixed order tray ----------
   The menu listing pins an order tray to the bottom of the viewport while it
   holds items (.menu-tray, position: fixed — assets/css/menu-page.css). At the
   very bottom of the page that tray sits on top of the footer's copyright bar,
   which is the one place on a phone where two elements genuinely overlap. The
   tray only exists while assets/js/menu-order.js has marked the page open, so
   the reservation is scoped to that state and costs nothing anywhere else.

   How much room is needed is not a constant: below 480px menu-page.css lays
   .menu-tray__inner out as a COLUMN, and the "Call to order …" label wraps, so
   the tray grows well past the 4.5rem the row layout needs. Rather than guess,
   assets/js/menu-order.js measures the tray and writes its real height to
   --menu-tray-height on <body>; the literals below are only the fallback for
   the moment before the first measurement (and they are generous enough at
   each breakpoint to clear the bar on their own).

   :has() carries the scope because the footer is a sibling of <main>, not a
   descendant of the menu page. A browser without :has() simply ignores this
   block and keeps the previous (overlapping) behaviour — no layout depends on
   it being applied. */
body:has(.menu-page--tray-open) .franchesco-footer__bar {
	padding-bottom: calc(var(--space-5) + var(--menu-tray-height, 4.5rem));
}

/* Embedded maps are handled once, in style.css (the responsive foundation
   sheet, enqueued last): a single selector list there forces every map embed
   to width: 100% so it can never scroll the page sideways. Do not restate
   those rules here — two copies drift apart. */

/* ---------- Tablet (max-width: 1024px) ---------- */

@media (max-width: 1024px) {
	/* main.css already drops the grid to two columns here; the brand column
	   spans both so the three detail columns pair up evenly underneath. */
	.franchesco-footer__col--brand {
		grid-column: 1 / -1;
	}
}

/* ---------- Large phone (max-width: 768px) ----------
   AC: every footer column stacks vertically below 768px. */

@media (max-width: 768px) {
	.franchesco-footer__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-8);
	}

	.franchesco-footer__col--brand {
		grid-column: auto;
	}

	.franchesco-footer {
		padding-top: var(--space-12);
	}

	/* Full-width rows: the whole line is tappable, not just the digits. */
	.franchesco-footer__contact {
		width: 100%;
		min-height: 48px;
	}

	.franchesco-footer__contact-value {
		font-size: var(--text-base);
	}

	/* The 44px touch floor is on the LINK, never on the <li>: the hours column
	   (.franchesco-footer__list--plain) is plain text and is deliberately
	   exempt. Keep any future floor scoped the same way. */
	.franchesco-footer .franchesco-nav__list a,
	.franchesco-footer__list a {
		display: flex;
		align-items: center;
		min-height: 44px;
	}

	.franchesco-footer .franchesco-nav__list {
		gap: 0;
	}

	.franchesco-social {
		gap: var(--space-4);
	}

	/* Icon-only call button on phones: the number is already in the footer,
	   and the header row has to fit brand + call + cart + hamburger at 320px. */
	.franchesco-header__call-text {
		display: none;
	}

	.franchesco-header__call {
		padding: 0;
	}

	/* The actions row now carries call + language + cart. main.css wraps the
	   header itself, but not this inner row: without wrapping here the three
	   controls push past the right edge at 320px. */
	.franchesco-header__actions {
		flex-wrap: wrap;
		justify-content: flex-end;
		row-gap: var(--space-2);
	}
}

/* ---------- Phone (max-width: 480px) ---------- */

@media (max-width: 480px) {
	.franchesco-footer__grid {
		gap: var(--space-6);
	}

	.franchesco-footer__bar {
		text-align: center;
	}

	/* At 320px the strapline is what pushes the brand block into the
	   hamburger; the brand name alone identifies the site well enough. */
	.franchesco-brand__tag {
		display: none;
	}

	/* Stacked tray fallback: summary on its own line above the actions row,
	   plus the wrapped call label — roughly twice the row-layout height. See
	   the note above; --menu-tray-height replaces this once JS has measured. */
	body:has(.menu-page--tray-open) .franchesco-footer__bar {
		padding-bottom: calc(var(--space-5) + var(--menu-tray-height, 9.5rem));
	}
}

@media (prefers-reduced-motion: reduce) {
	.franchesco-header__call,
	.franchesco-social__link,
	.franchesco-footer__contact {
		transition: none;
	}
}
