/* ==========================================================================
   Base - CSS Custom Properties, Reset, Typography
   ========================================================================== */

:root {
	/* Colors */
	--gpchild-color-primary: #2563eb;
	--gpchild-color-primary-dark: #1d4ed8;
	--gpchild-color-secondary: #7c3aed;
	--gpchild-color-accent: #f59e0b;
	--gpchild-color-text: #1f2937;
	--gpchild-color-text-light: #6b7280;
	--gpchild-color-text-inverse: #ffffff;
	--gpchild-color-bg: #ffffff;
	--gpchild-color-bg-alt: #f9fafb;
	--gpchild-color-bg-dark: #111827;
	--gpchild-color-border: #e5e7eb;
	--gpchild-color-overlay: rgba(0, 0, 0, 0.5);

	/* Spacing */
	--gpchild-space-xs: 0.25rem;
	--gpchild-space-sm: 0.5rem;
	--gpchild-space-md: 1rem;
	--gpchild-space-lg: 1.5rem;
	--gpchild-space-xl: 2rem;
	--gpchild-space-2xl: 3rem;
	--gpchild-space-3xl: 4rem;

	/* Typography */
	--gpchild-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--gpchild-font-serif: Georgia, "Times New Roman", Times, serif;
	--gpchild-font-mono: "SF Mono", Monaco, "Cascadia Code", "Courier New", monospace;
	--gpchild-font-heading: var(--gpchild-font-sans);
	--gpchild-font-body: var(--gpchild-font-sans);

	--gpchild-text-xs: 0.75rem;
	--gpchild-text-sm: 0.875rem;
	--gpchild-text-base: 1rem;
	--gpchild-text-lg: 1.125rem;
	--gpchild-text-xl: 1.25rem;
	--gpchild-text-2xl: 1.5rem;
	--gpchild-text-3xl: 2rem;
	--gpchild-text-4xl: 2.5rem;
	--gpchild-text-5xl: 3rem;

	--gpchild-leading-tight: 1.25;
	--gpchild-leading-normal: 1.5;
	--gpchild-leading-relaxed: 1.75;

	/* Layout */
	--gpchild-container-max: 1200px;
	--gpchild-container-wide: 1400px;
	--gpchild-container-narrow: 800px;
	--gpchild-sidebar-width: 300px;

	/* Grid */
	--gpchild-grid-columns: 3;
	--gpchild-grid-gap: var(--gpchild-space-lg);

	/* Border */
	--gpchild-radius-sm: 0.25rem;
	--gpchild-radius-md: 0.5rem;
	--gpchild-radius-lg: 1rem;
	--gpchild-radius-full: 9999px;

	/* Shadows */
	--gpchild-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--gpchild-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
	--gpchild-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
	--gpchild-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

	/* Transitions */
	--gpchild-transition-fast: 150ms ease;
	--gpchild-transition-base: 250ms ease;
	--gpchild-transition-slow: 350ms ease;

	/* Cards */
	--gpchild-card-bg: var(--gpchild-color-bg);
	--gpchild-card-border: var(--gpchild-color-border);
	--gpchild-card-shadow: var(--gpchild-shadow-sm);
	--gpchild-card-radius: var(--gpchild-radius-md);
	--gpchild-card-padding: var(--gpchild-space-lg);

	/* Hero */
	--gpchild-hero-height: 500px;
	--gpchild-hero-overlay: var(--gpchild-color-overlay);
}

/* Reset */
.gpchild-front-page *,
.gpchild-front-page *::before,
.gpchild-front-page *::after {
	box-sizing: border-box;
}

.gpchild-front-page img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Typography */
.gpchild-front-page {
	font-family: var(--gpchild-font-body);
	font-size: var(--gpchild-text-base);
	line-height: var(--gpchild-leading-normal);
	color: var(--gpchild-color-text);
	overflow-x: hidden;
}

.gpchild-front-page h1,
.gpchild-front-page h2,
.gpchild-front-page h3,
.gpchild-front-page h4 {
	font-family: var(--gpchild-font-heading);
	line-height: var(--gpchild-leading-tight);
	margin-top: 0;
}

.gpchild-front-page a {
	color: var(--gpchild-color-primary);
	text-decoration: none;
	transition: color var(--gpchild-transition-fast);
}

.gpchild-front-page a:hover,
.gpchild-front-page a:focus {
	color: var(--gpchild-color-primary-dark);
}

.gpchild-front-page a:focus-visible {
	outline: 2px solid var(--gpchild-color-primary);
	outline-offset: 2px;
}

/* Container */
.gpchild-container {
	width: 100%;
	max-width: var(--gpchild-container-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--gpchild-space-lg);
	padding-right: var(--gpchild-space-lg);
}

.gpchild-container--wide {
	max-width: var(--gpchild-container-wide);
}

.gpchild-container--narrow {
	max-width: var(--gpchild-container-narrow);
}

/* Layout */
.gpchild-layout {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gpchild-space-2xl);
	max-width: var(--gpchild-container-wide);
	margin: 0 auto;
	padding: 0 var(--gpchild-space-lg);
}

.gpchild-layout--full .gpchild-content {
	width: 100%;
}

.gpchild-layout--with-sidebar .gpchild-content {
	flex: 1;
	min-width: 0;
}

.gpchild-layout--with-sidebar .gpchild-sidebar {
	width: var(--gpchild-sidebar-width);
	flex-shrink: 0;
}

/* Section spacing */
.gpchild-section {
	padding-top: var(--gpchild-space-2xl);
	padding-bottom: var(--gpchild-space-2xl);
}

.gpchild-section--no-pad-top {
	padding-top: 0;
}

.gpchild-section__title {
	font-size: var(--gpchild-text-2xl);
	font-weight: 700;
	margin-bottom: var(--gpchild-space-xl);
}

/* Post meta */
.gpchild-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--gpchild-space-sm);
	font-size: var(--gpchild-text-sm);
	color: var(--gpchild-color-text-light);
}

.gpchild-meta__separator::before {
	content: "\00B7";
}

/* Category badge */
.gpchild-badge {
	display: inline-block;
	padding: var(--gpchild-space-xs) var(--gpchild-space-sm);
	font-size: var(--gpchild-text-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--gpchild-color-primary);
	color: var(--gpchild-color-text-inverse);
	border-radius: var(--gpchild-radius-sm);
}

.gpchild-badge a {
	color: inherit;
}

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

/* Responsive */
@media (max-width: 1024px) {
	:root {
		--gpchild-grid-columns: 2;
		--gpchild-hero-height: 400px;
		--gpchild-sidebar-width: 260px;
	}
}

@media (max-width: 768px) {
	:root {
		--gpchild-grid-columns: 1;
		--gpchild-hero-height: 300px;
		--gpchild-text-3xl: 1.75rem;
		--gpchild-text-4xl: 2rem;
		--gpchild-text-5xl: 2.5rem;
	}

	.gpchild-layout--with-sidebar {
		flex-direction: column;
	}

	.gpchild-layout--with-sidebar .gpchild-sidebar {
		width: 100%;
	}

	.gpchild-layout {
		gap: var(--gpchild-space-xl);
	}
}

/* Text overflow prevention */
.gpchild-front-page h1,
.gpchild-front-page h2,
.gpchild-front-page h3,
.gpchild-front-page h4,
.gpchild-front-page p,
.gpchild-front-page a,
.gpchild-header a,
.gpchild-footer a {
	overflow-wrap: break-word;
	word-wrap: break-word;
}

@media (max-width: 480px) {
	:root {
		--gpchild-hero-height: 220px;
		--gpchild-text-2xl: 1.25rem;
		--gpchild-text-3xl: 1.5rem;
		--gpchild-text-4xl: 1.75rem;
		--gpchild-text-5xl: 2rem;
		--gpchild-space-2xl: 2rem;
		--gpchild-space-3xl: 2.5rem;
		--gpchild-card-padding: var(--gpchild-space-md);
	}

	.gpchild-container {
		padding-left: var(--gpchild-space-md);
		padding-right: var(--gpchild-space-md);
	}

	.gpchild-section {
		padding-top: var(--gpchild-space-xl);
		padding-bottom: var(--gpchild-space-xl);
	}

	.gpchild-section__title {
		font-size: var(--gpchild-text-xl);
	}

	.gpchild-layout {
		gap: var(--gpchild-space-lg);
	}
}

@media (max-width: 360px) {
	:root {
		--gpchild-hero-height: 180px;
		--gpchild-text-xl: 1.125rem;
		--gpchild-text-2xl: 1.125rem;
		--gpchild-text-3xl: 1.25rem;
		--gpchild-text-4xl: 1.375rem;
		--gpchild-text-5xl: 1.5rem;
		--gpchild-space-lg: 1rem;
		--gpchild-space-xl: 1.25rem;
		--gpchild-space-2xl: 1.5rem;
		--gpchild-space-3xl: 2rem;
	}

	.gpchild-container {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}
}

@media (max-width: 320px) {
	:root {
		--gpchild-hero-height: 160px;
		--gpchild-text-lg: 1rem;
		--gpchild-text-xl: 1.0625rem;
		--gpchild-text-2xl: 1.0625rem;
		--gpchild-text-3xl: 1.125rem;
		--gpchild-text-4xl: 1.25rem;
		--gpchild-text-5xl: 1.375rem;
		--gpchild-space-lg: 0.75rem;
		--gpchild-space-xl: 1rem;
		--gpchild-space-2xl: 1.25rem;
		--gpchild-space-3xl: 1.5rem;
	}
}

/* ==========================================================================
   Reduced Motion
   Respect user preference to minimize animations and transitions
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	:root {
		--gpchild-transition-fast: 0ms;
		--gpchild-transition-base: 0ms;
		--gpchild-transition-slow: 0ms;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.gpchild-hero-slider__track {
		scroll-behavior: auto;
	}

	.gpchild-post-carousel__track {
		scroll-behavior: auto;
	}

	/* Disable hover transforms */
	.gpchild-post-grid__item:hover,
	.gpchild-post-grid-featured__item:hover,
	.gpchild-post-list__item:hover,
	.gpchild-related__card:hover,
	.gpchild-back-to-top:hover,
	.gpchild-sharing__btn:hover {
		transform: none;
	}

	/* Disable image zoom on hover */
	.gpchild-post-grid__item:hover .gpchild-post-grid__image,
	.gpchild-post-grid-featured__item:hover .gpchild-post-grid-featured__image,
	.gpchild-post-carousel__item:hover .gpchild-post-carousel__image,
	.gpchild-related__card:hover .gpchild-related__thumb img,
	.gpchild-grid-photo__item:hover .gpchild-grid-photo__thumbnail img {
		transform: none;
	}

	/* Progress bar: no transition */
	.gpchild-progress-bar {
		transition: none;
	}
}
