:root {
	--paper: #f5efe1;
	--ink: #1f2933;
	--accent: #9c6644;
	--accent-dark: #6b3f22;
	--muted: #6c6f73;
	--card: rgba(255, 251, 245, 0.92);
	--shadow: 0 18px 50px rgba(38, 23, 8, 0.12);
	--border: rgba(107, 63, 34, 0.16);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: Georgia, "Times New Roman", serif;
	color: var(--ink);
	background:
		radial-gradient(circle at top left, rgba(156, 102, 68, 0.22), transparent 30%),
		radial-gradient(circle at top right, rgba(59, 99, 95, 0.18), transparent 28%),
		linear-gradient(180deg, #fcf8f0 0%, var(--paper) 100%);
}

a {
	color: var(--accent-dark);
}

.shell {
	width: min(1680px, calc(100% - 1rem));
	margin: 0 auto;
	padding: 1rem 0 2rem;
}

.hero,
.album-hero,
.album-card,
.photo-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 24px;
	box-shadow: var(--shadow);
}

.hero,
.album-hero {
	padding: 2rem;
	margin-bottom: 2rem;
}

.album-hero {
	padding: 0.8rem 1rem;
	margin-bottom: 0.8rem;
	display: grid;
	grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.75rem 1rem;
}

.album-hero h1,
.album-hero p,
.album-hero .meta-row {
	margin-bottom: 0;
}

.album-hero-title {
	display: grid;
	gap: 0.2rem;
	min-width: 0;
}

.album-hero h1 {
	font-size: clamp(1.2rem, 1.2vw + 0.95rem, 1.65rem);
	line-height: 1.1;
}

.album-hero .eyebrow {
	margin-bottom: 0;
	font-size: 0.72rem;
}

.album-hero .meta-row {
	gap: 0.5rem;
	font-size: 0.85rem;
}

.album-hero-footer {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.album-hero-description {
	font-size: 0.92rem;
	line-height: 1.35;
	min-width: 0;
}

.album-hero-description p {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.eyebrow {
	margin: 0 0 0.5rem;
	font-size: 0.85rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

.hero-grid,
.album-grid {
	display: grid;
	gap: 1rem;
}

.album-grid {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.album-card {
	padding: 1.3rem;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.album-card-thumbnail {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 18px;
	background: #efe6d7;
	border: 1px solid rgba(107, 63, 34, 0.12);
}

.album-card-thumbnail img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	object-position: center;
}

.album-card-link {
	color: inherit;
	text-decoration: none;
}

.album-card-link:hover {
	border-color: rgba(107, 63, 34, 0.28);
	box-shadow: 0 20px 55px rgba(38, 23, 8, 0.16);
}

.meta-row {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	color: var(--muted);
	font-size: 0.95rem;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	background: rgba(156, 102, 68, 0.12);
	color: var(--accent-dark);
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.album-link,
.back-link {
	text-decoration: none;
	font-weight: 700;
}

.album-link:hover,
.back-link:hover {
	text-decoration: underline;
}

.viewer-shell {
	display: grid;
	gap: 1rem;
	--viewer-layout-height: min(72vh, calc(100vh - 11rem));
}
.viewer-layout {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr);
	gap: 1rem;
	align-items: stretch;
	height: var(--viewer-layout-height);
	max-height: var(--viewer-layout-height);
}

.viewer-sidebar {
	min-width: 0;
	height: 100%;
}

.photo-card {
	overflow: hidden;
}

.viewer-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.viewer-actions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.viewer-counter {
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent-dark);
}

.icon-button,
.nav-button,
.thumb-close {
	appearance: none;
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.85);
	color: var(--ink);
	border-radius: 999px;
	font: inherit;
	cursor: pointer;
	transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
	box-shadow: 0 8px 24px rgba(38, 23, 8, 0.1);
}

.icon-button,
.thumb-close {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.7rem 1rem;
}

.icon-button svg {
	width: 1rem;
	height: 1rem;
	fill: currentColor;
}

.nav-button {
	align-self: center;
	width: 3rem;
	height: 3rem;
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0.5rem;
	flex: 0 0 auto;
}

.icon-button:hover,
.nav-button:hover,
.thumb-close:hover,
.thumb-button:hover {
	transform: translateY(-1px);
	border-color: rgba(107, 63, 34, 0.28);
	box-shadow: 0 14px 30px rgba(38, 23, 8, 0.14);
}

.nav-button:disabled {
	opacity: 0.4;
	cursor: default;
	transform: none;
	box-shadow: none;
}

.viewer-stage {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: stretch;
	padding: 0.75rem;
	width: 100%;
	height: 100%;
	max-width: 100%;
	min-height: 0;
	gap: 0.25rem;
	position: relative;
	overflow: hidden;
	justify-self: stretch;
}

.viewer-stage:fullscreen {
	width: 100vw;
	height: 100vh;
	max-width: none;
	padding: 1rem;
	background: #0f141a;
	gap: 0.75rem;
}

.viewer-figure {
	margin: 0;
	padding: 0.5rem;
	border-radius: 20px;
	background: rgba(239, 230, 215, 0.72);
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: pan-y;
	user-select: none;
	cursor: grab;
	min-height: 0;
	height: 100%;
	overflow: hidden;
}

.viewer-stage:fullscreen .viewer-figure {
	min-height: 0;
	padding: 0;
	background: transparent;
	border-radius: 0;
}

.viewer-figure.is-dragging {
	cursor: grabbing;
}

#viewer-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0 auto;
	object-fit: contain;
	object-position: center;
	background: #efe6d7;
}

.viewer-stage.fit-contain #viewer-image {
	object-fit: contain;
}

.viewer-stage:fullscreen #viewer-image {
	background: #0f141a;
}

.viewer-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	width: 3rem;
	height: 3rem;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	line-height: 1;
	padding: 0;
}

.viewer-stage:fullscreen .viewer-close {
	display: inline-flex;
}

.photo-card img {
	display: block;
	max-width: 100%;
	max-height: 72vh;
	width: auto;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	background: #efe6d7;
}

.photo-body {
	padding: 1.2rem 1.25rem 1.4rem;
}

.viewer-copy-card .photo-body {
	padding-top: 1.35rem;
	height: 100%;
	overflow: auto;
}

.viewer-copy-card {
	height: 100%;
}

.viewer-copy-stack {
	display: grid;
	gap: 1rem;
	align-content: start;
}

.viewer-copy-box {
	padding: 1rem 1.1rem;
	border-radius: 18px;
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.62);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.viewer-copy-box h3 {
	margin-bottom: 0.6rem;
	color: var(--accent-dark);
	font-size: 0.98rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.viewer-copy-box p:last-child,
.viewer-copy-box .comment-list:last-child,
.viewer-copy-box .comment:last-child {
	margin-bottom: 0;
}

.viewer-copy-box .comment {
	background: rgba(255, 250, 243, 0.95);
}

.photo-body h3 {
	margin-bottom: 0.65rem;
}

.viewer-hints {
	margin: 0;
	font-size: 0.95rem;
}

.comment-block {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}

.comment-list {
	display: grid;
	gap: 0.85rem;
}

.comment {
	padding: 0.9rem 1rem;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.65);
}

.comment-author {
	font-weight: 700;
	margin-bottom: 0.35rem;
}

.muted {
	color: var(--muted);
}

.thumb-overlay {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 1rem;
	z-index: 20;
}

.thumb-overlay.is-hidden {
	display: none;
}

.thumb-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(31, 41, 51, 0.55);
	backdrop-filter: blur(6px);
}

.thumb-panel {
	position: relative;
	z-index: 1;
	width: min(1200px, calc(100% - 1rem));
	max-height: min(88vh, 960px);
	background: rgba(255, 250, 243, 0.97);
	border: 1px solid var(--border);
	border-radius: 28px;
	box-shadow: 0 24px 60px rgba(13, 20, 27, 0.28);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.thumb-panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.2rem;
	border-bottom: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.8);
}

.thumb-panel-header h2 {
	margin: 0;
	font-size: 1.1rem;
}

.thumb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 0.9rem;
	padding: 1rem;
	overflow: auto;
}

.thumb-button {
	appearance: none;
	border: 1px solid var(--border);
	border-radius: 18px;
	padding: 0.5rem;
	background: rgba(255, 255, 255, 0.78);
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
	box-shadow: 0 8px 20px rgba(38, 23, 8, 0.08);
	transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.thumb-button img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 14px;
	max-height: none;
	background: #efe6d7;
}

.thumb-button strong,
.thumb-button span {
	display: block;
	padding: 0.45rem 0.1rem 0;
	font-size: 0.86rem;
	line-height: 1.35;
}

.thumb-button strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thumb-button span {
	color: var(--muted);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.thumb-button.is-active {
	border-color: var(--accent-dark);
	box-shadow: 0 14px 32px rgba(107, 63, 34, 0.18);
	background: rgba(255, 247, 238, 0.96);
}

@media (max-width: 980px) {
	.album-hero {
		grid-template-columns: 1fr;
		align-items: start;
	}

	.album-hero-footer {
		justify-content: space-between;
	}

	.viewer-layout {
		grid-template-columns: 1fr;
		height: auto;
		max-height: none;
	}

	.viewer-stage {
		width: min(100%, max(320px, calc(100vh - 12rem)));
		height: auto;
		aspect-ratio: 1 / 1;
		min-height: 320px;
		justify-self: center;
	}

	.nav-button {
		width: 2.6rem;
		height: 2.6rem;
		margin: 0 0.2rem;
	}

	.viewer-sidebar {
		height: auto;
	}

	.viewer-copy-card,
	.viewer-copy-card .photo-body {
		height: auto;
		max-height: none;
	}
}

@media (max-width: 700px) {
	.shell {
		width: min(100% - 1rem, 1100px);
	}

	.hero,
	.album-hero,
	.album-card,
	.photo-body {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.viewer-figure {
		min-height: 0;
	}

	.thumb-grid {
		grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	}

	.viewer-actions {
		width: 100%;
	}

	.viewer-actions .icon-button {
		flex: 1 1 0;
		justify-content: center;
	}
}
