/*
 * Base styles: typography, links, buttons, focus and the theme toggle.
 * Anything specific to a page or a component goes in its own file later.
 */

/* ==========================================================================
   Page defaults
   ========================================================================== */
html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	background-color: var(--sol-bg);
	color: var(--sol-text);
	font-family: var(--sol-font-sans);
	font-size: var(--sol-text-md);
	line-height: var(--sol-leading-body);
	-webkit-font-smoothing: antialiased;
	transition: background-color var(--sol-normal) ease, color var(--sol-normal) ease;
}

::selection {
	background: var(--sol-accent);
	color: var(--sol-accent-ink);
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

/* ==========================================================================
   Headings
   ========================================================================== */
h1,
h2,
h3,
.sol-serif {
	font-family: var(--sol-font-serif);
	font-weight: 500;
	line-height: var(--sol-leading-title);
	letter-spacing: -0.01em;
	color: var(--sol-text);
}

h1 { font-size: var(--sol-h1); }
h2 { font-size: var(--sol-h2); }
h3 { font-size: var(--sol-h3); }

/* ==========================================================================
   Links and focus
   ========================================================================== */
a {
	color: inherit;
	text-decoration-color: var(--sol-line);
	text-underline-offset: 3px;
	transition: color var(--sol-fast) ease;
}

a:hover {
	color: var(--sol-gold-text);
}

:focus-visible {
	outline: 2px solid var(--sol-focus);
	outline-offset: 3px;
}

/* ==========================================================================
   Buttons
   Usage: <a class="sol-btn">, <a class="sol-btn sol-btn--ghost">
   ========================================================================== */
.sol-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--sol-space-2);
	padding: 13px 26px;
	border: 1.5px solid transparent;
	border-radius: var(--sol-radius-pill);
	background: var(--sol-accent);
	color: var(--sol-accent-ink);
	font: 600 0.9375rem/1.2 var(--sol-font-sans);
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--sol-fast) ease, background-color var(--sol-fast) ease;
}

.sol-btn:hover {
	color: var(--sol-accent-ink);
	transform: translateY(-1px);
}

.sol-btn:active {
	transform: scale(0.97);
}

.sol-btn--ghost {
	background: transparent;
	border-color: var(--sol-text);
	color: var(--sol-text);
}

.sol-btn--ghost:hover {
	color: var(--sol-text);
	background: var(--sol-surface-alt);
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.sol-container {
	width: 100%;
	max-width: var(--sol-container);
	margin-inline: auto;
	padding-inline: var(--sol-gutter);
}

.sol-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Theme toggle
   Shows the moon in light mode and the sun in dark mode.
   ========================================================================== */
.sol-toggle {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--sol-line);
	border-radius: 50%;
	background: transparent;
	color: var(--sol-text);
	cursor: pointer;
	transition: background-color var(--sol-fast) ease;
}

.sol-toggle:hover {
	background: var(--sol-surface-alt);
}

.sol-toggle svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sol-toggle__sun { display: none; }

:root[data-theme="dark"] .sol-toggle__sun  { display: block; }
:root[data-theme="dark"] .sol-toggle__moon { display: none; }

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .sol-toggle__sun  { display: block; }
	:root:not([data-theme="light"]) .sol-toggle__moon { display: none; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
