/*
 * Projektai - Figma 30:242 + 30:275 (desktop, 1440) and 33:592 + 33:624 (phone, 390).
 *
 * Every value is read from those nodes. Paired values (phone, desktop) interpolate linearly from 390
 * to 1440; the layout switches from the phone stack to the desktop row at 768px. The two lists are
 * core/query loops; projects.php gives each item inv-pos-<1..5> (the size drawn for that page
 * position, cycling) and inv-side-left|right (photo side, alternating down the whole page), and writes
 * its number. Strokes in the frames are INSIDE their boxes, so a 1px line takes 1px from the padding
 * it sits in.
 */

.inv-projects {
	/* Section title 30:244 Helvetica Neue 500 80 / 80; 33:594 Inter 500 48 / 48. */
	--inv-projects-title: clamp(48px, calc(48px + 32 * (100vw - 390px) / 1050), 80px);
	/* Photo to details: 24 below the photo on the phone (33:597), 56 beside it on the desktop
	   (30:250 / 30:258 padding on the photo side). */
	--inv-projects-gap: clamp(24px, calc(24px + 32 * (100vw - 390px) / 1050), 56px);
	/* The separator lines: #d0d0ca on the phone (33:593 / 33:625), #999993 on the desktop (30:243 /
	   30:276). One property, so the drawn-across line of the scroll motion (motion.css) is the same
	   colour as the border it stands in for. */
	--inv-projects-line: #d0d0ca;
	box-sizing: border-box;
	margin: 0;
	padding: 0 var(--inv-inline);
	background: var(--wp--preset--color--c-06);
	color: var(--wp--preset--color--c-01);
}

/* Igyvendinti 30:242 / 33:592: 120 above (64 on the phone); 80 below the last project (30:266 bottom
   padding) and 64 on the phone (33:592 bottom padding). */
.inv-projects.inv-projects--done {
	padding-top: clamp(64px, calc(64px + 56 * (100vw - 390px) / 1050), 120px);
	padding-bottom: clamp(64px, calc(64px + 16 * (100vw - 390px) / 1050), 80px);
}

/* Vystomi 30:275 / 33:624: the separator opens it; 140 below (64 on the phone). */
.inv-projects.inv-projects--dev {
	padding-top: 0;
	padding-bottom: clamp(64px, calc(64px + 76 * (100vw - 390px) / 1050), 140px);
}

/* Heading 33:593 (phone): title, 24, label, 24, then a 1px #d0d0ca line. */
.inv-projects .inv-projects__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	box-sizing: border-box;
	margin: 0;
	padding: 0 0 23px;
	border-bottom: 1px solid var(--inv-projects-line);
}

.inv-projects .inv-projects__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--inv-projects-title);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	color: var(--wp--preset--color--c-01);
}

/* List labels 30:245 / 30:277 Inter 400 20 / 24.2; 33:595 / 33:626 Inter 400 16 / 19.36. #888880. */
.inv-projects .inv-projects__label {
	margin: 0;
	font-family: var(--wp--preset--font-family--inter);
	font-size: clamp(16px, calc(16px + 4 * (100vw - 390px) / 1050), 20px);
	font-weight: 400;
	line-height: 1.2102;
	letter-spacing: 0;
	color: var(--wp--preset--color--c-02);
}

/* The Vystomi label row 30:276 / 33:625: a 1px line above, the label 36 below it (32 on the phone). */
.inv-projects .inv-projects__cat {
	padding: clamp(31px, calc(31px + 4 * (100vw - 390px) / 1050), 35px) 0 0;
	border-top: 1px solid var(--inv-projects-line);
}

/* First project: 90 below the heading line (30:246, an empty 36 + 54 frame) and 40 on the phone
   (33:592 item spacing); 36 below the Vystomi label (30:276 bottom padding) and 40 on the phone. */
.inv-projects--done .inv-projects__list {
	margin: clamp(40px, calc(40px + 50 * (100vw - 390px) / 1050), 90px) 0 0;
}

.inv-projects--dev .inv-projects__list {
	margin: clamp(36px, calc(40px - 4 * (100vw - 390px) / 1050), 40px) 0 0;
}

.inv-projects .inv-proj-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* One project 33:597 (phone): photo on top, then the number beside the details. 56 between projects
   on the phone (33:596), 80 on the desktop (30:248 bottom padding). */
.inv-projects .inv-proj-items > li {
	display: flex;
	flex-direction: column;
	gap: var(--inv-projects-gap);
	margin: 0;
	padding: 0;
}

.inv-projects .inv-proj-items > li + li {
	margin-top: clamp(56px, calc(56px + 24 * (100vw - 390px) / 1050), 80px);
}

/* Photo: column width, the height the phone frame draws for that position, radius 10, cropped to
   fill (scaleMode FILL). */
.inv-projects .inv-proj__photo {
	width: 100%;
	margin: 0;
}

.inv-projects .inv-proj__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 342 / 214;
	object-fit: cover;
	border-radius: 10px;
}

.inv-projects .inv-pos-2 .inv-proj__photo img {
	aspect-ratio: 342 / 217;
}

.inv-projects .inv-pos-3 .inv-proj__photo img {
	aspect-ratio: 342 / 216;
}

.inv-projects .inv-pos-4 .inv-proj__photo img {
	aspect-ratio: 342 / 254;
}

.inv-projects .inv-pos-5 .inv-proj__photo img {
	aspect-ratio: 342 / 226;
}

/* Number and details side by side, 16 apart (33:599). */
.inv-projects .inv-proj__info {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 16px;
	min-width: 0;
	margin: 0;
}

/* Number 30:251 Inter 700 160 / 160; 33:600 Inter 700 80 / 80 in a 128 column (1.6 times its size).
   #e0e0da. */
.inv-projects .inv-proj__num {
	flex: 0 0 1.6em;
	margin: 0;
	font-family: var(--wp--preset--font-family--inter);
	font-size: clamp(80px, calc(80px + 80 * (100vw - 390px) / 1050), 160px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	color: var(--wp--preset--color--c-05);
}

/* Details 30:252 / 33:601: status, type, city, 16 apart (12 on the phone, 6 down from the number's top). */
.inv-projects .inv-proj__details {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: stretch;
	gap: clamp(12px, calc(12px + 4 * (100vw - 390px) / 1050), 16px);
	min-width: 0;
	margin: 0;
	padding: 6px 0 0;
}

/* Igyvendintas 30:254 Inter 400 14 / 16.94; 33:603 Inter 400 13 / 15.73. #888880. */
.inv-projects .inv-proj__status {
	align-self: flex-start;
	margin: 0;
	font-family: var(--wp--preset--font-family--inter);
	font-size: clamp(13px, calc(13px + 1 * (100vw - 390px) / 1050), 14px);
	font-weight: 400;
	line-height: 1.2102;
	letter-spacing: 0;
	color: var(--wp--preset--color--c-02);
}

/* Vystomas 30:283 / 33:633: a 1px #0a0a09 box, radius 2, 5 / 10 padding, Inter 400 10 / 12.1
   uppercase (textCase UPPER) in both frames. */
.inv-projects--dev .inv-proj__status {
	padding: 4px 9px;
	border: 1px solid var(--wp--preset--color--c-01);
	border-radius: 2px;
	font-size: 10px;
	text-transform: uppercase;
	color: var(--wp--preset--color--c-01);
}

/* Project type 30:255 Helvetica Neue 500 30 / 36; 33:604 Inter 500 25 / 30 (both 120%). #0a0a09. */
.inv-projects .inv-proj__type {
	margin: 0;
	font-family: var(--wp--preset--font-family--inter);
	font-size: clamp(25px, calc(25px + 5 * (100vw - 390px) / 1050), 30px);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0;
	color: var(--wp--preset--color--c-01);
	overflow-wrap: break-word;
}

/* City 30:256 Inter 400 16 / 19.36; 33:605 Inter 400 15 / 18.15. #888880. */
.inv-projects .inv-proj__city {
	margin: 0;
	font-family: var(--wp--preset--font-family--inter);
	font-size: clamp(15px, calc(15px + 1 * (100vw - 390px) / 1050), 16px);
	font-weight: 400;
	line-height: 1.2102;
	letter-spacing: 0;
	color: var(--wp--preset--color--c-02);
}

/* Desktop shape (768 and up). */
@media (min-width: 768px) {
	.inv-projects {
		--inv-projects-line: #999993;
	}

	/* Heading row 30:243: 103 tall at 1440 (the 80 title line plus 23), title at the top, label
	   centred, a 1px #999993 line along the bottom. */
	.inv-projects .inv-projects__head {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 0;
		min-height: calc(var(--inv-projects-title) + 23px);
		padding: 0;
	}

	.inv-projects .inv-projects__title {
		align-self: flex-start;
		font-family: var(--wp--preset--font-family--helvetica-neue);
	}

	/* Photo and information side by side (30:248): the photo's own width, the information takes the
	   rest. Even positions put the photo on the right (30:257). */
	.inv-projects .inv-proj-items > li {
		flex-direction: row;
		align-items: flex-start;
		gap: 0;
	}

	.inv-projects .inv-proj-items > li.inv-side-right {
		flex-direction: row-reverse;
	}

	.inv-projects .inv-proj__photo {
		flex: none;
	}

	/* The five drawn photo boxes, as a share of the 1312 column: 880 x 550 (30:249), 820 x 520
	   (30:265), 920 x 580 (30:267), 780 x 580 (30:287), 880 x 580 (30:289). */
	.inv-projects .inv-pos-1 {
		--inv-projects-photo: calc(880 / 1312);
	}

	.inv-projects .inv-pos-2 {
		--inv-projects-photo: calc(820 / 1312);
	}

	.inv-projects .inv-pos-3 {
		--inv-projects-photo: calc(920 / 1312);
	}

	.inv-projects .inv-pos-4 {
		--inv-projects-photo: calc(780 / 1312);
	}

	.inv-projects .inv-pos-5 {
		--inv-projects-photo: calc(880 / 1312);
	}

	.inv-projects .inv-proj-items > li .inv-proj__photo {
		width: calc(var(--inv-projects-photo, 0.5) * 100%);
	}

	.inv-projects .inv-pos-1 .inv-proj__photo img {
		aspect-ratio: 880 / 550;
	}

	.inv-projects .inv-pos-2 .inv-proj__photo img {
		aspect-ratio: 820 / 520;
	}

	.inv-projects .inv-pos-3 .inv-proj__photo img {
		aspect-ratio: 920 / 580;
	}

	.inv-projects .inv-pos-4 .inv-proj__photo img {
		aspect-ratio: 780 / 580;
	}

	.inv-projects .inv-pos-5 .inv-proj__photo img {
		aspect-ratio: 880 / 580;
	}

	/* Information 30:250: the number, then the details directly under it, 56 from the photo. */
	.inv-projects .inv-proj__info {
		flex: 1 1 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.inv-projects .inv-side-left .inv-proj__info {
		padding-left: var(--inv-projects-gap);
	}

	.inv-projects .inv-side-right .inv-proj__info {
		padding-right: var(--inv-projects-gap);
	}

	.inv-projects .inv-proj__num {
		flex: none;
	}

	/* 30:259 / 30:281: beside a photo on the right, the number sits on the photo side. */
	.inv-projects .inv-side-right .inv-proj__num {
		text-align: right;
	}

	.inv-projects .inv-proj__details {
		padding-top: 0;
	}

	.inv-projects .inv-proj__type {
		font-family: var(--wp--preset--font-family--helvetica-neue);
	}

	/* A project saved without a photo (the featured image block then prints nothing) keeps its
	   information where the drawing puts it, beside the empty photo place, rather than across the row. */
	.inv-projects .inv-proj-items > li:not(.has-post-thumbnail) > .inv-proj__info {
		flex: 0 1 calc((1 - var(--inv-projects-photo, 0.5)) * 100%);
	}

	.inv-projects .inv-proj-items > li.inv-side-left:not(.has-post-thumbnail) > .inv-proj__info {
		margin-left: auto;
	}

	.inv-projects .inv-proj-items > li.inv-side-right:not(.has-post-thumbnail) > .inv-proj__info {
		margin-right: auto;
	}
}

/* A list with no projects (projects.php marks its section inv-projects--empty) hides its label and
   its list. The space after the last project on the page stays the drawn 140 (64 on the phone). */
.inv-projects.inv-projects--empty .inv-projects__label,
.inv-projects.inv-projects--empty .inv-projects__list {
	display: none;
}

.inv-projects.inv-projects--dev.inv-projects--empty {
	padding-bottom: clamp(0px, calc(60 * (100vw - 390px) / 1050), 60px);
}

/* With no Igyvendinti projects the heading's own line already separates it from Vystomi. */
.inv-projects.inv-projects--done.inv-projects--empty {
	padding-bottom: 0;
}

.inv-projects--done.inv-projects--empty + .inv-projects--dev .inv-projects__cat {
	border-top-color: transparent;
}
