/**
 * Clinitec Design System
 *
 * Ported from the Next.js globals.css Tailwind v4 @theme configuration.
 * Defines the complete color system, typography, spacing, and utility classes
 * used across all theme templates and Elementor widgets.
 *
 * @package Clinitec
 */

/* ===================================================================
   CSS RESET (minimal — browsers handle most of this now)
   =================================================================== */

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

/* ===================================================================
   DESIGN TOKENS — CSS Custom Properties
   =================================================================== */

:root {
	/* ---------- Navy Scale (Primary Brand) ---------- */
	--navy-50:  #f3f6fb;
	--navy-100: #e1e9f4;
	--navy-200: #c3d2e9;
	--navy-300: #95b0d6;
	--navy-400: #5e85bd;
	--navy-500: #3a5f9a;
	--navy-600: #2a4a80;
	--navy-700: #204070; /* Brand navy */
	--navy-800: #1b355d;
	--navy-900: #15293b;
	--navy-950: #0c1828;

	/* ---------- Teal Scale (Accent Brand) ---------- */
	--teal-50:  #ecfdf6;
	--teal-100: #d0fae7;
	--teal-200: #a4f3d0;
	--teal-300: #6ae5b5;
	--teal-400: #30cf96;
	--teal-500: #00a080; /* Brand teal */
	--teal-600: #008a6e;
	--teal-700: #016e5a;
	--teal-800: #075848;
	--teal-900: #0a493d;
	--teal-950: #002a23;

	/* ---------- Semantic Tokens (Light Theme) ---------- */
	--background:           #f8fafc;
	--foreground:           #0b1f3a;
	--card:                 #ffffff;
	--card-foreground:      #0b1f3a;
	--popover:              #ffffff;
	--popover-foreground:   #0b1f3a;
	--primary:              var(--navy-700);
	--primary-foreground:   #ffffff;
	--secondary:            #ecfdf6;
	--secondary-foreground: #075848;
	--muted:                #f1f5f9;
	--muted-foreground:     #475569;
	--accent:               #008a6e;
	--accent-foreground:    #ffffff;
	--destructive:          #c2410c;
	--destructive-foreground: #ffffff;
	--border:               #e2e8f0;
	--input:                #e2e8f0;
	--ring:                 #008a6e;

	/* ---------- Chart Colors ---------- */
	--chart-1: #00a080;
	--chart-2: #204070;
	--chart-3: #30cf96;
	--chart-4: #5e85bd;
	--chart-5: #016e5a;

	/* ---------- Typography ---------- */
	--font-sans:    "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-display: "Space Grotesk", "Manrope", ui-sans-serif, system-ui, sans-serif;

	/* ---------- Border Radius ---------- */
	--radius-sm:  0.375rem;
	--radius-md:  0.5rem;
	--radius-lg:  0.75rem;
	--radius-xl:  1rem;
	--radius-2xl: 1.25rem;
	--radius-3xl: 1.5rem;
	--radius-full: 9999px;

	/* ---------- Transitions ---------- */
	--transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);

	/* ---------- Shadows ---------- */
	--shadow-sm:   0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md:   0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
	--shadow-lg:   0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
	--shadow-xl:   0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	--shadow-teal-glow: 0 0 0 1px color-mix(in oklch, var(--teal-500) 25%, transparent),
	                   0 8px 24px -8px color-mix(in oklch, var(--teal-500) 45%, transparent);

	/* ---------- Layout ---------- */
	--container-width: 80rem; /* 1280px */
	--header-height: 4.5rem;
}

/* ---------- Dark Theme ---------- */
.dark {
	--background:           var(--navy-950);
	--foreground:           #f8fafc;
	--card:                 var(--navy-900);
	--card-foreground:      #f8fafc;
	--popover:              var(--navy-900);
	--popover-foreground:   #f8fafc;
	--primary:              var(--teal-400);
	--primary-foreground:   var(--teal-950);
	--secondary:            var(--navy-800);
	--secondary-foreground: var(--teal-100);
	--muted:                var(--navy-800);
	--muted-foreground:     var(--navy-300);
	--accent:               var(--teal-500);
	--accent-foreground:    #ffffff;
	--destructive:          #f87171;
	--destructive-foreground: #ffffff;
	--border:               var(--navy-800);
	--input:                var(--navy-800);
	--ring:                 var(--teal-400);
}

/* ===================================================================
   BASE TYPOGRAPHY
   =================================================================== */

body {
	font-family: var(--font-sans);
	font-size: 1rem;
	line-height: 1.625;
	background-color: var(--background);
	color: var(--foreground);
	transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.15;
	color: var(--primary);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p { line-height: 1.625; }

a {
	color: var(--accent);
	text-decoration: none;
	transition: color var(--transition-fast);
}

a:hover {
	color: var(--teal-600);
}

::selection {
	background: color-mix(in oklch, var(--accent) 25%, transparent);
	color: var(--primary);
}

/* ===================================================================
   LAYOUT UTILITIES
   =================================================================== */

.container-page {
	max-width: var(--container-width);
	margin-inline: auto;
	padding-inline: 1.25rem;
}

@media (min-width: 1024px) {
	.container-page {
		padding-inline: 2rem;
	}
}

.container-narrow {
	max-width: 48rem;
	margin-inline: auto;
}

.section-padding {
	padding-block: 5rem;
}

@media (min-width: 768px) {
	.section-padding { padding-block: 6rem; }
}

@media (min-width: 1024px) {
	.section-padding { padding-block: 8rem; }
}

/* Responsive grids */
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }

@media (min-width: 768px) {
	.grid-2 { grid-template-columns: repeat(2, 1fr); }
	.grid-3 { grid-template-columns: repeat(2, 1fr); }
	.grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
	.grid-3 { grid-template-columns: repeat(3, 1fr); }
	.grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ===================================================================
   DECORATIVE UTILITIES
   =================================================================== */

.glass {
	background: color-mix(in oklch, var(--card) 75%, transparent);
	backdrop-filter: saturate(180%) blur(16px);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
}

.hairline {
	border: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
}

.text-gradient-brand {
	background: linear-gradient(120deg, var(--primary), var(--accent));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.shadow-teal-glow {
	box-shadow: var(--shadow-teal-glow);
}

.bg-grid-pattern {
	background-image:
		linear-gradient(to right, var(--navy-700) 1px, transparent 1px),
		linear-gradient(to bottom, var(--navy-700) 1px, transparent 1px);
	background-size: 56px 56px;
	opacity: 0.04;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent);
}

.eyebrow::before {
	content: '';
	display: inline-block;
	width: 2rem;
	height: 1px;
	background: currentColor;
}

/* ===================================================================
   BUTTONS
   =================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.625rem 1.25rem;
	font-family: var(--font-sans);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.5;
	border: none;
	border-radius: var(--radius-full);
	cursor: pointer;
	text-decoration: none;
	transition: all var(--transition-fast);
	white-space: nowrap;
}

.btn:hover {
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn svg {
	width: 1em;
	height: 1em;
}

/* Sizes */
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }

/* Primary (navy) */
.btn-primary {
	background: var(--primary);
	color: var(--primary-foreground);
}
.btn-primary:hover {
	background: var(--navy-800);
	color: var(--primary-foreground);
}

/* Accent (teal) */
.btn-accent {
	background: var(--accent);
	color: var(--accent-foreground);
}
.btn-accent:hover {
	background: var(--teal-700);
	color: var(--accent-foreground);
}

/* Outline */
.btn-outline {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--primary);
}
.btn-outline:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: transparent;
}

/* Ghost */
.btn-ghost {
	background: transparent;
	color: var(--primary);
}
.btn-ghost:hover {
	background: var(--muted);
	color: var(--primary);
}

/* White outline (for dark backgrounds) */
.btn-white-outline {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #ffffff;
}
.btn-white-outline:hover {
	border-color: rgba(255, 255, 255, 0.6);
	color: #ffffff;
}

/* ===================================================================
   BADGES
   =================================================================== */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.625rem;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
	border-radius: var(--radius-full);
	background: var(--secondary);
	color: var(--secondary-foreground);
}

.badge-accent {
	background: var(--accent);
	color: var(--accent-foreground);
}

.badge-outline {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--muted-foreground);
}

.badge-muted {
	background: var(--muted);
	color: var(--muted-foreground);
}

/* ===================================================================
   CARDS
   =================================================================== */

.card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-2xl);
	padding: 1.5rem;
	box-shadow: var(--shadow-sm);
	transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card-hover:hover {
	border-color: var(--teal-200);
	box-shadow: var(--shadow-lg);
}

/* ===================================================================
   FORM ELEMENTS
   =================================================================== */

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--foreground);
	margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
	width: 100%;
	padding: 0.625rem 0.875rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--foreground);
	background: var(--card);
	border: 1px solid var(--input);
	border-radius: var(--radius-lg);
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.form-textarea {
	min-height: 6rem;
	resize: vertical;
}

.form-error {
	display: block;
	font-size: 0.75rem;
	color: var(--destructive);
	margin-top: 0.25rem;
	min-height: 1em;
}

.required {
	color: var(--destructive);
}

/* ===================================================================
   ACCESSIBILITY
   =================================================================== */

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

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: 0.75rem 1.25rem;
	background: var(--primary);
	color: #ffffff;
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: var(--radius-lg);
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
	color: #ffffff;
}

/* Focus-visible for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

:focus:not(:focus-visible) {
	outline: none;
}

/* ===================================================================
   ANIMATIONS
   =================================================================== */

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

/* Scroll reveal (used by main.js IntersectionObserver) */
.animate-on-scroll {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ===================================================================
   PROSE CONTENT (block editor / Elementor output)
   =================================================================== */

.prose-content {
	color: var(--foreground);
	line-height: 1.75;
}

.prose-content h2,
.prose-content h3,
.prose-content h4 {
	margin-top: 2rem;
	margin-bottom: 0.75rem;
	color: var(--primary);
}

.prose-content p {
	margin-bottom: 1rem;
}

.prose-content ul,
.prose-content ol {
	margin-bottom: 1rem;
	padding-left: 1.5rem;
}

.prose-content li {
	margin-bottom: 0.375rem;
}

.prose-content a {
	color: var(--accent);
	text-decoration: underline;
}

.prose-content img {
	border-radius: var(--radius-xl);
	margin-block: 1.5rem;
}

.prose-content blockquote {
	border-left: 4px solid var(--accent);
	padding-left: 1rem;
	font-style: italic;
	color: var(--muted-foreground);
	margin-block: 1.5rem;
}

.prose-content code {
	background: var(--muted);
	padding: 0.125rem 0.375rem;
	border-radius: var(--radius-sm);
	font-size: 0.875em;
}

.prose-content pre {
	background: var(--muted);
	padding: 1rem;
	border-radius: var(--radius-lg);
	overflow-x: auto;
	margin-block: 1.5rem;
}

.prose-content pre code {
	background: none;
	padding: 0;
}

/* ===================================================================
   PAGINATION
   =================================================================== */

.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin-top: 3rem;
}

.pagination a,
.pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.75rem;
	border-radius: var(--radius-lg);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--foreground);
	text-decoration: none;
	border: 1px solid var(--border);
	transition: all var(--transition-fast);
}

.pagination a:hover,
.pagination .current {
	background: var(--primary);
	color: #ffffff;
	border-color: var(--primary);
}

/* ===================================================================
   BREADCRUMBS
   =================================================================== */

.breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
	color: var(--muted-foreground);
}

.breadcrumbs a {
	color: var(--muted-foreground);
	transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
	color: var(--accent);
}

.breadcrumbs .breadcrumb-separator {
	opacity: 0.5;
}

.breadcrumbs .breadcrumb-current {
	color: var(--foreground);
	font-weight: 500;
}

/* ===================================================================
   WORDPRESS CORE ALIGNMENTS
   =================================================================== */

.alignwide {
	max-width: 90rem;
	margin-inline: auto;
}

.alignfull {
	max-width: 100%;
	margin-inline: calc(50% - 50vw);
}

.wp-block-image img,
.wp-block-image.alignfull img {
	border-radius: var(--radius-xl);
}

/* ===================================================================
   UTILITY HELPERS
   =================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

.relative { position: relative; }
.absolute { position: absolute; }

.hidden { display: none !important; }

@media (min-width: 768px) {
	.md\:hidden { display: none !important; }
	.md\:block { display: block !important; }
}

@media (max-width: 767px) {
	.mobile\:hidden { display: none !important; }
}
