/* Selekro Theme – Main Styles */

:root {
	--font-family: 'Sora', system-ui, -apple-system, sans-serif;
	--sidebar-width: 260px;
	--radius-sm: 6px;
	--radius-md: 8px;
	--transition: 180ms ease;
	--content-padding: clamp(1.25rem, 3vw, 2.5rem);
}

[data-theme="dark"] {
	--color-bg: #000000;
	--color-bg-elevated: #111111;
	--color-bg-hover: #1a1a1a;
	--color-text: #ffffff;
	--color-text-muted: #a3a3a3;
	--color-border: #2a2a2a;
	--color-accent: #ffffff;
	--color-overlay: rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
	--color-bg: #ffffff;
	--color-bg-elevated: #f5f5f5;
	--color-bg-hover: #ececec;
	--color-text: #000000;
	--color-text-muted: #666666;
	--color-border: #e0e0e0;
	--color-accent: #000000;
	--color-overlay: rgba(255, 255, 255, 0.65);
}

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

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-family);
	font-size: 15px;
	line-height: 1.6;
	color: var(--color-text);
	background: var(--color-bg);
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

button, input, select { font: inherit; color: inherit; }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 1.25rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg-elevated);
	cursor: pointer;
	transition: background var(--transition);
}

.button:hover { background: var(--color-bg-hover); }

/* Layout shell */
.site-shell {
	display: flex;
	min-height: 100vh;
}

.site-main {
	flex: 1;
	min-width: 0;
	margin-left: var(--sidebar-width);
}

/* Sidebar */
.site-sidebar {
	position: fixed;
	top: 0;
	left: 0;
	width: var(--sidebar-width);
	height: 100vh;
	border-right: 1px solid var(--color-border);
	background: var(--color-bg);
	z-index: 100;
}

.site-sidebar__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 1.75rem 1.25rem 1.25rem;
}

.site-brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 2rem;
}

.site-brand__logo {
	width: 40px;
	height: 40px;
	color: var(--color-text);
}

.site-brand__logo svg { width: 100%; height: 100%; }

.site-brand__name {
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.site-nav { flex: 1; overflow-y: auto; }

.site-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.site-nav__item a {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.65rem 0.85rem;
	border-radius: var(--radius-sm);
	color: var(--color-text-muted);
	transition: background var(--transition), color var(--transition);
}

.site-nav__item a:hover,
.site-nav__item.is-active a {
	background: var(--color-bg-hover);
	color: var(--color-text);
}

.site-nav__icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.site-nav__icon svg { width: 100%; height: 100%; }

.site-nav__badge {
	margin-left: auto;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.5;
}

.site-nav__item.is-phase-two a {
	pointer-events: none;
	opacity: 0.45;
}

.site-sidebar__footer {
	margin-top: auto;
	padding-top: 1.5rem;
	border-top: 1px solid var(--color-border);
}

.color-mode-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.55rem 0.75rem;
	margin-bottom: 1rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: transparent;
	cursor: pointer;
}

.color-mode-toggle__icon { width: 18px; height: 18px; }
.color-mode-toggle__icon svg { width: 100%; height: 100%; }

[data-theme="dark"] .color-mode-toggle__icon--light,
[data-theme="light"] .color-mode-toggle__icon--dark { display: none; }

.site-social {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.site-social a {
	display: flex;
	width: 20px;
	height: 20px;
	color: var(--color-text-muted);
	transition: color var(--transition);
}

.site-social a:hover { color: var(--color-text); }
.site-social svg { width: 100%; height: 100%; }

.site-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
	font-size: 0.8rem;
}

.site-legal a { color: var(--color-text-muted); }
.site-legal a:hover { color: var(--color-text); }

.site-copyright {
	margin: 0;
	font-size: 0.75rem;
	color: var(--color-text-muted);
	line-height: 1.4;
}

/* Mobile menu */
.mobile-menu-toggle {
	display: none;
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 200;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg);
	cursor: pointer;
}

.mobile-menu-toggle svg { width: 22px; height: 22px; margin: auto; }

.site-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 90;
}

/* Hero slideshow */
.hero-slideshow {
	position: relative;
	width: 100%;
	height: 100vh;
	min-height: 480px;
	background: var(--color-bg-elevated);
	overflow: hidden;
}

.hero-slideshow__track,
.hero-slideshow__slide {
	width: 100%;
	height: 100%;
}

.hero-slideshow__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 800ms ease;
}

.hero-slideshow__slide.is-active { opacity: 1; z-index: 1; }

.hero-slideshow__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero-slideshow__dots {
	position: absolute;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 0.5rem;
	z-index: 2;
}

.hero-slideshow__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.hero-slideshow__dot.is-active { background: #fff; }

.hero-slideshow__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 2rem;
	text-align: center;
	color: var(--color-text-muted);
	gap: 1rem;
}

/* Gallery page */
.gallery-page,
.content-page,
.legal-page,
.project-single {
	padding: var(--content-padding);
}

.page-header {
	margin-bottom: 2rem;
}

.page-header__title {
	margin: 0 0 0.35rem;
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 600;
	line-height: 1.1;
}

.page-header__subtitle {
	margin: 0;
	color: var(--color-text-muted);
	font-size: 1rem;
}

.gallery-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 1rem;
	margin-bottom: 2.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--color-border);
}

.gallery-toolbar:has(.gallery-tabs) {
	justify-content: space-between;
}

.gallery-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
}

.gallery-tabs__btn {
	padding: 0.25rem 0;
	border: none;
	background: none;
	color: var(--color-text-muted);
	cursor: pointer;
	border-bottom: 2px solid transparent;
}

.gallery-tabs__btn.is-active {
	color: var(--color-text);
	border-bottom-color: var(--color-text);
}

.gallery-tabs__btn.is-phase-two { opacity: 0.4; cursor: not-allowed; }

.gallery-toolbar__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
}

.gallery-search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg-elevated);
}

.gallery-search svg { width: 16px; height: 16px; flex-shrink: 0; }

.gallery-search input {
	border: none;
	background: transparent;
	outline: none;
	min-width: 140px;
}

.gallery-sort select {
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg-elevated);
}

.section-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.section-heading h2 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
}

.section-heading__link {
	font-size: 0.875rem;
	color: var(--color-text-muted);
}

.section-heading__link:hover { color: var(--color-text); }

.projects-section { margin-bottom: 3rem; }

.projects-row {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(180px, 220px);
	gap: 1rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	scrollbar-width: thin;
}

.project-card {
	position: relative;
	display: block;
	aspect-ratio: 2 / 3;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--color-bg-elevated);
}

.project-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.project-card:hover img { transform: scale(1.03); }

.project-card__overlay {
	position: absolute;
	inset: auto 0 0 0;
	padding: 1rem;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
	color: #fff;
}

.project-card__overlay h3 {
	margin: 0 0 0.25rem;
	font-size: 0.95rem;
	font-weight: 600;
}

.project-card__overlay p {
	margin: 0;
	font-size: 0.75rem;
	opacity: 0.85;
}

.year-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.year-filters__btn {
	padding: 0.35rem 0.65rem;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: transparent;
	font-size: 0.8rem;
	cursor: pointer;
}

.year-filters__btn.is-active {
	background: var(--color-text);
	color: var(--color-bg);
	border-color: var(--color-text);
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.5rem;
}

.gallery-grid__item {
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	border-radius: var(--radius-sm);
	overflow: hidden;
	aspect-ratio: 2 / 3;
}

.gallery-grid__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity var(--transition);
}

.gallery-grid__item:hover img { opacity: 0.85; }

.gallery-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 2rem;
}

.gallery-load-more {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 2rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg-elevated);
	cursor: pointer;
	min-width: 280px;
	justify-content: center;
}

.gallery-load-more:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-state {
	color: var(--color-text-muted);
	padding: 2rem 0;
}

/* Lightbox */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.92);
	padding: 2rem;
}

.lightbox[hidden] { display: none; }

.lightbox__figure {
	margin: 0;
	max-width: min(1200px, 92vw);
	max-height: 88vh;
	text-align: center;
}

.lightbox__image {
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
	margin: 0 auto;
	border-radius: var(--radius-sm);
}

.lightbox__caption {
	margin-top: 0.75rem;
	color: #ccc;
	font-size: 0.875rem;
}

.lightbox__close,
.lightbox__nav {
	position: absolute;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	cursor: pointer;
	border-radius: var(--radius-sm);
}

.lightbox__close {
	top: 1rem;
	right: 1rem;
	width: 44px;
	height: 44px;
	padding: 0;
}

.lightbox__close svg { width: 20px; height: 20px; margin: auto; }

.lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 2rem;
	line-height: 1;
}

.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

/* Password form */
.project-password {
	max-width: 420px;
	padding: var(--content-padding);
}

.project-password__form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1rem;
}

.project-password__form input {
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-bg-elevated);
}

/* Legal pages */
.legal-page__content h2 {
	margin-top: 2rem;
	font-size: 1.1rem;
}

.legal-page__content p,
.legal-page__content li {
	color: var(--color-text-muted);
}

.entry-content > *:first-child { margin-top: 0; }

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

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

@media (max-width: 768px) {
	:root { --sidebar-width: min(85vw, 300px); }

	.mobile-menu-toggle { display: flex; align-items: center; justify-content: center; }

	.site-sidebar {
		transform: translateX(-100%);
		transition: transform 240ms ease;
	}

	.site-sidebar.is-open {
		transform: translateX(0);
	}

	.site-overlay.is-visible { display: block; }

	.site-main { margin-left: 0; }

	.gallery-grid { grid-template-columns: repeat(2, 1fr); }

	.gallery-toolbar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
	.gallery-grid { grid-template-columns: 1fr 1fr; gap: 0.35rem; }
}
