/*
 * Projecten – Vakgroep Huisartsgeneeskunde
 * Stijlen voor de vaste projectpagina.
 *
 * Lettertypes, kopkleur, tekstkleur en linkkleur komen uit Divi: de plugin
 * zet zelf geen lettertype en laat koppen en tekst de Divi-opmaak erven.
 * Kleuren leest de plugin uit de Divi-thema-opties en zet ze als variabelen:
 *   --hgm-accent   primaire kleur (Divi: accent / Primary Color)
 *   --hgm-hero-bg  primaire kleur, zo nodig donkerder voor witte tekst
 *   --hgm-link     linkkleur
 *   --hgm-heading  kopkleur
 * Overschrijven kan in Divi › Thema-opties › Aangepaste CSS, bijv.:
 *   :root { --hgm-accent: #001c3d; }
 */

.hgm-project,
.hgm-shortcode,
.hgm-related {
	--hgm-a: var(--hgm-accent, var(--gcid-primary-color, #1f4f8f));
	--hgm-l: var(--hgm-a);
	--hgm-h: var(--hgm-heading, currentColor);
	--hgm-a-soft: #f2f5f9;
	--hgm-a-soft: color-mix(in srgb, var(--hgm-a) 7%, #fff);
	--hgm-a-line: #d5dde8;
	--hgm-a-line: color-mix(in srgb, var(--hgm-a) 22%, #fff);
	--hgm-border: rgba(0, 0, 0, 0.1);
	--hgm-surface: #f6f7f9;
	--hgm-surface: color-mix(in srgb, var(--hgm-a) 4%, #f7f7f7);
	--hgm-radius: 14px;
	--hgm-gap: clamp(32px, 5vw, 72px);
}

/* Divi-container zonder extra bovenmarge of zijbalklijn. */
#main-content .container.hgm-container {
	padding-top: 0;
}
#main-content .container.hgm-container::before {
	display: none;
}

.hgm-project .screen-reader-text,
.hgm-shortcode .screen-reader-text,
.hgm-related .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hgm-icon {
	flex: none;
	width: 1.1em;
	height: 1.1em;
	vertical-align: -0.15em;
}

/* -------------------------------------------------------------------------
 * Kop (varianten: donker, afbeelding, licht)
 * ---------------------------------------------------------------------- */

.hgm-hero {
	--hgm-pad: clamp(44px, 6vw, 96px);
	position: relative;
	padding: calc(var(--hgm-pad) + var(--hgm-header-offset, 0px)) 0 var(--hgm-pad);
}

/* Donker: primaire kleur van de site, witte tekst. */
.hgm-hero--donker {
	background-color: #1f4f8f;
	background-color: var(--hgm-a);
	background-color: var(--hgm-hero-bg, color-mix(in srgb, var(--hgm-a) 80%, #000));
	background-image: radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.12), transparent 55%);
}

/* Afbeelding: projectafbeelding met een donkere laag in de huisstijlkleur. */
.hgm-hero--afbeelding {
	display: flex;
	align-items: flex-end;
	min-height: clamp(380px, 44vw, 600px);
	background: #1d2733 var(--hgm-hero-img) center / cover no-repeat;
	isolation: isolate;
}
.hgm-hero--afbeelding::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.25));
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--hgm-hero-bg, #1d2733) 94%, transparent) 0%,
		color-mix(in srgb, var(--hgm-hero-bg, #1d2733) 72%, transparent) 45%,
		color-mix(in srgb, var(--hgm-hero-bg, #1d2733) 20%, transparent) 100%
	);
}
.hgm-hero--afbeelding .hgm-hero__inner {
	width: 80%;
}
.hgm-hero--afbeelding .hgm-hero__text {
	max-width: 720px;
}

/* Licht: alleen geschikt bij een menu met donkere tekst. */
.hgm-hero--licht {
	background: var(--hgm-a-soft);
	border-bottom: 1px solid var(--hgm-a-line);
}

.hgm-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--hgm-gap);
	align-items: center;
}
.hgm-hero--has-image .hgm-hero__inner {
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}
.hgm-hero__text > *:last-child {
	margin-bottom: 0;
}

.hgm-back {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	margin-bottom: 22px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--hgm-l);
	text-decoration: none;
}
.hgm-back:hover,
.hgm-back:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.hgm-back .hgm-icon {
	transition: transform 0.2s ease;
}
.hgm-back:hover .hgm-icon {
	transform: translateX(-3px);
}

.hgm-project ul.hgm-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}
.hgm-project ul.hgm-tags li {
	margin: 0;
	padding: 0;
}

.hgm-chip {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--hgm-a);
	background: #fff;
	border: 1px solid var(--hgm-a-line);
	border-radius: 999px;
}

.hgm-status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: #3f4a57;
	background: #eceff3;
	border-radius: 999px;
	white-space: nowrap;
}
.hgm-status::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}
.hgm-status--lopend {
	color: #17663a;
	background: #e1f3e8;
}
.hgm-status--voorbereiding {
	color: #855400;
	background: #fcefd6;
}
.hgm-status--afgerond {
	color: #44505e;
	background: #eceff3;
}

/* Koppen erven lettertype, gewicht en kleur van Divi; alleen maat en ritme hier. */
.hgm-project .hgm-hero__title {
	margin: 0 0 18px;
	padding: 0;
	font-size: clamp(32px, 3.6vw, 50px);
	line-height: 1.12;
	text-wrap: balance;
	overflow-wrap: break-word;
	hyphens: manual;
}

.hgm-project .hgm-hero__lead {
	max-width: 62ch;
	margin: 0 0 22px;
	padding: 0;
	font-size: clamp(19px, 1.6vw, 22px);
	line-height: 1.6;
}

.hgm-project .hgm-hero__meta {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	opacity: 0.85;
}
.hgm-hero__meta .hgm-icon {
	color: var(--hgm-a);
}

/* Witte tekst op de donkere varianten. */
.hgm-hero--dark,
.hgm-hero--dark .hgm-hero__title,
.hgm-hero--dark .hgm-hero__lead,
.hgm-hero--dark .hgm-hero__meta,
.hgm-hero--dark .hgm-hero__meta .hgm-icon,
.hgm-hero--dark .hgm-back {
	color: #fff;
}
.hgm-hero--dark .hgm-hero__lead {
	opacity: 0.92;
}
.hgm-hero--dark .hgm-chip {
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.38);
}
.hgm-hero--dark .hgm-back:focus-visible {
	outline-color: #fff;
}

.hgm-hero__media {
	margin: 0;
}
.hgm-hero__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--hgm-radius);
	box-shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.55);
}
.hgm-hero__media figcaption {
	margin-top: 10px;
	font-size: 13px;
	line-height: 1.5;
	opacity: 0.8;
}

/* -------------------------------------------------------------------------
 * Inhoud + zijkolom
 * ---------------------------------------------------------------------- */

.hgm-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
	gap: var(--hgm-gap);
	align-items: start;
	padding-top: clamp(40px, 6vw, 80px) !important;
	padding-bottom: clamp(48px, 7vw, 96px);
}
.hgm-body--no-aside {
	grid-template-columns: minmax(0, 1fr);
}
.hgm-body--no-aside .hgm-body__main {
	max-width: 780px;
}

/* De beschrijving erft lettergrootte, regelafstand en kleuren van Divi,
   net als een gewoon blogbericht. */
.hgm-content > *:first-child {
	margin-top: 0;
}
.hgm-content h2:not(:first-child),
.hgm-content h3:not(:first-child),
.hgm-content h4:not(:first-child) {
	margin-top: 1.2em;
}
.hgm-content ul,
.hgm-content ol {
	line-height: inherit;
}
.hgm-content img {
	border-radius: 10px;
}
.hgm-content blockquote {
	margin: 1.6em 0;
	padding: 4px 0 4px 22px;
	border-left: 4px solid var(--hgm-a);
	font-size: 1.12em;
}

.hgm-body__aside {
	display: grid;
	gap: 20px;
}

/* Blokken: standaard een lichte tint van de primaire kleur (instelbaar). */
.hgm-card-box {
	padding: 28px 28px 24px;
	background: var(--hgm-box-bg, var(--hgm-a-soft));
	border: 1px solid var(--hgm-box-border, transparent);
	border-radius: var(--hgm-radius);
}
.hgm-card-box .hgm-card-box__title {
	margin: 0 0 16px;
	padding: 0 0 14px;
	font-size: 22px;
	line-height: 1.3;
	border-bottom: 1px solid var(--hgm-border);
}

.hgm-dl {
	margin: 0;
}
.hgm-dl__row {
	padding: 0 0 14px;
}
.hgm-dl__row:last-child {
	padding-bottom: 0;
}
.hgm-dl dt {
	margin: 0 0 3px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--hgm-hero-bg, var(--hgm-a));
}
.hgm-dl dd {
	margin: 0;
	line-height: 1.55;
}

ul.hgm-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
ul.hgm-list li {
	position: relative;
	margin: 0;
	padding: 0 0 2px 14px;
}
ul.hgm-list li::before {
	content: "";
	position: absolute;
	top: 0.68em;
	left: 0;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--hgm-a);
}

.hgm-external {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-weight: 600;
	color: var(--hgm-l);
	text-decoration: none;
	word-break: break-word;
}
.hgm-external:hover,
.hgm-external:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Contact */
.hgm-person {
	display: flex;
	align-items: center;
	gap: 14px;
}
.hgm-person__photo {
	flex: none;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 50%;
}
.hgm-card-box p.hgm-person__name {
	margin: 0;
	padding: 0;
	font-weight: 700;
	line-height: 1.35;
	color: var(--hgm-h);
}
.hgm-card-box p.hgm-person__role {
	margin: 2px 0 0;
	padding: 0;
	font-size: 0.92em;
	line-height: 1.45;
	opacity: 0.85;
}
ul.hgm-contact-links {
	display: grid;
	gap: 6px;
	margin: 16px 0 0;
	padding: 16px 0 0;
	list-style: none;
	border-top: 1px solid var(--hgm-border);
}
ul.hgm-contact-links li {
	margin: 0;
	padding: 0;
}
ul.hgm-contact-links a {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.6em;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--hgm-l);
	text-decoration: none;
	overflow-wrap: anywhere;
}
ul.hgm-contact-links a .hgm-icon {
	margin-top: 0.2em;
}
ul.hgm-contact-links a:hover,
ul.hgm-contact-links a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Publicaties & downloads
 * ---------------------------------------------------------------------- */

.hgm-section-title,
.hgm-project h2.hgm-section-title {
	margin: 0 0 20px;
	padding: 0;
	font-size: clamp(24px, 2.4vw, 32px);
	line-height: 1.25;
}

.hgm-links-section {
	margin-top: clamp(40px, 5vw, 64px);
}

ul.hgm-links-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--hgm-border);
}
ul.hgm-links-list li.hgm-link {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin: 0;
	padding: 18px 0;
	border-bottom: 1px solid var(--hgm-border);
}
.hgm-link__icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	color: var(--hgm-a);
	background: var(--hgm-a-soft);
	border-radius: 10px;
}
.hgm-link__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding-top: 2px;
}
.hgm-link__title {
	font-weight: 600;
	line-height: 1.45;
	color: var(--hgm-h);
	text-decoration: none;
	overflow-wrap: anywhere;
}
a.hgm-link__title:hover,
a.hgm-link__title:focus-visible {
	color: var(--hgm-l);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.hgm-link__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	font-size: 0.9em;
	line-height: 1.45;
}
.hgm-link__type {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hgm-a);
}

/* -------------------------------------------------------------------------
 * Meer projecten
 * ---------------------------------------------------------------------- */

.hgm-related {
	padding: clamp(48px, 7vw, 88px) 0;
	background: var(--hgm-box-bg, var(--hgm-surface));
}
.hgm-related__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: 28px;
}
.hgm-related__head .hgm-section-title {
	margin: 0;
}

.hgm-button {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	padding: 12px 22px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff !important;
	background: var(--hgm-hero-bg, var(--hgm-a));
	border-radius: 999px;
	text-decoration: none;
	transition: filter 0.2s ease;
}
.hgm-button:hover,
.hgm-button:focus-visible {
	filter: brightness(1.15);
}
.hgm-button .hgm-icon {
	transition: transform 0.2s ease;
}
.hgm-button:hover .hgm-icon {
	transform: translateX(3px);
}

.hgm-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}

.hgm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--hgm-border);
	border-radius: var(--hgm-radius);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.hgm-card:hover,
.hgm-card:focus-within {
	box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.35);
	transform: translateY(-3px);
}
.hgm-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--hgm-a-soft);
}
.hgm-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.hgm-card:hover .hgm-card__img {
	transform: scale(1.03);
}
.hgm-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--hgm-a);
}
.hgm-card__placeholder .hgm-icon {
	width: 40px;
	height: 40px;
	opacity: 0.5;
}
.hgm-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 22px 22px 24px;
}
.hgm-card .hgm-card__title {
	margin: 0;
	padding: 0;
	font-size: 22px;
	line-height: 1.3;
}
.hgm-card__link {
	color: inherit;
	text-decoration: none;
}
.hgm-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.hgm-card__link:focus-visible {
	outline: none;
}
.hgm-card:focus-within {
	outline: 3px solid var(--hgm-a);
	outline-offset: 2px;
}
.hgm-card .hgm-card__excerpt {
	display: -webkit-box;
	margin: 0;
	padding: 0;
	overflow: hidden;
	font-size: 0.95em;
	line-height: 1.6;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}
.hgm-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin-top: auto;
	padding-top: 4px;
	font-weight: 600;
	color: var(--hgm-l);
}
.hgm-card__more .hgm-icon {
	transition: transform 0.2s ease;
}
.hgm-card:hover .hgm-card__more .hgm-icon {
	transform: translateX(3px);
}

/* -------------------------------------------------------------------------
 * Focus & beweging
 * ---------------------------------------------------------------------- */

.hgm-project a:focus-visible,
.hgm-related a:focus-visible,
.hgm-shortcode a:focus-visible {
	outline: 3px solid var(--hgm-a);
	outline-offset: 3px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.hgm-project *,
	.hgm-related * {
		transition: none !important;
	}
}

/* -------------------------------------------------------------------------
 * Responsief (Divi-breekpunten: 980px en 767px)
 * ---------------------------------------------------------------------- */

@media (max-width: 980px) {
	.hgm-hero--has-image .hgm-hero__inner,
	.hgm-body {
		grid-template-columns: minmax(0, 1fr);
	}
	.hgm-hero__media {
		max-width: 640px;
	}
	.hgm-hero--afbeelding::before {
		background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.4));
		background: linear-gradient(
			0deg,
			color-mix(in srgb, var(--hgm-hero-bg, #1d2733) 95%, transparent) 0%,
			color-mix(in srgb, var(--hgm-hero-bg, #1d2733) 60%, transparent) 100%
		);
	}
	.hgm-body__aside {
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	}
	.hgm-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.hgm-cards > :nth-child(3) {
		display: none;
	}
}

@media (max-width: 767px) {
	.hgm-cards {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}
	.hgm-cards > :nth-child(3) {
		display: flex;
	}
	.hgm-card-box {
		padding: 22px 20px 18px;
	}
}

@media print {
	.hgm-hero {
		color: #000;
		background: none !important;
	}
	.hgm-hero--dark,
	.hgm-hero--dark * {
		color: #000 !important;
	}
	.hgm-hero--afbeelding::before,
	.hgm-related,
	.hgm-back {
		display: none;
	}
	.hgm-body {
		display: block;
	}
}
