/*
 * Ballpark Scout brand layer on top of Blocksy.
 * Light palette is set in Customizer > Colors (Blocksy palette).
 * This file adds dark mode, brand type, the logo mark and small components.
 * ":root:root" raises specificity so these win over Blocksy's generated CSS.
 */

/* ---------- Tokens ---------- */
:root:root {
	--bps-pin: #E2463F;
	--bps-scan: #1F9C86;
	--bps-muted: #5B6870;
	--bps-chip: #E6EBEE;
	--bps-radius: 10px;
	--bps-radius-sm: 6px;
	--bps-mark: url(../img/mark.svg);

	--theme-font-family: var(--bps-font-body);
	--theme-button-text-initial-color: #FFFFFF;
	--theme-button-text-hover-color: #FFFFFF;
	--theme-button-border-radius: var(--bps-radius);
	--theme-form-field-border-radius: var(--bps-radius);
	--theme-border-radius: var(--bps-radius);
	color-scheme: light;
}

/* Dark mode: saved choice */
:root:root[data-bps-mode="dark"] {
	--theme-palette-color-1: #E2463F;
	--theme-palette-color-2: #F0625B;
	--theme-palette-color-3: #C9D2D7;
	--theme-palette-color-4: #E8EDF0;
	--theme-palette-color-5: #25313A;
	--theme-palette-color-6: #1A2228;
	--theme-palette-color-7: #0F1418;
	--theme-palette-color-8: #141B20;
	--bps-scan: #3FBFA8;
	--bps-muted: #8A969E;
	--bps-chip: #1A2228;
	--bps-mark: url(../img/mark-dark.svg);
	color-scheme: dark;
}

/* Dark mode: follow the system when nothing is saved */
@media (prefers-color-scheme: dark) {
	:root:root:not([data-bps-mode="light"]) {
		--theme-palette-color-1: #E2463F;
		--theme-palette-color-2: #F0625B;
		--theme-palette-color-3: #C9D2D7;
		--theme-palette-color-4: #E8EDF0;
		--theme-palette-color-5: #25313A;
		--theme-palette-color-6: #1A2228;
		--theme-palette-color-7: #0F1418;
		--theme-palette-color-8: #141B20;
		--bps-scan: #3FBFA8;
		--bps-muted: #8A969E;
		--bps-chip: #1A2228;
		--bps-mark: url(../img/mark-dark.svg);
		color-scheme: dark;
	}
}

/* ---------- Type ---------- */
body {
	font-family: var(--bps-font-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body :is(h1, h2, h3, h4, h5, h6),
body .entry-title,
body .page-title {
	font-family: var(--bps-font-display);
	letter-spacing: -0.015em;
	line-height: 1.1;
}

body :is(h1, .entry-title) {
	letter-spacing: -0.025em;
	line-height: 1.05;
}

/* Numbers: distances, ratings, counts, coordinates */
.bps-data,
body :is(code, kbd, samp, pre) {
	font-family: var(--bps-font-data);
	font-variant-numeric: tabular-nums;
}

/* ---------- Logo: scored-diamond mark + wordmark ---------- */
.site-branding .site-title {
	font-family: var(--bps-font-display);
	font-weight: 700;
	letter-spacing: -0.01em;
}

.site-branding .site-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	color: var(--theme-palette-color-4);
}

.site-branding .site-title a::before {
	content: "";
	flex: none;
	width: 1.75em;
	height: 1.75em;
	background: var(--bps-mark) center / contain no-repeat;
}

/* Tagline under the wordmark, lined up with the text (mark is 1.75em + 0.5em gap) */
.site-branding .site-description {
	margin: 2px 0 0;
	padding-left: calc(2.25 * 25px);
	font-family: var(--bps-font-body);
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--bps-muted);
}

/* Keep the wordmark from crowding the header buttons on phones (Blocksy mobile breakpoint) */
@media (max-width: 689.98px) {
	.site-branding .site-title {
		font-size: 19px;
	}

	.site-branding .site-description {
		padding-left: calc(2.25 * 19px);
		font-size: 11.5px;
	}
}

/* ---------- Flat surfaces: hairlines, not shadows ---------- */
.entries[data-cards="boxed"] .entry-card,
.ct-sidebar .ct-widget,
.comments-area {
	box-shadow: none;
}

.entries[data-cards="boxed"] .entry-card {
	border: 1px solid var(--theme-palette-color-5);
	border-radius: var(--bps-radius);
}

/* ---------- Buttons and links ---------- */
.wp-block-button__link,
.ct-button,
button[type="submit"],
input[type="submit"] {
	font-weight: 600;
	box-shadow: none;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--theme-palette-color-4);
	border: 1px solid var(--theme-palette-color-5);
	background: transparent;
}

:focus-visible {
	outline: 2px solid var(--theme-palette-color-1);
	outline-offset: 2px;
}

/* ---------- Small components (usable from any block via "Additional CSS class") ---------- */

/* Chip / tag */
.bps-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.3em 0.75em;
	border-radius: 999px;
	background: var(--bps-chip);
	color: var(--theme-palette-color-4);
	font-size: 13px;
	line-height: 1.3;
}

/* Card: surface with a hairline, no shadow */
.bps-card {
	background: var(--theme-palette-color-8);
	border: 1px solid var(--theme-palette-color-5);
	border-radius: var(--bps-radius);
	padding: 16px;
}

/* Location / map accent (teal), only for map and check-in features */
.bps-scan {
	color: var(--bps-scan);
}

.bps-muted {
	color: var(--bps-muted);
}

/* ---------- Light/dark switch ---------- */
.bps-mode-toggle {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--theme-palette-color-5);
	border-radius: var(--bps-radius);
	background: transparent;
	color: var(--theme-palette-color-4);
	cursor: pointer;
}

.bps-mode-toggle svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.bps-mode-toggle__moon {
	fill: currentColor;
	stroke: none;
}

.bps-mode-toggle .bps-mode-toggle__sun,
.bps-mode-toggle[aria-pressed="true"] .bps-mode-toggle__moon {
	display: none;
}

.bps-mode-toggle[aria-pressed="true"] .bps-mode-toggle__sun {
	display: block;
}

.bps-mode-toggle:hover {
	border-color: var(--theme-palette-color-3);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}