/* ==========================================================================
   ScholarPortal — main.css
   Mobile-first. No framework (no Bootstrap/Tailwind) to keep payload small.
   ========================================================================== */

:root {
	--red: #E63946;
	--blue: #1D3557;
	--blue-soft: rgba(29, 53, 87, 0.08);
	--white: #FFFFFF;
	--radius: 8px;
	--container: 1200px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	color: var(--blue);
	background: var(--white);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }

.sp-container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 20px;
}
.sp-container--narrow { max-width: 760px; }

/* ---------- Header ---------- */
.sp-header {
	border-bottom: 1px solid var(--blue-soft);
	position: sticky;
	top: 0;
	background: var(--white);
	z-index: 50;
}
.sp-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 14px;
	padding-bottom: 14px;
	flex-wrap: wrap;
}
.sp-logo {
	display: flex;
	flex-direction: column;
	font-weight: 800;
	font-size: 1.25rem;
	line-height: 1.2;
	color: var(--blue);
}
.sp-logo__text { letter-spacing: 0.2px; }
.sp-logo__accent { color: var(--red); }
.sp-logo__underline {
	display: block;
	width: 60px;
	height: 5px;
	margin-top: 5px;
	background: repeating-linear-gradient(90deg, var(--blue) 0 8px, var(--red) 8px 16px);
}
.sp-logo--footer { color: var(--white); margin-bottom: 10px; }
.sp-logo--footer .sp-logo__underline {
	background: repeating-linear-gradient(90deg, #ffffff 0 8px, var(--red) 8px 16px);
}
.sp-nav-toggle {
	display: flex;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
}
.sp-nav-toggle__bar {
	width: 22px;
	height: 2px;
	background: var(--blue);
}
.sp-nav {
	display: none;
	width: 100%;
	order: 3;
	margin-top: 14px;
}
.sp-nav.is-open { display: block; }
.sp-nav__list {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.sp-nav__list a { font-weight: 600; }
.sp-search { display: flex; }
.sp-search input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid var(--blue-soft);
	border-radius: 20px;
	font-size: 0.9rem;
}

/* ---------- Hero ---------- */
.sp-hero {
	background: var(--blue);
	color: var(--white);
	padding: 40px 0;
}
.sp-hero__title { font-size: 1.8rem; color: var(--white); }
.sp-hero__subtitle { opacity: 0.85; margin-bottom: 20px; }
.sp-hero__search {
	display: flex;
	background: var(--white);
	border-radius: 24px;
	padding: 6px;
	gap: 6px;
	max-width: 520px;
}
.sp-hero__search input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 10px 14px;
	font-size: 0.9rem;
	color: var(--blue);
	outline: none;
}
.sp-hero__search button {
	background: var(--red);
	color: var(--white);
	border: none;
	border-radius: 18px;
	padding: 10px 20px;
	font-weight: 700;
	cursor: pointer;
}
.sp-hero__stats {
	display: flex;
	gap: 24px;
	margin-top: 24px;
	flex-wrap: wrap;
}
.sp-hero__stats strong { display: block; font-size: 1.3rem; }
.sp-hero__stats span { font-size: 0.8rem; opacity: 0.8; }

/* ---------- Scholarship filter/sort bar ---------- */
.sp-filter-bar {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	background: var(--blue-soft);
	padding: 18px;
	border-radius: var(--radius);
	margin-bottom: 24px;
}
.sp-filter-field label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.sp-filter-field select {
	width: 100%;
	padding: 10px 12px;
	border-radius: 6px;
	border: 1.5px solid rgba(29,53,87,0.25);
	background: var(--white);
	color: var(--blue);
	font-size: 0.85rem;
}
.sp-filter-actions { display: flex; align-items: center; gap: 16px; }
.sp-filter-clear { font-size: 0.82rem; font-weight: 700; color: var(--red); }

@media (min-width: 640px) {
	.sp-filter-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Section headers ---------- */
.sp-section { padding: 40px 0; }
.sp-section--alt { background: #fafbfc; }
.sp-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-left: 4px solid var(--red);
	padding-left: 12px;
	margin-bottom: 24px;
}
.sp-section__head--blue { border-left-color: var(--blue); }
.sp-section__head h2 { font-size: 1.3rem; }
.sp-section__head--red h2 { color: var(--red); }
.sp-section__head--blue h2 { color: var(--blue); }
.sp-section__head a { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }

/* ---------- Grids ---------- */
.sp-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

/* ---------- Cards ---------- */
.sp-card {
	background: var(--white);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.sp-card--scholarship {
	border: 1.5px solid var(--red);
	padding: 18px;
	position: relative;
}
.sp-card--scholarship::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 4px;
	background: var(--red);
}
.sp-tag {
	display: inline-block;
	background: var(--red);
	color: var(--white);
	font-size: 0.7rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 12px;
	width: fit-content;
	/* spacing between this and sibling badges is handled by the
	   parent .sp-card__badges flex gap, not a margin here, so it
	   doesn't double up when badges are stacked. */
}
.sp-card__title { font-size: 1.05rem; margin-bottom: 8px; }
.sp-card__title a { color: var(--blue); }
.sp-card__excerpt { font-size: 0.88rem; opacity: 0.75; margin-bottom: 10px; }
.sp-card__deadline { font-size: 0.8rem; font-weight: 700; color: var(--red); margin-bottom: 12px; }
.sp-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sp-read-more { font-size: 0.82rem; font-weight: 700; color: var(--blue); display: inline-block; margin-top: 4px; }

/* Category/taxonomy badge — visually distinct (outline) from the solid sp-tag status badge */
.sp-cat-badge {
	display: inline-block;
	background: transparent;
	color: var(--blue);
	font-size: 0.7rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 12px;
	border: 1.5px solid var(--blue);
}
.sp-cat-badge:hover { background: var(--blue); color: var(--white); }
.sp-cat-badge--on-image {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--white);
	border-color: var(--white);
}

/* Pills used on taxonomy/category archive pages and the "Browse Categories" hub */
.sp-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.sp-pill {
	display: inline-block;
	background: var(--blue-soft);
	color: var(--blue);
	font-size: 0.85rem;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: 20px;
}
.sp-pill:hover { background: var(--blue); color: var(--white); }
.sp-browse-heading { font-size: 1rem; margin-bottom: 12px; }
.sp-browse-all { margin-top: 30px; font-size: 0.88rem; font-weight: 600; }
.sp-grid--with-margin { margin-top: 24px; }

/* Category hub page (Browse Categories template) */
.sp-cat-hub-heading { font-size: 1.1rem; margin-top: 36px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--blue-soft); }
.sp-cat-hub-heading:first-of-type { margin-top: 0; }
.sp-cat-hub-heading--red { color: var(--red); }
.sp-cat-hub-heading--blue { color: var(--blue); }

.sp-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 20px;
	font-weight: 700;
	font-size: 0.85rem;
	text-align: center;
	cursor: pointer;
	border: none;
}
.sp-btn--dark { background: var(--blue); color: var(--white); align-self: flex-start; }
.sp-btn--red { background: var(--red); color: var(--white); }
.sp-btn--large { padding: 14px 28px; font-size: 0.95rem; margin-top: 20px; }

.sp-card--article { border: 1px solid var(--blue-soft); }
.sp-card__thumb { background: var(--blue); aspect-ratio: 16/9; display: block; position: relative; }
.sp-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-card__thumb-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--blue), #2a4a7a); }
.sp-card__body { padding: 16px; }
.sp-eyebrow { font-size: 0.75rem; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Single scholarship ---------- */
.sp-single-scholarship { padding: 30px 0 60px; }
.sp-single-scholarship__meta {
	display: flex;
	gap: 24px;
	margin: 16px 0 24px;
	flex-wrap: wrap;
}
.sp-single-scholarship__meta div { background: var(--blue-soft); padding: 10px 16px; border-radius: var(--radius); }
.sp-single-scholarship__meta strong { display: block; font-size: 0.7rem; text-transform: uppercase; opacity: 0.6; }

/* ---------- Article ---------- */
.sp-article { padding: 30px 0 60px; }
.sp-article__thumb { margin: 20px 0; border-radius: var(--radius); overflow: hidden; }
.sp-article__content { font-size: 1.02rem; }
.sp-article__content h2 { margin-top: 1.6em; color: var(--blue); }

/* ---------- Page header (About/Contact/Disclaimer/Privacy/Terms/Categories/Archive) ---------- */
.sp-page-header { background: var(--blue-soft); padding: 32px 0; margin-bottom: 10px; }
.sp-page-header h1 { margin-bottom: 6px; }
.sp-page-header p { opacity: 0.75; margin: 0; }

/* ---------- Notices ---------- */
.sp-notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; font-size: 0.9rem; }
.sp-notice--success { background: #e6f6ea; color: #1e6b3a; border: 1px solid #b7e4c3; }
.sp-notice--error { background: #fdeaec; color: var(--red); border: 1px solid #f6c1c6; }
.sp-notice--info { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(29,53,87,0.15); }

/* ---------- Contact form ---------- */
.sp-contact-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.sp-field label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.sp-field input, .sp-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--blue-soft);
	border-radius: var(--radius);
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--blue);
}
.sp-field input:focus, .sp-field textarea:focus { outline: none; border-color: var(--blue); }
.sp-hp-field { position: absolute; left: -9999px; opacity: 0; }
.sp-contact-alt { font-size: 0.88rem; opacity: 0.75; }

/* ---------- Legal pages (Disclaimer / Privacy Policy / Terms / Cookie Policy) ---------- */
.sp-legal h2 { color: var(--blue); margin-top: 1.8em; }
.sp-cookie-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.88rem; }
.sp-cookie-table th, .sp-cookie-table td { border: 1px solid var(--blue-soft); padding: 10px 12px; text-align: left; vertical-align: top; }
.sp-cookie-table th { background: var(--blue-soft); color: var(--blue); }
.sp-legal hr { border: none; border-top: 1px solid var(--blue-soft); margin: 40px 0; }

/* ---------- Footer ---------- */
.sp-footer { background: var(--blue); color: var(--white); margin-top: 40px; padding: 0 20px; }
.sp-footer__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 30px;
	padding: 40px 0 20px;
	align-items: start;
	max-width: var(--container);
	margin: 0 auto;
}
.sp-footer__col { min-width: 0; }
.sp-footer h4 { color: var(--white); font-size: 0.95rem; }
.sp-footer p, .sp-footer a { color: rgba(255,255,255,0.75); font-size: 0.88rem; }
.sp-footer__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sp-newsletter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sp-newsletter input { flex: 1 1 160px; min-width: 0; padding: 10px 14px; border-radius: 18px; border: none; font-size: 0.85rem; }
.sp-newsletter button { flex: 0 0 auto; background: var(--red); color: var(--white); border: none; border-radius: 18px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.sp-footer__bottom {
	border-top: 1px solid rgba(255,255,255,0.15);
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 12px 0;
	align-items: flex-start;
}
.sp-footer__copy { font-size: 0.78rem; opacity: 0.7; margin: 0; }
.sp-footer__legal { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.sp-footer__legal a { font-size: 0.78rem; text-decoration: underline; white-space: nowrap; }

@media (min-width: 700px) {
	.sp-footer__bottom { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 0; gap: 0; }
	.sp-footer__legal { gap: 4px 16px; }
}

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 700px) {
	.sp-grid--scholarships { grid-template-columns: repeat(2, 1fr); }
	.sp-grid--articles { grid-template-columns: repeat(2, 1fr); }
	.sp-footer__inner { grid-template-columns: 2fr 1fr 1.4fr; }
}

@media (min-width: 960px) {
	.sp-nav-toggle { display: none; }
	.sp-nav {
		display: flex !important;
		align-items: center;
		gap: 28px;
		width: auto;
		order: 2;
		margin-top: 0;
	}
	.sp-nav__list { flex-direction: row; margin: 0; gap: 22px; }
	.sp-search { width: 240px; }
	.sp-hero__title { font-size: 2.4rem; }
	.sp-grid--scholarships { grid-template-columns: repeat(4, 1fr); }
	.sp-grid--articles { grid-template-columns: repeat(3, 1fr); }
	.sp-filter-bar { grid-template-columns: repeat(5, 1fr) auto; align-items: end; }
}
