/* ============================================
   BOCKEN.ORG CENTRALIZED STYLES
   ============================================ */

/* ============================================
   FONT DEFINITIONS
   ============================================ */

@font-face {
	font-family: 'crosses';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(/fonts/crosses.woff2) format('woff2'),
	     url(/fonts/crosses.ttf) format('truetype');
}

@font-face {
	font-family: 'Noto Color Emoji Subset';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(/fonts/NotoColorEmoji.woff2) format('woff2'),
	     url(/fonts/NotoColorEmoji.ttf) format('truetype');
}

/* ============================================
   COLOR SYSTEM
   Based on Nord Theme with semantic naming
   ============================================ */

:root {
	/* ============================================
	   BASE NORD COLORS
	   Keep original Nord colors for reference
	   ============================================ */
	--nord0: #2E3440;
	--nord1: #3B4252;
	--nord2: #434C5E;
	--nord3: #4C566A;
	--nord4: #D8DEE9;
	--nord5: #E5E9F0;
	--nord6: #ECEFF4;
	--nord7: #8FBCBB;
	--nord8: #88C0D0;
	--nord9: #81A1C1;
	--nord10: #5E81AC;
	--nord11: #BF616A;
	--nord12: #D08770;
	--nord13: #EBCB8B;
	--nord14: #A3BE8C;
	--nord15: #B48EAD;

	/* Named color aliases (backward compatibility) */
	--lightblue: var(--nord9);
	--blue: var(--nord10);
	--red: var(--nord11);
	--orange: var(--nord12);
	--yellow: var(--nord13);
	--green: var(--nord14);
	--purple: var(--nord15);

	/* ============================================
	   SEMANTIC COLOR SYSTEM - LIGHT MODE
	   ============================================ */

	/* Primary Color - Main interactive elements */
	--color-primary: var(--nord10);
	--color-primary-hover: var(--nord9);
	--color-primary-active: var(--nord8);

	/* Accent Color - Call-to-action, emphasis */
	--color-accent: var(--nord11);
	--color-accent-hover: #d07179;
	--color-accent-active: #a04e56;

	/* Secondary Accent - Alternative emphasis */
	--color-secondary: var(--nord12);
	--color-secondary-hover: #e09880;
	--color-secondary-active: #b87060;

	/* Background Colors */
	--color-bg-primary: #fbf9f3;
	--color-bg-secondary: var(--nord5);
	--color-bg-tertiary: var(--nord6);
	--color-bg-elevated: var(--nord4);

	/* Surface Colors (cards, panels, etc.) */
	--color-surface: var(--nord6);
	--color-surface-hover: var(--nord5);

	/* Text Colors */
	--color-text-primary: var(--nord0);
	--color-text-secondary: var(--nord3);
	--color-text-tertiary: var(--nord2);
	--color-text-inverse: white;
	--color-text-on-primary: white;
	--color-text-on-accent: white;
	--color-text-muted: var(--nord4);

	/* UI Element Colors */
	--color-ui-dark: var(--nord0);
	--color-ui-mid: var(--nord3);
	--color-ui-light: var(--nord4);
	--color-ui-hover: var(--nord3);

	/* Border Colors */
	--color-border: var(--nord4);
	--color-border-hover: var(--nord3);

	/* Link Colors */
	--color-link: var(--nord10);
	--color-link-visited: var(--nord15);
	--color-link-hover: var(--nord9);

	/* Status Colors */
	--color-success: var(--nord14);
	--color-warning: var(--nord13);
	--color-error: var(--nord11);
	--color-info: var(--nord10);

	/* Shared transitions & shadows */
	--transition-fast: 100ms;
	--transition-normal: 200ms;
	--shadow-sm: 0 0 0.4em 0.05em rgba(0,0,0,0.2);
	--shadow-md: 0 0 0.5em 0.1em rgba(0,0,0,0.3);
	--shadow-lg: 0 0 1em 0.1em rgba(0,0,0,0.4);
	--shadow-hover: 0.1em 0.1em 0.5em 0.1em rgba(0,0,0,0.3);
	--radius-pill: 1000px;
	--radius-card: 20px;
	--radius-sm: 0.3rem;
	--radius-md: 0.5rem;
	--radius-lg: 0.75rem;

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

	/* Font size scale */
	--text-sm: 0.85rem;
	--text-base: 1rem;
	--text-lg: 1.1rem;
	--text-xl: 1.5rem;
	--text-2xl: 2rem;
	--text-3xl: 3rem;
}

/* ============================================
   DARK MODE COLOR OVERRIDES
   ============================================ */

@media (prefers-color-scheme: dark) {
	:root {
		/* Dark mode custom colors */
		--nord6-dark: #292c31;
		--accent-dark: #1f1f21;
		--background-dark: #21201b;
		--font-default-dark: #ffffff;

		/* Primary Color - Same but adjusted for dark backgrounds */
		--color-primary: var(--nord9);
		--color-primary-hover: var(--nord8);
		--color-primary-active: var(--nord7);

		/* Accent Color - Slightly lighter for dark mode */
		--color-accent: #d07179;
		--color-accent-hover: #e08189;
		--color-accent-active: var(--nord11);

		/* Secondary Accent */
		--color-secondary: #e09880;
		--color-secondary-hover: #f0a890;
		--color-secondary-active: var(--nord12);

		/* Background Colors */
		--color-bg-primary: var(--background-dark);
		--color-bg-secondary: var(--accent-dark);
		--color-bg-tertiary: var(--nord6-dark);
		--color-bg-elevated: var(--nord0);

		/* Surface Colors */
		--color-surface: var(--nord0);
		--color-surface-hover: var(--nord1);

		/* Text Colors */
		--color-text-primary: var(--font-default-dark);
		--color-text-secondary: var(--nord4);
		--color-text-tertiary: var(--nord5);
		--color-text-inverse: var(--nord0);
		--color-text-on-primary: white;
		--color-text-on-accent: white;
		--color-text-muted: var(--nord3);

		/* UI Element Colors */
		--color-ui-dark: var(--nord6);
		--color-ui-mid: var(--nord4);
		--color-ui-light: var(--nord3);
		--color-ui-hover: var(--nord2);

		/* Border Colors */
		--color-border: var(--nord2);
		--color-border-hover: var(--nord3);

		/* Link Colors */
		--color-link: var(--nord8);
		--color-link-visited: #c89fb6;
		--color-link-hover: var(--nord7);
	}
}

/* ============================================
   BASE STYLES
   ============================================ */

* {
	box-sizing: border-box;
	font-family: Helvetica, Arial, "Noto Sans", sans-serif;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--color-bg-primary);
	color: var(--color-text-primary);
	overflow-x: hidden;
}

/* ============================================
   LINK STYLES
   ============================================ */

a:not(:visited) {
	color: var(--color-link);
}

a:visited {
	color: var(--color-link-visited);
}

a:hover,
a:focus-visible {
	color: var(--color-link-hover);
}


/* ============================================
   GLOBAL UTILITY CLASSES
   ============================================ */

/* Pill-shaped element base */
.g-pill {
	border-radius: var(--radius-pill);
	border: none;
	cursor: pointer;
	display: inline-block;
	text-decoration: none;
	transition: var(--transition-fast);
}

/* Interactive hover/focus effects */
.g-interactive {
	transition: var(--transition-fast);
}
.g-interactive:hover,
.g-interactive:focus-visible {
	transform: scale(1.05);
	box-shadow: var(--shadow-hover);
}
.g-interactive:focus {
	scale: 0.9;
}

/* Light background button (with dark mode) */
.g-btn-light {
	background-color: var(--nord5);
	color: var(--nord0);
	box-shadow: var(--shadow-sm);
}
@media (prefers-color-scheme: dark) {
	.g-btn-light {
		background-color: var(--nord0);
		color: white;
	}
}

/* Dark background button */
.g-btn-dark,
.g-btn-dark:visited,
.g-btn-dark:link {
	background-color: var(--nord0);
	color: var(--nord6);
	box-shadow: var(--shadow-lg);
}
.g-btn-dark:hover,
.g-btn-dark:focus-visible {
	background-color: var(--nord1);
	color: var(--nord6);
}

/* Icon badge (circular icon container) */
.g-icon-badge {
	font-family: "Noto Color Emoji", "Noto Color Emoji Subset", emoji, sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	text-decoration: none;
	transition: var(--transition-fast);
	box-shadow: var(--shadow-lg);
}
.g-icon-badge:hover,
.g-icon-badge:focus-visible {
	transform: scale(1.1);
	box-shadow: var(--shadow-hover);
}

/* Tag/chip styling */
.g-tag,
.g-tag:visited,
.g-tag:link {
	padding: 0.25em 1em;
	border-radius: var(--radius-pill);
	background-color: var(--nord5);
	color: var(--nord0);
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
	box-shadow: var(--shadow-sm);
	border: none;
	display: inline-block;
}
.g-tag:hover,
.g-tag:focus-visible {
	transform: scale(1.05);
	background-color: var(--nord8);
	box-shadow: var(--shadow-hover);
	color: var(--nord0);
}
@media (prefers-color-scheme: dark) {
	.g-tag,
	.g-tag:visited,
	.g-tag:link {
		background-color: var(--nord0);
		color: white;
	}
	.g-tag:hover,
	.g-tag:focus-visible {
		background-color: var(--nord8);
		color: var(--nord0);
	}
}

/* ============================================
   RECIPE GRID
   Responsive card grid used across recipe pages
   ============================================ */

.recipe-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.5em;
	padding: 0 1.5em;
	max-width: 1400px;
	margin: 0 auto 2em;
}
@media (min-width: 600px) {
	.recipe-grid {
		grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	}
}
@media (min-width: 1024px) {
	.recipe-grid {
		grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
		gap: 1.8em;
	}
}
