/* 
Theme: Ma Lettre de Motivation
Premium Modern CSS based on "CoverCraft" concept
*/

:root {
	--primary-color: #2563eb;
	--primary-hover: #1d4ed8;
	--primary-light: #eff6ff;
	--text-main: #0f172a;      /* Slate 900 */
	--text-muted: #64748b;     /* Slate 500 */
	--bg-main: #f8fafc;        /* Slate 50 */
	--bg-card: #ffffff;
	--border-color: #e2e8f0;   /* Slate 200 */
	--radius-sm: 6px;
	--radius: 12px;
	--radius-lg: 20px;
	--shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
	--shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
	--shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
	--shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
	--font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-heading: 'Merriweather', 'Playfair Display', serif;
}

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

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-main);
	color: var(--text-main);
	background-color: var(--bg-main);
	line-height: 1.6;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--primary-color);
	text-decoration: none;
	transition: all 0.2s ease;
}

a:hover {
	color: var(--primary-hover);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: var(--radius-sm);
}

.container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
}

/* Header - Sleek & Smart */
.site-header {
	background: var(--bg-card);
	border-bottom: 1px solid var(--border-color);
	padding: 5px 0;
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 1000;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

/* Push body down due to fixed header */
body {
	padding-top: 55px;
}

.header-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.site-branding {
	display: flex;
	align-items: center;
}

.site-logo img, .custom-logo-link img {
	max-height: 45px !important;
	width: auto !important;
	display: block;
}

.site-title {
	font-family: var(--font-main);
	font-weight: 700;
	font-size: 1.5rem;
	margin: 0;
	letter-spacing: -0.5px;
}

.site-title a {
	color: var(--primary-color);
}

.site-description {
	display: none; /* Hide description in header to keep it ultra clean */
}

/* Navigation */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 32px;
	align-items: center;
}

.main-navigation a {
	color: var(--text-main);
	font-weight: 500;
	font-size: 0.95rem;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
	color: var(--primary-color);
}

/* Header Buttons */
.header-actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

.btn {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	padding: 8px 16px;
	border-radius: 8px; /* Modern slightly rounded */
	font-weight: 600;
	font-size: 0.90rem;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}

.btn-login {
	background: transparent;
	color: var(--text-main);
}
.btn-login:hover {
	color: var(--primary-color);
}

.btn-primary {
	background: var(--primary-color);
	color: white;
}
.btn-primary:hover {
	background: var(--primary-hover);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
	background: var(--text-muted);
	color: white;
}
.btn-secondary:hover {
	background: var(--text-main);
}

/* Hamburger */
.menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 10px;
}

.hamburger {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--text-main);
	position: relative;
}

.hamburger::before, .hamburger::after {
	content: '';
	position: absolute;
	width: 24px;
	height: 2px;
	background: var(--text-main);
	left: 0;
	transition: 0.2s;
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

@media (max-width: 900px) {
	.menu-toggle { display: block; }
	.main-navigation {
		display: none;
		position: absolute;
		top: 60px;
		left: 0;
		right: 0;
		background: var(--bg-card);
		box-shadow: var(--shadow-lg);
		padding: 24px;
		z-index: 1000;
	}
	.main-navigation.toggled { display: block; }
	.main-navigation ul {
		flex-direction: column;
		gap: 20px;
		align-items: flex-start;
	}
	.header-actions .btn-login { display: none; }
}

/* Hero Section */
.hero-section {
	text-align: center;
	padding: 80px 24px 70px;
	max-width: 900px;
	margin: 0 auto;
	position: relative;
}

/* Premium SaaS Glow Effect Behind Hero */
.hero-section::before {
	content: '';
	position: absolute;
	top: -50px;
	left: 50%;
	transform: translateX(-50%);
	width: 600px;
	height: 400px;
	background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, rgba(248,250,252,0) 70%);
	z-index: -1;
	pointer-events: none;
}

.hero-title {
	font-family: var(--font-heading);
	font-size: clamp(2.5rem, 5vw + 1rem, 4rem); /* Fluid scaling */
	line-height: 1.15;
	color: var(--text-main);
	margin-bottom: 24px;
	letter-spacing: -1.5px;
	animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-subtitle {
	font-size: clamp(1.1rem, 2vw + 0.5rem, 1.35rem);
	color: var(--text-muted);
	margin-bottom: 48px;
	max-width: 700px;
	margin-inline: auto;
	opacity: 0;
	animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

/* Advanced Search Bar in Hero */
.hero-search-wrapper {
	max-width: 650px;
	margin: 0 auto;
	position: relative;
	box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.05); /* Deep ultra-soft shadow */
	border-radius: 12px;
	opacity: 0;
	animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero-search-wrapper input {
	width: 100%;
	padding: 22px 30px;
	padding-right: 70px;
	border: 1px solid rgba(226, 232, 240, 0.8);
	border-radius: 12px;
	font-size: 1.15rem;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(10px);
	outline: none;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-search-wrapper input:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 4px var(--primary-light), 0 25px 30px -10px rgba(37,99,235,0.1);
	transform: translateY(-2px);
}

.hero-search-wrapper button {
	position: absolute;
	right: 10px;
	top: 10px;
	bottom: 10px;
	background: var(--primary-color);
	border: none;
	width: 54px;
	border-radius: 8px;
	color: white;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.hero-search-wrapper button:hover {
	background: var(--primary-hover);
	transform: scale(1.05);
}

/* Layout Grid with Sidebar */
.main-layout {
	display: flex;
	gap: 48px;
	padding: 40px 0 80px;
}

.layout-content {
	flex: 1;
}

.layout-sidebar {
	width: 260px;
	flex-shrink: 0;
}

@media (max-width: 1024px) {
	.main-layout {
		flex-direction: column-reverse;
	}
	.layout-sidebar {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		gap: 32px;
	}
	.sidebar-widget {
		flex: 1;
		min-width: 200px;
	}
}

/* Sidebar Widgets (Categories/Styles) */
.sidebar-widget {
	margin-bottom: 32px;
}

.sidebar-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin-bottom: 16px;
	color: var(--text-main);
	font-family: var(--font-main);
}

.sidebar-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sidebar-list li {
	margin-bottom: 12px;
}

.sidebar-list a {
	display: flex;
	align-items: center;
	color: var(--text-muted);
	font-weight: 500;
	font-size: 0.95rem;
}

.sidebar-list a:hover,
.sidebar-list a.active {
	color: var(--text-main);
}

.sidebar-list a::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #cbd5e1;
	border-radius: 5px;
	margin-right: 12px;
	background: #fff;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-list a:hover::before {
	border-color: var(--primary-color);
	transform: scale(1.05);
}

.sidebar-list a.active::before {
	background: var(--primary-color);
	border-color: var(--primary-color);
	/* Simple SVG checkmark via background-image */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
	background-size: 12px;
	background-position: center;
	background-repeat: no-repeat;
	animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Post Cards */
.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 32px;
}

.card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: 24px;
	transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	flex-direction: column;
	position: relative;
	opacity: 0;
	transform: translateY(20px);
	overflow: hidden; /* For spotlight */
}

/* Spotlight Effect */
.card::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: radial-gradient(
		600px circle at var(--mouse-x) var(--mouse-y),
		rgba(37, 99, 235, 0.04),
		transparent 40%
	);
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
	z-index: 1;
}

.card:hover::before {
	opacity: 1;
}

/* Base state for JS animation */
.card.animate-fade-up {
	opacity: 1;
	transform: translateY(0);
}

/* Fallback if JS is disabled */
.no-js .card {
	opacity: 1;
	transform: none;
}

.card:hover {
	transform: translateY(-8px);
	box-shadow: 0 25px 30px -5px rgba(15, 23, 42, 0.08), 0 10px 15px -5px rgba(15, 23, 42, 0.05); /* Premium hover shadow */
	border-color: #cbd5e1;
}

.card-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 8px;
	line-height: 1.4;
	color: var(--text-main);
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.card-title a {
	color: var(--text-main);
}
.card-title a:hover {
	color: var(--primary-color);
}

.card-rating {
	color: #eab308; /* Yellow */
	font-size: 0.9rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 4px;
}

.card-rating svg {
	width: 14px;
	height: 14px;
}

.card-desc {
	color: var(--text-muted);
	font-size: 0.9rem;
	margin-bottom: 24px;
	flex-grow: 1;
	line-height: 1.5;
}

.card-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.card-actions .btn {
	padding: 8px 0;
	font-size: 0.9rem;
}

/* Single Pages */
.single-page-wrapper {
	max-width: 800px;
	margin: 80px auto;
	background: var(--bg-card);
	border-radius: var(--radius-lg);
	padding: 48px;
	box-shadow: var(--shadow);
	border: 1px solid var(--border-color);
}

.single-header {
	text-align: center;
	margin-bottom: 48px;
}

.single-header h1 {
	font-family: var(--font-heading);
	font-size: 3rem;
	line-height: 1.2;
	margin-bottom: 16px;
	color: var(--text-main);
}

.single-meta {
	color: var(--text-muted);
	font-size: 0.95rem;
}

.single-content {
	font-size: 1.1rem;
	color: #334155;
	line-height: 1.8;
}

.single-content h2 {
	font-family: var(--font-heading);
	font-size: 2rem;
	margin-top: 2em;
	margin-bottom: 1em;
	color: #0f172a;
}

.single-content p {
	margin-bottom: 1.5em;
}

/* Footer */
.site-footer {
	background: var(--bg-card);
	border-top: 1px solid var(--border-color);
	padding: 40px 0 24px;
	margin-top: auto;
}

.footer-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.footer-nav {
	display: flex;
	gap: 24px;
	margin-bottom: 24px;
	flex-wrap: wrap;
	justify-content: center;
}

.footer-nav a {
	color: var(--text-muted);
	font-weight: 500;
	font-size: 0.95rem;
}

.footer-nav a:hover {
	color: var(--text-main);
}

.footer-social {
	display: flex;
	gap: 16px;
	margin-bottom: 24px;
}

.footer-social a {
	color: var(--text-muted);
	transition: color 0.2s;
}

.footer-social a:hover {
	color: var(--primary-color);
}

.footer-copyright {
	color: #94a3b8;
	font-size: 0.85rem;
	width: 100%;
	text-align: center;
	padding-top: 24px;
	border-top: 1px solid var(--border-color);
	display: flex;
	justify-content: space-between;
}

@media (max-width: 600px) {
	.footer-copyright {
		flex-direction: column;
		gap: 10px;
	}
	.hero-title {
		font-size: 2.5rem;
	}
}

/* Pagination */
.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 48px;
}

.page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	border-radius: 6px;
	font-weight: 600;
	color: var(--text-muted);
	background: transparent;
	border: 1px solid transparent;
	transition: all 0.2s;
}

.page-numbers:hover {
	background: #f1f5f9;
	color: var(--text-main);
}

.page-numbers.current {
	background: var(--bg-card);
	border-color: var(--border-color);
	color: var(--text-main);
	box-shadow: var(--shadow-sm);
}

/* Hide old taxonomy pills */
.category-filters {
	display: none;
}

/* =========================================
   SINGLE PAGES & COVER LETTER PREVIEWS
   ========================================= */

/* Single Blog Post */
.single-content {
	max-width: 800px;
	margin: 60px auto;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: 48px;
	box-shadow: var(--shadow-sm);
}

.single-content .entry-header {
	text-align: center;
	margin-bottom: 40px;
}

.single-content .entry-title {
	font-family: var(--font-heading);
	font-size: 2.5rem;
	line-height: 1.25;
	color: var(--text-main);
	margin-top: 10px;
}

.entry-meta {
	color: var(--text-muted);
	font-size: 0.95rem;
}

.entry-content {
	color: #334155;
	font-size: 1.1rem;
	line-height: 1.8;
}

.entry-content h2 {
	font-family: var(--font-heading);
	font-size: 1.75rem;
	color: var(--text-main);
	margin-top: 2.5em;
	margin-bottom: 1em;
}

.entry-content p {
	margin-bottom: 1.5em;
}

.post-thumbnail-single img {
	width: 100%;
	height: auto;
	border-radius: var(--radius);
	margin-bottom: 40px;
	box-shadow: var(--shadow);
}

/* Specific Cover Letter Examples Pages */
.lettre-container {
	display: flex;
	gap: 40px;
	margin: 40px 0;
	align-items: flex-start;
}

.lettre-content {
	flex: 1;
	background: #ffffff;
	padding: 60px 50px;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-hover);
	border: 1px solid #cbd5e1;
	font-family: "Times New Roman", Times, serif; /* realistic document font */
	font-size: 1.15rem;
	line-height: 1.6;
	color: #000;
	position: relative;
	background-image: linear-gradient(#fff, #fff), linear-gradient(to right, #cbd5e1 1px, transparent 1px);
	background-origin: padding-box;
	background-clip: padding-box;
}

.lettre-meta-sidebar {
	width: 320px;
	position: sticky;
	top: 120px;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: 30px;
	box-shadow: var(--shadow-sm);
}

.lettre-actions {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 30px;
}

.btn-copy { width: 100%; }
.btn-print { width: 100%; }

.lettre-advice {
	background: var(--primary-light);
	border-left: 4px solid var(--primary-color);
	padding: 24px;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	margin-top: 30px;
}

.lettre-advice h3 {
	color: var(--primary-color);
	margin-top: 0;
	margin-bottom: 12px;
	font-size: 1.1rem;
}

.lettre-advice p {
	font-size: 0.95rem;
	color: var(--text-main);
	margin: 0;
}

@media (max-width: 900px) {
	.lettre-container {
		flex-direction: column;
	}
	.lettre-meta-sidebar {
		width: 100%;
		position: static;
	}
}

/* Improved SVG Mockup background for Cards */
.card-image-wrapper {
	position: relative;
	background: #fff;
	overflow: hidden;
	border-radius: var(--radius) var(--radius) 0 0;
	margin: -24px -24px 20px -24px; /* offset the card padding */
	height: 180px; /* Fixed height for consistent cards */
}

/* Ensure real thumbnails fill the wrapper cleanly */
.card-image-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Fallback: Create a fake document look inside the grid card */
.card-image-placeholder {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
}

.card-image-placeholder::before {
	content: '';
	position: absolute;
	top: 15px; left: 15px; right: 15px; bottom: 15px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-top-width: 12px; /* Simulate document header */
	border-top-color: #cbd5e1;
	box-shadow: var(--shadow-sm);
	border-radius: 2px;
}
.card-image-placeholder::after {
	content: '';
	position: absolute;
	top: 40px; left: 30px; right: 30px;
	height: 60px;
	background: repeating-linear-gradient(
		to bottom,
		transparent,
		transparent 8px,
		#e2e8f0 8px,
		#e2e8f0 10px
	);
}

/* =========================================
   KEYFRAMES & ACCESSIBILITY & SCROLLBAR
   ========================================= */

@keyframes fadeUp {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
	0% { transform: scale(0.8); }
	50% { transform: scale(1.1); }
	100% { transform: scale(1); }
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: var(--bg-main);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Custom Text Selection */
::selection {
	background: var(--primary-color);
	color: white;
}

/* Reading Progress Bar */
.reading-progress-bar {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	background: var(--primary-color);
	z-index: 9999;
	transition: width 0.1s;
	pointer-events: none;
}

/* Custom Toast Notification */
.custom-toast {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: #0f172a;
	color: white;
	padding: 14px 24px;
	border-radius: 30px;
	box-shadow: var(--shadow-hover);
	font-weight: 500;
	z-index: 10000;
	opacity: 0;
	transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	align-items: center;
	gap: 10px;
}

.custom-toast.show {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

.custom-toast.error {
	background: #ef4444;
}

/* Accessibility Focus Outlines */
a:focus-visible, button:focus-visible, input:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.4);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}
