/* =========================================================
   STUDYMEDIC GLOBAL STYLES
   Header, footer and homepage styles live in separate files.
========================================================= */

:root {
	/* Brand */
	--sm-blue: #2A1E7C;
	--sm-blue-dark: #2A1E7C;
	--sm-blue-soft: #f5f7ff;
	--sm-pink: #EB568F;
	--sm-pink-dark: #EB568F;
	--sm-pink-soft: #fff7fa;

	/* Text */
	--sm-ink: #23283b;
	--sm-text: #23283b;
	--sm-text-soft: #5f667a;
	--sm-muted: #747b8f;
	--sm-line: #e7eaf0;
	--sm-soft: #f7f8fc;
	--sm-white: #ffffff;

	/* Typography */
	--sm-font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
	--sm-font-display: clamp(2.25rem, 3.2vw, 3.25rem);
	--sm-font-h2: clamp(1.875rem, 2.7vw, 2.625rem);
	--sm-font-h3: clamp(1.375rem, 2vw, 1.875rem);
	--sm-font-h4: 1.25rem;
	--sm-font-body: 1rem;
	--sm-font-small: 0.875rem;
	--sm-font-eyebrow: 0.8125rem;
	--sm-font-button: 0.9375rem;

	--sm-weight-regular: 400;
	--sm-weight-medium: 500;
	--sm-weight-semibold: 600;
	--sm-weight-bold: 700;

	--sm-line-display: 1.08;
	--sm-line-heading: 1.18;
	--sm-line-body: 1.7;

	/* Layout */
	--sm-container: 1200px;
	--sm-radius: 20px;
	--sm-radius-sm: 10px;
	--sm-radius-md: 16px;
	--sm-radius-lg: 24px;
	--sm-radius-pill: 999px;
	--sm-shadow: 0 14px 45px rgba(18, 26, 42, 0.08);
	--sm-section: clamp(3.75rem, 7vw, 7rem);
}


/* =========================================================
   RESET / BASE
========================================================= */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	color: var(--sm-ink);
	background: var(--sm-white);
	font-family: var(--sm-font-family);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

button,
input,
textarea,
select {
	font: inherit;
}

button {
	cursor: pointer;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.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: 0;
}

.screen-reader-text:focus,
.skip-link:focus {
	position: fixed;
	top: 16px;
	left: 16px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 10px 14px;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
	border-radius: 8px;
	background: var(--sm-ink);
	color: var(--sm-white);
	text-decoration: none;
}


/* =========================================================
   LAYOUT
========================================================= */

.container {
	width: min(calc(100% - 40px), var(--sm-container));
	margin-inline: auto;
}

.container--narrow {
	max-width: 820px;
}

.section {
	padding-block: var(--sm-section);
}

.site-main {
	min-width: 0;
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.55em;
	color: var(--sm-blue-dark);
	font-family: var(--sm-font-family);
	font-weight: var(--sm-weight-bold);
	line-height: var(--sm-line-heading);
	letter-spacing: -0.025em;
}

h1 {
	font-size: var(--sm-font-display);
	line-height: var(--sm-line-display);
}

h2 {
	font-size: var(--sm-font-h2);
}

h3 {
	font-size: var(--sm-font-h3);
	font-weight: var(--sm-weight-semibold);
}

h4 {
	font-size: var(--sm-font-h4);
	font-weight: var(--sm-weight-semibold);
}

p,
li {
	font-size: var(--sm-font-body);
	line-height: var(--sm-line-body);
}

p {
	margin: 0 0 1rem;
	color: var(--sm-text-soft);
}

small,
.small-text,
.sm-muted {
	font-size: var(--sm-font-small);
	line-height: 1.6;
	color: var(--sm-muted);
}

.eyebrow,
.sm-eyebrow {
	margin: 0 0 10px;
	color: var(--sm-pink-dark);
	font-size: var(--sm-font-eyebrow);
	font-weight: var(--sm-weight-bold);
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sm-section-title {
	margin: 0 0 18px;
	color: var(--sm-blue-dark);
	font-size: var(--sm-font-h2);
	font-weight: var(--sm-weight-bold);
	line-height: var(--sm-line-heading);
}

.sm-section-subtitle {
	margin: 0 0 14px;
	color: var(--sm-blue);
	font-size: var(--sm-font-h3);
	font-weight: var(--sm-weight-semibold);
	line-height: 1.25;
}

.sm-body {
	color: var(--sm-text-soft);
	font-size: var(--sm-font-body);
	line-height: var(--sm-line-body);
}

/* =========================================================
   SHARED BUTTONS
========================================================= */

.button {
	display: inline-flex;
	min-height: 48px;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-weight: var(--sm-weight-semibold);
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
	transform: translateY(-1px);
}

.button--primary {
	background: var(--sm-blue);
	color: var(--sm-white);
	box-shadow: 0 8px 24px rgba(43, 58, 140, 0.2);
}

.button--secondary {
	border-color: #d9deef;
	background: var(--sm-white);
	color: var(--sm-blue);
}


/* =========================================================
   PAGE / POST CONTENT
========================================================= */

.entry-header,
.archive-header {
	margin-bottom: 34px;
}

.entry-title,
.archive-title {
	max-width: 900px;
}

.entry-meta,
.post-card__meta {
	color: var(--sm-muted);
	font-size: 0.9rem;
}

.entry-media {
	overflow: hidden;
	margin-bottom: 32px;
	border-radius: var(--sm-radius);
}

.entry-content {
	padding-bottom: 20px;
}

.prose {
	color: #253047;
}

.prose > * + * {
	margin-top: 1em;
}

.prose h2,
.prose h3,
.prose h4 {
	color: var(--sm-ink);
}

.prose a {
	color: var(--sm-blue);
	text-underline-offset: 3px;
}

.prose ul,
.prose ol {
	padding-left: 1.25rem;
}

.prose img {
	border-radius: 16px;
}


/* =========================================================
   POST GRID
========================================================= */

.posts-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}

.post-card {
	overflow: hidden;
	border: 1px solid var(--sm-line);
	border-radius: var(--sm-radius);
	background: var(--sm-white);
}

.post-card__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background: var(--sm-soft);
}

.post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.post-card:hover .post-card__media img {
	transform: scale(1.02);
}

.post-card__content {
	padding: 24px;
}

.post-card__title {
	font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.post-card__title a {
	text-decoration: none;
}

.post-card__content p:last-child {
	margin-bottom: 0;
	color: var(--sm-muted);
}


/* =========================================================
   PAGINATION
========================================================= */

.pagination {
	margin-top: 36px;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.page-numbers {
	padding: 8px 12px;
	border: 1px solid var(--sm-line);
	border-radius: 8px;
	text-decoration: none;
}

.page-numbers.current {
	background: var(--sm-blue);
	color: var(--sm-white);
	border-color: var(--sm-blue);
}


/* =========================================================
   SEARCH
========================================================= */

.search-box {
	margin-top: 28px;
}

.search-form {
	display: flex;
	gap: 8px;
	max-width: 560px;
}

.search-field {
	min-width: 0;
	flex: 1;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--sm-line);
	border-radius: 10px;
}

.search-submit {
	min-height: 48px;
	padding: 10px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--sm-blue);
	color: var(--sm-white);
	font-weight: var(--sm-weight-semibold);
}


/* =========================================================
   WOOCOMMERCE BASE
========================================================= */

.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button {
	border-radius: 999px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {
	.posts-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.container {
		width: min(calc(100% - 30px), var(--sm-container));
	}
}

@media (max-width: 680px) {
	.section {
		padding-block: clamp(3rem, 13vw, 4.5rem);
	}

	.posts-grid {
		grid-template-columns: 1fr;
	}

	.search-form {
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition: none !important;
		animation: none !important;
	}
}


/* =========================================================
   GLOBAL RESPONSIVE TYPOGRAPHY
========================================================= */

@media (max-width: 600px) {
	:root {
		--sm-font-display: clamp(1.875rem, 9vw, 2.375rem);
		--sm-font-h2: clamp(1.625rem, 7vw, 2.125rem);
		--sm-font-h3: clamp(1.25rem, 5.5vw, 1.6875rem);
		--sm-font-body: 0.9375rem;
		--sm-font-button: 0.875rem;
	}
}

/* =========================================================
   DEFAULT WORDPRESS PAGES
   Applies only to normal Pages using the Default template.
   Keeps new pages aligned to the same 1200px width as the header.
========================================================= */

.standard-page {
	padding: 0;
	background: var(--sm-white);
}

.standard-page__article {
	margin: 0;
	padding: 0;
}

.standard-page__hero {
	margin: 0;
	padding: clamp(2.5rem, 5vw, 4.25rem) 0 clamp(2rem, 4vw, 3.25rem);
	background: linear-gradient(110deg, #ffffff 0%, var(--sm-pink-soft) 100%);
	border-bottom: 1px solid var(--sm-line);
}

.standard-page__hero-inner {
	display: flex;
	align-items: center;
	min-height: 92px;
}

.standard-page__title {
	width: 100%;
	max-width: 980px;
	margin: 0;
	color: var(--sm-blue-dark);
	font-family: var(--sm-font-family);
	font-size: clamp(2.25rem, 4vw, 3.75rem);
	font-weight: var(--sm-weight-bold);
	line-height: 1.08;
	letter-spacing: -0.035em;
}

.standard-page__body {
	padding: clamp(2.75rem, 5vw, 4.5rem) 0 clamp(5rem, 8vw, 7rem);
}

.standard-page__content {
	width: min(calc(100% - 40px), var(--sm-container));
	max-width: var(--sm-container);
	margin-inline: auto;
	padding: 0;
	color: var(--sm-text-soft);
}

.standard-page__content > :first-child {
	margin-top: 0;
}

.standard-page__content > :last-child {
	margin-bottom: 0;
}

.standard-page__content p,
.standard-page__content li,
.standard-page__content td,
.standard-page__content th {
	font-family: var(--sm-font-family);
	color: var(--sm-text-soft);
}

.standard-page__content h2,
.standard-page__content h3,
.standard-page__content h4,
.standard-page__content h5,
.standard-page__content h6 {
	font-family: var(--sm-font-family);
	color: var(--sm-blue-dark);
}

.standard-page__content h2 {
	margin-top: 1.7em;
}

.standard-page__content h3 {
	margin-top: 1.5em;
}

.standard-page__content a {
	color: var(--sm-blue);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.standard-page__content a:hover,
.standard-page__content a:focus-visible {
	color: var(--sm-pink-dark);
}

.standard-page__content img,
.standard-page__content iframe,
.standard-page__content video {
	max-width: 100%;
}

@media (max-width: 900px) {
	.standard-page__content {
		width: min(calc(100% - 30px), var(--sm-container));
	}
}

@media (max-width: 600px) {
	.standard-page__hero {
		padding: 2rem 0 1.75rem;
	}

	.standard-page__hero-inner {
		min-height: 64px;
	}

	.standard-page__title {
		font-size: clamp(2rem, 10vw, 2.625rem);
	}

	.standard-page__body {
		padding: 2rem 0 5.5rem;
	}

	.standard-page__content {
		width: calc(100% - 28px);
	}
}

/* =========================================================
   LEARNDASH CONTENT WIDTH
   Keep LearnDash single pages aligned with the same 1200px
   site container used by standard pages, without changing
   LearnDash's internal UI/layout.
========================================================= */

body.single-sfwd-quiz .entry-header .container--narrow,
body.single-sfwd-quiz .entry-media.container--narrow,
body.single-sfwd-quiz .entry-content.container--narrow,
body.single-sfwd-courses .entry-header .container--narrow,
body.single-sfwd-courses .entry-media.container--narrow,
body.single-sfwd-courses .entry-content.container--narrow,
body.single-sfwd-lessons .entry-header .container--narrow,
body.single-sfwd-lessons .entry-media.container--narrow,
body.single-sfwd-lessons .entry-content.container--narrow,
body.single-sfwd-topic .entry-header .container--narrow,
body.single-sfwd-topic .entry-media.container--narrow,
body.single-sfwd-topic .entry-content.container--narrow {
	max-width: var(--sm-container);
}

body.single-sfwd-quiz .learndash-wrapper,
body.single-sfwd-courses .learndash-wrapper,
body.single-sfwd-lessons .learndash-wrapper,
body.single-sfwd-topic .learndash-wrapper {
	width: 100%;
	max-width: 100%;
}
