/*
Theme Name: Timeline
Theme URI: https://example.com/timeline
Author: Patrik Alienus
Description: Photographer career timeline. Scrolling front-page timeline, gallery custom post type, contact page.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: timeline
*/

:root {
	--bg: #0e0e0f;
	--bg-soft: #17171a;
	--card: #1c1c20;
	--line: #2e2e34;
	--text: #ece9e4;
	--muted: #9a958c;
	--accent: #c8a06a;
	--maxw: 1180px;
	--serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--sans: "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: .01em; }

/* ---------- Header / nav ---------- */
.site-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 32px;
	mix-blend-mode: difference;
}
.site-brand {
	font-family: var(--serif);
	font-size: 22px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #fff;
}

.menu-toggle {
	width: 34px; height: 26px;
	background: none; border: 0; padding: 0;
	cursor: pointer;
	display: flex; flex-direction: column; justify-content: space-between;
}
.menu-toggle span {
	display: block; height: 2px; width: 100%;
	background: #fff;
	transition: transform .3s ease, opacity .3s ease;
}
.nav-open .menu-toggle span:nth-child(1) { transform: translateY(12px) rotate(45deg); }
.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-12px) rotate(-45deg); }

.site-nav {
	position: fixed;
	inset: 0;
	z-index: 40;
	background: rgba(10,10,11,.97);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .4s ease;
}
.nav-open .site-nav { opacity: 1; pointer-events: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; text-align: center; }
.site-nav li { margin: 18px 0; }
.site-nav a {
	font-family: var(--serif);
	font-size: clamp(34px, 7vw, 64px);
	color: var(--text);
	transition: color .25s ease;
}
.site-nav a:hover { color: var(--accent); }

/* ---------- Layout ---------- */
.site-main { min-height: 60vh; }
.site-footer {
	text-align: center;
	color: var(--muted);
	font-size: 13px;
	letter-spacing: .08em;
	padding: 60px 20px;
	border-top: 1px solid var(--line);
}

/* ---------- Intro ---------- */
.timeline-intro {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 40px 24px;
}
.timeline-intro h1 {
	font-size: clamp(48px, 10vw, 120px);
	margin: 0;
	line-height: 1.02;
}
.timeline-tagline {
	color: var(--muted);
	letter-spacing: .22em;
	text-transform: uppercase;
	font-size: 13px;
	margin-top: 18px;
}
.scroll-hint {
	margin-top: 56px;
	font-size: 26px;
	color: var(--accent);
	animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* ---------- Timeline ---------- */
.timeline {
	position: relative;
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 24px 24px 60px;
}
.timeline::before {
	content: "";
	position: absolute;
	top: 0; bottom: 0;
	left: 50%;
	width: 1px;
	background: var(--line);
	transform: translateX(-50%);
}
.timeline-year {
	position: relative;
	text-align: center;
	margin: 30px 0 18px;
	scroll-margin-top: 84px;
	z-index: 2;
}
.timeline-year span {
	font-family: var(--serif);
	font-size: 26px;
	color: var(--accent);
	background: var(--bg);
	padding: 4px 20px;
	border: 1px solid var(--line);
	border-radius: 30px;
}

.timeline-item {
	position: relative;
	width: 50%;
	padding: 0 40px;
	margin: 12px 0;
}
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-marker {
	position: absolute;
	top: 26px;
	width: 13px; height: 13px;
	background: var(--accent);
	border-radius: 50%;
	border: 3px solid var(--bg);
}
.timeline-item:nth-child(odd) .timeline-marker { right: -7px; }
.timeline-item:nth-child(even) .timeline-marker { left: -6px; }

.timeline-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 6px;
	overflow: hidden;
	transition: transform .3s ease, border-color .3s ease;
}
.timeline-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.timeline-thumb img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.timeline-body { padding: 16px 20px 18px; }
.timeline-date {
	display: block;
	font-size: 11px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 6px;
}
.timeline-title { margin: 0 0 4px; font-size: 22px; line-height: 1.15; }
.timeline-title a:hover { color: var(--accent); }
.timeline-subtitle { color: var(--muted); margin: 0 0 8px; font-style: italic; font-size: 15px; }
.timeline-excerpt { color: var(--muted); font-size: 14px; line-height: 1.5; }
.timeline-excerpt p { margin: 0; }

/* ---------- Year nav (right side) ---------- */
.year-nav {
	position: fixed;
	top: 50%;
	right: 22px;
	transform: translateY(-50%);
	z-index: 45;
}
.year-nav ul { list-style: none; margin: 0; padding: 0; }
.year-nav li { margin: 2px 0; }
.year-nav a {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding: 3px 0;
	color: var(--muted);
}
.year-nav-label {
	font-family: var(--sans);
	font-size: 12px;
	letter-spacing: .1em;
	opacity: 0;
	transform: translateX(6px);
	transition: opacity .25s ease, transform .25s ease, color .25s ease;
}
.year-nav-dot {
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--line);
	flex: none;
	transition: background .25s ease, transform .25s ease;
}
.year-nav a:hover .year-nav-label,
.year-nav a.is-active .year-nav-label {
	opacity: 1;
	transform: none;
	color: var(--text);
}
.year-nav a:hover .year-nav-dot { background: var(--accent); }
.year-nav a.is-active .year-nav-dot {
	background: var(--accent);
	transform: scale(1.5);
}

@media (max-width: 760px) {
	.year-nav { display: none; }
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Page heads ---------- */
.page-head {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 140px 24px 30px;
	text-align: center;
}
.page-head h1 { font-size: clamp(40px, 7vw, 76px); margin: 0; }
.page-intro, .page-head .page-intro { color: var(--muted); max-width: 640px; margin: 16px auto 0; }
.back-link {
	display: inline-block;
	color: var(--muted);
	font-size: 13px;
	letter-spacing: .1em;
	text-transform: uppercase;
	margin-bottom: 18px;
}
.back-link:hover { color: var(--accent); }

/* ---------- Gallery archive grid ---------- */
.gallery-grid {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 30px 24px 90px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 18px;
}
.gallery-card {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	aspect-ratio: 4/3;
	background: var(--bg-soft);
}
.gallery-card img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .6s ease, filter .4s ease;
	filter: brightness(.78);
}
.gallery-card:hover img { transform: scale(1.05); filter: brightness(.55); }
.gallery-card-label {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #fff;
}
.gallery-card-title { font-family: var(--serif); font-size: 34px; }
.gallery-card-count {
	font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
	color: rgba(255,255,255,.8); margin-top: 6px;
}

/* ---------- Single gallery photo grid ---------- */
.photo-grid {
	max-width: 1320px;
	margin: 0 auto;
	padding: 20px 16px 90px;
	columns: 3;
	column-gap: 14px;
}
.photo-item {
	display: block;
	margin: 0 0 14px;
	break-inside: avoid;
	overflow: hidden;
	border-radius: 4px;
}
.photo-item img { width: 100%; transition: transform .5s ease, opacity .4s ease; }
.photo-item:hover img { transform: scale(1.04); }

/* ---------- Single entry / page ---------- */
.entry-single, .page-single {
	max-width: 760px;
	margin: 0 auto;
	padding: 130px 24px 80px;
}
.entry-head { text-align: center; margin-bottom: 36px; }
.entry-head h1 { font-size: clamp(36px, 6vw, 60px); margin: 6px 0; }
.entry-subtitle { color: var(--muted); font-style: italic; }
.entry-location { color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.entry-hero { margin: 0 0 36px; border-radius: 6px; overflow: hidden; }
.entry-content { font-size: 18px; line-height: 1.8; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content img { border-radius: 4px; margin: 1.4em 0; }
.entry-link { margin-top: 30px; }
.entry-link a { color: var(--accent); letter-spacing: .06em; }

.empty { text-align: center; color: var(--muted); padding: 120px 20px; }

/* ---------- Lightbox ---------- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(8,8,9,.96);
	display: none;
	align-items: center;
	justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 88vh; border-radius: 4px; }
.lightbox button {
	position: absolute;
	background: none; border: 0; color: #fff;
	cursor: pointer; opacity: .7; transition: opacity .2s ease;
}
.lightbox button:hover { opacity: 1; }
.lightbox-close { top: 24px; right: 30px; font-size: 40px; line-height: 1; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); font-size: 60px; padding: 0 24px; }
.lightbox-prev { left: 6px; }
.lightbox-next { right: 6px; }

/* ---------- Fallback list ---------- */
.post-list { max-width: 760px; margin: 0 auto; padding: 20px 24px 80px; }
.post-list-item { padding: 26px 0; border-bottom: 1px solid var(--line); }
.post-list-item h2 { margin: 0 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
	.timeline::before { left: 18px; }
	.timeline-item { width: 100%; padding: 0 0 0 48px; }
	.timeline-item:nth-child(even) { left: 0; }
	.timeline-item:nth-child(odd) .timeline-marker,
	.timeline-item:nth-child(even) .timeline-marker { left: 12px; right: auto; }
	.timeline-year { text-align: left; padding-left: 4px; }
	.photo-grid { columns: 2; }
	.site-header { padding: 16px 20px; }
}
@media (max-width: 480px) {
	.photo-grid { columns: 1; }
}
