/*
 * GV Theme component styles. Design tokens come from theme.json
 * (--wp--preset--color--*, --wp--preset--font-size--*, --wp--preset--spacing--*).
 * Keep this lean — no framework, good Core Web Vitals on shared hosting.
 */

:root {
	--gv-radius: 10px;
	--gv-border: 1px solid #e3e6ea;
	--gv-shadow: 0 1px 2px rgba(20, 23, 26, .06), 0 4px 16px rgba(20, 23, 26, .05);
}

/* Slim brand bar across the very top of every page. */
body {
	border-top: 4px solid transparent;
	border-image: linear-gradient(90deg,
		var(--wp--preset--color--primary),
		var(--wp--preset--color--secondary) 55%,
		var(--wp--preset--color--accent)) 1;
}

/* ---- Header / nav ---- */
.gv-header .wp-block-navigation { gap: 1.5rem; font-weight: 500; }
.gv-header .wp-block-navigation a { text-decoration: none; }
.gv-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent); }

/* ---- Generic section rhythm ---- */
.gv-section { padding-block: clamp(2rem, 1.4rem + 2.6vw, 3.75rem); }
.gv-section:nth-of-type(even) { background: var(--wp--preset--color--surface); }
.gv-section-inner {
	max-width: var(--wp--style--global--wide-size, 1140px);
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-right, 1.25rem);
}
.gv-section-title { font-size: var(--wp--preset--font-size--x-large); margin: 0 0 1.5rem; }
/* Short accent underline under section titles for a pop of colour. */
.gv-section-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin-top: .6rem;
	border-radius: 2px;
	background: var(--wp--preset--color--accent);
}
.gv-section-more { margin-top: 1.25rem; }
.gv-section-more a { font-weight: 600; text-decoration: none; }
.gv-section-more a:hover { color: var(--wp--preset--color--accent); }

/* ---- Homepage two-column (main content + news sidebar) ---- */
.gv-home-grid {
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin-inline: auto;
	padding: clamp(1.5rem, 1rem + 2vw, 3rem) var(--wp--style--root--padding-right, 1.25rem);
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: clamp(1.5rem, 1rem + 2vw, 3rem);
	align-items: start;
}
/* Inside the main column, sections are plain (no full-width band). */
.gv-home-main .gv-section { padding-block: 0 2.25rem; background: none; }
.gv-home-main .gv-section:last-child { padding-bottom: 0; }
.gv-home-main .gv-section-inner { max-width: none; margin: 0; padding-inline: 0; }

.gv-home-aside { position: sticky; top: 1.5rem; }
@media (max-width: 900px) {
	.gv-home-grid { grid-template-columns: 1fr; }
	.gv-home-aside { position: static; }
}

/* News feed */
.gv-news {
	background: var(--wp--preset--color--surface);
	border: var(--gv-border);
	border-radius: var(--gv-radius);
	padding: 1.1rem 1.25rem 1.25rem;
}
.gv-news-heading {
	font-size: var(--wp--preset--font-size--large);
	margin: 0 0 .75rem;
	padding-bottom: .4rem;
	border-bottom: 2px solid var(--wp--preset--color--primary);
}
.gv-news-list { list-style: none; margin: 0; padding: 0; }
/* Bold date on the left, sentence (with inline links) on the right. */
.gv-news-item {
	display: flex;
	gap: .55rem;
	padding: .5rem 0;
	font-size: .92rem;
	line-height: 1.5;
}
.gv-news-date { flex: 0 0 auto; font-weight: 700; color: var(--wp--preset--color--primary); white-space: nowrap; }
.gv-news-body { flex: 1 1 auto; }
.gv-news-body p { margin: 0 0 .4rem; }
.gv-news-body p:last-child { margin-bottom: 0; }
.gv-news-body a:hover { color: var(--wp--preset--color--accent); }
.gv-news-empty { color: var(--wp--preset--color--muted); font-size: .9rem; margin: 0; }
.gv-news-more { margin: .9rem 0 0; }
.gv-news-more a { font-weight: 600; text-decoration: none; font-size: .9rem; }
.gv-news-more a:hover { color: var(--wp--preset--color--accent); }
/* Full /news/ page list: a little more room per entry. */
.gv-news-list--full .gv-news-item { padding: .7rem 0; font-size: 1rem; gap: 1rem; }

/* ---- Hero ---- */
/* Full-width tinted band so the intro reads as a distinct header area. */
.gv-hero {
	text-align: left;
	background:
		radial-gradient(1200px 400px at 15% -10%, rgba(58, 124, 165, .10), transparent 60%),
		linear-gradient(180deg, var(--wp--preset--color--surface), var(--wp--preset--color--base));
	border-bottom: 1px solid #e7ebef;
}
.gv-hero h1 { margin-bottom: .25rem; }
.gv-hero-sub { color: var(--wp--preset--color--primary); font-weight: 600; margin-top: 0; }
.gv-hero-intro { max-width: 62ch; font-size: 1.05rem; }
.gv-hero-buttons { margin-top: 1.5rem; }

/* Two-column hero: portrait beside text, stacking on narrow screens.
   With no portrait, the text simply fills the row. */
.gv-hero-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: clamp(1.5rem, 1rem + 3vw, 3rem);
}
.gv-hero-text { flex: 1 1 360px; }
.gv-hero-text > :first-child { margin-top: 0; }
.gv-portrait {
	flex: 0 0 auto;
	width: clamp(160px, 14vw, 240px);
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 16px;
	box-shadow: var(--gv-shadow);
}

/* ---- Card grid (projects) ---- */
.gv-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}
.gv-card {
	border: var(--gv-border);
	border-radius: var(--gv-radius);
	overflow: hidden;
	background: var(--wp--preset--color--base);
	box-shadow: var(--gv-shadow);
	display: flex;
	flex-direction: column;
}
.gv-card-imglink { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.gv-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Themed placeholder shown until a project has a featured image. */
.gv-card-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, hsl(var(--gv-h, 210) 42% 40%), hsl(calc(var(--gv-h, 210) + 28) 48% 28%));
}
.gv-card-ph-mono {
	font-family: var(--wp--preset--font-family--serif, Georgia, serif);
	font-size: 2.25rem;
	font-weight: 700;
	letter-spacing: .06em;
	color: rgba(255, 255, 255, .9);
}
.gv-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.gv-card-title { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: normal; line-height: 1.35; }
.gv-card-title a { text-decoration: none; }
.gv-card-title a:hover { text-decoration: underline; }
.gv-card-summary { margin: 0; color: var(--wp--preset--color--muted); font-size: .95rem; }

/* ---- Research theme cards ---- */
.gv-theme-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}
.gv-theme-card {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	padding: 1rem 1.1rem;
	border: var(--gv-border);
	border-top: 3px solid var(--wp--preset--color--secondary);
	border-radius: var(--gv-radius);
	text-decoration: none;
	color: inherit;
	background: var(--wp--preset--color--base);
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.gv-theme-card:hover {
	border-top-color: var(--wp--preset--color--accent);
	transform: translateY(-2px);
	box-shadow: var(--gv-shadow);
}
.gv-theme-name { font-weight: 700; color: var(--wp--preset--color--primary); }
.gv-theme-desc { color: var(--wp--preset--color--muted); font-size: .9rem; }

/* ---- Publication list ---- */
.gv-pub-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.gv-pub-item {
	padding: .9rem 0;
	border-bottom: var(--gv-border);
	display: flex;
	flex-direction: column;
	gap: .15rem;
}
.gv-pub-item:last-child { border-bottom: 0; }
.gv-pub-title { font-weight: 600; text-decoration: none; }
.gv-pub-title:hover { text-decoration: underline; }
.gv-pub-meta { font-size: .92rem; }
.gv-pub-sub { font-size: .88rem; color: var(--wp--preset--color--muted); }
.gv-year {
	font-size: var(--wp--preset--font-size--large);
	margin: 1.75rem 0 .25rem;
	padding-bottom: .25rem;
	border-bottom: 2px solid var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

/* ---- Single publication / project ---- */
.gv-pub-single, .gv-project-single { max-width: var(--wp--style--global--content-size, 720px); }
.gv-pub-authors { font-size: 1.05rem; margin: .25rem 0; }
.gv-pub-venue { color: var(--wp--preset--color--muted); margin: 0 0 1rem; }
.gv-pub-abstract { line-height: 1.7; }
.gv-pub-citation { background: var(--wp--preset--color--surface); padding: 1rem; border-radius: var(--gv-radius); }
.gv-h { font-size: var(--wp--preset--font-size--large); margin: 1.75rem 0 .5rem; }
.gv-bibtex summary { cursor: pointer; font-weight: 600; color: var(--wp--preset--color--primary); }
.gv-bibtex pre {
	background: var(--wp--preset--color--contrast);
	color: #f4f5f7;
	padding: 1rem;
	border-radius: var(--gv-radius);
	overflow-x: auto;
	font-size: .85rem;
	white-space: pre;
}
.gv-lead { font-size: 1.1rem; line-height: 1.6; }
.gv-project-hero img { border-radius: var(--gv-radius); width: 100%; }
.gv-related { margin: .25rem 0 1rem 1.1rem; }
.gv-collaborators { list-style: none; margin: .25rem 0 1rem; padding: 0; }
.gv-collaborators li { padding: .3rem 0; border-bottom: 1px solid #eef0f2; }
.gv-collaborators li:last-child { border-bottom: 0; }
.gv-collab-aff { color: var(--wp--preset--color--muted); font-size: .9rem; }
.gv-collab-aff::before { content: "— "; }
.gv-backlink { margin-top: 2.5rem; }
.gv-backlink a { text-decoration: none; font-weight: 600; }

/* ---- Resource link buttons ---- */
.gv-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.gv-link-btn {
	display: inline-block;
	padding: .35rem .8rem;
	border: 1px solid var(--wp--preset--color--primary);
	border-radius: 999px;
	font-size: .85rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--primary);
}
.gv-link-btn:hover { background: var(--wp--preset--color--primary); color: #fff; }

/* ---- Pills, badges, status ---- */
.gv-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.gv-pill {
	font-size: .78rem;
	padding: .15rem .65rem;
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}
.gv-pill:hover { color: var(--wp--preset--color--primary); }
.gv-badge {
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--wp--preset--color--accent);
}
.gv-status {
	display: inline-block;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	padding: .15rem .6rem;
	border-radius: 999px;
	color: #fff;
	width: fit-content;
}
.gv-status--current { background: #1f7a4d; }
.gv-status--completed, .gv-status--archived { background: var(--wp--preset--color--muted); }
.gv-status--on_hold { background: var(--wp--preset--color--accent); }
.gv-project-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.gv-dates { color: var(--wp--preset--color--muted); font-weight: 600; }

/* ---- Filter bar (no-JS) ---- */
.gv-filterbar { display: flex; gap: .5rem; margin: 1rem 0; flex-wrap: wrap; }
.gv-filterbar input[type="search"] {
	flex: 1 1 240px;
	padding: .5rem .75rem;
	border: var(--gv-border);
	border-radius: var(--gv-radius);
	font-size: 1rem;
}
.gv-filterbar button {
	padding: .5rem 1.1rem;
	border: 0;
	border-radius: var(--gv-radius);
	background: var(--wp--preset--color--primary);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
.gv-filter-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin: .5rem 0; }
.gv-filter-label { font-weight: 700; font-size: .85rem; color: var(--wp--preset--color--muted); }
.gv-chip {
	font-size: .82rem;
	padding: .25rem .75rem;
	border: var(--gv-border);
	border-radius: 999px;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}
.gv-chip:hover { border-color: var(--wp--preset--color--secondary); }
.gv-chip.is-active { background: var(--wp--preset--color--primary); color: #fff; border-color: var(--wp--preset--color--primary); }
.gv-filter-clear { font-size: .88rem; color: var(--wp--preset--color--muted); }
.gv-empty { color: var(--wp--preset--color--muted); }

/* ---- Focus visibility (a11y) ---- */
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--secondary);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
