/* universal selector */
* {
	margin: 0;
	padding: 0;
	font-family: "Merriweather", serif;
	/* outline: 1px solid rgba(255, 0, 0, 0.2); */
}

/* Base (Desktop-first approach) */
h1 {
	font-size: clamp(2.5rem, 5vw, 4rem);	/* 40px to 64px */ /* clamp(min, preferred, max) for responsive typography */
	line-height: 1.2;
}

h2 {
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);	/* ~28px to 40px */
	line-height: 1.3;
}

h3 {
	font-size: clamp(1.5rem, 3vw, 2rem);	/* 24px to 32px */
	line-height: 1.3;
}

p, li, span {
	font-size: clamp(1rem, 1.5vw, 1.2rem);	/* 16px to 19.2px */
	line-height: 1.6;
}

/* Extra-large screens */
@media (min-width: 1600px) {
	h1 { font-size: 4.5rem; }	/* ~72px */
	h2 { font-size: 3rem; }		/* ~48px */
	h3 { font-size: 2.5rem; }	/* ~40px */
}

/* Small screens (extra safety) */
@media (max-width: 480px) {
	h1 { font-size: 2rem; }		/* ~32px */
	h2 { font-size: 1.5rem; }	/* ~24px */
	h3 { font-size: 1.25rem; }	/* ~20px */
}

/* ===============================
	NAVIGATION BAR
================================ */
.navbar {
	display: flex;
	padding: 1.5% 6% 1.2%;
	justify-content: space-between;
	align-items: center;
	background-color: white;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	z-index: 100;
}

.navbar img {
	width: clamp(120px, 12vw, 220px);
	height: auto; /* keeps the logo ratio */
	vertical-align: middle;
}

.navbar nav {
	margin-left: auto; /* pushes nav to the right */
	display: flex;
	align-items: center;
}

/* ---------- MENU TABS ---------- */
.horizontal-tabs {
	display: flex;
	gap: clamp(2rem, 5vw, 5rem);
}

.horizontal-tabs li:not(.has-submenu)::after { /* to create line under tab when hovered over, except tabs that have sub tabs */
	content: ''; 
	width: 0%;
	height: 3px;
	background: #3498DB;
	display: block;
	margin: auto;
	transition: 0.5s;
}

.horizontal-tabs li:not(.has-submenu):hover::after { /* to create line under tab when hovered over, except tabs that have sub tabs */
	width: 100%;
}

.horizontal-tabs li {
	list-style: none; /* removes bullet points */
}

.horizontal-tabs a { /* removes link style for tabs */
	text-decoration: none;
	color: #000;
	font-weight: bold;
	transition: 0.5s;
	white-space: nowrap;
}

.horizontal-tabs a:hover {
	color: #3498DB;
}

/* ---------- MENU SUB TABS ---------- */
.has-submenu {
	position: relative; /* ensures submenu is positioned relative to the parent */
}

.has-submenu:hover .submenu { /* when "What We Do" is hovered over, the submenu expands */
	transform: translateX(-50%) scaleY(1);
	opacity: 1; /* for smooth fade in */
	visibility: visible; /* ensure submenu is clickable and interactable */
}

.submenu {
	position: absolute;
	z-index: 100;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) scaleY(0); /* starts slightly above and collapsed vertically */
	transform-origin: top; /* ensures scaleY expands downward from top */
	text-align: center;
	padding: 2rem 1rem;
	border-radius: 5px;
	background: linear-gradient(135deg, #3498DB, #5dade2);
	width: clamp(8.5rem, 12.5vw, 14rem);
	box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
	opacity: 0;
	visibility: hidden;
	transition: 0.4s;
}

.submenu a {
	display: inline-block;
	color: #fff;
}

.submenu a + a {
	margin-top: 1.5rem;	/* extra spacing only between links, not before the first one */
}

/* for line to appear when hovered over a sub tab page */
.submenu a::after {
	content: ''; 
	width: 0%;
	height: 2px;
	background: #fff;
	display: block;
	margin: auto;
	transition: 0.5s;
}

.submenu a:hover::after {
	width: 100%;
}

.submenu a:hover { 
	color: #fff; /* by default, the text changes to blue when hovered */
}

/* ---------- DONATION BUTTON ---------- */
.donate-button {
	position: relative;
	margin: 0.5rem clamp(2rem, 4vw, 5rem);;
	z-index: 150;
	text-decoration: none;
}

/* ---------- LANGUAGE SETTINGS BUTTON ---------- */
.language-button {
	background-color: transparent;
	text-decoration: underline;
	color: #000;
	cursor: pointer;
	border: 0px;
	transition: 0.5s;
	font-size: clamp(0.85rem, 1vw, 1rem);
}

.language-button:hover {
	color: #3498DB;
}

.language-dropdown {
	position: relative;
	display: inline-block;
}

.language-dropdown .language-list {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-20px);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.3s ease, opacity 0.3s ease;
	background-color: rgba(255, 255, 255, 0.95);
	min-width: 100px;
	border: 1px solid #ccc;
	border-radius: 5px;
	z-index: 200;
	text-align: center;
	margin-top: 1rem;
}

/* to show dropdown when active */
.language-dropdown .language-list.show {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
	pointer-events: auto;
}

/* for each item/link of list */
.language-dropdown .language-list a {
	display: block;
	padding: 12px 12px;
	text-decoration: none;
	color: #000;
}

.language-dropdown .language-list a:hover {
	background-color: #eee;
	transition: 0.7s;
}

/* --------------------------------
	MOBILE VER MENU
---------------------------------- */
.navbar .menu-button {
	color: #000;
	cursor: pointer;
	display: none;
	font-size: 1.7rem;
	margin: 0.7rem 0;
}

.menu-button i {
	transition: transform 0.3s ease;
	color: #000;
}

.menu-button i.fa-xmark {
	transform: rotate(90deg);
}

.off-canvas-menu {
	display: none;
	position: absolute;
	right: 2rem;
	top: 6rem;
	max-height: 0;
	width: 300px;
	background-color: rgb(255, 255, 255);
	backdrop-filter: blur(15px);
	border-radius: 10px;
	overflow: hidden;
	transition: 0.5s;
	z-index: 500;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* soft shadow */
}

.off-canvas-menu.open {
	max-height: 800px;
}

.vertical-tabs { 
	margin-top: 3rem;
}

.vertical-tabs li { /* all menu pages */
	padding: 1rem;
	display: flex;
	margin-left: 2.5rem;
}

.vertical-tabs a {
	text-decoration: none;
	color: #000;
	font-weight: bold;
	transition: 0.5s;
	white-space: nowrap;
}

.vertical-tabs a:hover {
	color: #3498DB;
}

/* ---------- MENU SUB TABS UNDER "WHAT WE DO" ---------- */
.has-submenu-mobile { /* "What We Do" */
	position: relative;
	display: flex;
	align-items: center;
	cursor: pointer;
	flex-wrap: wrap; /* allows submenu to appear below */
}

.has-submenu-mobile i { /* down arrow */
	font-size: 0.8rem;
	margin-left: 1rem;
	color: #000;
	transition: transform 0.3s ease;
}

.has-submenu-mobile.active i {
	transform: rotate(180deg);
}

.submenu-mobile { /* "Mission Work" and "Teaching" */
	width: 100%; /* full width below parent */
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s ease;
}

.has-submenu-mobile.active .submenu-mobile { /* drop down when "What We Do" is clicked on */
	max-height: 500px; /* enough to show all links */
}

.submenu-mobile li {
	margin: 0;
	padding: 1.5rem 0 0 2.5rem; 
}

.submenu-mobile a {
	font-weight: normal;
	font-style: italic;
	letter-spacing: 0.15px;
}

.off-canvas-menu .donate-button {
	width: 100%;
	display: flex;
	justify-content: center;
	margin: 3rem 0;
	padding-left: 0;
	border-radius: 0;
}

.off-canvas-menu .language-list {
	display: flex;
	justify-content: center;
	gap: 1rem;
	width: 100%;
	margin: 2rem 0 2rem;
}

.off-canvas-menu .language-list a {
	color: #000;
	text-decoration: none;
}

.off-canvas-menu .language-list a.active {
	text-decoration: underline;
	font-weight: bold;
	color: #000;
}

/* ---------- ACTIVATING SMALLER MENU ---------- */
@media(max-width: 800px) {
	.navbar .horizontal-tabs, .navbar .donate-button, .language-dropdown {
		display: none;
	}

	.navbar .menu-button {
		display: block;
	}

	.off-canvas-menu {
		display: block;
		/* to make the menu take up the entire screen width on mobile */
		left: 2rem;
		width: unset;
	}
}

/* ===============================
	FOOTER
=============================== */
footer {
	width: 100%;
	text-align: left;
	background: linear-gradient(135deg, #5dade2, #3498DB);
}

footer .footer-container {
	width: 90%;
	margin: auto;
	align-items: center;
	padding: 5rem 0;
}

.footer-col {
	padding: 0 1rem;
}

.footer-col:first-child {
	flex: 4; /* take up 40% of row */
}

.footer-col:last-child {
	flex: 6; /* take up 60% of row */
}

.footer-col .donate-button {
	background-color: #fff;
	color: #3498DB;
	display: block;
	margin: 3rem 0;
}

.footer-col img {
	width: clamp(200px, 30vw, 350px);
	height: auto;
	display: block;
	padding: 1rem 0;
}

.footer-col .row {
	justify-content: flex-start; /* aligns them to the left, no stretching */
	align-items: center;	/* vertically centers them */
}

.footer-col .row .separator {
	width: 3px;
	height: 5rem;
	background-color: #fff;
	border-radius: 5px;
	align-self: center;
	margin: 0 4rem;
}

.footer-icons {
	display: flex;
	gap: 2rem;
	color: #fff;
	cursor: pointer;
	padding: 1rem 0;
	font-size: 3.5rem;
}

.footer-icons a {
	text-decoration: none;
	color: inherit;
	transition: transform 0.2s ease;
}

.footer-icons .fa-youtube:hover {
	transform: scale(1.05);
}

.footer-icons .fa-instagram:hover {
	transform: scale(1.05);
}

.footer-icons .fa-youtube:active { /* when the button is pressed on */
	transform: scale(0.95);
}

.footer-icons .fa-instagram:active { /* when the button is pressed on */
	transform: scale(0.95);
}

.footer-col span {
	color: #fff;
}

.footer-col .language-list {
	display: flex;
	gap: 1rem;
	width: 100%;
	padding: 1rem 0;
}

.footer-col .language-list a {
	color: #fff;
	text-decoration: none;
}

.footer-col .language-list a.active {
	text-decoration: underline;
	font-weight: bold;
}

/* --------------------------------
	ADJUSTING FOR SMALLER SCREENS
---------------------------------- */
@media(max-width: 800px) { /* mainly to center everything on mobile ver */
	footer {
		text-align: center;
	}

	footer .footer-container {
		align-items: center;
		justify-content: center;
		padding: 3rem 0;
	}

	.footer-col {
		flex-basis: 100%;
		padding: 0.5rem 0;
		text-align: center;
	}

	.footer-col .row {
		gap: 0;
		margin-bottom: 2rem;
	}

	.footer-col .row .separator {
		display: none;
	}

	.footer-col img,
	.footer-col .donate-button {
		margin-left: auto;
		margin-right: auto;
	}

	.footer-icons {
		justify-content: center;
	}
}

/* ===============================
	FOR ROWS
================================ */
.row {
	display: flex; /* makes each item sit side by side instead of being vert stacked */
	justify-content: space-between; /* makes first item to far left and last to far right in flex container and others to be evenly spaced between */
}

@media(max-width: 800px) {
	.row {
		flex-direction: column; /* makes columns stacked vertically when screen is smaller */
	}
}

/* ===============================
	BASIC BUTTONS
================================ */
.button {
	background-color: #3498DB;
	color: #fff;
	border: none;
	outline: none;
	border-radius: 5px;
	font-weight: bold;
	cursor: pointer;
	transition: transform 0.2s ease, color 0.2s ease;
	padding: 1rem 2.5rem;
	font-size: clamp(0.9rem, 1vw, 1.2rem);
}

.button:hover {
	transform: scale(1.05);
}

.button:active { /* when the button is pressed on */
	transform: scale(0.95);
}

/* ===============================
	CAROUSEL
=============================== */
.carousel-container {
	position: relative; /* to help position arrow buttons that has a position: absolute */
	padding: 0 2rem;
	overflow: hidden; /* to hide anthing that spills outside the container */
}

/* actual carousel */
.carousel {
	width: 100%;
	display: grid;
	grid-auto-flow: column;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none; /* For Firefox */
	gap: 1rem; /* between each card */
}

.carousel::-webkit-scrollbar { /* For WebKit browsers (Chrome, Safari, Edge) */
	display: none;
}

.card {
	display: flex;
	align-items: stretch;
	justify-content: flex-start; 	/* to align images properly at the top */
	scroll-snap-align: start; 		/* remove if you dont want it to snap */
	height: auto;
	flex-direction: column;
	border: 1px solid rgba(0, 0, 0, 0.05); /* very faint border */
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* soft shadow */
	border-radius: 5px;
}

.card img {
	width: 100%;
	object-fit: cover;
	border-radius: 5px;
}

.carousel-pagination { /* handles placement of dots to be placed under carousel */
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 2rem;
}

.carousel-dot {
	width: 10px;
	height: 10px;
	background-color: #ccc;
	border-radius: 50%;
	transition: background-color 0.3s;
}

.carousel-dot.active {
	background-color: #3498DB;
}

/* --------------------------------
	SLIDING BEHAVIOR
---------------------------------- */
.carousel.dragging {
	scroll-snap-type: none;
	scroll-behavior: auto;
}

.carousel.dragging .card {
	cursor: grab;
	user-select: none;
}

/* --------------------------------
	L & R ARROW ICONS
---------------------------------- */
.carousel-container i {
	position: absolute; /* will place arrows relative to .carousel-container only if it is position: relative */
	top: 50%;
	transform: translateY(-50%);
	font-size: 2rem;
	cursor: pointer;
	transition: transform 0.2s ease;
	z-index: 100;
}

/* targets first and last <i> elements and positions them on the opposite sides */
.carousel-container i:first-child {
	left: 0; 
}

.carousel-container i:last-child {
	right: 0;
}

.carousel-container i:hover { /* to have arrow icons grow a little when hovered over */
	transform: translateY(-50%) scale(1.2);    /* makes it 20% bigger */
}

.carousel-container i:active { /* when the button is pressed on */
	transform: translateY(-50%) scale(0.95);
}

/* ===============================
	IMAGE POPUPS
================================ */
#popup { /* hidden by default */
	display: none; /* hidden by default */
	position: fixed;
	top: 0; 
	left: 0;
	width: 100%; 
	height: 100%;
	background: rgba(0,0,0,0.9);
	align-items: center;
	justify-content: center;
	gap: 2rem;
	z-index: 9999;
}

.popup-content { /* the image */
	max-width: 90%;
	max-height: 80%;
	border-radius: 5px;
}

.close-btn { /* close button */
	position: absolute;
	top: 30px; 
	right: 40px;
	font-size: 2.5rem;
	color: white;
	cursor: pointer;
}

.arrow-btn {
	font-size: 3rem;
	color: white;
	cursor: pointer;
}
