/*
minigal: minimalist gallery
BORSH
https://www.borsh.pro
*/

:root {
	/* Light theme colors */
	--bg-primary: #ffffff;
	--bg-secondary: #f8f9fa;
	--bg-card: #ffffff;
	--text-primary: #1a1a1a;
	--text-secondary: #666666;
	--text-muted: #888888;
	--border-color: #e0e0e0;
	--shadow-color: rgba(0, 0, 0, 0.1);
	--accent-color: #e74c3c;
	--overlay-bg: rgba(0, 0, 0, 0.8);
	--glass-bg: rgba(255, 255, 255, 0.8);
	--glass-border: rgba(255, 255, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
	:root {
		/* Dark theme colors */
		--bg-primary: #1a1a1a;
		--bg-secondary: #2d2d2d;
		--bg-card: #2d2d2d;
		--text-primary: #e0e0e0;
		--text-secondary: #a0a0a0;
		--text-muted: #808080;
		--border-color: #404040;
		--shadow-color: rgba(0, 0, 0, 0.3);
		--accent-color: #ff6b6b;
		--overlay-bg: rgba(0, 0, 0, 0.9);
		--glass-bg: rgba(45, 45, 45, 0.8);
		--glass-border: rgba(255, 255, 255, 0.1);
	}
}

:root {
	font-family: 'Inter', sans-serif;
}

@supports (font-variation-settings: normal) {
	:root {
		font-family: 'Inter var', sans-serif;
	}
}

/* Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

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

.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px;
}
/* Global Paragraph Styles */
p {
	margin-bottom: 1em;
	line-height: 1.6;
}
p:first-child {
	margin-top: 0;
}
p:last-child {
	margin-bottom: 0;
}

/* Top Navigation Menu */
.top-menu {
	background: var(--glass-bg);
	border-bottom: 1px solid var(--glass-border);
	padding: 0.5rem 0;
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
}

.menu-content {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.logo {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--text-primary);
	text-decoration: none;
}

.logo span {
	color: var(--accent-color);
}

.main-nav {
	display: flex;
	gap: 1.5rem;
	align-items: center;
}

.nav-link {
	color: var(--text-secondary);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.3s ease;
	padding: 0.4rem 0.8rem;
	border-radius: 6px;
	font-size: 0.9rem;
}

.nav-link:hover {
	color: var(--accent-color);
	background: var(--bg-secondary);
}

.nav-link.active {
	color: var(--accent-color);
	background: var(--bg-secondary);
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	font-size: 1.5rem;
	color: var(--text-primary);
	cursor: pointer;
	padding: 0.25rem;
}

/* Navigation Tiles */
.navigation-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
	margin: 30px 0;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

.nav-tile {
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	background: var(--bg-card);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: var(--text-primary);
	font-weight: 600;
	font-size: 0.9em;
	text-align: center;
	box-shadow: 0 2px 8px var(--shadow-color);
	transition: all 0.3s ease;
	padding: 10px;
	position: relative;
	overflow: hidden;
	max-width: 320px;
	max-height: 320px;
	width: 100%;
	height: auto;
	justify-self: center;
	opacity: 0.7;
	filter: saturate(0.8);
	border: 1px solid var(--border-color);
}

.nav-tile.active {
	opacity: 1;
	filter: saturate(1);
	box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
	border: 2px solid var(--accent-color);
}

.nav-tile-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	position: absolute;
	top: 0;
	left: 0;
	transition: all 0.3s ease;
}

.nav-tile.active .nav-tile-image {
	filter: brightness(1.1);
}

.nav-tile-text {
	position: relative;
	z-index: 2;
	background: rgba(255, 255, 255, 0.9);
	padding: 8px 12px;
	border-radius: 8px;
	backdrop-filter: blur(4px);
	transition: all 0.3s ease;
	color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
	.nav-tile-text {
		background: rgba(45, 45, 45, 0.9);
		color: var(--text-primary);
	}
}

.nav-tile.active .nav-tile-text {
	background: rgba(255, 255, 255, 0.95);
	color: var(--accent-color);
	font-weight: 700;
}

.nav-tile:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px var(--shadow-color);
	opacity: 0.9;
	filter: saturate(0.9);
}

.nav-tile.active:hover {
	box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
	transform: translateY(-3px) scale(1.02);
}

/* Square Tiles Grid */
.projects-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 20px;
	padding: 40px 0;
}

.project-tile {
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 12px var(--shadow-color);
	cursor: pointer;
	background: var(--bg-card);
	position: relative;
	border: 1px solid var(--border-color);
}

.project-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.project-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(transparent 40%, var(--overlay-bg));
	color: white;
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.project-tile:hover .project-overlay {
	opacity: 1;
}

.tile-title {
	font-size: 1.1em;
	font-weight: 600;
	margin-bottom: 4px;
}

.tile-subtitle {
	font-size: 0.9em;
	opacity: 0.9;
}

/* Project Card Modal */
.project-card {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--overlay-bg);
	z-index: 1000;
	overflow-y: auto;
}

.project-card.active {
	display: block;
}

.card-content {
	position: relative;
	max-width: 900px;
	margin: 40px auto;
	background: var(--bg-card);
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px var(--shadow-color);
	border: 1px solid var(--border-color);
}

.card-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.95);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	text-decoration: none;
	color: #333;
	z-index: 1001;
	cursor: pointer;
	opacity: 0.8;
	box-shadow: 0 2px 8px var(--shadow-color);
}

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

/* Image containers with zoom button */
.card-image-container,
.gallery-image-container {
	position: relative;
	display: block;
	width: 100%;
}

.card-image-container .image-zoom-btn,
.gallery-image-container .image-zoom-btn {
	position: absolute;
	bottom: 15px;
	right: 15px;
	width: 40px;
	height: 40px;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: #333;
	cursor: pointer;
	opacity: 0.7;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px var(--shadow-color);
	z-index: 10;
}

.card-image-container:hover .image-zoom-btn,
.gallery-image-container:hover .image-zoom-btn {
	opacity: 1;
	transform: scale(1.1);
}

.image-zoom-btn:hover {
	background: white;
	transform: scale(1.1);
}

/* Ensure images fill their containers */
.card-main-image,
.card-cover {
	width: 100%;
	display: block;
	position: relative;
}

.card-main-image {
	max-height: 50vh;
	object-fit: contain;
	background: var(--bg-secondary);
	padding: 20px;
}

.card-cover {
	max-height: 50vh;
	object-fit: cover;
	background: var(--bg-secondary);
	padding: 0;
}

/* Make images clickable */
.card-main-image,
.card-cover,
.project-gallery img {
	cursor: zoom-in;
	transition: transform 0.3s ease;
}

.card-main-image:hover,
.card-cover:hover,
.project-gallery img:hover {
	transform: scale(1.02);
}

.card-info {
	padding: 30px;
	flex: 1;
}

.card-title {
	font-size: 2em;
	margin-bottom: 8px;
	color: var(--text-primary);
	font-weight: 700;
}

/* Russian subtitle styling */
.card-subtitle {
	font-size: 1.3em;
	color: var(--text-secondary);
	margin-bottom: 20px;
	font-style: italic;
}

/* Card Description with Multiple Languages */
.card-description {
	color: var(--text-secondary);
	line-height: 1.6;
	margin-bottom: 25px;
}

.card-desc-lang-main {
	font-weight: 400;
	font-style: normal;
	margin-bottom: 15px;
	display: block;
}

.card-desc-lang-alt {
	font-weight: 300;
	font-style: italic;
	color: var(--text-muted);
	line-height: 1.5;
	font-size: 0.95em;
	border-left: 2px solid var(--accent-color);
	padding-left: 15px;
	margin-bottom: 15px;
	display: block;
}

/* Project Indicators Block - UPDATED */
.card-indicators {
	margin: 25px 0;
	padding: 0;
}

.card-indicators ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	background: var(--border-color);
	border-radius: 8px;
	overflow: hidden;
}

.card-indicators li {
	flex: 1;
	min-width: 120px;
	background: var(--bg-card);
	padding: 15px;
	text-align: right;
	position: relative;
}

.card-indicators li:not(:last-child)::after {
	content: "";
	position: absolute;
	right: 0;
	top: 15%;
	height: 70%;
	width: 1px;
	background: var(--border-color);
}

.indicator-value {
	display: block;
	font-size: 1.5em;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 4px;
	line-height: 1;
}

.indicator-unit {
	display: inline;
	font-size: 0.9em;
	color: var(--text-muted);
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
	margin-left: 2px;
}

.indicator-label {
	display: block;
	font-size: 0.85em;
	color: var(--text-secondary);
	margin-top: 8px;
	text-transform: uppercase;
	font-weight: 400;
}

/* Location Block */
.card-location {
	margin: 20px 0;
	padding: 0;
}

.card-location ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.card-location li {
	padding: 8px 0;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.card-location li:last-child {
	border-bottom: none;
}

.location-level {
	font-size: 0.8em;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 400;
	min-width: 80px;
}

.location-names {
	flex: 1;
	text-align: right;
}

.location-name-main {
	display: block;
	font-weight: 600;
	color: var(--text-primary);
	font-size: 0.95em;
}

.location-name-alt {
	display: block;
	font-weight: 300;
	font-style: italic;
	color: var(--text-muted);
	font-size: 0.85em;
	margin-top: 2px;
}

.meta-label {
	font-size: 0.85em;
	color: var(--text-muted);
	margin-bottom: 4px;
}

.meta-value {
	font-weight: 600;
	color: var(--text-primary);
}

.card-description {
	color: var(--text-secondary);
	line-height: 1.6;
	margin-bottom: 25px;
}

/* .card-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 20px;
	margin-top: 35px;
	padding-top: 25px;
	border-top: 2px solid var(--border-color);
	border-top: 2px solid var(--accent-color);
} */

.card-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 20px;
	margin-top: 35px;
	padding-top: 25px;
	border-top: 2px dotted var(--text-muted);
	position: relative;
}


.meta-item {
	display: flex;
	flex-direction: column;
}

/* Fullscreen image viewer */
.fullscreen-viewer {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--overlay-bg);
	z-index: 3000;
	align-items: center;
	justify-content: center;
}

.fullscreen-viewer.active {
	display: flex;
}

.fullscreen-image {
	max-width: 95%;
	max-height: 95%;
	object-fit: contain;
}

.fullscreen-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	color: #333;
	cursor: pointer;
	z-index: 3001;
}

.fullscreen-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 60px;
	height: 60px;
	background: rgba(255, 255, 255, 0.8);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #333;
	cursor: pointer;
	z-index: 3001;
	transition: all 0.3s ease;
}

.fullscreen-nav:hover {
	background: white;
	transform: translateY(-50%) scale(1.1);
}

.fullscreen-prev {
	left: 20px;
}

.fullscreen-next {
	right: 20px;
}

.fullscreen-nav.hidden {
	display: none;
}

/* Project gallery specific styles */
.project-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
	margin: 25px 0;
	padding: 0 10px;
}

.project-gallery .gallery-image-container {
	position: relative;
	display: block;
}

.project-gallery img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 8px;
	transition: transform 0.3s ease;
}

.project-gallery img:hover {
	transform: scale(1.05);
}

/* Footer */
.footer-signature {
	text-align: center;
	padding: 40px 0 20px;
	color: var(--text-muted);
	border-top: 1px solid var(--border-color);
	margin-top: 40px;
}

.footer-signature a {
	color: var(--text-primary);
	text-decoration: none;
	font-weight: 600;
}

.footer-signature a:hover {
	color: var(--accent-color);
}

/* Responsive columns */
@media (max-width: 1200px) {
	.projects-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 992px) {
	.projects-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.navigation-grid {
		grid-template-columns: repeat(3, 1fr);
		max-width: 400px;
	}

	.main-nav {
		gap: 1rem;
	}

	.nav-link {
		padding: 0.4rem 0.7rem;
		font-size: 0.85rem;
	}
}

@media (max-width: 768px) {
	.projects-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 15px;
	}

	.card-content {
		margin: 20px;
		max-width: none;
	}

	.card-main-image,
	.card-cover {
		max-height: 40vh;
		padding: 15px;
	}

	.card-info {
		padding: 25px;
	}

	.card-title {
		font-size: 1.6em;
	}

	.card-subtitle {
		font-size: 1.1em;
	}

	.navigation-grid {
		grid-template-columns: repeat(2, 1fr);
		max-width: 500px;
		gap: 10px;
	}

	.nav-tile {
		font-size: 0.8em;
		padding: 8px;
		max-width: 120px;
		max-height: 120px;
	}

	.menu-toggle {
		display: block;
	}

	.main-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--glass-bg);
		backdrop-filter: blur(20px) saturate(180%);
		flex-direction: column;
		padding: 1rem;
		border-bottom: 1px solid var(--glass-border);
	}

	.main-nav.active {
		display: flex;
	}

	.nav-link {
		padding: 0.8rem;
		text-align: center;
		width: 100%;
	}

	.top-menu {
		padding: 0.4rem 0;
	}
}

@media (max-width: 480px) {
	.projects-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.container {
		padding: 15px;
	}

	.card-content {
		margin: 10px;
		border-radius: 12px;
	}

	.card-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 20px;
	}

	.card-main-image,
	.card-cover {
		max-height: 35vh;
		padding: 10px;
	}

	.card-info {
		padding: 20px;
	}

	.card-title {
		font-size: 1.4em;
	}

	.card-subtitle {
		font-size: 1em;
	}

	.card-meta {
		grid-template-columns: 1fr;
		gap: 15px;
		padding-top: 20px;
		margin-top: 30px;
	}

	.navigation-grid {
		grid-template-columns: repeat(2, 1fr);
		max-width: 300px;
		gap: 8px;
	}

	.nav-tile {
		font-size: 0.75em;
		padding: 6px;
		max-width: 150px;
		max-height: 150px;
	}

	.top-menu {
		padding: 0.3rem 0;
	}

	.logo {
		font-size: 1.2rem;
	}

	.card-indicators ul {
		flex-direction: column;
	}

	.card-indicators li {
		min-width: auto;
		padding: 12px 15px;
		text-align: left;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.card-indicators li:not(:last-child)::after {
		display: none;
	}

	.card-indicators li:not(:last-child) {
		border-bottom: 1px solid var(--border-color);
	}

	.indicator-content {
		text-align: right;
	}

	.indicator-value {
		display: inline;
		font-size: 1.3em;
		margin-bottom: 0;
	}

	.indicator-unit {
		display: inline;
		font-size: 0.85em;
		margin-left: 2px;
	}

	.indicator-label {
		display: block;
		margin-top: 2px;
		font-size: 0.8em;
		text-align: left;
	}
}

/* Very small screens */
@media (max-width: 360px) {
	.projects-grid {
		grid-template-columns: 1fr;
		max-width: 300px;
		margin: 0 auto;
	}

	.navigation-grid {
		grid-template-columns: 1fr;
		max-width: 200px;
	}

	.nav-tile {
		max-width: 200px;
		max-height: 200px;
	}
}
