/**
 * Site chrome and the remaining page components from
 * autoarty-plan/design/stitch-design-system/code.html.
 *
 * Header (TopNavBar), research panel + body-style tiles, Originals, Features,
 * The Latest feed, newsletter banner, footer. Tokens come from stitch.css;
 * nothing here introduces a colour of its own.
 */

/* ============================================================
   TOPBAR  — black tier, 4px red rule, fixed
   ============================================================ */
.aa-topbar {
	position: fixed;
	inset-inline: 0;
	top: 0;
	z-index: 500;
	background: var(--asphalt-black);
	border-bottom: 4px solid var(--race-red);
	/* Set the ink on the CONTAINER, not on each link. The nav anchors carry no
	   class, so `.stitch a:not([class])` (0,2,1) out-specifies any
	   `.aa-mainnav a` rule (0,1,1) and forces `color: inherit` — inheriting
	   body text, i.e. black on a black bar. Colouring the container makes that
	   inherit resolve correctly instead of fighting it. */
	color: var(--paper-white);
}

/* WordPress admin bar sits above everything when logged in. */
.admin-bar .aa-topbar { top: 32px; }

@media (max-width: 782px) {
	.admin-bar .aa-topbar { top: 46px; }
}

.aa-topbar__inner {
	max-width: var(--container-max);
	margin-inline: auto;
	padding: 8px var(--margin-mobile);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

@media (min-width: 768px) {
	.aa-topbar__inner { padding-inline: var(--margin-desktop); }
}

.aa-topbar__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
}

.aa-wordmark {
	font-family: var(--font-display);
	font-size: 32px;
	line-height: 1;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: var(--paper-white);
	white-space: nowrap;
	flex: 0 0 auto;
}

.aa-wordmark:hover { color: var(--race-red); }

@media (min-width: 768px) {
	.aa-wordmark { font-size: 40px; }
}

/* pill search — centered in topbar */
.aa-topsearch {
	flex: 1;
	display: none;
	position: relative;
	max-width: 600px;
	margin-inline: auto;
}

@media (min-width: 900px) {
	.aa-topsearch { display: flex; }
}

.aa-topsearch input {
	width: 100%;
	padding: 9px 48px 9px 24px;
	border: 0;
	border-radius: 9999px;
	background: var(--paper-white);
	color: var(--asphalt-black);
	font-family: var(--font-body);
	font-size: var(--body-md);
	font-style: italic;
}

.aa-topsearch input:focus {
	outline: none;
	box-shadow: 0 0 0 2px var(--race-red);
}

.aa-topsearch button {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--asphalt-black);
	cursor: pointer;
}

.aa-topsearch svg { width: 20px; height: 20px; }

.aa-topbar__actions {
	display: none;
	align-items: center;
	gap: 24px;
	margin-left: auto;
}

@media (min-width: 768px) {
	.aa-topbar__actions { display: flex; }
}

.aa-btn--sub {
	background: var(--race-red);
	color: var(--paper-white);
	font-family: var(--font-headline);
	font-size: 18px;
	line-height: 1;
	text-transform: uppercase;
	padding: 10px 24px;
	border: 0;
}

.aa-btn--sub:hover { background: var(--surface-tint); color: var(--paper-white); }

.aa-topbar__signin {
	font-family: var(--font-headline);
	font-size: 18px;
	text-transform: uppercase;
	color: var(--paper-white);
}

.aa-topbar__signin:hover { color: var(--race-red); }

/* hamburger */
.aa-topbar__toggle {
	display: block;
	margin-left: auto;
	width: 40px;
	height: 34px;
	padding: 7px 6px;
	background: none;
	border: 2px solid var(--paper-white);
	cursor: pointer;
}

.aa-topbar__toggle span {
	display: block;
	height: 2px;
	background: var(--paper-white);
	margin-bottom: 4px;
}

.aa-topbar__toggle span:last-child { margin-bottom: 0; }
.aa-topbar__toggle:hover { border-color: var(--race-red); }
.aa-topbar__toggle:hover span { background: var(--race-red); }

@media (min-width: 768px) {
	.aa-topbar__toggle { display: none; }
}

/* high-density nav row */
.aa-mainnav {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	padding-top: 8px;
}

.aa-mainnav.is-open { display: flex; flex-direction: column; align-items: flex-start; }

@media (min-width: 768px) {
	.aa-mainnav { display: flex; flex-direction: row; }
}

.aa-mainnav a {
	font-family: var(--font-util);
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--paper-white);
	padding: 4px 0;
	white-space: nowrap;
}

.aa-mainnav a:hover { color: var(--race-red); }

/* the fixed header needs the page pushed down */
.aa-topbar__spacer { height: 104px; }

@media (min-width: 768px) {
	.aa-topbar__spacer { height: 124px; }
}

/* ============================================================
   RESEARCH PANEL  — "Start Your Research"
   ============================================================ */
.aa-research__head {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-bottom: 8px;
}

.aa-research__head::before,
.aa-research__head::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--asphalt-black);
	display: none;
}

@media (min-width: 768px) {
	.aa-research__head::before,
	.aa-research__head::after { display: block; }
}

.aa-research__panel {
	background: var(--paper-white);
	border: 1px solid var(--surface-dim);
	padding: 24px;
	margin-bottom: 48px;
}

@media (min-width: 768px) {
	.aa-research__panel { padding: 32px; }
}

.aa-research__label {
	display: block;
	text-align: center;
	margin-bottom: 24px;
}

.aa-research__form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

@media (min-width: 768px) {
	.aa-research__form { grid-template-columns: 2fr 1fr auto; }
}

.aa-research__form .stitch-btn { padding: 12px 32px; }

/* body-style tiles */
.aa-tiles {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

@media (min-width: 640px) {
	.aa-tiles { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
	.aa-tiles { grid-template-columns: repeat(5, 1fr); }
}

.aa-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	height: 192px;
	padding: 16px;
	background: var(--paper-white);
	border: 1px solid var(--surface-dim);
	text-align: center;
	transition: border-color 0.15s ease-in-out;
}

.aa-tile:hover { border-color: var(--race-red); }

.aa-tile__figure {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.aa-tile__figure img {
	height: 80px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}

.aa-tile__label {
	font-family: var(--font-util);
	font-weight: 700;
	font-size: var(--label-bold);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--asphalt-black);
}

.aa-tile:hover .aa-tile__label { color: var(--race-red); }

.aa-tile__count {
	font-family: var(--font-util);
	font-size: 10px;
	text-transform: uppercase;
	color: var(--tertiary);
}

/* ============================================================
   FEATURES  — bordered 12-col article, grayscale photo
   ============================================================ */
.aa-feature {
	display: grid;
	grid-template-columns: 1fr;
	border: 2px solid var(--asphalt-black);
	background: var(--paper-white);
}

@media (min-width: 768px) {
	.aa-feature { grid-template-columns: 7fr 5fr; }
}

.aa-feature__media {
	position: relative;
	min-height: 300px;
	overflow: hidden;
	border-bottom: 2px solid var(--asphalt-black);
	background: var(--surface-variant);
}

@media (min-width: 768px) {
	.aa-feature__media {
		border-bottom: 0;
		border-right: 2px solid var(--asphalt-black);
	}
}

.aa-feature__media img,
.aa-feature__media .stitch-card__placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1);
	transition: filter 0.7s ease-in-out, transform 0.7s ease-in-out;
}

.aa-feature:hover .aa-feature__media img { filter: grayscale(0); }

.aa-feature__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 32px;
	background: var(--surface-container-low);
	transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
}

@media (min-width: 768px) {
	.aa-feature__body { padding: 48px; }
}

.aa-feature:hover .aa-feature__body { background: var(--asphalt-black); }
.aa-feature:hover .aa-feature__body h3,
.aa-feature:hover .aa-feature__body p { color: var(--paper-white); }

.aa-feature__chip {
	display: inline-block;
	width: max-content;
	background: var(--race-red);
	color: var(--paper-white);
	font-family: var(--font-util);
	font-size: var(--caption);
	text-transform: uppercase;
	padding: 4px 8px;
	margin-bottom: 24px;
}

.aa-feature__title {
	font-family: var(--font-headline);
	font-size: var(--headline-lg-mobile);
	line-height: 1;
	text-transform: none;
	color: var(--asphalt-black);
	margin-bottom: 24px;
}

@media (min-width: 768px) {
	.aa-feature__title { font-size: var(--headline-lg); }
}

.aa-feature__quote {
	font-family: var(--font-body);
	font-size: var(--body-lg);
	line-height: var(--body-lg-lh);
	border-left: 4px solid var(--race-red);
	padding-left: 16px;
	margin-bottom: 32px;
	color: var(--on-surface);
}

.aa-feature__byline {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: auto;
}

.aa-feature__avatar {
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border-radius: 9999px;
	background: var(--asphalt-black);
	display: grid;
	place-items: center;
	color: var(--paper-white);
}

.aa-feature:hover .aa-feature__avatar { background: var(--paper-white); color: var(--asphalt-black); }
.aa-feature__avatar svg { width: 20px; height: 20px; }

/* ============================================================
   THE LATEST  — underline feed cards
   ============================================================ */
.aa-feed {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--gutter);
}

.aa-feeditem {
	display: flex;
	flex-direction: column;
	background: var(--paper-white);
	border-bottom: 2px solid var(--surface-dim);
	padding-bottom: 16px;
	transition: border-color 0.15s ease-in-out;
}

.aa-feeditem:hover { border-bottom-color: var(--race-red); }

.aa-feeditem__media {
	height: 192px;
	margin-bottom: 16px;
	overflow: hidden;
	background: var(--surface-variant);
}

.aa-feeditem__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease-in-out;
}

.aa-feeditem:hover .aa-feeditem__media img { transform: scale(1.05); }

.aa-feeditem__title {
	font-family: var(--font-headline);
	font-size: 20px;
	line-height: 1.1;
	text-transform: none;
	color: var(--asphalt-black);
	margin: 4px 0 8px;
}

.aa-feeditem:hover .aa-feeditem__title { color: var(--race-red); }

.aa-feeditem__excerpt {
	font-family: var(--font-body);
	font-size: var(--body-md);
	color: var(--on-surface-variant);
}

.aa-loadmore { display: flex; justify-content: center; margin-top: 32px; }

/* ============================================================
   NEWSLETTER  — red band, black border, hard shadow
   ============================================================ */
.aa-newsletter {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	background: var(--race-red);
	border: 4px solid var(--asphalt-black);
	box-shadow: 8px 8px 0 var(--asphalt-black);
	padding: 32px;
	margin-bottom: var(--section-gap);
}

@media (min-width: 768px) {
	.aa-newsletter { flex-direction: row; padding: 48px; }
}

.aa-newsletter__copy { color: var(--paper-white); }
.aa-newsletter__copy h2 { color: var(--paper-white); margin-bottom: 8px; line-height: 1; }
.aa-newsletter__copy p { color: var(--paper-white); }

.aa-newsletter__form {
	display: flex;
	width: 100%;
	background: var(--paper-white);
	border: 2px solid var(--asphalt-black);
	padding: 4px;
}

@media (min-width: 768px) {
	.aa-newsletter__form { width: 50%; }
}

.aa-newsletter__form input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 12px 16px;
	font-family: var(--font-util);
	font-size: var(--subheading);
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--asphalt-black);
}

.aa-newsletter__form input:focus { outline: none; }
.aa-newsletter__form input::placeholder { color: var(--rim-gray); }

.aa-newsletter__form button {
	background: var(--asphalt-black);
	color: var(--paper-white);
	font-family: var(--font-headline);
	font-size: 20px;
	text-transform: uppercase;
	border: 0;
	padding: 12px 32px;
	cursor: pointer;
}

.aa-newsletter__form button:hover { background: var(--surface-tint); }

/* ============================================================
   FOOTER
   ============================================================ */
.aa-footer {
	background: var(--asphalt-black);
	color: var(--paper-white);
	border-top: 8px solid var(--race-red);
	padding-block: 80px;
}

/* Classless links inside the dark chrome inherit the container ink. */
.aa-footer a:not([class]),
.aa-topbar a:not([class]) { color: var(--paper-white); }

.aa-footer a:not([class]):hover,
.aa-topbar a:not([class]):hover { color: var(--race-red); }

.aa-footer__inner {
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--margin-mobile);
}

@media (min-width: 768px) {
	.aa-footer__inner { padding-inline: var(--margin-desktop); }
}

.aa-footer__brand {
	font-family: var(--font-headline);
	font-size: var(--headline-lg);
	line-height: 1;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: var(--race-red);
	display: block;
	margin-bottom: 48px;
}

.aa-footer__social {
	display: flex;
	justify-content: center;
	gap: 32px;
	margin-bottom: 48px;
}

.aa-footer__social a { color: var(--paper-white); }
.aa-footer__social a:hover { color: var(--race-red); }
.aa-footer__social svg { width: 24px; height: 24px; fill: currentColor; }

.aa-footer__cols {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--gutter);
	margin-bottom: 64px;
}

@media (min-width: 768px) {
	.aa-footer__cols { grid-template-columns: repeat(4, 1fr); }
}

.aa-footer__col { display: flex; flex-direction: column; gap: 16px; }

.aa-footer__col a {
	font-family: var(--font-util);
	font-weight: 700;
	font-size: var(--label-bold);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--paper-white);
}

.aa-footer__col a:hover { color: var(--race-red); }

.aa-footer__legal {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	border-top: 1px solid var(--rim-gray);
	padding-top: 32px;
}

@media (min-width: 768px) {
	.aa-footer__legal { flex-direction: row; }
}

.aa-footer__legal p,
.aa-footer__legal a {
	font-family: var(--font-util);
	font-size: var(--caption);
	text-transform: uppercase;
	color: var(--rim-gray);
	margin: 0;
}

.aa-footer__legal a:hover { color: var(--paper-white); }
.aa-footer__legal div { display: flex; gap: 24px; flex-wrap: wrap; }
