/* custom.css - Optimized styles for Home Education website */

/* ========== COLOR SYSTEM ========== */
:root {
	--primary-blue: #5E5BFF;
	--secondary-blue: #3A8DFF;
	--light-blue: #F0F5FF;
	--accent-blue: #4D7CFE;
	--dark-blue: #1A1F36;
	--light-gray: #F8F9FA;
	--medium-gray: #E6E9F0;
	--text-primary: #1A1F36;
	--text-secondary: #4A5568;
	--text-muted: #718096;
	--gradient-blue: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
	--gradient-subtle: linear-gradient(135deg, rgba(94, 91, 255, 0.05), rgba(58, 141, 255, 0.05));
	--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 -1px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========== BOOTSTRAP OVERRIDES ========== */
/* Primary color overrides for Bootstrap components */
.btn-primary {
	background-color: var(--primary-blue) !important;
	border-color: var(--primary-blue) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
	background-color: var(--secondary-blue) !important;
	border-color: var(--secondary-blue) !important;
}

.btn-outline-primary {
	color: var(--primary-blue) !important;
	border-color: var(--primary-blue) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
	background-color: var(--primary-blue) !important;
	border-color: var(--primary-blue) !important;
	color: white !important;
}

.badge-primary {
	background-color: var(--primary-blue) !important;
}

.bg-primary {
	background-color: var(--primary-blue) !important;
}

.text-primary {
	color: var(--primary-blue) !important;
}

.border-primary {
	border-color: var(--primary-blue) !important;
}

.display-4 {
	font-size: 3rem
}

/* ========== BASE STYLES ========== */
body {
	font-family: 'Open Sans', sans-serif;
	color: var(--text-primary);
	background-color: var(--light-gray);
	line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: 'Montserrat', sans-serif;
	font-weight: 600;
	color: var(--dark-blue);
	line-height: 1.3;
}

.badge {
	padding: .5em 1em;
	display: inline-block;
	width: auto !important;
}

/* ========== COMPONENT STYLES ========== */

/* Navigation */
.navbar {
	background-color: white;
	box-shadow: var(--shadow-sm);
	padding: 15px;
	transition: all 0.3s ease;
}

.logo-container {
	display: flex;
	align-items: center;
}

.logo-box {
	width: 50px;
	height: 50px;
	background: var(--gradient-blue);
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 800;
	font-size: 24px;
	margin-right: 12px;
	box-shadow: var(--shadow-md);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.logo-box::before {
	content: "";
	position: absolute;
	top: -8px;
	left: -8px;
	width: 16px;
	height: 16px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
}

.logo-box::after {
	content: "";
	position: absolute;
	bottom: -12px;
	right: -12px;
	width: 24px;
	height: 24px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 50%;
}

.logo-box:hover {
	transform: rotate(5deg) scale(1.05);
	box-shadow: var(--shadow-lg);
}

.logo-text {
	display: flex;
	flex-direction: column;
}

.logo-text h2 {
	font-size: 24px;
	font-weight: 800;
	margin-bottom: 0;
	line-height: 1.1;
	color: var(--dark-blue);
	letter-spacing: -0.5px;
}

.logo-text .subtitle {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	margin-top: -2px;
	color: var(--text-muted);
}

/* Hero Section */
.hero-section {
	background: linear-gradient(rgba(26, 31, 54, 0.85), rgba(58, 141, 255, 0.8)), url('images/page-header.jpeg');
	background-size: cover;
	background-position: center;
	color: white;
	padding: 120px 0;
	position: relative;
}

.hero-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--gradient-blue);
	opacity: 0.1;
	z-index: 1;
}

.hero-section>.container {
	position: relative;
	z-index: 2;
}

.hero-section h1 {
	color: #fff;
	font-weight: 600;
}

/* Section Titles */
.section-title {
	position: relative;
	margin-bottom: 40px;
	padding-bottom: 15px;
	color: var(--dark-blue);
}

.section-title:after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 60px;
	height: 4px;
	background: var(--accent-blue);
	border-radius: 2px;
}

/* Cards */
.card {
	border: none;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--shadow-md);
	margin-bottom: 30px;
	transition: all 0.3s ease;
	background: white;
}

.card:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-xl);
}

.card-img-top {
	height: 200px;
	object-fit: cover;
}

.card-title {
	color: var(--primary-blue);
	font-weight: 600;
	margin-bottom: 12px;
}

.btn-primary {
	background-color: var(--primary-blue);
	border-color: var(--primary-blue);
	border-radius: 8px;
	padding: 10px 24px;
	font-weight: 600;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
	background-color: var(--secondary-blue);
	border-color: var(--secondary-blue);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

/* Feature Boxes */
.feature-box {
	text-align: center;
	padding: 32px 24px;
	border-radius: 12px;
	background: white;
	box-shadow: var(--shadow-md);
	margin-bottom: 30px;
	transition: all 0.3s ease;
	height: 100%;
	border: 1px solid var(--medium-gray);
}

.feature-box:hover {
	transform: translateY(-8px);
	box-shadow: var(--shadow-xl);
	border-color: var(--primary-blue);
}

.feature-icon {
	width: 70px;
	height: 70px;
	background: var(--light-blue);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
	color: var(--primary-blue);
	font-size: 28px;
	transition: all 0.3s ease;
}

.feature-box:hover .feature-icon {
	background: var(--gradient-blue);
	color: white;
	transform: scale(1.1);
}

/* Testimonials */
.testimonial {
	background: var(--light-blue);
	padding: 32px;
	border-radius: 12px;
	margin-bottom: 30px;
	border-left: 4px solid var(--accent-blue);
}

.testimonial img {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 20px;
	border: 3px solid white;
	box-shadow: var(--shadow-sm);
}

/* Newsletter */
.newsletter {
	background: var(--gradient-blue);
	color: white;
	padding: 80px 0;
	margin-top: 30px;
	margin-bottom: 0;
	position: relative;
	overflow: hidden;
}

.newsletter::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
	background-size: cover;
}

.newsletter>.container {
	position: relative;
	z-index: 2;
}

.newsletter h2 {
	color: #fff;
}

/* Footer */
footer {
	background: var(--dark-blue);
	color: white;
	padding: 80px 0 30px;
}

.footer-title {
	position: relative;
	padding-bottom: 15px;
	margin-bottom: 20px;
	color: white;
}

.footer-title:after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 40px;
	height: 3px;
	background: var(--accent-blue);
	border-radius: 2px;
}

.social-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	color: white;
	margin-right: 10px;
	transition: all 0.3s ease;
}

.social-links a:hover {
	background: var(--accent-blue);
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.copyright {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding-top: 24px;
	margin-top: 60px;
	text-align: center;
	font-size: 14px;
	opacity: 0.7;
}

/* ========== IMAGE SCALING SYSTEM ========== */
.photo-scale {
	position: relative;
	width: 100%;
	background-color: var(--light-gray);
	overflow: hidden;
	border-radius: 8px;
}

.photo-scale>img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0px;
	display: block;
	transition: transform 0.3s ease;
}

.photo-2inch::before {
	content: "";
	display: block;
	padding-top: 140%;
}

.photo-16x9::before {
	content: "";
	display: block;
	padding-top: 56.25%;
}

.photo-square::before {
	content: "";
	display: block;
	padding-top: 100%;
}

/* ========== ARTICLE PAGES ========== */

/* Page Header */
.page-header {
	background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), url('images/page-header.jpeg');
	background-size: cover;
	background-position: center;
	color: white;
	padding: 100px 0;
	margin-bottom: 20px;
	text-align: center;
	position: relative;
}

.page-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--gradient-blue);
	opacity: 0.3;
	z-index: 1;
}

.page-header>.container {
	position: relative;
	z-index: 2;
}

.page-header h1 {
	color: #fff;
	font-weight: 600;
}

/* Article Card Styles */
.article-card {
	border: none;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--shadow-md);
	margin-bottom: 30px;
	transition: all 0.3s ease;
	background: white;
	display: flex;
	flex-direction: column;
}

.article-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-xl);
}

.article-card .photo-scale {
	border-radius: 12px 12px 0 0;
}

.article-card .card-body {
	padding: 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.article-card .card-title {
	color: var(--dark-blue);
	font-weight: 600;
	margin-bottom: 12px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.article-card .card-text {
	color: var(--text-secondary);
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 16px;
}

.article-meta {
	color: var(--text-muted);
	font-size: 14px;
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center
}

.article-meta i {
	margin-right: 4px;
	opacity: 0.7;
}

/* Horizontal Article Card */
.article-card-horizontal {
	flex-direction: row;
	height: auto;
}

.article-card-horizontal .photo-scale {
	width: 40%;
	border-radius: 12px 0 0 12px;
}

.article-card-horizontal .card-body {
	width: 60%;
}

/* Fix for badges in horizontal cards */
.article-card-horizontal .badge {
	width: auto !important;
	display: inline-block !important;
	align-self: flex-start !important;
	flex: none !important;
}

.article-card-horizontal .article-meta {
	justify-content: flex-start
}

/* Article Detail Page */
.article-header {
	margin-bottom: 40px;
}

.article-title {
	color: var(--dark-blue);
	margin-bottom: 20px;
	line-height: 1.3;
}

.article-featured-image {
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 30px;
	box-shadow: var(--shadow-md);
}

.article-featured-image .photo-scale {
	border-radius: 12px;
}

/* ========== ARTICLE CONTENT STYLES ========== */
.article-content {
	line-height: 1.8;
	font-size: 16px;
	color: var(--text-primary);
}

/* Headings in article content */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
	color: var(--dark-blue);
	margin: 40px 0 20px 0;
	font-weight: 600;
}

.article-content h1 {
	font-size: 2rem;
	border-bottom: 2px solid var(--light-blue);
	padding-bottom: 10px;
}

.article-content h2 {
	font-size: 1.75rem;
	border-bottom: 1px solid var(--light-blue);
	padding-bottom: 8px;
}

.article-content h3 {
	font-size: 1.5rem;
}

.article-content h4 {
	font-size: 1.25rem;
}

.article-content h5 {
	font-size: 1.1rem;
}

/* Paragraphs */
.article-content p {
	margin-bottom: 20px;
	text-align: justify;
}

/* Lists */
.article-content ul,
.article-content ol {
	margin-bottom: 20px;
	padding-left: 24px;
}

.article-content li {
	margin-bottom: 8px;
}

.article-content ul li {
	list-style-type: disc;
}

.article-content ol li {
	list-style-type: decimal;
}

/* Links */
.article-content a {
	color: var(--primary-blue);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: all 0.2s ease;
}

.article-content a:hover {
	color: var(--secondary-blue);
	border-bottom: 1px solid var(--secondary-blue);
}

/* Blockquotes */
.article-content blockquote {
	border-left: 4px solid var(--accent-blue);
	padding: 20px 20px 20px 30px;
	margin: 30px 0;
	background-color: var(--light-blue);
	border-radius: 0 8px 8px 0;
	font-style: italic;
	position: relative;
}

.article-content blockquote:before {
	content: '"';
	font-size: 3rem;
	color: var(--accent-blue);
	position: absolute;
	left: 10px;
	top: 10px;
	opacity: 0.3;
	line-height: 1;
}

.article-content blockquote p {
	margin-bottom: 0;
}

/* Tables */
.article-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 25px 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

.article-content table th,
.article-content table td {
	padding: 12px 15px;
	text-align: left;
	border-bottom: 1px solid var(--medium-gray);
}

.article-content table th {
	background-color: var(--light-blue);
	color: var(--dark-blue);
	font-weight: 600;
}

.article-content table tr:last-child td {
	border-bottom: none;
}

.article-content table tr:hover {
	background-color: rgba(240, 245, 255, 0.5);
}

/* Code and pre */
.article-content code {
	background-color: var(--light-gray);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
	color: var(--primary-blue);
}

.article-content pre {
	background-color: var(--dark-blue);
	color: white;
	padding: 20px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 20px 0;
	box-shadow: var(--shadow-md);
}

.article-content pre code {
	background-color: transparent;
	color: inherit;
	padding: 0;
}

/* Images in content */
.article-content img {
	max-width: 100%;
	height: 100%;
	border-radius: 8px;
	margin: 20px 0;
	box-shadow: var(--shadow-md);
}

.article-content img.alignleft {
	float: left;
	margin-right: 20px;
	margin-bottom: 20px;
}

.article-content img.alignright {
	float: right;
	margin-left: 20px;
	margin-bottom: 20px;
}

.article-content img.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* Text formatting */
.article-content strong,
.article-content b {
	font-weight: 700;
	color: var(--dark-blue);
}

.article-content em,
.article-content i {
	font-style: italic;
}

.article-content u {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.article-content del {
	text-decoration: line-through;
	color: var(--text-muted);
}

.article-content mark {
	background-color: #FFEB3B;
	padding: 2px 4px;
	border-radius: 2px;
}

/* Horizontal rule */
.article-content hr {
	border: 0;
	height: 1px;
	background: var(--medium-gray);
	margin: 40px 0;
}

/* Definition lists */
.article-content dl {
	margin: 20px 0;
}

.article-content dt {
	font-weight: 600;
	color: var(--dark-blue);
	margin-top: 15px;
}

.article-content dd {
	margin-left: 20px;
	margin-bottom: 10px;
	color: var(--text-secondary);
}

/* Pagination */
.pagination {
	justify-content: center;
	margin-top: 60px;
}

.page-link {
	color: var(--primary-blue);
	border: 1px solid var(--medium-gray);
	padding: 10px 18px;
	border-radius: 8px;
	margin: 0 4px;
	transition: all 0.3s ease;
}

.page-link:hover {
	color: white;
	background-color: var(--primary-blue);
	border-color: var(--primary-blue);
	transform: translateY(-2px);
	box-shadow: var(--shadow-sm);
}

.page-item.active .page-link {
	background-color: var(--primary-blue);
	border-color: var(--primary-blue);
	box-shadow: var(--shadow-sm);
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
	.hero-section {
		padding: 80px 0;
	}

	.hero-section h1 {
		font-size: 1.875rem;
	}

	.page-header {
		padding: 80px 0;
	}

	.page-header h1 {
		font-size: 1.5rem;
	}

	.article-featured-image .photo-16x9::before {
		padding-top: 75%;
	}

	.logo-text h2 {
		font-size: 20px;
	}

	.article-card-horizontal {
		flex-direction: column;
	}

	.article-card-horizontal .photo-scale,
	.article-card-horizontal .card-body {
		width: 100%;
	}

	.article-card-horizontal .photo-scale {
		border-radius: 12px 12px 0 0;
	}

	.article-meta {
		font-size: 12px;
	}

	/* Responsive tables */
	.article-content table {
		display: block;
		overflow-x: auto;
	}
}

@media (max-width: 576px) {
	.hero-section {
		padding: 60px 0;
	}

	.page-header {
		padding: 60px 0;
	}

	.feature-box,
	.testimonial {
		padding: 24px 16px;
	}

	.newsletter {
		padding: 60px 0;
	}

	.article-content {
		font-size: 15px;
	}

	.article-content h1 {
		font-size: 1.75rem;
	}

	.article-content h2 {
		font-size: 1.5rem;
	}

	.article-content h3 {
		font-size: 1.25rem;
	}
}