/**
 * ZAI COFFEE — Footer
 * -----------------------------------------------------------------------------
 * Four responsive columns on an Anthracite surface with Lületaşı text.
 *
 * All values resolve through tokens from 01-tokens.css. Contrast on the dark
 * surface is verified: --zai-text-inverse is 13.0:1 and
 * --zai-text-inverse-muted is 7.74:1 against #222222, so both pass AAA/AA.
 *
 * @package zaicoffeetheme
 * @since   1.0.0
 */

/* ==========================================================================
   1. Shell
   ========================================================================== */

.zai-footer {
	margin-block-start: var(--zai-space-9);
	padding-block: var(--zai-space-9) var(--zai-space-6);
	background-color: var(--zai-bg-inverse);
	color: var(--zai-text-inverse);
}

/* ==========================================================================
   2. Column grid
   ========================================================================== */

.zai-footer__grid {
	display: grid;
	gap: var(--zai-space-8) var(--zai-space-6);
	grid-template-columns: minmax(0, 1fr);
}

/*
 * 2 columns on small tablets, then the four-column editorial layout. The brand
 * column is deliberately slightly wider than the link columns so the
 * description does not wrap too tightly.
 */
@media (min-width: 640px) {
	.zai-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.zai-footer__grid {
		grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
		gap: var(--zai-space-6);
	}
}

.zai-footer__col {
	min-width: 0;
}

/* ==========================================================================
   3. Brand column
   ========================================================================== */

.zai-footer__col--brand {
	display: flex;
	flex-direction: column;
	gap: var(--zai-space-4);
}

.zai-footer__description {
	max-width: 32ch;
	margin: 0;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	line-height: var(--zai-lh-relaxed);
	color: var(--zai-text-inverse-muted);
}

.zai-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: var(--zai-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.zai-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--zai-touch-target);
	height: var(--zai-touch-target);
	color: var(--zai-text-inverse-muted);
	border: var(--zai-border-width) solid var(--zai-border-color-inverse);
	border-radius: var(--zai-radius);
	transition:
		color var(--zai-dur-fast) var(--zai-ease),
		border-color var(--zai-dur-fast) var(--zai-ease);
}

.zai-footer__social a:hover {
	color: var(--zai-text-inverse);
	border-color: var(--zai-text-inverse);
}

.zai-footer__social a:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-text-inverse);
	outline-offset: var(--zai-focus-offset);
}

/* ==========================================================================
   4. Menu columns
   ========================================================================== */

.zai-footer__heading {
	margin: 0 0 var(--zai-space-4);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-eyebrow);
	font-weight: var(--zai-fw-semibold);
	line-height: var(--zai-lh-normal);
	letter-spacing: var(--zai-ls-caps);
	text-transform: uppercase;
	color: var(--zai-text-inverse);
}

.zai-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.zai-footer__list li {
	margin: 0;
}

.zai-footer__list a {
	display: inline-flex;
	align-items: center;
	min-height: var(--zai-touch-target);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	line-height: var(--zai-lh-normal);
	color: var(--zai-text-inverse-muted);
	text-decoration: none;
	transition: color var(--zai-dur-fast) var(--zai-ease);
}

.zai-footer__list a:hover {
	color: var(--zai-text-inverse);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.zai-footer__list a:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-text-inverse);
	outline-offset: var(--zai-focus-offset);
}

/* ==========================================================================
   5. Contact column
   ========================================================================== */

/*
 * ONE FOOTER CONTACT LAYOUT, INDEPENDENT OF THE PAGE STYLESHEET.
 *
 * WHY THE PHONE SLID BESIDE THE ADDRESS
 *
 * The footer reuses the shared `<address class="zai-contact">` block. The
 * İletişim page stylesheet (17-content.css) also used the bare `.zai-contact`
 * class for its two-column page composition, and it loads AFTER this file, so
 * on every content page it replaced this column's vertical flow with
 * `display: grid; grid-template-columns: 6fr 6fr`. The address landed in the
 * first column and the phone in the second — beside it instead of beneath it.
 * The homepage never loads 17-content.css, which is why only the homepage
 * looked correct.
 *
 * The page composition is now scoped to `.zai-pc-content` (see 17-content.css),
 * so it can no longer reach the global footer or the mobile drawer. Every rule
 * below is additionally scoped to `.zai-footer__col--contact` and re-states the
 * layout foundation (`display`, `gap`, `width`, `white-space`), so this column
 * renders identically no matter which page stylesheet happens to load.
 *
 * THE SYSTEM
 *
 * The column is a vertical flex stack of exactly three rows — address, phone,
 * email — and can never flow horizontally. Each row is a two-column grid: a
 * fixed 20px icon cell and a fluid `minmax(0, 1fr)` text cell. Because the icon
 * cell and the column gap are shared, the text of all three rows starts at
 * exactly the same x. Vertical alignment is expressed per row TYPE, which is
 * the only way one rule satisfies both cases:
 *
 *   - `.zai-contact__address` keeps `align-items: start` and the glyph is
 *     centred inside a box exactly one line box tall, so the pin centres on the
 *     FIRST line and a wrapped address never drags it to the middle of the
 *     paragraph;
 *   - `.zai-contact__line` uses `align-items: center`, so the phone and mail
 *     glyphs centre against their single line of text.
 *
 * The SVG itself is untouched: same 18px size, stroke and inherited colour.
 */

.zai-footer .zai-footer__col--contact .zai-contact {
	/* One icon column width, shared by all three rows (20px). */
	--zai-contact-icon-column: 1.25rem;

	/* Vertical stack, full column width, never wrapping into a second column. */
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: flex-start;
	gap: var(--zai-space-3);
	width: 100%;
	min-width: 0;
	/* Reset, so even a stray grid declaration cannot create side-by-side columns. */
	grid-template-columns: none;
}

.zai-footer .zai-footer__col--contact .zai-contact__address,
.zai-footer .zai-footer__col--contact .zai-contact__line {
	display: grid;
	grid-template-columns: var(--zai-contact-icon-column) minmax(0, 1fr);
	column-gap: var(--zai-space-3);
	row-gap: 0;
	width: 100%;
	min-width: 0;
	margin: 0;
}

/* Multi-line address: align the icon with the FIRST line of text. */
.zai-footer .zai-footer__col--contact .zai-contact__address {
	align-items: start;
}

/* Single-line phone and email: centre the icon with its one line of text. */
.zai-footer .zai-footer__col--contact .zai-contact__line {
	align-items: center;
}

/*
 * The text cell owns its width and can shrink below its content size, so a row
 * can never overflow the contact column. The address span may wrap, and the
 * links stretch to the full cell width so the touch target stays generous.
 */
.zai-footer .zai-footer__col--contact .zai-contact__address > span,
.zai-footer .zai-footer__col--contact .zai-contact__line > .zai-contact__link {
	min-width: 0;
}

/*
 * `0531 326 75 67` and `info@zaicoffee.co` must each stay on one line. Both are
 * short enough for the fluid text cell at every breakpoint, and `minmax(0, 1fr)`
 * above means a long line can never widen the column.
 */
.zai-footer .zai-footer__col--contact .zai-contact__line .zai-contact__link {
	white-space: nowrap;
}

/*
 * The icon box is made exactly one text line tall, so centring the glyph inside
 * it centres it on the first line instead of the whole paragraph. `1em` here is
 * the row's own font-size (--zai-fs-sm), which is the same measure the text uses.
 *
 * The SVG keeps its 18px width, so the default `xMidYMid meet` scaling renders
 * the glyph at its original 18px size, centred in that taller box — the icon is
 * not stretched and its stroke is unchanged.
 */
.zai-footer .zai-footer__col--contact .zai-contact .zai-icon {
	height: calc(1em * var(--zai-lh-relaxed));
	margin-block-start: 0;
	justify-self: center;
}

/* ==========================================================================
   6. Shared contact block (used by the footer and the mobile drawer)
   ========================================================================== */

.zai-contact {
	display: flex;
	flex-direction: column;
	gap: var(--zai-space-3);
	margin: 0;
	font-style: normal;
}

.zai-contact__address,
.zai-contact__line {
	display: flex;
	align-items: flex-start;
	gap: var(--zai-space-3);
	margin: 0;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	line-height: var(--zai-lh-relaxed);
	color: var(--zai-text-muted);
}

.zai-contact .zai-icon {
	flex-shrink: 0;
	margin-block-start: 0.3em;
	color: var(--zai-green);
}

.zai-contact__link {
	display: inline-flex;
	align-items: center;
	min-height: 1.5rem;
	color: var(--zai-green);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

.zai-contact__link:hover {
	color: var(--zai-green-hover);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* --- Inverse variant: footer and dark surfaces ---------------------------- */

.zai-contact--inverse .zai-contact__address,
.zai-contact--inverse .zai-contact__line {
	color: var(--zai-text-inverse-muted);
}

.zai-contact--inverse .zai-icon {
	color: var(--zai-text-inverse-muted);
}

.zai-contact--inverse .zai-contact__link {
	min-height: var(--zai-touch-target);
	color: var(--zai-text-inverse);
}

.zai-contact--inverse .zai-contact__link:hover {
	color: var(--zai-text-inverse-muted);
}

.zai-contact--inverse .zai-contact__link:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-text-inverse);
	outline-offset: var(--zai-focus-offset);
}

/* ==========================================================================
   7. Bottom bar
   ========================================================================== */

.zai-footer__bottom {
	display: flex;
	flex-direction: column;
	gap: var(--zai-space-4);
	margin-block-start: var(--zai-space-8);
	padding-block-start: var(--zai-space-5);
	border-block-start: var(--zai-border-width) solid var(--zai-border-color-inverse);
}

/* On wider screens the legal links sit left and the copyright right. */
@media (min-width: 768px) {
	.zai-footer__bottom {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: var(--zai-space-6);
	}
}

.zai-footer__legal-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--zai-space-1) var(--zai-space-5);
	margin: 0;
	padding: 0;
	list-style: none;
}

.zai-footer__legal-list li {
	margin: 0;
}

.zai-footer__legal-list a {
	display: inline-flex;
	align-items: center;
	min-height: var(--zai-touch-target);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-xs);
	line-height: var(--zai-lh-normal);
	color: var(--zai-text-inverse-muted);
	text-decoration: none;
	transition: color var(--zai-dur-fast) var(--zai-ease);
}

.zai-footer__legal-list a:hover {
	color: var(--zai-text-inverse);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.zai-footer__legal-list a:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-text-inverse);
	outline-offset: var(--zai-focus-offset);
}

.zai-footer__copyright {
	margin: 0;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-xs);
	line-height: var(--zai-lh-normal);
	letter-spacing: var(--zai-ls-wide);
	color: var(--zai-text-inverse-muted);
}

/* ==========================================================================
   8. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.zai-footer__social a,
	.zai-footer__list a,
	.zai-footer__legal-list a {
		transition: none;
	}
}

