/* ========== Variables ========== */
:root {
	--color-bg: #ffffff;
	--color-bg-secondary: #f5f5f5;
	--color-text: #1a1a1a;
	--color-text-secondary: #666;
	--color-gray: #666666;
	--color-gray-light: #e5e5e5;
	--color-accent: #0066cc;
	--header-height: 80px;
	--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
	--color-bg: #1a1a1a;
	--color-bg-secondary: #2a2a2a;
	--color-text: #ffffff;
	--color-text-secondary: #999;
	--color-gray: #999999;
	--color-gray-light: #333333;
	--color-accent: #4d9fff;
}

/* ========== Reset & Base ========== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: var(--font-sans);
	background: var(--color-bg);
	color: var(--color-text);
	line-height: 1.6;
	transition: background-color 0.3s ease, color 0.3s ease;
}

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

main {
	min-height: calc(100vh - var(--header-height) - 200px);
}

.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem;
}

/* ========== Typography ========== */
h1, h2, h3 {
	line-height: 1.2;
}

.page-header h1 {
	font-size: 2.5rem;
	margin-bottom: 0;
}

/* ========== Header & Navigation ========== */
header {
	height: var(--header-height);
	background: var(--color-bg);
	border-bottom: 1px solid var(--color-gray-light);
	position: sticky;
	top: 0;
	z-index: 100;
}

nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: var(--header-height); /* Statt height: 100% */
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 2rem;
}

.site-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--color-text);
	text-decoration: none;
}

nav ul {
	display: flex;
	gap: 2rem;
	list-style: none;
}

nav a {
	color: var(--color-text);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s ease;
}

nav a:hover,
nav a.active {
	color: var(--color-accent);
}

/* Theme Toggle */
.theme-toggle {
	background: none;
	border: 2px solid var(--color-gray-light);
	border-radius: 100px;
	width: 44px;
	height: 44px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.theme-toggle:hover {
	border-color: var(--color-accent);
}

/* ========== Home Page ========== */
.home-page {
	padding: 0;
}

/* Home Intro Section */
.home-intro {
	padding: 2rem;
	text-align: center;
	max-width: 900px;
	margin: 0 auto;
	position: relative;
}

.intro-content {
	font-size: 1;
	line-height: 1.8;
	color: var(--color-text);
	font-weight: 300;
}

.intro-content p {
	margin-bottom: 1.5rem;
}

/* .intro-content p:last-child {
	margin-bottom: 0;
}

.intro-content p:first-child {
	font-size: 1.6rem;
	font-weight: 400;
} */

.intro-content a {
	color: var(--color-accent);
	text-decoration: none;
	border-bottom: 1px solid var(--color-accent);
	transition: all 0.3s ease;
}

.intro-content a:hover {
	border-bottom-width: 2px;
}

/* .home-intro::after {
	content: "";
	display: block;
	width: 100px;
	height: 1px;
	background: var(--color-gray-light);
	margin: 3rem auto 0;
} */

/* Home Bilder-Galerie */
.home-gallery {
	max-width: 1200px;
	margin: 2rem auto;
	padding: 0 1rem;
}

.masonry-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1rem;
	justify-content: center;
	align-items: start;
	margin: 0 auto;
}

/* Alternative mit flexbox für bessere Zentrierung */
@media (min-width: 1200px) {
	.masonry-grid {
		display: flex;
		flex-wrap: wrap;
		gap: 1rem;
		justify-content: center;
	}
	
	.masonry-grid .masonry-item {
		flex: 0 1 calc(25% - 0.75rem); /* 4 Spalten */
		max-width: 300px;
	}
}

@media (min-width: 768px) and (max-width: 1199px) {
	.masonry-grid .masonry-item {
		flex: 0 1 calc(50% - 0.5rem); /* 2 Spalten */
	}
}

@media (max-width: 767px) {
	.masonry-grid .masonry-item {
		flex: 0 1 100%; /* 1 Spalte */
	}
}

.masonry-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	transition: transform 0.3s ease;
}

/* Home Albums Link */
.home-albums-link {
	text-align: center;
	padding: 3rem 2rem;
	background: var(--color-bg-secondary);
}

.view-all-albums {
	display: inline-block;
	padding: 1rem 2rem;
	background: var(--color-accent);
	color: white;
	text-decoration: none;
	border-radius: 100px;
	transition: all 0.3s ease;
}

.view-all-albums:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Recent Albums Section */
.recent-albums {
	padding: 3rem 2rem;
	max-width: 1400px;
	margin: 0 auto;
}

.recent-albums h2 {
	font-size: 1.5rem;
	margin-bottom: 2rem;
	font-weight: 400;
}

/* ========== Albums Grid ========== */
.albums-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
	margin: 2rem 0;
}

.albums-grid.compact {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1.5rem;
}

.album-card {
	display: block;
	text-decoration: none;
	background: var(--color-bg);
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--color-gray-light);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.album-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.album-card img {
	width: 100%;
	height: 250px;
	object-fit: cover;
}

.album-card.compact img {
	height: 150px;
}

.album-info {
	padding: 1.5rem;
}

.album-info h3 {
	margin-bottom: 0.5rem;
	font-size: 1.25rem;
}

.album-card.compact h3 {
	font-size: 1.1rem;
	font-weight: 500;
}

.album-info p,
.album-info span {
	color: var(--color-gray);
	font-size: 0.875rem;
}

/* ========== Photo Grid ========== */
.photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1rem;
	padding: 0 2rem 2rem;
	max-width: 1400px;
	margin: 0 auto;
}

.photo-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background: var(--color-bg-secondary);
}

.photo-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.photo-item:hover img {
	transform: scale(1.05);
}

/* ========== Photo Single View ========== */
.photo-single {
	display: flex;
	min-height: calc(100vh - 60px);
	gap: 2rem;
	padding: 1rem;
	max-width: 1400px;
	margin: 0 auto;
}

.photo-container {
	flex: 1;
	display: flex;
	align-items: flex-start; /* Statt center - richtet oben aus */
	justify-content: center;
	overflow: auto; /* Erlaubt Scrollen wenn nötig */
	padding: 1rem 0;
}

.photo-container img {
	max-width: 100%;
	max-height: calc(100vh - 100px);
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.photo-sidebar {
	width: 300px;
	flex-shrink: 0; /* Sidebar bleibt bei 300px */
}

/* Mobile */
@media (max-width: 768px) {
	.photo-single {
		flex-direction: column;
		padding: 0.5rem;
		gap: 1rem;
	}
	
	.photo-container {
		min-height: 50vh;
		max-height: 70vh;
	}
	
	.photo-container img {
		max-height: 70vh;
		width: 100%;
		height: auto;
	}
	
	.photo-sidebar {
		width: 100%;
		padding: 0 0.5rem;
	}
	
	.photo-nav-bottom {
		display: flex;
		gap: 1rem;
		margin-top: 1rem;
	}
}

/* Navigation */
.nav-prev, .nav-next, .back-link {
	padding: 0.5rem 1rem;
	background: var(--color-primary);
	color: white;
	border-radius: 4px;
	text-decoration: none;
}

.back-link {
	background: var(--color-bg);
	color: var(--color-text);
	border: 1px solid var(--color-border);
}

/* ========== Tags ========== */
.tag {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	margin: 0.25rem 0.25rem 0.25rem 0;
	background: rgba(0,102,204,0.1);
	color: var(--color-accent);
	border-radius: 100px;
	font-size: 0.875rem;
	text-decoration: none;
	transition: all 0.2s ease;
}

.tag:hover {
	background: var(--color-accent);
	color: white;
}

/* ========== About Page ========== */
.about-page {
	max-width: 1000px;
	margin: 0 auto;
}

.about-page h1 {
	text-align: center;
	margin-bottom: 2rem;
	font-size: 2.5rem;
}

.content-wrapper {
	display: flex;
	gap: 2rem;
	align-items: flex-start;
	margin-bottom: 3rem;
}

.author-avatar {
	width: 200px;
	height: 200px;
	object-fit: cover;
	flex-shrink: 0;
}

.author-text {
	flex: 1;
}

.about-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1.5rem;
	margin-top: 4rem;
	padding-top: 4rem;
	border-top: 1px solid var(--color-gray-light);
}

/* ========== Footer ========== */
footer {
	text-align: center;
	padding: 3rem 2rem;
	border-top: 1px solid var(--color-gray-light);
	color: var(--color-gray);
}

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

/* ========== Responsive ========== */
@media (max-width: 768px) {
	nav {
		padding: 0 1rem;
	}
	
	nav ul {
		gap: 1rem;
	}
	
	.home-intro {
		padding: 1.5rem;
	}
	
	.intro-content {
		font-size: 1.2rem;
	}
	
	.intro-content p:first-child {
		font-size: 1.3rem;
	}
	
	.photo-single {
		flex-direction: column;
	}
	
	.photo-container {
		height: 60vh;
	}
	
	.photo-sidebar {
		width: 100%;
		border-left: none;
		border-top: 1px solid var(--color-gray-light);
	}
	
	.content-wrapper {
		flex-direction: column;
	}
	
	.author-avatar {
		width: 100%;
		max-width: 300px;
		height: auto;
		aspect-ratio: 1;
	}
}

@media (max-width: 900px) {
	.masonry-grid {
		columns: 3 150px;
	}
}

@media (max-width: 600px) {
	.masonry-grid {
		columns: 2 150px;
	}
	
	.albums-grid,
		.albums-grid.compact {
			grid-template-columns: repeat(2, 1fr); /* 2 Spalten statt 1 */
			gap: 1rem; /* Etwas kleinerer Gap für mobile */
		}
		
		.album-card img,
		.album-card.compact img {
			height: 120px; /* Kleinere Bilder auf mobile */
		}
		
		.album-info {
			padding: 1rem; /* Weniger Padding */
		}
		
		.album-info h3 {
			font-size: 0.9rem; /* Kleinere Schrift */
		}
		
		.photo-grid {
			grid-template-columns: 1fr;
		}
	}

/* ========== Album Page ========== */
.album-header {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem;
}

.breadcrumb {
	margin-bottom: 1rem;
}

.breadcrumb a {
	color: var(--color-accent);
	text-decoration: none;
}

.album-description {
	font-size: 1.125rem;
	color: var(--color-gray);
	max-width: 800px;
}

/* ========== Photo Details ========== */
.photo-sidebar h1 {
	font-size: 1.5rem;
	margin-bottom: 1rem;
}

.description {
	color: var(--color-gray);
	margin-bottom: 2rem;
	line-height: 1.8;
}

.photo-details {
	margin: 2rem 0;
}

.photo-details dt {
	font-weight: 600;
	margin-top: 1rem;
	margin-bottom: 0.25rem;
	color: var(--color-gray);
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.photo-details dd {
	margin: 0;
}

/* Photo Navigation */
.back-link {
	color: var(--color-accent);
	text-decoration: none;
	font-weight: 500;
}

.photo-nav-top {
	margin-bottom: 2rem;
}

.photo-nav-bottom {
	display: flex;
	justify-content: space-between;
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-gray-light);
}

/* Links als Block-Elemente mit fester Breite */
.nav-prev, .nav-next {
	display: inline-block;
	white-space: nowrap; /* Text und Pfeil bleiben zusammen */
}

.photo-nav-bottom a {
	color: var(--color-accent);
	text-decoration: none;
	font-weight: 500;
}

.photo-nav-bottom a:hover {
	text-decoration: underline;
}

/* ========== Filter & Tags Page ========== */
.tags-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 2rem;
}

.tag-item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: var(--color-bg-secondary);
	color: var(--color-text);
	text-decoration: none;
	border-radius: 100px;
	transition: all 0.2s ease;
	border: 1px solid var(--color-gray-light);
}

.tag-item:hover {
	background: var(--color-accent);
	color: white;
	border-color: var(--color-accent);
}

.tag-item .count {
	font-size: 0.875rem;
	opacity: 0.7;
}

.filter-info {
	padding: 1rem 1.5rem;
	background: var(--color-bg-secondary);
	border-radius: 8px;
	margin-bottom: 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

.clear-filter {
	color: var(--color-gray);
	text-decoration: none;
	white-space: nowrap;
}

.clear-filter:hover {
	color: var(--color-accent);
}

/* Album Tags in der Übersicht */
.album-tags {
	margin-top: 0.5rem;
}

.album-tags .tag {
	font-size: 0.75rem;
	padding: 0.2rem 0.5rem;
}

/* ========== Photo Overlay ========== */
.photo-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 1.5rem;
	background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
	color: white;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
	opacity: 1;
}

.photo-overlay h3 {
	font-size: 1.125rem;
	margin-bottom: 0.25rem;
}

.photo-overlay span {
	font-size: 0.875rem;
	opacity: 0.9;
}

/* ========== Footer ========== */
footer {
	text-align: center;
	padding: 3rem 2rem;
	border-top: 1px solid var(--color-gray-light);
	background: var(--color-bg);
}

.footer-content {
	max-width: 800px;
	margin: 0 auto;
}

.social-links {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--color-gray);
	transition: all 0.3s ease;
}

.social-link:hover {
	color: var(--color-accent);
	transform: translateY(-2px);
}

.social-link svg {
	width: 24px;
	height: 24px;
}

/* Spezifische Hover-Farben optional */
.social-link.social-mastodon:hover { color: #6364ff; }
.social-link.social-instagram:hover { color: #e4405f; }
.social-link.social-bluesky:hover { color: #00a8e8; }
.social-link.social-email:hover { color: var(--color-accent); }
.social-link.social-signal:hover { color: #3a76f0; }
.social-link.social-rss:hover { color: #ff9500; }

footer p {
	color: var(--color-gray);
	margin: 0;
}

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

/* View Toggle */
.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
}

.view-toggle {
	padding: 0.5rem 1rem;
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-gray-light);
	border-radius: 4px;
	text-decoration: none;
	font-size: 0.9rem;
	transition: all 0.2s ease;
}

.view-toggle:hover {
	background: var(--color-accent);
	color: white;
	border-color: var(--color-accent);
}

/* Load More Button */
.load-more {
	display: block;
	margin: 2rem auto;
	padding: 0.75rem 2rem;
	background: var(--color-accent);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1rem;
	transition: all 0.2s ease;
}

.load-more:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* All Photos Grid */
.photo-grid.all-photos {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Alle Fotos Seite */
.all-photos-page .photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1rem;
	margin: 2rem 0;
}

.all-photos-page .photo-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background: var(--color-gray-light);
	aspect-ratio: 1;
}

.all-photos-page .photo-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease, opacity 0.3s ease;
	opacity: 0;
}

.all-photos-page .photo-item img.loaded {
	opacity: 1;
}

.all-photos-page .photo-item:hover img {
	transform: scale(1.05);
}

/* Loader */
.loader {
	text-align: center;
	padding: 2rem;
	color: var(--color-gray);
}

/* Zwei Buttons nebeneinander */
.home-albums-link {
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

@media (max-width: 768px) {
	.all-photos-page .photo-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5rem;
	}
	
	.home-albums-link {
		flex-direction: column;
		align-items: center;
	}
	
	.view-all-albums {
		width: 100%;
		max-width: 300px;
		text-align: center;
	}
}

/* Photo Grid für Alle Fotos - ohne extra Padding */
.photo-grid.all-photos {
	padding: 0;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1rem;
}

.photo-grid.all-photos.compact {
	padding: 0;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1rem;
}

@media (max-width: 600px) {
	.photo-grid.all-photos.compact {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5rem;
	}
}
	
	/* Container mit weniger Padding für Alle Fotos */
	main:has(.photo-grid.all-photos) .container {
		padding: 1rem 0.5rem;
	}
}

/* Home Tags Section - als Fließtext */
.home-tags {
	max-width: 900px;
	margin: 0 auto 3rem;
	padding: 0 2rem;
}

.home-tags-intro {
	text-align: center;
	font-size: 1.1rem;
	line-height: 1.8;
}

.home-tags-intro p {
	margin: 0;
	color: var(--color-text-secondary);
}

.tag-inline {
	color: var(--color-accent);
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.tag-inline:hover {
	text-decoration: underline;
}

@media (max-width: 768px) {
	.home-tags {
		padding: 0 1.5rem;
		margin-bottom: 2rem;
	}
	
	.home-tags-intro {
		font-size: 1rem;
	}
}