/* new.lanep.org — mobile-first styles */

:root {
	--bg: #121212;
	--surface: #1e1e1e;
	--surface-2: #2a2a2a;
	--text: #eaeaea;
	--muted: #9a9a9a;
	--accent: #8ec5ff;
	--radius: 10px;
	--pad: 16px;
	--max: 1100px;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(18, 18, 18, 0.92);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid #262626;
	padding-top: env(safe-area-inset-top);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding-top: 8px;
	padding-bottom: 8px;
}

.brand {
	font-weight: 700;
	font-size: 20px;
	letter-spacing: 0.5px;
	color: var(--text);
	white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 10px 8px 0;
	font-size: 16px;
	white-space: nowrap;
}

.search-box {
	flex: 1;
	min-width: 0;
	position: relative;
}

.search-box input {
	width: 100%;
	height: 42px;
	padding: 0 14px;
	border: 1px solid #333;
	border-radius: 21px;
	background: var(--surface);
	color: var(--text);
	font-size: 16px; /* 16px+ stops iOS zooming on focus */
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.search-box input:focus { border-color: var(--accent); }

/* ---------- search results ---------- */

.result-count {
	color: var(--muted);
	font-size: 14px;
	margin: 12px 0 4px;
}

.trip-list {
	list-style: none;
	margin: 0 0 40px;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 2px;
}

.trip-list a {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px 8px;
	border-radius: var(--radius);
	color: inherit;
}
.trip-list a:hover, .trip-list a:focus-visible { background: var(--surface); text-decoration: none; }
.trip-list a:active { background: var(--surface-2); }

.trip-list img {
	width: 64px;
	height: 64px;
	flex: none;
	border-radius: 8px;
	object-fit: cover;
	background: var(--surface-2);
}

.trip-info { min-width: 0; }

.trip-title {
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.trip-meta {
	color: var(--muted);
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (min-width: 760px) {
	.trip-list { grid-template-columns: 1fr 1fr; column-gap: 16px; }
}

/* ---------- trip page ---------- */

.trip-header { padding: 16px 0 8px; }

.trip-header h1 {
	font-size: 24px;
	line-height: 1.2;
	margin: 0 0 4px;
}

.trip-header .trip-meta { white-space: normal; font-size: 15px; }

.description {
	margin: 12px 0 0;
	color: #cfcfcf;
	white-space: pre-line;
}
.description.clamped {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.more-btn {
	background: none;
	border: 0;
	padding: 4px 0;
	color: var(--accent);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 3px;
	margin: 12px calc(-1 * var(--pad)) 40px;
}

@media (min-width: 600px) {
	.gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin-left: 0; margin-right: 0; }
	.gallery button { border-radius: 6px; }
}

.gallery button {
	position: relative;
	display: block;
	padding: 0;
	border: 0;
	aspect-ratio: 1 / 1;
	background: var(--surface-2);
	overflow: hidden;
	cursor: pointer;
}

.gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.2s;
}
.gallery button:hover img { opacity: 0.85; }

.play-badge {
	position: absolute;
	right: 6px;
	bottom: 6px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
.play-badge::after {
	content: "";
	margin-left: 3px;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #fff;
}

.status {
	color: var(--muted);
	padding: 40px 0;
	text-align: center;
}

/* ---------- full-screen viewer ---------- */

body.viewer-open { overflow: hidden; }

.viewer {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: #000;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	overflow: hidden;
}
.viewer[hidden] { display: none; }

.slide {
	position: absolute;
	inset: 0;
	overflow: hidden;
	will-change: transform;
}

.viewer.animating .slide { transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.3, 1); }

.slide img,
.slide video {
	position: absolute;
	transform-origin: 50% 50%;
	max-width: none;
	will-change: transform;
}

.slide img { -webkit-user-drag: none; }

.slide.loading::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.slide-error {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted);
}

.viewer-bar {
	position: absolute;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 8px;
	color: #fff;
	pointer-events: none;
	transition: opacity 0.2s;
}
.viewer-bar > * { pointer-events: auto; }

.viewer-top {
	top: 0;
	padding-top: calc(8px + env(safe-area-inset-top));
	background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.viewer-bottom {
	bottom: 0;
	justify-content: center;
	padding-bottom: calc(12px + env(safe-area-inset-bottom));
	background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
	font-size: 14px;
	color: #ddd;
	text-align: center;
}
.viewer-bottom > * { pointer-events: none; }

.viewer-counter { flex: 1; padding-left: 8px; font-size: 15px; }

.viewer.ui-hidden .viewer-bar,
.viewer.ui-hidden .viewer-nav { opacity: 0; pointer-events: none; }
.viewer.ui-hidden .viewer-bar > * { pointer-events: none; }

.icon-btn {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 22px;
	line-height: 44px;
	text-align: center;
	cursor: pointer;
	padding: 0;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.2); }

.viewer-nav {
	position: absolute;
	top: 50%;
	margin-top: -28px;
	width: 56px;
	height: 56px;
	font-size: 30px;
	line-height: 56px;
	transition: opacity 0.2s;
}
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }
.viewer-nav[disabled] { opacity: 0.2; cursor: default; }

/* Touch devices swipe instead of using arrow buttons. */
@media (hover: none) and (pointer: coarse) {
	.viewer-nav { display: none; }
}
