/* Projects page: measured masonry, expand-to-full-width cards */

/* Filter bar */
.filters{ padding: 32px 0 0; }
.filter-bar{ display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn{
	font-family: var(--font-display); font-size: 13px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
	color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: 999px;
	padding: 8px 18px; cursor: pointer; transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.filter-btn:hover{ color: var(--text-strong); border-color: var(--accent); }
.filter-btn.active{ color: var(--text-strong); background: var(--accent); border-color: var(--accent); }

/* Masonry: full-width expanded slot above, two measured masonry columns below */
.cards-section{ padding: 24px 0 48px; }
.expanded-slot{ width: 100%; margin-bottom: 16px; }
.expanded-slot:empty{ display: none; }
.card-columns{ display: flex; align-items: flex-start; }
.card-col{ flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }

/* Cards */
.card-item{
	display: flex; flex-direction: column; padding: 28px; opacity: 0; transform: translateY(24px);
	transition: opacity .6s ease, transform .25s ease, box-shadow .25s ease, border-color .2s ease;
}
.card-item.visible{ opacity: 1; transform: translateY(0); }
.card-item.hidden{ display: none; }
.card-item:not(.expanded){ cursor: pointer; }
.card-item.expanded{ box-shadow: 0 16px 40px rgba(43,43,43,.14); }

@media (hover: hover){
	.card-item.visible:not(.expanded):hover{
		transform: translateY(-2px);
		border-color: rgba(3,45,57,.28);
		box-shadow: 0 14px 34px rgba(3,45,57,.12);
	}
	.card-item:not(.expanded):hover .card-title{
		text-decoration: underline;
		text-decoration-color: var(--accent);
		text-decoration-thickness: 1px;
		text-underline-offset: .14em;
	}
}
.card-item h2{ margin: 0 0 12px; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; letter-spacing: .04em; color: var(--text-strong); }

/* The title doubles as the expand trigger */
.card-title{
	appearance: none; -webkit-appearance: none; font-family: inherit; font-size: inherit; font-weight: inherit;
	letter-spacing: inherit; line-height: inherit; color: var(--text-strong); background: transparent; border: 0;
	padding: 0; margin: 0; text-align: left; cursor: pointer; display: inline-block;
	transition: color .2s ease, text-decoration-color .2s ease;
}
.card-title:hover, .card-title:focus-visible{
	color: var(--text-strong); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .14em;
}
.card-title:focus-visible{ outline: 2px solid var(--text-strong); outline-offset: 4px; border-radius: 2px; }
.card-summary{ font-size: 16px; margin: 0 0 16px; max-width: 68ch; }

/* Collapsed logo slot: one consistent stage and safe area for every logo orientation. */
.card-logo{
	width: 100%;
	height: 210px;
	margin-bottom: 20px;
	padding: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	border-radius: calc(var(--radius) - 2px);
	background: var(--bg);
}
.card-logo img{
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}
.card-item.expanded .card-logo{ display: none; }

/* Expanded body */
.card-body{ display: none; margin-bottom: 4px; }
.card-item.expanded .card-body{ display: block; animation: card-body-in .4s ease both; }
@keyframes card-body-in{ from{ opacity: 0; transform: translateY(8px); } to{ opacity: 1; transform: translateY(0); } }
.card-detail-text{ font-size: 15px; margin: 0 0 16px; max-width: 68ch; }

/* PDF link */
.card-pdf-wrap{ margin: 0 0 24px; }
.card-pdf{
	display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; color: var(--text-strong);
	text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 2px;
	transition: color .2s ease, border-color .2s ease;
}
.card-pdf:hover{ color: var(--text-strong); border-color: var(--accent); }

/* Expanded galleries: natural image heights, masonry columns */
.project-gallery{ columns: 2; column-gap: 16px; margin-top: 8px; }
.gallery-item{
	position: relative; z-index: 0; width: 100%; display: inline-block; vertical-align: top; break-inside: avoid;
	margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
	background: var(--bg); cursor: pointer; transition: box-shadow .25s ease;
}
/* Keep the stacking context constant on hover: toggling z-index inside a multicol layout with a
   column-span item forces Chrome to restack the whole gallery, which shows as a flash/flicker. */
.gallery-item:hover{ box-shadow: 0 12px 28px rgba(43,43,43,.12); }
.gallery-item img{ width: 100%; height: auto; display: block; object-fit: contain; }

/* Logo artwork uses a normalized stage instead of running full-bleed like photography. */
.gallery-item.logo-art img{
	height: 320px;
	padding: 48px;
	background: var(--bg);
	object-fit: contain;
}

.gallery-item figcaption{
	padding: 10px 16px; font-size: 12px;
	color: var(--text-strong); background: var(--card); border-top: 1px solid var(--border);
}
.gallery-wide{ column-span: all; }

/* See more button */
.expand-btn{
	align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 13px;
	font-weight: 400; letter-spacing: .08em; color: var(--text-strong); background: none; border: none; padding: 0;
	margin-top: 4px; cursor: pointer; border-bottom: 1px solid var(--accent); transition: opacity .2s ease;
}
.expand-btn:hover{ opacity: .7; }
.chevron{ display: inline-block; font-size: 11px; line-height: 1; transition: transform .2s ease; }
.card-item.expanded .chevron{ transform: rotate(180deg); }

/* Tags */
.card-tags{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tag{
	font-size: 11px; color: var(--text-strong);
	border: 1px solid;  border-radius: 999px; padding: 3px 10px;
}
.empty-state{ text-align: center; padding: 48px 24px; color: var(--text); font-size: 15px; }

/* Lightbox */
.lightbox{
	position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(43,43,43,.92); z-index: 100;
	display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
}
.lightbox.open{ opacity: 1; visibility: visible; }
.lightbox-content{ max-width: 90%; max-height: 90%; }
.lightbox-content img{ max-width: 100%; max-height: 90vh; object-fit: contain; display: block; border-radius: 8px; transform: scale(.95); transition: transform .3s ease; }
.lightbox.open .lightbox-content img{ transform: scale(1); }

/* Dark logos need a light presentation surface inside the dark lightbox. */
.lightbox.logo-preview .lightbox-content{
	width: min(90vw, 900px);
	height: min(76vh, 680px);
	padding: clamp(28px, 6vw, 64px);
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255,255,255,.2);
	border-radius: 14px;
	background: var(--bg);
	box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.lightbox.logo-preview .lightbox-content img{
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	background: transparent;
	object-fit: contain;
}
.lightbox-close{
	position: absolute; top: 20px; right: 24px; background: none; border: none; color: rgba(253,250,247,.9);
	font-size: 32px; cursor: pointer; padding: 8px; line-height: 1; transition: color .2s ease;
}
.lightbox-close:hover{ color: var(--accent); }

@media (max-width: 740px){
	.card-columns{ flex-direction: column; }
	.card-item{ padding: 22px; }
	.project-gallery{ columns: 1; }
	.card-logo{ height: 180px; padding: 28px; }
	.gallery-item.logo-art img{ height: 260px; padding: 36px; }
}
@media (max-width: 560px){ .filter-bar{ gap: 6px; } .filter-btn{ font-size: 12px; padding: 6px 14px; } }
@media (prefers-reduced-motion: reduce){
	.card-item{ opacity: 1; transform: none; transition: none; }
	.card-item.expanded .card-body{ animation: none; }
	.chevron{ transition: none; }
}
