/*
 * TherapyBuilt — base.css
 *
 * Modern CSS reset + sensible defaults.
 * Depends on: tokens.css
 */

/* -------------------------------------------------------------------------
 * Box sizing
 * ------------------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Document
 * ------------------------------------------------------------------------ */

html {
	font-size: 100%;       /* 16px base */
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-sans);
	font-size: var(--text-base);
	font-weight: var(--weight-normal);
	line-height: var(--leading-relaxed);
	color: var(--tb-text);
	background-color: var(--tb-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* -------------------------------------------------------------------------
 * Typography reset
 * ------------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--font-serif);
	font-weight: var(--weight-semibold);
	line-height: var(--leading-tight);
	color: var(--tb-heading);
}

p {
	margin: 0 0 var(--space-4);
}

p:last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------------------
 * Links
 * ------------------------------------------------------------------------ */

a {
	color: var(--tb-primary);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover,
a:focus {
	color: var(--tb-primary-dark);
}

a:focus-visible {
	outline: 2px solid var(--tb-primary);
	outline-offset: 3px;
	border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------------------
 * Lists
 * ------------------------------------------------------------------------ */

ul, ol {
	margin: 0 0 var(--space-4);
	padding-left: var(--space-6);
}

li {
	margin-bottom: var(--space-1);
}

/* -------------------------------------------------------------------------
 * Images + media
 * ------------------------------------------------------------------------ */

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

/* -------------------------------------------------------------------------
 * Form elements reset
 * ------------------------------------------------------------------------ */

button,
input,
select,
textarea {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	margin: 0;
}

button {
	cursor: pointer;
	border: none;
	background: none;
	padding: 0;
}

/* -------------------------------------------------------------------------
 * Horizontal rule
 * ------------------------------------------------------------------------ */

hr {
	border: none;
	border-top: 1px solid var(--tb-border);
	margin: var(--space-8) 0;
}

/* -------------------------------------------------------------------------
 * Skip link (accessibility)
 * ------------------------------------------------------------------------ */

.tb-skip-link {
	position: absolute;
	top: -100%;
	left: var(--space-4);
	z-index: var(--z-toast);
	padding: var(--space-2) var(--space-4);
	background: var(--tb-primary);
	color: #fff;
	font-weight: var(--weight-medium);
	text-decoration: none;
	border-radius: var(--radius-md);
	transition: top var(--transition-fast);
}

.tb-skip-link:focus {
	top: var(--space-4);
}

/* -------------------------------------------------------------------------
 * Screen reader utility
 * ------------------------------------------------------------------------ */

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