/*
 * Design System - AELITA
 * components/dealer-detail.css - the .a-dealer dealer detail page
 * (single autosalon, contacts-page.php).
 *
 * Source of truth: docs/aelita-design/DESIGN.md
 * Consumes tokens.css / layout.css only: no hex values, no decorative
 * shadows, no gradients, no glass, no `transition: all`. Sharp corners
 * (--radius: 0), a single red accent (the primary Call button and the
 * eyebrow dash). Only transform / colour properties are animated, and only
 * under (hover: hover) and (pointer: fine).
 *
 * Loaded on dealer detail pages only (see inc/enqueue.php).
 */

/* -------------------------------------------------------------------- */
/* Page shell                                                           */
/* -------------------------------------------------------------------- */
.a-dealer {
	padding-block: 0 var(--space-8);
}

/* -------------------------------------------------------------------- */
/* Breadcrumbs (scoped styling of the existing breadcrumbs() output)    */
/* -------------------------------------------------------------------- */
.a-dealer__breadcrumbs {
	padding-block: var(--space-5);
	font-size: var(--fs-small);
	line-height: 1.5;
	color: var(--text-secondary);
	overflow-wrap: anywhere;
}

.a-dealer__breadcrumbs a,
.a-dealer__breadcrumbs .breadcrumbs-link {
	color: var(--text-secondary);
	text-decoration: none;
}

/* -------------------------------------------------------------------- */
/* Identity: logo + eyebrow + H1 + address                              */
/* -------------------------------------------------------------------- */
.a-dealer__identity {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-5);
	padding-block: var(--space-4) var(--space-6);
	border-bottom: var(--border-w) solid var(--border);
}

.a-dealer__logo {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 104px;
	height: 64px;
}

.a-dealer__logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: left center;
}

.a-dealer__monogram {
	font-family: var(--font-display-strong);
	font-size: 34px;
	line-height: 1;
	color: var(--c-ink-300);
}

.a-dealer__intro {
	min-width: 0;
}

.a-dealer__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	margin: 0 0 var(--space-3);
	font-size: var(--fs-caption);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-secondary);
}

.a-dealer__accent {
	width: 28px;
	height: 2px;
	background-color: var(--c-red-600);
}

.a-dealer__title {
	margin: 0;
	font-family: var(--font-display-strong);
	font-size: var(--fs-display);
	font-weight: var(--fw-bold);
	line-height: var(--lh-display);
	letter-spacing: -0.01em;
	color: var(--text-primary);
	text-transform: none;
	overflow-wrap: anywhere;
}

.a-dealer__address {
	margin: var(--space-4) 0 0;
	font-style: normal;
	font-size: var(--fs-body);
	line-height: 1.5;
	color: var(--text-primary);
}

.a-dealer__address-line {
	display: block;
	overflow-wrap: anywhere;
}

/* -------------------------------------------------------------------- */
/* Primary actions: Call (primary) / Route (secondary) / Catalogue      */
/* -------------------------------------------------------------------- */
.a-dealer__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	padding-block: var(--space-6);
}

.a-dealer__actions .a-button {
	width: 100%;
}

.a-dealer__action--catalogue {
	justify-content: flex-start;
}

.a-dealer__action svg {
	width: 18px;
	height: 18px;
	transition: transform var(--dur-press) var(--ease-out);
}

/* -------------------------------------------------------------------- */
/* Optional dealership photo (supporting visual only)                   */
/* -------------------------------------------------------------------- */
.a-dealer__media {
	margin: 0 0 var(--space-7);
}

.a-dealer__media img {
	display: block;
	width: 100%;
	height: auto;
	background-color: var(--bg-muted);
}

/* -------------------------------------------------------------------- */
/* Sales / Service                                                      */
/* -------------------------------------------------------------------- */
.a-dealer__contacts {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-4);
}

.a-dealer__group {
	border: var(--border-w) solid var(--border);
	padding: var(--space-5);
}

.a-dealer__group-title {
	margin: 0 0 var(--space-4);
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-heading);
	color: var(--text-primary);
}

.a-dealer__phones {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.a-dealer__phone {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: var(--fs-h4);
	font-weight: var(--fw-bold);
	color: var(--text-primary);
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: color var(--dur-press) var(--ease-out);
}

.a-dealer__group-address {
	margin: var(--space-4) 0 0;
	font-style: normal;
	font-size: var(--fs-small);
	line-height: 1.5;
	color: var(--text-secondary);
	overflow-wrap: anywhere;
}

.a-dealer__hours {
	margin-top: var(--space-5);
}

.a-dealer__hours-label {
	display: block;
	margin-bottom: var(--space-2);
	font-size: var(--fs-caption);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-secondary);
}

.a-dealer__hours-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	font-size: var(--fs-small);
	line-height: 1.5;
	color: var(--text-primary);
}

.a-dealer__hours-list li {
	overflow-wrap: anywhere;
}

/* -------------------------------------------------------------------- */
/* Location: address + route + map                                      */
/* -------------------------------------------------------------------- */
.a-dealer__location {
	margin-top: var(--space-8);
}

.a-dealer__section-title {
	margin: 0 0 var(--space-5);
	font-family: var(--font-display);
	font-size: var(--fs-h2);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-heading);
	color: var(--text-primary);
}

.a-dealer__location-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-5);
	align-items: start;
}

.a-dealer__location-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-4);
}

.a-dealer__location-info .a-dealer__address {
	margin-top: 0;
}

.a-dealer__route svg {
	width: 18px;
	height: 18px;
}

.a-dealer__map {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	min-height: 300px;
	aspect-ratio: 16 / 10;
	border: var(--border-w) solid var(--border);
	background-color: var(--bg-muted);
}

.a-dealer__map iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 100%;
	border: 0;
}

/* -------------------------------------------------------------------- */
/* Desktop                                                              */
/* -------------------------------------------------------------------- */
@media (min-width: 480px) {
	.a-dealer__actions .a-button {
		width: auto;
	}
}

@media (min-width: 768px) {
	.a-dealer__identity {
		grid-template-columns: auto minmax(0, 1fr);
		align-items: start;
		gap: var(--space-6);
	}

	.a-dealer__logo {
		width: 120px;
		height: 72px;
	}

	.a-dealer__contacts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.a-dealer__contacts--single {
		grid-template-columns: minmax(0, 1fr);
	}

	.a-dealer__map {
		aspect-ratio: 16 / 9;
	}
}

@media (min-width: 992px) {
	.a-dealer__location-grid {
		grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
		gap: var(--space-6);
	}
}

/* -------------------------------------------------------------------- */
/* States                                                               */
/* -------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
	.a-dealer__breadcrumbs a:hover,
	.a-dealer__breadcrumbs .breadcrumbs-link:hover {
		color: var(--link-hover);
	}

	.a-dealer__phone:hover {
		color: var(--c-red-600);
	}

	.a-dealer__action--catalogue:hover svg {
		transform: translateX(3px);
	}
}

/* The legacy theme ships `*:focus { outline: none !important; }`. A scoped
 * important outline restores a visible keyboard focus ring on this page
 * only (same approach as the contacts directory). */
#main-content :focus-visible {
	outline: 2px solid var(--focus-ring) !important;
	outline-offset: 2px;
}

/* The map iframe is a focusable cross-origin embed; the iframe element itself
 * never matches :focus in Chromium, so the wrapper reacts with :focus-within
 * to keep the keyboard position visible. */
#main-content .a-dealer__map:focus-within {
	outline: 2px solid var(--focus-ring) !important;
	outline-offset: 2px;
}

/* -------------------------------------------------------------------- */
/* Reduced motion                                                       */
/* -------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.a-dealer__phone,
	.a-dealer__action svg {
		transition-duration: 0.01ms;
	}

	.a-dealer__action--catalogue:hover svg {
		transform: none;
	}
}
