/* --- General Setup & Variables --- */
:root {
	--primary-color: #a10000;
	--primary-hover: rgb(226, 9, 9);
	--secondary-color: #f4f4f4;
	--text-color: #333;
	--text-light: #fff;
	--border-color: #ddd;
	--tamil-font: 'Latha', 'Catamaran', sans-serif;
	--english-font: 'Catamaran', sans-serif;
	--border-radius: 8px;
	--box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

body {
	font-family: var(--english-font);
	color: var(--text-color);
	line-height: 1.6;
	margin: 0;
	background-color: var(--text-light);
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* --- Typography --- */
h1 {
	font-size: 2.5rem;
	margin-bottom: 1rem;
}

h2 {
	font-size: 2rem;
	margin-bottom: 1rem;
}

h3 {
	font-size: 1.5rem;
	margin-bottom: 0.5rem;
}

h1,
h2,
h3 {
	font-family: var(--tamil-font);
	font-weight: 700;
	line-height: 130%;
}

p {
	font-size: 1.2rem;
	text-align: justify;
	-webkit-hyphens: auto;
	-ms-hyphens: auto;
	hyphens: auto;
}

.subtitle {
	font-size: 1.2rem;
	margin-top: 0;
	padding-top: 0;
}

/* --- Header & Navigation --- */
.navbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 2.5rem;
	background-color: var(--text-light);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.nav-links {
	list-style: none;
	display: flex;
	gap: 2rem;
	margin: 0;
	padding: 0;
	font-size: 1.3rem;
}

.nav-links a {
	text-decoration: none;
	color: var(--text-color);
	font-weight: bold;
	transition: color 0.3s ease;
}

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

.hamburger {
	display: none;
	flex-direction: column;
	justify-content: space-around;
	width: 30px;
	height: 25px;
	cursor: pointer;
	z-index: 1002;
}

.hamburger span {
	height: 4px;
	width: 100%;
	background: var(--primary-color);
	border-radius: 3px;
	transition: all 0.3s ease-in-out;
}

/* --- Main Page Sections --- */
.full-width-banner {
	position: relative;
	padding: 6rem 2rem;
	color: var(--text-light);
	background-color: var(--primary-color);
	/* background-image: url('../images/learn-tamil-main-banner.jpg'); */
	background-size: cover;
	background-position: center;
}

.full-width-banner::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(245, 161, 16, 0);
}

.full-width-banner .banner-content h1,
.full-width-banner .banner-content p {
	color: #ffffff;
}

.full-width-banner .cta-button {
	background-color: #ffffff;
	color: var(--primary-color);
	font-weight: bold;
}

.banner-content {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	margin: 0 auto;
	text-align: center;
}

.banner-content h1 {
	font-size: 3rem;
	margin-top: 0;
	margin-bottom: 0;
	line-height: 120%;
	/* color: var(--primary-color); */
}

.banner-content p {
	font-size: 1.4rem;
	margin: 0 auto 1rem;
	text-align: center;
	line-height: 140%;
	/* color: #333; */
}

.hero {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 0;
}

.hero-text {
	flex: 1;
	text-align: center;
	max-width: 900px;
}

.language-intro {
	padding: 2rem 1rem;
	text-align: justify;
	line-height: 1.8;
	max-width: 900px;
}

.language-intro h2 {
	text-align: center;
	margin-bottom: 1.5rem;
	font-size: 2rem;
	color: var(--text-color);
}

.learning-path {
	text-align: center;
	padding: 3rem 2rem;
	background-color: var(--secondary-color);
	border-radius: var(--border-radius);
	margin-top: 2rem;
}

.path-container {
	display: flex;
	justify-content: space-around;
	gap: 1.5rem;
	margin-top: 2rem;
	flex-wrap: wrap;
}

.path-step {
	background: var(--text-light);
	padding: 2rem;
	border-radius: var(--border-radius);
	width: 30%;
	min-width: 280px;
	box-shadow: var(--box-shadow);
	display: flex;
	flex-direction: column;
}

.path-step p {
	text-align: justify;
	-webkit-hyphens: auto;
	-ms-hyphens: auto;
	hyphens: auto;
	flex-grow: 1;
}

.path-icon {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: var(--primary-color);
	color: var(--text-light);
	font-size: 1.5rem;
	line-height: 50px;
	margin: 0 auto 1rem;
}

.path-step .cta-button {
	margin: auto;
	width: 8rem;
}

/* --- Search Bar --- */
.search-section {
	background-color: #f0f0f0;
	padding: 3rem 1rem;
}

.search-wrapper {
	max-width: 700px;
	margin: 0 auto;
	display: flex;
	background-color: #fff;
	border-radius: 50px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	border: 1px solid #ddd;
}

#searchInput {
	flex-grow: 1;
	border: none;
	background: transparent;
	padding: 1rem 1.5rem;
	font-size: 1.1rem;
	outline: none;
	width: 100%;
}

#searchButton {
	border: none;
	background-color: var(--primary-color);
	color: white;
	padding: 0 1.5rem;
	border-radius: 0 50px 50px 0;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

#searchButton:hover {
	background-color: var(--primary-hover);
}

#searchButton svg {
	width: 24px;
	height: 24px;
	fill: white;
}

.search-results-container {
	max-width: 700px;
	margin: 2rem auto 0 auto;
}

.result-item {
	background-color: #fff;
	padding: 1.5rem;
	border-radius: var(--border-radius);
	margin-bottom: 1rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.result-item h3 {
	margin-top: 0;
}

.result-item h3 a {
	text-decoration: none;
	color: var(--primary-color);
}

.result-item p {
	margin-bottom: 0;
	color: #555;
}

.result-item mark {
	background-color: #ffc107;
	padding: 2px;
	border-radius: 3px;
}

/* --- Full-Width Hero Banner (for inner pages) --- */
.page-hero-banner {
	width: 100%;
	padding: 4rem 2rem;
	background-color: #a10000;
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	min-height: 250px;
	box-sizing: border-box;
}

.page-hero-banner h1 {
	margin: 0;
	font-size: 3rem;
	text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.page-hero-banner p {
	margin-top: 0.5rem;
	font-size: 1.2rem;
	text-align: center;
}

/* --- Buttons --- */
.cta-button {
	display: inline-block;
	padding: 12px 25px;
	border-radius: var(--border-radius);
	text-decoration: none;
	font-weight: bold;
	cursor: pointer;
	border: none;
	transition: background-color 0.3s ease, transform 0.2s ease;
	background-color: var(--primary-color);
	color: var(--text-light);
}

.cta-button:hover {
	background-color: var(--primary-hover);
	transform: translateY(-2px);
}

/* ----------- Blog snippets ----- */
#blog-snippets {
	margin: 1rem auto 3rem;
	max-width: 95%;
	padding: 12px;
	font-family: sans-serif;
}

#blog-snippets h2 {
	margin: 2rem auto;
	text-align: center;
}

.article-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 50px;
}

.article-snippet {
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	transition: transform 0.2s;
	position: relative;
}

.article-snippet:hover {
	transform: translateY(-5px);
}

.snippet-thumbnail img {
	width: 100%;
	height: auto;
	display: block;
}

.snippet-content {
	padding: 15px;
	padding-bottom: 5rem;
}

.snippet-content h3 {
	margin: 0 0 10px;
	font-size: 1.25em;
}

.snippet-content p {
	margin: 0;
	font-size: 0.9em;
	color: #555;
}

.read-now-btn {
	position: absolute;
	width: 40%;
	margin: 0 auto;
	bottom: 1rem;
	left: 15px;
	right: 15px;
	display: inline-block;
	background-color: var(--primary-color);
	color: #ffffff;
	padding: 12px 16px;
	border-radius: 5px;
	text-decoration: none;
	font-weight: bold;
	text-align: center;
	transition: background-color 0.2s;
}

.read-now-btn:hover {
	background-color: var(--primary-hover);
}

h4 {
	color: red;
}

/* --- Footer --- */
footer {
	background-color: var(--text-color);
	color: var(--text-light);
	text-align: center;
	padding: 2rem 1rem;
	margin-top: 40px;
}

.footer-links {
	margin-bottom: 1rem;
}

.footer-links a {
	color: var(--text-light);
	text-decoration: none;
	margin: 0 10px;
}

.footer-links a:hover {
	text-decoration: underline;
}

.social-media img {
	width: 24px;
	margin: 0 10px;
}

/* --- Responsive Design --- */
@media (max-width: 1120px) {
	.navbar {
		padding: 1.5rem;
	}

	/* Mobile Nav */
	.hamburger {
		display: flex;
	}

	.nav-links {
		position: fixed;
		top: 0;
		right: 0;
		height: 100vh;
		width: 100%;
		background-color: rgba(255, 255, 255, 0.9);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 1.2rem;
		transform: translateX(100%);
		transition: transform 0.4s ease-in-out;
		z-index: 1001;
	}

	.nav-links.active {
		transform: translateX(0);
	}

	.nav-links li {
		opacity: 0;
		transform: translateX(20px);
		transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
	}

	.nav-links.active li {
		opacity: 1;
		transform: translateX(0);
	}

	.nav-links.active li:nth-child(1) {
		transition-delay: 0.2s;
	}

	.nav-links.active li:nth-child(2) {
		transition-delay: 0.3s;
	}

	.nav-links.active li:nth-child(3) {
		transition-delay: 0.4s;
	}

	.nav-links.active li:nth-child(4) {
		transition-delay: 0.5s;
	}

	.nav-links.active li:nth-child(5) {
		transition-delay: 0.6s;
	}

	.nav-links a {
		font-size: 1.5rem;
	}

	.hamburger.active span:nth-child(1) {
		transform: translateY(8px) rotate(45deg);
	}

	.hamburger.active span:nth-child(2) {
		opacity: 0;
	}

	.hamburger.active span:nth-child(3) {
		transform: translateY(-13px) rotate(-45deg);
	}
}

@media (max-width: 992px) {
	.path-step {
		width: 45%;
		/* Two columns on tablets */
		margin-bottom: 1.5rem;
	}
}

@media (max-width: 768px) {

	/* Typography */
	h1,
	.banner-content h1 {
		font-size: 2rem;
	}

	h1,
	.banner-content p {
		font-size: 0.9rem;
	}

	p {
		font-size: 1rem;
		text-align: left;
	}

	/* Layout */
	.container {
		max-width: 95%;
		padding: 15px;
	}

	.hero {
		flex-direction: column;
		text-align: center;
	}

	.path-container {
		flex-direction: column;
		align-items: center;
	}

	.path-step {
		width: 100%;
		margin-bottom: 1rem;
	}

	/* Banners */
	.full-width-banner {
		background-image: none;
		background-color: var(--primary-color);
		padding: 4rem 1rem;
		min-height: auto;
	}

	.full-width-banner .banner-content h1,
	.full-width-banner .banner-content p {
		color: #ffffff;
	}

	.full-width-banner .cta-button {
		background-color: #ffffff;
		color: var(--primary-color);
		font-weight: bold;
	}

	.banner-content h1 {
		font-size: 1.8rem;
		margin-bottom: 0.3rem;
	}

	.banner-content p {
		font-size: 1.1rem;
	}

	/* Search Bar */
	.search-wrapper {
		border-radius: 30px;
	}

	#searchInput {
		padding: 0.8rem 1rem;
		font-size: 1rem;
	}

	#searchButton {
		padding: 0 1rem;
	}

	#searchButton svg {
		width: 20px;
		height: 20px;
	}

	/* Blog snippets */
	.article-grid {
		grid-template-columns: 1fr;
	}
}

/* --- Translation Section --- */
.translation-section {
	margin-top: 3rem;
	margin-bottom: 2rem;
}

.translation-card {
	background: rgba(255, 255, 255, 0.6);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: var(--border-radius);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
	padding: 2.5rem;
	max-width: 900px;
	margin: 0 auto;
	transition: transform 0.3s ease;
}

.translation-card:hover {
	transform: translateY(-3px);
}

.translation-header {
	text-align: center;
	margin-bottom: 2rem;
}

.translation-header h2 {
	margin-top: 0;
	color: var(--primary-color);
}

.translation-input-box {
	display: flex;
	gap: 15px;
	margin-bottom: 1.5rem;
}

.translation-input-box input[type="text"] {
	flex-grow: 1;
	padding: 1rem 1.5rem;
	border: 2px solid #eaeaea;
	border-radius: 50px;
	font-size: 1.1rem;
	outline: none;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	background: rgba(255, 255, 255, 0.9);
}

.translation-input-box input[type="text"]:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 10px rgba(161, 0, 0, 0.1);
}

.translation-input-box button {
	padding: 0 2rem;
	border-radius: 50px;
	background-color: var(--primary-color);
	color: white;
	border: none;
	font-weight: bold;
	font-size: 1.1rem;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.2s ease;
}

.translation-input-box button:hover {
	background-color: var(--primary-hover);
	transform: scale(1.05);
}

#trans-error-msg {
	color: #d9534f;
	margin-bottom: 1.5rem;
	font-weight: bold;
	display: none;
	text-align: center;
}

.translation-results {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	opacity: 0.5;
	/* visually distinct when inactive */
	transition: opacity 0.4s ease;
}

.translation-results.show-results {
	opacity: 1;
}

.result-box {
	background: #fff;
	padding: 1.5rem;
	border-radius: var(--border-radius);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
	border: 2px solid #eaeaea;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
	text-align: left;
}

.result-box::before {
	content: '';
	position: absolute;
	top: -50px;
	right: -30px;
	width: 100px;
	height: 100px;
	background: var(--primary-color);
	border-radius: 50%;
	opacity: 0.05;
	z-index: 0;
}

.result-box h3 {
	font-size: 1.3rem;
	margin-top: 0;
	color: #555;
	z-index: 1;
	border-bottom: 1px solid #eee;
	padding-bottom: 0.5rem;
	margin-bottom: 1rem;
}

.tamil-output {
	font-size: 1.3rem;
	color: var(--primary-color);
	text-align: left;
	font-weight: bold;
	font-family: var(--tamil-font);
	margin: 0 0 0.5rem 0;
	z-index: 1;
}

.tamil-translit {
	font-size: 1rem;
	color: #666;
	margin: 0;
	font-style: italic;
	z-index: 1;
}

@media (max-width: 768px) {
	.translation-results {
		grid-template-columns: 1fr;
	}

	.translation-input-box {
		flex-direction: column;
	}

	.translation-input-box input[type="text"],
	.translation-input-box button {
		width: 100%;
		border-radius: 10px;
	}

	.translation-input-box button {
		padding: 1rem;
	}
}