/*
Theme Name: B Artwork
Theme URI: https://www.maxserv.com/
Author: Bart Erkamp
Author URI: https://www.maxserv.com/
Description: A minimalist photography portfolio theme. Showcases projects in a CSS-columns masonry layout with a persistent left-hand project navigation. Inspired by the clean, gallery-style aesthetic of modern portrait portfolios.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: b-artwork
Tags: portfolio, photography, masonry, minimal, custom-menu
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
	--ba-bg: #ffffff;
	--ba-fg: #111111;
	--ba-muted: #8a8a8a;
	--ba-line: #e6e6e6;
	--ba-accent: #111111;

	--ba-sidebar-width: 240px;
	--ba-gutter: 14px;        /* space between masonry items */
	--ba-page-pad: 40px;

	--ba-font-sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
	--ba-fs-base: 15px;
	--ba-fs-nav: 14px;
	--ba-fs-h1: 28px;

	--ba-cols: 3;             /* masonry column count, overridden in media queries */
}

/* ==========================================================================
   Base / reset
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	background: var(--ba-bg);
	color: var(--ba-fg);
	font-family: var(--ba-font-sans);
	font-size: var(--ba-fs-base);
	line-height: 1.55;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

a {
	color: var(--ba-fg);
	text-decoration: none;
}

a:hover,
a:focus {
	opacity: 0.55;
}

h1, h2, h3 {
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 0.6em;
}

h1 { font-size: var(--ba-fs-h1); }

p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ba-fg);
	color: var(--ba-bg);
	padding: 10px 16px;
	z-index: 1000;
}
.skip-link:focus {
	left: 8px;
	top: 8px;
	opacity: 1;
}

/* ==========================================================================
   Layout shell: left sidebar + main
   ========================================================================== */
.ba-shell {
	display: flex;
	align-items: flex-start;
	min-height: 100vh;
}

.ba-sidebar {
	position: sticky;
	top: 0;
	flex: 0 0 var(--ba-sidebar-width);
	width: var(--ba-sidebar-width);
	height: 100vh;
	overflow-y: auto;
	padding: var(--ba-page-pad) 24px;
	border-right: 1px solid var(--ba-line);
	background: var(--ba-bg);
}

.ba-main {
	flex: 1 1 auto;
	min-width: 0; /* allow children to shrink instead of overflowing */
	padding: var(--ba-page-pad) var(--ba-page-pad) 80px;
}

/* ---- Branding ---- */
.ba-brand {
	margin: 0 0 28px;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.25;
}
.ba-brand a { display: inline-block; }
.ba-tagline {
	margin: 4px 0 0;
	font-size: 12px;
	font-weight: 400;
	color: var(--ba-muted);
}

/* ---- Project navigation ---- */
.ba-nav-heading {
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ba-muted);
	margin: 0 0 12px;
	font-weight: 600;
}

.ba-projectnav ul {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
}
.ba-projectnav li {
	margin: 0;
}
.ba-projectnav a {
	display: block;
	padding: 5px 0;
	font-size: var(--ba-fs-nav);
	color: var(--ba-fg);
	border: 0;
}
.ba-projectnav a:hover {
	opacity: 0.55;
}
.ba-projectnav .current a,
.ba-projectnav a[aria-current="page"] {
	font-weight: 600;
	opacity: 1;
}
.ba-projectnav .current a::before {
	content: "— ";
}

/* ---- Secondary (pages) menu ---- */
.ba-secondary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ba-secondary-nav a {
	display: block;
	padding: 4px 0;
	font-size: var(--ba-fs-nav);
	color: var(--ba-muted);
}
.ba-secondary-nav a:hover { color: var(--ba-fg); opacity: 1; }

.ba-social {
	margin-top: 24px;
	font-size: 13px;
}
.ba-social a { color: var(--ba-muted); }

/* ==========================================================================
   Mobile top bar + toggle
   ========================================================================== */
.ba-topbar {
	display: none;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid var(--ba-line);
	position: sticky;
	top: 0;
	background: var(--ba-bg);
	z-index: 50;
}
.ba-topbar .ba-brand { margin: 0; font-size: 16px; }

.ba-menu-toggle {
	display: none;
	background: none;
	border: 0;
	font: inherit;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	padding: 6px 4px;
	color: var(--ba-fg);
}

/* ==========================================================================
   Masonry gallery (JS Masonry — left-to-right ordering)
   ========================================================================== */
.ba-masonry {
	margin: 0;
}
/* Sizers define the column + gutter widths Masonry reads. Width adapts to the
   current --ba-cols via the media queries below. */
.ba-masonry__item,
.ba-masonry__sizer {
	width: calc((100% - (var(--ba-cols) - 1) * var(--ba-gutter)) / var(--ba-cols));
}
.ba-masonry__gutter-sizer {
	width: var(--ba-gutter);
}
.ba-masonry__sizer,
.ba-masonry__gutter-sizer {
	height: 0;
	margin: 0;
	padding: 0;
}
.ba-masonry__item {
	/* float is only the no-JS fallback; Masonry switches items to absolute. */
	float: left;
	margin: 0 0 var(--ba-gutter);
}
.ba-masonry__item img {
	width: 100%;
	border-radius: 1px;
	background: #f3f3f3;
}
.ba-masonry__item figcaption {
	font-size: 12px;
	color: var(--ba-muted);
	padding: 6px 2px 0;
}
.ba-masonry__item a {
	display: block;
	cursor: zoom-in;
}
.ba-masonry__item a img {
	transition: opacity 0.2s ease;
}
.ba-masonry__item a:hover img {
	opacity: 0.85;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.ba-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.98);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.ba-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}
.ba-lightbox__figure {
	margin: 0;
	max-width: 92vw;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.ba-lightbox__img {
	max-width: 92vw;
	max-height: 84vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 2px 30px rgba(0, 0, 0, 0.18);
}
.ba-lightbox__caption {
	margin-top: 12px;
	font-size: 12px;
	color: var(--ba-muted);
	text-align: center;
	min-height: 1em;
}
.ba-lightbox__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: 0;
	font: inherit;
	font-size: 34px;
	line-height: 1;
	color: var(--ba-fg);
	cursor: pointer;
	padding: 16px 20px;
	opacity: 0.55;
	transition: opacity 0.15s ease;
	user-select: none;
}
.ba-lightbox__btn:hover { opacity: 1; }
.ba-lightbox__prev { left: 6px; }
.ba-lightbox__next { right: 6px; }
.ba-lightbox__close {
	top: 14px;
	right: 16px;
	transform: none;
	font-size: 28px;
}
.ba-lightbox__counter {
	position: absolute;
	bottom: 18px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 12px;
	color: var(--ba-muted);
}
@media (max-width: 540px) {
	.ba-lightbox__btn { font-size: 26px; padding: 12px 14px; }
	.ba-lightbox__img { max-height: 78vh; }
}

/* ==========================================================================
   Project / archive grids (thumbnails of projects)
   ========================================================================== */
.ba-project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 28px;
}
.ba-project-card__title {
	margin: 12px 0 0;
	font-size: 15px;
	font-weight: 600;
}
.ba-project-card__meta {
	font-size: 12px;
	color: var(--ba-muted);
}

/* ==========================================================================
   Single project header
   ========================================================================== */
.ba-project-header {
	margin: 0 0 30px;
	max-width: 720px;
}
.ba-project-header h1 { margin-bottom: 8px; }
.ba-project-header .ba-project-intro {
	color: #444;
	font-size: 16px;
}

.ba-page-content {
	max-width: 720px;
}
.ba-page-content img { margin: 1em 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.ba-footer {
	margin-top: 60px;
	padding-top: 20px;
	border-top: 1px solid var(--ba-line);
	font-size: 12px;
	color: var(--ba-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	:root { --ba-cols: 3; }
}

@media (max-width: 900px) {
	:root {
		--ba-cols: 2;
		--ba-page-pad: 24px;
	}

	.ba-shell { display: block; }

	.ba-topbar { display: flex; }
	.ba-menu-toggle { display: inline-block; }

	.ba-sidebar {
		position: static;
		width: 100%;
		flex-basis: auto;
		height: auto;
		border-right: 0;
		border-bottom: 1px solid var(--ba-line);
		padding: 20px var(--ba-page-pad);
		display: none;
	}
	.ba-sidebar .ba-brand { display: none; } /* brand already shown in topbar */

	/* When toggled open */
	body.ba-nav-open .ba-sidebar { display: block; }
}

@media (max-width: 540px) {
	:root {
		--ba-cols: 1;
		--ba-gutter: 10px;
	}
}
