/* ==========================================================================
   Projects — list cards ([projects_grid]) and single project page
   ========================================================================== */

.isp-projects-grid,
.isp-project {
	--isp-green: #80a500;
	--isp-blue: #4c91cc;
	--isp-info-bg: #f3f7fa;
	--isp-partners-bg: #f1f5e3;
	font-family: "Exo", sans-serif;
}

/* ---------- Footer at the bottom when content is short ----------
   Body becomes a column at least one screen tall and <main> takes the spare
   space, pushing the Elementor footer down. Applies to project pages and to
   the page holding [projects_grid] (via :has, so no body class is needed). */
body.single-project,
body:has(.isp-projects-grid) {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh; /* excludes mobile/tablet browser bars where supported */
}

body.single-project > #content,
body:has(.isp-projects-grid) > #content {
	flex: 1 0 auto;
	width: 100%;
}

/* ---------- List cards ---------- */

.isp-projects-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 5rem 8%;
}

/* `.isp-projects-grid` prefix beats Elementor's `.elementor a { box-shadow: none }` */
.isp-projects-grid .isp-project-card {
	display: block;
	padding: 1.9rem 2.4rem;
	background: #fff;
	/* tight edge (same as the Careers cards) + soft glow from the design */
	box-shadow: 0 0 10px 2px rgba(76, 145, 204, 0.2), 0 10px 30px rgba(76, 145, 204, 0.12);
	text-decoration: none;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.isp-projects-grid .isp-project-card:hover,
.isp-projects-grid .isp-project-card:focus-visible {
	box-shadow: 0 0 12px 3px rgba(76, 145, 204, 0.28), 0 14px 36px rgba(76, 145, 204, 0.2);
	transform: translateY(-2px);
}

.isp-project-card__title {
	margin: 0 0 0.6rem;
	font-family: "Exo", sans-serif;
	font-size: 1.6rem;
	font-weight: 600;
	color: var(--isp-blue);
	text-transform: uppercase;
}

.isp-project-card__desc {
	margin: 0;
	font-family: "Exo", sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--isp-blue);
}

.isp-project-card:hover .isp-project-card__title {
	color: var(--isp-green);
}

/* ---------- Single project ---------- */

/* Extra specificity: the theme's `body:not([class*=elementor-page-]) .site-main`
   caps the width at 500–1140px and forces 10px side padding on mobile. */
.single-project .site-main.isp-project {
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	/* top padding clears the fixed, floating site header (top: 50px) */
	padding: 11rem 2rem 4rem;
	color: var(--isp-blue);
}

.isp-project__top {
	display: grid;
	/* image column = the 451px image used on /sustainable-production/ */
	grid-template-columns: minmax(0, 1fr) minmax(0, 451px);
	grid-template-areas:
		"head media"
		"body media";
	grid-template-rows: auto 1fr;
	column-gap: clamp(3rem, 10vw, 10rem);
}

.isp-project__head  { grid-area: head; }
.isp-project__body  { grid-area: body; }
.isp-project__media { grid-area: media; align-self: start; }

.isp-back {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--isp-blue);
	text-decoration: none;
}
.isp-back svg { color: var(--isp-green); }
.isp-back:hover { color: var(--isp-green); }

/* Type scale (same hierarchy as /sustainable-production/):
   H1 40px · subtitle 19px · H2 32px · body 16px */
.isp-project__title {
	margin: 2rem 0 1.5rem;
	font-family: "Exo", sans-serif;
	font-size: 40px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--isp-green);
}

.isp-project__subtitle {
	max-width: 620px;
	margin: 0;
	font-family: "Exo", sans-serif;
	font-size: 19px;
	line-height: 1.5;
	font-weight: 500;
	color: var(--isp-blue);
}

.isp-project__section { margin-top: 4rem; }

.isp-project h2 {
	margin: 0 0 1.5rem;
	font-family: "Exo", sans-serif;
	font-size: 32px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--isp-green);
}

.isp-project__text p,
.isp-project__text li {
	font-family: "Exo", sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: var(--isp-blue);
}
.isp-project__text p { margin: 0 0 1.25rem; }
.isp-project__text p:empty { display: none; } /* blank paragraphs from the editor */
.isp-project__text > :last-child { margin-bottom: 0; }
.isp-project__text a { color: var(--isp-blue); text-decoration: underline; }
.isp-project__text a:hover { color: var(--isp-green); }

/* Image + dashed circle, copied from /sustainable-production/ (.back-circle2):
   451×369 image, 24rem dashed circle peeking out at the top-left. */
.isp-project__media {
	position: relative;
	width: 100%;
	max-width: 451px;
	margin-top: 9rem; /* room for the circle above the image */
}

.isp-project__circle {
	position: absolute;
	/* = top -142px, left -119px, 384px wide at the full 451×369 size;
	   percentages so the circle scales when the image shrinks on tablets */
	top: -38.5%;
	left: -26.4%;
	width: 85.1%;
	aspect-ratio: 1;
	border: 2px dashed #80a5004a;
	border-radius: 50%;
	pointer-events: none;
}

.isp-project__image {
	position: relative; /* sits above the circle */
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 451 / 369;
	object-fit: cover;
}

/* Info box (logos + key facts) */
.isp-info,
.isp-partners {
	max-width: 1085px;
	margin: 0 auto;
}

.isp-info {
	margin-top: 8rem;
	padding: 3.5rem 3rem 3rem;
	background: var(--isp-info-bg);
}

/* All logos on one line: they shrink proportionally instead of wrapping. */
.isp-info__logos {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1rem, 3vw, 2.5rem);
	padding: 0 0.5rem 1.5rem;
	border-bottom: 2px solid rgba(76, 145, 204, 0.25);
}

.isp-info__logo {
	display: block;
	flex: 0 1 auto;
	min-width: 0;
	width: auto;
	height: auto;
	max-width: 280px;
	max-height: 90px;
	object-fit: contain;
	/* JPG logos have a white background; multiply blends it into the box colour */
	mix-blend-mode: multiply;
}

.isp-info__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2.6rem 3rem;
	margin: 3.5rem 0 0;
	padding: 0 0.3rem;
}

.isp-info__item dt {
	margin: 0 0 0.6rem;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--isp-green);
}

.isp-info__item dd {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 500;
	color: var(--isp-blue);
}

/* Partners box */
.isp-partners {
	margin-top: 5.5rem;
	padding: 3.5rem 3rem 3rem;
	background: var(--isp-partners-bg);
}

.isp-project .isp-partners h2 {
	margin-bottom: 1.5rem;
}

.isp-partners p {
	margin: 0;
	font-family: "Exo", sans-serif;
	font-size: 16px;
	line-height: 1.85;
	color: var(--isp-blue);
}

/* Previous / Share / Next */
.isp-pager {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	max-width: 1085px;
	margin: 5rem auto 2rem;
}

.isp-pager a,
.isp-share {
	display: inline-flex;
	align-items: center;
	gap: 0.8rem;
	font-family: "Exo", sans-serif;
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--isp-blue);
	text-decoration: none;
}
.isp-pager svg { color: var(--isp-green); }
.isp-pager a:hover { color: var(--isp-green); }
.isp-pager__next { text-align: right; }

.isp-share,
.isp-share:hover,
.isp-share:focus {
	padding: 0;
	border: 0;
	background: none !important;
	color: var(--isp-blue) !important;
	cursor: pointer;
}

.isp-share__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 2px solid var(--isp-blue);
	border-radius: 10px;
	transition: border-color 0.2s ease;
}
.isp-share__icon svg { color: var(--isp-blue); }
.isp-share:hover .isp-share__icon,
.isp-share[aria-expanded="true"] .isp-share__icon { border-color: var(--isp-green); }

/* Share popup (same options as the news detail page) */
.isp-pager__share { position: relative; }

.isp-share-box {
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 16px rgba(76, 145, 204, 0.2);
	transform: translateX(-50%);
	white-space: nowrap;
}
.isp-share-box[hidden] { display: none; }

.isp-pager .isp-share-option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	background: none !important;
	cursor: pointer;
}
.isp-share-option svg {
	width: 20px;
	height: 20px;
	fill: var(--isp-blue);
	transition: fill 0.2s ease;
}
.isp-share-option:hover svg,
.isp-share-option:focus-visible svg { fill: var(--isp-green); }

.isp-share-copied {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.75rem;
	color: var(--isp-green);
	white-space: nowrap;
}

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

@media (max-width: 1024px) {
	.isp-projects-grid { gap: 2.5rem 3rem; }
}

/* Tablet landscape / large portrait (e.g. 1024×1366): keep text left of the
   image, at the same fixed 451×369 image + 384px circle as /sustainable-production/.
   The gap (7.5rem = 120px) leaves room for the circle's 119px overhang on the left. */
@media (min-width: 901px) and (max-width: 1199px) {
	.isp-project__top {
		grid-template-columns: minmax(0, 1fr) 451px;
		column-gap: 7.5rem;
	}
}

/* Narrower tablets: stack (image between intro and text) */
@media (max-width: 900px) {
	.isp-project__top {
		grid-template-columns: 1fr;
		grid-template-areas:
			"head"
			"media"
			"body";
	}

	.isp-project__media {
		max-width: 451px;
		width: 80%;
		margin: 10rem 0 0 auto; /* room for the circle above */
	}
}

@media (max-width: 768px) {
	.isp-projects-grid { grid-template-columns: 1fr; }
	.isp-projects-grid .isp-project-card { padding: 1.5rem 1.6rem; }
	.isp-project-card__title { font-size: 1.3rem; }

	/* extra top room so "Back to projects" sits clear of the floating header */
	.single-project .site-main.isp-project { padding: 10.5rem 1.2rem 3rem; }

	/* Mobile hierarchy copied from /sustainable-production/:
	   H1 1.8rem · subtitle 19px · H2 32px · body 16px */
	.isp-project__title { margin: 1.5rem 0 1.2rem; font-size: 1.8rem; }
	.isp-project__subtitle { font-size: 19px; }
	.isp-project h2 { font-size: 32px; margin-bottom: 1.2rem; }
	.isp-project__section { margin-top: 3rem; }

	/* no image / circle on mobile */
	.isp-project__media { display: none; }

	.isp-info { margin-top: 4rem; padding: 2rem 1.4rem; }
	.isp-info__logos { padding: 0 0 1.2rem; }
	.isp-info__logo { max-height: 60px; }
	.isp-info__grid { grid-template-columns: 1fr; gap: 1.6rem; margin-top: 2rem; }
	.isp-partners { margin-top: 3rem; padding: 2rem 1.4rem; }

	.isp-pager { margin-top: 3rem; }
	.isp-pager a, .isp-share { font-size: 0.8rem; gap: 0.5rem; }
	.isp-share__label { display: none; }
}
