/* dilara ateş — portfolio (rebuilt from Cargo) */

:root {
	--text: rgba(0, 0, 0, 0.85);
	--muted: rgba(0, 0, 0, 0.4);
	--line: rgba(0, 0, 0, 0.15);
	--bg: #ffffff;
	--pad-top: 7rem;
	--pad: 5rem;
}

* { box-sizing: border-box; }

html {
	font-size: max(0.9vw, 10px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 1.2rem;
	line-height: 1.2;
	letter-spacing: -0.05em;
	font-variant-numeric: oldstyle-nums;
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:active, .nav a:active { opacity: 0.7; }
u a, a u { text-decoration: underline; }

blockquote { margin: 0; padding: 0 0 0 2em; }
[style*="--font-scale"] { font-size: calc(var(--font-scale) * 1em); }

.caption {
	display: block;
	font-family: HelveticaNeue-Light, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-weight: normal;
	font-size: 0.75em; /* 0.9rem relative to 1.2rem body */
	line-height: 1.2;
	letter-spacing: 0.02em;
	color: var(--muted);
}
.caption .caption { font-size: 1em; }
.caption a { color: var(--muted); }

/* ---------- header ---------- */

.header-desktop {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 20;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	column-gap: 2rem;
	padding: 0.5rem;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}
.header-desktop a { text-align: right; }
.header-desktop .info { grid-column: 2; }
.header-desktop .contact { grid-column: 4; }

.header-mobile { display: none; }

/* vertical divider between nav and page */
.divider {
	position: fixed;
	top: 0; bottom: 0; left: 50%;
	border-left: 1px solid var(--line);
	z-index: 15;
	pointer-events: none;
}

/* ---------- project grid (left) ---------- */

.nav {
	position: fixed;
	top: 0; left: 0;
	width: 50%;
	height: 100vh;
	height: 100dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: var(--pad-top) var(--pad) var(--pad);
	scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav .gal-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 5rem;
	row-gap: 5rem;
	align-items: end;
}
.nav .caption { margin-top: 1em; margin-bottom: 2em; }
.nav figure.m.active img,
.nav figure.m.active video { outline: 2px solid var(--line); outline-offset: 3px; }
.nav-title { display: none; }

/* ---------- page (right) ---------- */

.page {
	margin-left: 50%;
	width: 50%;
	min-height: 100vh;
	padding: var(--pad-top) var(--pad) var(--pad);
}

/* ---------- content building blocks ---------- */

/* behaves like Cargo's <media-item>: inline, full width unless scaled */
figure.m {
	margin: 0;
	display: inline-flex;
	flex-direction: column;
	vertical-align: bottom;
	width: 100%;
	max-width: 100%;
}
figure.m img,
figure.m video {
	display: block;
	width: 100%;
	height: auto;
	background: transparent;
}

.cols { display: flex; gap: 2rem; }
.gal + .cols { margin-top: 1rem; }
.cols > .col { flex: 1 1 0; min-width: 0; }

.gal { margin: 0; }
.gal-grid {
	display: grid;
	grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
	gap: 0;
}
.gal-columnized { display: grid; gap: 1rem; }
.gal-freeform { display: block; }
.gal-justify { display: flex; gap: 1rem; align-items: flex-start; }
.gal-justify > figure.m { flex: var(--ar, 1) 1 0%; min-width: 0; }

.gal-slideshow { position: relative; }
.gal-slideshow > figure.m { display: none; cursor: pointer; }
.gal-slideshow > figure.m.on { display: block; }
.gal-slideshow .ss-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 30px; height: 30px;
	border: 0; border-radius: 50%;
	background: rgba(87, 87, 87, 0.35);
	color: rgba(255, 255, 255, 0.9);
	font: 16px/30px Helvetica, Arial, sans-serif;
	cursor: pointer;
	padding: 0;
}
.gal-slideshow .ss-prev { left: 15px; }
.gal-slideshow .ss-next { right: 15px; }
.gal-slideshow .ss-btn:active { opacity: 0.7; }

.notfound { text-align: center; padding-top: 30vh; }

/* next project link at the end of each project */
.next-project { margin-top: 6rem; text-align: right; }
.next-project a { display: inline-block; }
.next-project a:hover { color: var(--text); }

/* full-screen image view (same feel as Cargo's quick view: white, 3rem padding) */
img.zoomable { cursor: zoom-in; }
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 3rem;
	background: var(--bg);
	cursor: zoom-out;
}
.lightbox.open { display: flex; animation: lb-in 120ms ease-out; }
.lightbox img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}
html.lb-open { overflow: hidden; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- mobile ---------- */

@media (max-width: 767px) {
	html { font-size: 13px; }
	:root { --pad-top: 2.8rem; --pad: 1.5rem; }

	.header-desktop, .divider { display: none; }
	.header-mobile {
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		position: fixed;
		top: 0; left: 0; right: 0;
		z-index: 20;
		padding: 1.4rem 1.5rem 1.1rem;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
	}
	.header-mobile .contact { font-size: 0.9rem; }
	.lightbox { padding: 10px; }
	.next-project { margin-top: 3rem; }

	.page {
		margin-left: 0;
		width: 100%;
		min-height: 0;
		padding: calc(var(--pad-top) + 3.6rem) var(--pad) var(--pad);
	}

	.nav {
		position: static;
		width: 100%;
		height: auto;
		overflow: visible;
		padding: 3rem var(--pad) 4rem;
		border-top: 1px solid var(--line);
	}
	.nav-title { display: block; margin-bottom: 2rem; }
	.nav .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 1rem; }

	.cols { flex-direction: column; gap: 1em; }
	.gal-grid { gap: 1rem; }
	.page .gal-grid[style*="--cols:2"] { grid-template-columns: 1fr; }
	.gal-justify { flex-direction: column; }
	figure.m[style*="width"] { width: 100% !important; }
	.home figure.m[style*="width"] { width: 60% !important; }
}
