/* Shared timeline + card + modal styles
   Used by art.html and memories.html.
   Colours come from CSS custom properties so a theme file
   (e.g. theme-dark.css) can re-skin everything by overriding the tokens. */

:root {
	--tl-accent: #74412d;
	--tl-accent-soft: rgba(116, 65, 45, 0.14);
	--tl-accent-line: rgba(116, 65, 45, 0.28);

	--tl-heading: #74412d;
	--tl-text: #888;
	--tl-muted: #999;

	--tl-card-bg: rgba(116, 65, 45, 0.04);
	--tl-card-border: rgba(116, 65, 45, 0.12);
	--tl-img-bg: #ddd;
	--tl-node-bg: #fff;
	--tl-shadow: rgba(116, 65, 45, 0.16);

	--tl-tag-text: #fff;

	--tl-modal-bg: #fff;
	--tl-modal-text: #777;
	--tl-overlay: rgba(30, 16, 10, 0.72);

	--tl-page-bg: #fff;
}

html {
	scroll-behavior: smooth;
}

/* timeline pages have no banner, so give the content room to breathe up top */
#main > section#Art,
#main > section#Memories {
	padding-top: 3.5em;
}

.tl-title {
	color: var(--tl-heading);
	margin-bottom: 0.35em;
}

.tl-note {
	color: var(--tl-muted);
	font-weight: 400;
	max-width: 44rem;
}

/* --- Timeline layout --- */
.tl-timeline {
	position: relative;
	margin: 3rem 0 1rem;
	padding: 0;
	list-style: none;
}

/* the vertical spine */
.tl-timeline::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 20px;
	width: 3px;
	background: linear-gradient(to bottom, transparent, var(--tl-accent-line) 8%, var(--tl-accent-line) 92%, transparent);
}

.tl-entry {
	position: relative;
	margin: 0 0 2.75rem 0;
	padding-left: 64px;
}

.tl-entry:last-child {
	margin-bottom: 0;
}

/* the node on the spine */
.tl-entry::before {
	content: "";
	position: absolute;
	left: 12px;
	top: 6px;
	width: 19px;
	height: 19px;
	border-radius: 50%;
	background: var(--tl-node-bg);
	border: 3px solid var(--tl-accent);
	box-shadow: 0 0 0 5px var(--tl-accent-soft);
	transition: transform 0.25s ease-in-out, background 0.25s ease-in-out;
}

.tl-entry:hover::before {
	transform: scale(1.18);
	background: var(--tl-accent);
}

.tl-year {
	display: inline-block;
	font-family: "Lato", sans-serif;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--tl-accent);
	font-size: 0.95em;
	margin-bottom: 0.6rem;
}

.tl-experienced {
	display: block;
	font-family: "Lato", sans-serif;
	font-size: 0.82em;
	font-weight: 400;
	letter-spacing: 0.04em;
	color: var(--tl-muted);
	margin-top: 0.1rem;
}

.tl-tag {
	display: inline-block;
	font-family: "Lato", sans-serif;
	font-weight: 700;
	font-size: 0.68em;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--tl-tag-text);
	background: var(--tl-accent);
	border-radius: 999px;
	padding: 0.28em 0.85em;
	margin: 0.1em 0 0.7em;
}

.tl-card {
	display: flex;
	gap: 1.4rem;
	width: 100%;
	text-align: left;
	background: var(--tl-card-bg);
	border: 1px solid var(--tl-card-border);
	border-radius: 14px;
	padding: 1.1rem 1.2rem;
	font: inherit;
	color: inherit;
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* compact card (no description — image, title/tag only; art.html) */
.tl-card-compact {
	align-items: center;
	padding: 0.8rem 1.2rem;
}

.tl-card-compact img {
	width: 72px;
	min-width: 72px;
	height: 72px;
}

.tl-card-compact .tl-card-head {
	margin-bottom: 0;
}

/* interactive card (opens a modal) */
button.tl-card {
	cursor: pointer;
}

button.tl-card:hover,
button.tl-card:focus-visible {
	transform: translateY(-3px);
	border-color: var(--tl-accent-line);
	box-shadow: 0 10px 26px var(--tl-shadow);
	outline: none;
}

.tl-card img {
	display: block;
	width: 120px;
	min-width: 120px;
	height: 120px;
	object-fit: contain;
	border-radius: 8px;
	background: var(--tl-img-bg);
}

.tl-card-body {
	flex: 1;
	min-width: 0;
}

.tl-card-body h3 {
	color: var(--tl-heading);
	font-size: 1.15em;
	margin: 0 0 0.25em 0;
	line-height: 1.25em;
}

/* title + tag sharing one line, tag pushed to the right (art.html) */
.tl-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.9rem;
	margin-bottom: 0.5em;
}

.tl-card-head h3 {
	margin: 0;
}

.tl-card-head .tl-tag {
	flex: none;
	margin: 0;
}

.tl-medium {
	font-family: "Lato", sans-serif;
	font-size: 0.82em;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--tl-muted);
	margin-bottom: 0.55em;
}

.tl-card-body p {
	font-family: "Lato", sans-serif;
	font-size: 0.92em;
	line-height: 1.65em;
	color: var(--tl-text);
	margin: 0;
}

.tl-more {
	display: inline-block;
	margin-top: 0.7em;
	font-family: "Lato", sans-serif;
	font-size: 0.82em;
	letter-spacing: 0.06em;
	color: var(--tl-accent);
}

/* ============================================================= */
/*  Grid variant (art.html): square cards grouped under a heading */
/*  per tag — no year/spine, chronology isn't the point.          */
/* ============================================================= */

.tl-grid-heading {
	color: var(--tl-heading);
	font-family: "Lato", sans-serif;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	font-size: 1.6em;
	margin: 2.75rem 0 1.1rem;
}

.tl-grid-heading:first-child {
	margin-top: 0.5rem;
}

.tl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 2.2rem;
	margin: 0 0 1rem;
	padding: 0;
}

.tl-grid-card {
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	border: 1px solid var(--tl-card-border);
	background: var(--tl-card-bg);
	padding: 1.2rem;
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out, opacity 0.6s ease-out;
}

.tl-grid-card:hover,
.tl-grid-card:focus-visible {
	transform: translateY(-3px);
	border-color: var(--tl-accent-line);
	box-shadow: 0 10px 26px var(--tl-shadow);
	outline: none;
}

.tl-grid-card-img {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 10px;
	background: var(--tl-img-bg);
}

.tl-grid-card-img img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tl-grid-card-body {
	padding-top: 0.9rem;
}

.tl-grid-card-body h3 {
	color: var(--tl-heading);
	font-size: 1em;
	line-height: 1.3em;
	margin: 0;
}

/* ============================================================= */
/*  Feed variant (memories.html): full photos, minimal captions,  */
/*  timeline spine kept.                                          */
/* ============================================================= */

.tl-feed .tl-entry {
	padding-left: 52px;
	margin-bottom: 3.5rem;
	scroll-margin-top: 4.5rem;
}

.tl-feed .tl-entry:last-child {
	margin-bottom: 0;
}

/* --- Horizontal year index (sticky) --- */
.tl-index {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	gap: 0.4rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	padding: 0.7rem 0;
	margin-bottom: 1.25rem;
	background: var(--tl-page-bg);
	border-bottom: 1px solid var(--tl-accent-line);
	scrollbar-width: thin;
	scrollbar-color: var(--tl-accent-line) transparent;
}

/* clear the fixed mobile title bar */
@media screen and (max-width: 1024px) {
	.tl-index {
		top: 44px;
	}

	.tl-feed .tl-entry {
		scroll-margin-top: 6rem;
	}
}

.tl-index::-webkit-scrollbar {
	height: 5px;
}

.tl-index::-webkit-scrollbar-thumb {
	background: var(--tl-accent-line);
	border-radius: 3px;
}

#main .tl-index a {
	flex: none;
	padding: 0.34em 0.9em;
	border-radius: 999px;
	border: 1px solid var(--tl-card-border);
	background: var(--tl-card-bg);
	color: var(--tl-muted);
	font-family: "Lato", sans-serif;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.04em;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

#main .tl-index a:hover,
#main .tl-index a.is-current {
	background: var(--tl-accent);
	border-color: var(--tl-accent);
	color: var(--tl-tag-text);
}

/* one year marker per year; that year's memories stack beneath it */
.tl-feed .tl-year {
	font-size: 1.15em;
	margin-bottom: 1.1rem;
}

/* wraps one year's entries (memories stack; art usually has one) */
.tl-group {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.memory {
	/* box grows by 30px; padding absorbs it so the photo keeps its size */
	max-width: 430px;
	background: var(--tl-card-bg);
	border: 1px solid var(--tl-card-border);
	border-radius: 20px;
	padding: calc(0.85rem + 15px);
}

.memory-photo {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	border-radius: 15px;
	overflow: hidden;
	cursor: zoom-in;
	line-height: 0;
}

.memory-photo img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 460px;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.memory-photo:hover img,
.memory-photo:focus-visible img {
	transform: scale(1.03);
}

.memory-photo:focus-visible {
	outline: 2px solid var(--tl-accent);
	outline-offset: 2px;
}

.memory-body {
	padding: 0.85rem 0.55rem 0.3rem;
}

.memory-loc {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 0.55em;
	row-gap: 0.35em;
	font-family: "Lato", sans-serif;
	font-size: 0.63em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tl-muted);
	margin: 0 0 0.35em 0;
}

.memory-pin {
	width: 1.05em;
	height: 1.05em;
	fill: var(--tl-accent);
	flex: none;
}

.memory-place {
	min-width: 0;
}

/* date always sits on its own line so a long place name never
   gets squeezed or clipped trying to share the row */
.memory-date {
	display: inline-flex;
	align-items: center;
	flex-basis: 100%;
}

.memory-cal {
	width: 1.05em;
	height: 1.05em;
	margin-right: 0.35em;
	fill: var(--tl-accent);
	flex: none;
}

.memory-text {
	font-family: "Lato", sans-serif;
	font-size: 0.8em;
	line-height: 1.6em;
	color: var(--tl-text);
	margin: 0;
}

/* --- Lightbox (full-size photo) --- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1.5rem;
	background: rgba(0, 0, 0, 0.92);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease-in-out;
}

.lightbox.is-open {
	opacity: 1;
	pointer-events: auto;
}

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 12px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.lightbox-close {
	position: absolute;
	top: 0.8rem;
	right: 1.1rem;
	background: none;
	border: 0;
	color: #fff;
	font-size: 2.5rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
}

.lightbox-close:hover {
	opacity: 1;
}

/* --- Scroll reveal --- */
.tl-entry,
.tl-grid-card {
	opacity: 0;
	transform: translateY(24px);
}

/* .tl-grid-card already declares its own transition (hover lift included) */
.tl-entry {
	transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tl-entry.is-visible,
.tl-grid-card.is-visible {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.tl-entry,
	.tl-grid-card {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* --- Modal --- */
.tl-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: var(--tl-overlay);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease-in-out;
}

.tl-modal.is-open {
	opacity: 1;
	pointer-events: auto;
}

.tl-modal-inner {
	position: relative;
	display: flex;
	gap: 1.8rem;
	max-width: 780px;
	width: 100%;
	max-height: 88vh;
	overflow-y: auto;
	background: var(--tl-modal-bg);
	border-radius: 16px;
	padding: 2rem;
}

.tl-modal-inner img {
	width: 240px;
	min-width: 240px;
	height: auto;
	align-self: flex-start;
	border-radius: 10px;
}

.tl-modal [hidden] {
	display: none !important;
}

.tl-modal-inner h2 {
	color: var(--tl-heading);
	font-size: 1.7em;
	margin-bottom: 0.15em;
}

.tl-modal-inner .tl-year {
	font-size: 1em;
}

.tl-modal-inner p {
	font-family: "Lato", sans-serif;
	font-size: 0.98em;
	line-height: 1.75em;
	color: var(--tl-modal-text);
}

.tl-modal-close {
	position: absolute;
	top: 0.8rem;
	right: 1rem;
	background: none;
	border: 0;
	font-size: 1.9rem;
	line-height: 1;
	color: var(--tl-muted);
	cursor: pointer;
}

.tl-modal-close:hover {
	color: var(--tl-accent);
}

@media screen and (max-width: 736px) {
	.tl-card {
		flex-direction: column;
		gap: 1rem;
	}

	.tl-card img {
		width: 100%;
		height: 200px;
	}

	.tl-card-compact {
		flex-direction: row;
	}

	.tl-card-compact img {
		width: 72px;
		height: 72px;
	}

	.tl-modal-inner {
		flex-direction: column;
		padding: 1.5rem;
		gap: 1.2rem;
	}

	.tl-modal-inner img {
		width: 60%;
		min-width: 0;
		align-self: center;
	}
}
