/* Carson Daly Racing - site chrome.
 *
 * The header, navigation, footer and page shell. Component styling lives in the
 * CDR Core plugin; this is everything that wraps it.
 */

/* ---------- reset and page shell ---------- */

body.cdr-site {
	margin: 0;
	background: var(--cdr-black);
	color: var(--cdr-off-white);
	font-family: var(--cdr-font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

.cdr-site img { max-width: 100%; height: auto; }

.cdr-site a { color: var(--cdr-yellow); }

.cdr-site :focus-visible {
	outline: 2px solid var(--cdr-yellow);
	outline-offset: 3px;
}

.cdr-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 12px 18px;
	background: var(--cdr-yellow);
	color: var(--cdr-ink);
	font-weight: 600;
}

.cdr-skip:focus { left: 0; }

.cdr-main { display: block; }

.cdr-section {
	padding-block: var(--cdr-section-y);
}

.cdr-section--tight { padding-block: clamp(28px, 4vw, 52px); }
.cdr-section--flush-top { padding-top: 0; }

.cdr-shell {
	max-width: var(--cdr-container);
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 32px);
}

/* ---------- header ---------- */

.cdr-header {
	position: relative;
	z-index: 20;
	/* --cdr-header-alpha comes from the Customizer, 1 by default, which is the
	   original solid black bar. */
	background: rgba(10, 10, 11, var(--cdr-header-alpha, 1));
	border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.cdr-header--sticky {
	position: sticky;
	top: 0;
}

/* Sitting over the hero: the header keeps its height but takes no space of its
   own, so the hero starts at the top of the page. */
.cdr-header--over {
	position: absolute;
	inset: 0 0 auto;
	background: transparent;
	border-bottom-color: transparent;
}

.cdr-header--over + .cdr-countdown {
	padding-top: 84px;
}

.cdr-header--sticky.cdr-header--over {
	position: fixed;
}

/* Button colours have to be two classes deep.
 *
 * `.cdr-site a` sets every link to the brand yellow, and that outranks a
 * single-class button rule - which left the solid header button yellow on
 * yellow, and invisible. These restate the button's own colours with enough
 * specificity to win, for buttons anywhere on the site. */
.cdr-site .cdr-btn {
	color: var(--cdr-off-white);
}

.cdr-site .cdr-btn span {
	color: var(--cdr-yellow);
}

.cdr-site .cdr-btn--solid,
.cdr-site .cdr-btn--solid span {
	color: var(--cdr-ink);
}

.cdr-site .cdr-btn:hover,
.cdr-site .cdr-btn:focus-visible,
.cdr-site .cdr-btn:hover span,
.cdr-site .cdr-btn:focus-visible span {
	color: var(--cdr-ink);
}

.cdr-header__cta {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Social icons repeated inside the open mobile menu. Hidden until the menu
   stacks, which the inline breakpoint stylesheet controls. */
.cdr-nav__social {
	display: none;
	padding-top: 14px;
	margin-top: 4px;
	border-top: 1px solid var(--cdr-rule);
	width: 100%;
}

.cdr-nav.is-open .cdr-nav__social { display: block; }

.cdr-header__inner {
	max-width: var(--cdr-container);
	margin-inline: auto;
	padding: 14px clamp(16px, 4vw, 32px);
	display: flex;
	align-items: center;
	gap: clamp(16px, 3vw, 40px);
}

.cdr-header__brand { flex: 0 1 auto; }

.cdr-brand {
	display: flex;
	align-items: center;
	gap: 11px;
	text-decoration: none;
}

.cdr-brand__mark {
	display: inline-flex;
	align-items: center;
	color: var(--cdr-yellow);
	width: 42px;
	flex: 0 0 auto;
}

.cdr-brand__mark svg,
.cdr-brand__mark img {
	display: block;
	width: 100%;
	height: auto;
}

.cdr-brand__text { display: flex; flex-direction: column; line-height: 1; }

.cdr-brand__name {
	font-family: var(--cdr-font-display);
	font-style: italic;
	font-weight: 800;
	font-stretch: 85%;
	font-size: 16px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--cdr-white);
	white-space: nowrap;
}

.cdr-brand__sub {
	margin-top: 3px;
	font-family: var(--cdr-font-data);
	font-size: 8.5px;
	letter-spacing: 0.42em;
	text-transform: uppercase;
	color: var(--cdr-grey);
}

.cdr-brand--stacked { flex-direction: column; gap: 8px; text-align: center; }
.cdr-brand--stacked .cdr-brand__text { align-items: center; }

.custom-logo-link { display: block; }
.cdr-brand__logo,
.custom-logo {
	display: block;
	width: var(--cdr-logo-width, 200px);
	max-width: 100%;
	height: auto;
}

/* ---------- navigation ---------- */

/* min-width:0 lets the nav shrink instead of forcing the header wider than its
   container, and the menu wraps rather than overflowing. Without both, adding
   the header button to a nine-item menu pushed the button off the right of the
   page. Nothing moves while there is room. */
.cdr-nav {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	justify-content: center;
}

.cdr-menu {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(10px, 2.2vw, 32px);
	list-style: none;
	margin: 0;
	padding: 0;
}

.cdr-header__brand { min-width: 0; }

.cdr-menu a {
	display: block;
	padding: 6px 0;
	font-family: var(--cdr-font-display);
	font-style: italic;
	font-weight: 700;
	font-stretch: 90%;
	font-size: 13px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--cdr-off-white);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
	transition: color var(--cdr-speed) var(--cdr-ease), border-color var(--cdr-speed) var(--cdr-ease);
}

.cdr-menu a:hover { color: var(--cdr-yellow); }

.cdr-menu .current-menu-item > a,
.cdr-menu .current_page_item > a,
.cdr-menu .current-menu-parent > a,
.cdr-menu .current-menu-ancestor > a {
	color: var(--cdr-white);
	border-bottom-color: var(--cdr-yellow);
}

.cdr-menu .sub-menu {
	display: none;
	position: absolute;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: var(--cdr-panel);
	border: 1px solid var(--cdr-rule);
	min-width: 190px;
}

.cdr-menu li { position: relative; }
.cdr-menu li:hover > .sub-menu,
.cdr-menu li:focus-within > .sub-menu { display: block; }
.cdr-menu .sub-menu a { padding: 8px 16px; border-bottom: 0; font-size: 12px; }

.cdr-nav__empty {
	margin: 0;
	font-family: var(--cdr-font-data);
	font-size: 11px;
	color: var(--cdr-grey-dim);
}

/* ---------- social ---------- */

.cdr-social {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cdr-social__link {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	color: var(--cdr-off-white);
	transition: color var(--cdr-speed) var(--cdr-ease);
}

.cdr-social__link:hover { color: var(--cdr-yellow); }
.cdr-social__link svg { width: 20px; height: 20px; display: block; }

.cdr-header__social { flex: 0 0 auto; }

/* ---------- mobile menu ---------- */

.cdr-burger {
	display: none;
	width: 42px;
	height: 42px;
	margin-left: auto;
	background: transparent;
	border: 1px solid var(--cdr-rule-strong);
	cursor: pointer;
	position: relative;
}

.cdr-burger__bars,
.cdr-burger__bars::before,
.cdr-burger__bars::after {
	position: absolute;
	left: 50%;
	width: 18px;
	height: 2px;
	background: var(--cdr-white);
	transform: translateX(-50%);
	transition: transform var(--cdr-speed) var(--cdr-ease), opacity var(--cdr-speed) var(--cdr-ease);
}

.cdr-burger__bars { top: 50%; margin-top: -1px; }
.cdr-burger__bars::before { content: ""; top: -6px; }
.cdr-burger__bars::after  { content: ""; top: 6px; }

.cdr-burger[aria-expanded="true"] .cdr-burger__bars { background: transparent; }
.cdr-burger[aria-expanded="true"] .cdr-burger__bars::before { transform: translateX(-50%) translateY(6px) rotate(45deg); }
.cdr-burger[aria-expanded="true"] .cdr-burger__bars::after  { transform: translateX(-50%) translateY(-6px) rotate(-45deg); }

/* ---------- footer ---------- */

.cdr-footer {
	background: var(--cdr-black);
	border-top: 1px solid var(--cdr-rule);
	color: var(--cdr-off-white);
}

.cdr-footer__inner {
	max-width: var(--cdr-container);
	margin-inline: auto;
	padding: clamp(34px, 5vw, 62px) clamp(16px, 4vw, 32px);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(24px, 4vw, 48px);
	align-items: start;
}

.cdr-footer__motto {
	margin: 0;
	display: flex;
	flex-direction: column;
	font-family: var(--cdr-font-display);
	font-style: italic;
	font-weight: 800;
	font-stretch: 85%;
	font-size: clamp(22px, 3vw, 34px);
	line-height: 1.06;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--cdr-white);
}

.cdr-footer__motto-accent { color: var(--cdr-yellow); }

.cdr-footer__brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.cdr-footer__social { justify-content: center; }

.cdr-footer__subscribe { justify-self: end; width: 100%; max-width: 340px; }

.cdr-footer__legal {
	border-top: 1px solid var(--cdr-rule);
}

.cdr-footer__legal-inner {
	max-width: var(--cdr-container);
	margin-inline: auto;
	padding: 16px clamp(16px, 4vw, 32px);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 12.5px;
	color: var(--cdr-grey-dim);
}

.cdr-footer__legal-inner p { margin: 0; }

.cdr-footer__links {
	display: flex;
	gap: 18px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cdr-footer__links a,
.cdr-footer__credit a {
	color: var(--cdr-grey);
	text-decoration: none;
}

.cdr-footer__links a:hover,
.cdr-footer__credit a:hover { color: var(--cdr-yellow); }

/* ---------- shared page furniture ---------- */

/* padding-block only: the `padding` shorthand would reset the inline padding
   this element inherits from .cdr-shell and push titles to the screen edge. */
.cdr-page-head {
	padding-block: clamp(34px, 5vw, 64px) clamp(20px, 3vw, 34px);
	border-bottom: 1px solid var(--cdr-rule);
}

.cdr-page-title {
	margin: 0;
	font-family: var(--cdr-font-display);
	font-style: italic;
	font-weight: 800;
	font-stretch: 85%;
	font-size: clamp(34px, 6vw, 72px);
	line-height: .95;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: var(--cdr-white);
}

.cdr-prose { max-width: 68ch; }
.cdr-prose h2, .cdr-prose h3 { color: var(--cdr-white); }
.cdr-prose p { color: var(--cdr-grey); }

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
	.cdr-footer__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.cdr-footer__subscribe { grid-column: 1 / -1; justify-self: start; max-width: none; }
}

/* The mobile menu rules are emitted by the theme at the breakpoint chosen in
   the Customizer - see cdr_child_header_inline_styles(). A media query cannot
   read a custom property, so they cannot live here. */

@media (max-width: 640px) {
	.cdr-footer__inner { grid-template-columns: 1fr; }
	.cdr-footer__brand { align-items: flex-start; }
	.cdr-footer__social { justify-content: flex-start; }
	.cdr-brand--stacked { flex-direction: row; text-align: left; }
	.cdr-brand--stacked .cdr-brand__text { align-items: flex-start; }
	.cdr-footer__legal-inner { justify-content: flex-start; }
}

/* ---------- two-up section (news beside Instagram) ---------- */

.cdr-duo {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(16px, 2vw, 26px);
	align-items: stretch;
}

@media (max-width: 900px) {
	.cdr-duo { grid-template-columns: 1fr; }
}

/* ---------- post archive ---------- */

.cdr-archive {
	list-style: none;
	margin: 0 0 40px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: clamp(20px, 2.6vw, 32px);
}

.cdr-archive__item {
	display: flex;
	flex-direction: column;
	background: var(--cdr-panel);
	border: 1px solid var(--cdr-rule);
}

.cdr-archive__thumb {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--cdr-panel-raised);
}

.cdr-archive__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cdr-archive__body { padding: 18px 20px 22px; }

.cdr-archive__title {
	margin: 8px 0 4px;
	font-family: var(--cdr-font-display);
	font-style: italic;
	font-weight: 700;
	font-stretch: 88%;
	font-size: 18px;
	line-height: 1.15;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.cdr-archive__title a { color: var(--cdr-white); text-decoration: none; }
.cdr-archive__title a:hover { color: var(--cdr-yellow); }

.cdr-archive__date {
	margin: 0 0 8px;
	font-style: italic;
	font-size: 12.5px;
	color: var(--cdr-yellow);
}

.cdr-archive__excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--cdr-grey);
}

.cdr-site .navigation.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
}

.cdr-site .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding-inline: 12px;
	border: 1px solid var(--cdr-rule-strong);
	color: var(--cdr-off-white);
	text-decoration: none;
	font-family: var(--cdr-font-data);
	font-size: 12px;
}

.cdr-site .page-numbers.current,
.cdr-site .page-numbers:hover {
	background: var(--cdr-yellow);
	border-color: var(--cdr-yellow);
	color: var(--cdr-ink);
}
