/*
	castesan.github.io — custom styles on top of Strata (HTML5 UP, CC BY 3.0).
	Loaded after main.css: everything here overrides the template.
	Fonts: Inter (body) and Playfair Display (section titles), from Google Fonts.
	To change colours, edit the variables in :root only.
*/

:root {
	--primary: #2c3e50;        /* headings and strong text */
	--accent: #3498db;         /* links, company names, card borders */
	--accent-hover: #e74c3c;   /* card border on hover */
	--text: #2c3e50;
	--text-muted: #7f8c8d;
	--card-border: #e1e8ed;
	--gradient-a: #667eea;     /* header tint, pills, active tab */
	--gradient-b: #764ba2;
	--gradient: linear-gradient(135deg, var(--gradient-a) 0%, var(--gradient-b) 100%);
	--shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Base typography: Inter everywhere, slightly more compact than the template */
body, input, select, textarea, button {
	font-family: 'Inter', Helvetica, sans-serif;
}

body, input, select, textarea {
	font-size: 12pt;
	line-height: 1.5em;
	color: var(--text);
}

html {
	scroll-behavior: smooth;
}

/* ---------- Header (left column on desktop, top band on mobile) ---------- */

/* The photo in images/bg.jpg shows through a translucent violet gradient.
   With the neutral placeholder the header looks like a plain gradient. */
#header {
	background-color: var(--gradient-b);
	background-image:
		linear-gradient(135deg, rgba(102, 126, 234, 0.88) 0%, rgba(118, 75, 162, 0.88) 100%),
		url('../../images/bg.jpg');
	background-position: center center, center center;
	background-repeat: no-repeat, no-repeat;
	background-size: cover, cover;
	padding: 4em 2.5em;
}

#header > .inner {
	margin: 0 0 1.5em 0;
}

#header h1 {
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.15;
	color: #fff;
	letter-spacing: -0.5px;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
	margin: 0 0 0.5em 0;
}

#header .subtitle {
	font-size: 0.75rem;
	font-weight: 400;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.85);
	margin: 0.3rem 0;
}

#header h2 {
	color: #fff;
	font-size: 1.1rem;
	margin: 0 0 0.6em 0;
}

#header p {
	color: rgba(255, 255, 255, 0.9);
	line-height: 1.5;
	margin: 0 0 1em 0;
}

#header .image.avatar img {
	/* Any photo becomes a centred circle, square or not */
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border: 4px solid rgba(255, 255, 255, 0.35);
	box-shadow: var(--shadow);
	transition: transform 0.3s ease;
}

#header .image.avatar img:hover {
	transform: scale(1.05);
}

/* CV download buttons under the headline */
#header .actions {
	margin: 1.2em 0 0 0;
	justify-content: flex-end;
}

#header .actions .button {
	background-color: rgba(255, 255, 255, 0.18);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
	color: #fff !important;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	height: 2.6em;
	line-height: 2.6em;
	padding: 0 1.2em;
}

#header .actions .button:before {
	color: #fff !important;
}

#header .actions .button:hover {
	background-color: rgba(255, 255, 255, 0.32);
}

/* ---------- Footer (inside the header on desktop, at the bottom on mobile) ---------- */

#footer .icons {
	margin: 1rem 0;
}

#footer .icons li {
	margin: 0.2rem;
}

#footer .icons li a {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	width: 45px;
	height: 45px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

#footer .icons li a:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: translateY(-3px) scale(1.1);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#footer .copyright {
	font-size: 0.7rem;
	margin: 1rem 0 0 0;
	color: rgba(255, 255, 255, 0.75);
}

#footer .copyright a {
	color: rgba(255, 255, 255, 0.9);
}

/* On phones and tablets the template moves the footer to the bottom of the page
   and gives it its own background; tint it like the header. */
@media screen and (max-width: 980px) {
	#footer {
		background-color: var(--gradient-b);
		background-image:
			linear-gradient(135deg, rgba(102, 126, 234, 0.88) 0%, rgba(118, 75, 162, 0.88) 100%),
			url('../../images/bg.jpg');
		background-position: center center, bottom center;
		background-size: cover, cover;
	}
}

/* ---------- Main column ---------- */

#main {
	padding: 3em 2.5em 1.5em 2.5em;
}

#main section h2,
#main .tab-content h2 {
	font-family: 'Playfair Display', Georgia, serif;
	color: var(--primary);
	font-size: 1.8rem;
	font-weight: 600;
	margin-bottom: 1.3rem;
	padding-bottom: 0.7rem;
	position: relative;
}

#main .tab-content h2::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 60px;
	height: 3px;
	background: var(--gradient);
	border-radius: 2px;
}

#main p {
	line-height: 1.5;
	margin: 0 0 1em 0;
}

#main a {
	color: var(--accent);
}

/* Tabs */
.tab-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	background: #fff;
	border-radius: 15px;
	box-shadow: var(--shadow);
	padding: 0.5rem;
	margin-bottom: 2rem;
}

.tab-button {
	flex: 1 1 auto;
	padding: 0.8rem 1rem;
	background: transparent;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-muted);
	text-align: center;
	white-space: nowrap;
	transition: all 0.3s ease;
}

.tab-button:hover {
	background: rgba(52, 152, 219, 0.1);
	color: var(--accent);
	transform: translateY(-2px);
}

.tab-button.active {
	background: var(--gradient);
	color: #fff;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
	transform: translateY(-2px);
}

.tab-content {
	display: none;
}

.tab-content.active {
	display: block;
	animation: fadeIn 0.4s ease-in-out;
}

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

/* Cards: one per job, degree, project, course… */
.card {
	background: #fff;
	padding: 1.5rem;
	border-radius: 15px;
	margin: 1.5rem 0;
	border: 1px solid var(--card-border);
	border-left: 5px solid var(--accent);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
}

.card:hover {
	border-left-color: var(--accent-hover);
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card.compact {
	padding: 1rem 1.5rem;
	margin: 0.8rem 0;
}

.card h4 {
	color: var(--primary);
	font-weight: 600;
	font-size: 1.1rem;
	line-height: 1.3;
	margin: 0 0 0.5rem 0;
}

.card h4 a {
	color: var(--primary);
	text-decoration: none;
}

.card h4 a:hover {
	color: var(--accent);
}

.card .meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.card .meta:last-child {
	margin-bottom: 0;
}

.card .org {
	color: var(--accent);
	font-weight: 500;
	font-size: 0.95rem;
}

.card .period {
	background: var(--gradient);
	color: #fff;
	padding: 0.3rem 0.8rem;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 500;
	white-space: nowrap;
}

.card ul {
	margin: 0;
	padding-left: 1.2rem;
}

.card li {
	margin: 0.5rem 0;
	line-height: 1.6;
}

.card p {
	margin: 0;
}

.card p + p {
	margin-top: 0.6rem;
}

/* Publications: group titles, reference line, co-author cards in a second colour */
#main .tab-content h3 {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 2rem 0 0.5rem 0;
}

.card .ref {
	font-size: 0.9rem;
	color: var(--text-muted);
}

.card .ref a {
	color: var(--text-muted);
	text-decoration: none;
	border-bottom: 1px dotted var(--text-muted);
}

.card .ref a:hover {
	color: var(--accent);
}

.card.coauthor {
	border-left-color: var(--gradient-b);
}

.card.coauthor .org {
	color: var(--gradient-b);
}

.card .links {
	margin-top: 0.8rem;
	font-size: 0.9rem;
}

.card .links a {
	text-decoration: none;
	font-weight: 500;
}

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

/* ---------- Responsive ---------- */

@media screen and (max-width: 1680px) {
	body, input, select, textarea { font-size: 11.5pt; }
}

@media screen and (max-width: 1280px) {
	body, input, select, textarea { font-size: 11pt; }
	#main { padding: 2.5em 2em 1em 2em; }
}

@media screen and (max-width: 980px) {
	/* Header becomes a centred band on top; template already does the layout */
	#header { padding: 3em 2em; }
	#header .actions { justify-content: center; }
}

@media screen and (max-width: 768px) {
	.tab-nav { flex-direction: column; gap: 0.5rem; }
	.tab-button { min-width: auto; flex: none; }
	.card .meta { flex-direction: column; align-items: flex-start; }
	.card .period { align-self: flex-start; }
}

@media screen and (max-width: 600px) {
	.tab-button { font-size: 0.75rem; padding: 0.6rem 0.8rem; }
	#main { padding: 2em 1.2em 1em 1.2em; }
}
