/* Gallery page styles (2026 theme). Loaded after site.css. */

.gallery-hero > img { object-position: center 60%; }

/* ---------- Virtual tours ---------- */

.gallery-tours { background: var(--sand); max-width: none; border-bottom: 1px solid var(--line); }
/* ---------- Category navigation ---------- */

.gallery-browser { margin-top: 50px; }
.gallery-filter {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--paper);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	margin-bottom: 50px;
}
.gallery-filter-inner {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 14px 0;
}
.gallery-filter a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 15px;
	font-size: 12px;
	letter-spacing: .3px;
	white-space: nowrap;
	border: 1px solid var(--line);
	background: white;
	transition: background .2s, border-color .2s, color .2s;
}
.gallery-filter a:hover { border-color: var(--line-dark); }
.gallery-filter a[aria-current] { background: var(--green); border-color: var(--green); color: white; }
.gallery-filter .count { font-size: 10px; color: var(--muted); letter-spacing: .5px; }
.gallery-filter a[aria-current] .count { color: var(--gold-light); }

/* ---------- Photo groups ---------- */

.gallery-group + .gallery-group { margin-top: 80px; }
.gallery-group[hidden] { display: none; }
.group-head {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: baseline;
	column-gap: 24px;
	margin-bottom: 26px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--line);
}
.group-head h3 { grid-column: 1; grid-row: 1; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.8px; }
.group-head .eyebrow { grid-column: 2; grid-row: 1; margin: 0; }
.group-intro { grid-column: 1 / -1; max-width: 640px; margin-top: 12px; font-size: 14px; color: var(--muted); }

.photo-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-flow: dense;
	gap: 14px;
}
.photo-grid .gallery-photo { aspect-ratio: 4 / 3; }
.photo-grid .gallery-photo img { position: absolute; inset: 0; }
.photo-grid .gallery-photo.feature { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.photo-grid .gallery-photo.feature span { font-size: 14px; padding: 50px 22px 18px; }

/* Caption sits above the photo (photo is absolutely positioned inside the tile) */
.photo-grid .gallery-photo span { z-index: 1; }

/* ---------- Floor plans ---------- */

.plan-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.gallery-photo.plan-tile {
	grid-column: span 2;
	display: flex;
	flex-direction: column;
	background: white;
	border: 1px solid var(--line);
	color: var(--ink);
	transition: border-color .2s, box-shadow .2s;
}
.gallery-photo.plan-tile.wide { grid-column: span 3; }
.gallery-photo.plan-tile:hover { border-color: var(--line-dark); box-shadow: 0 10px 30px rgba(24, 63, 59, .08); }
.gallery-photo.plan-tile img {
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: #f7f7f5;
	padding: 12px;
}
.gallery-photo.plan-tile:hover img { transform: none; }
.gallery-photo.plan-tile span {
	position: static;
	background: none;
	border-top: 1px solid var(--line);
	padding: 14px 18px;
	font-size: 13px;
	align-items: center;
}
.plan-tile .bi { color: var(--gold-text); font-size: 13px; flex-shrink: 0; }

/* ---------- Responsive ---------- */

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

@media (max-width: 760px) {
	.gallery-browser { margin-top: 35px; }
	/* Chips scroll sideways inside the bar instead of wrapping onto many rows */
	.gallery-filter { margin-bottom: 32px; }
	.gallery-filter-inner {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		padding: 12px 0;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.gallery-filter-inner::-webkit-scrollbar { display: none; }
	.gallery-filter-inner::after { content: ''; flex: 0 0 1px; }

	.gallery-group + .gallery-group { margin-top: 55px; }
	.group-head { margin-bottom: 18px; padding-bottom: 14px; }
	.group-head { grid-template-columns: 1fr; }
	.group-head .eyebrow { grid-column: 1; grid-row: 2; margin-top: 6px; }

	.photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.photo-grid .gallery-photo.feature { grid-row: span 1; aspect-ratio: 4 / 3; }
	.photo-grid .gallery-photo.feature span { font-size: 12px; padding: 35px 14px 12px; }

	.plan-grid { grid-template-columns: 1fr; gap: 14px; }
	.gallery-photo.plan-tile, .gallery-photo.plan-tile.wide { grid-column: auto; }
	.gallery-photo.plan-tile img { padding: 8px; }
	.gallery-photo.plan-tile span { padding: 12px 14px; font-size: 12px; }
}

@media (max-width: 400px) {
	.photo-grid { gap: 8px; }
	.gallery-photo span { font-size: 9px; }
}

/* Embedded interactive floor plan tour (CubiCasa) */
.virtual-tour { max-width: 1200px; }
.virtual-tour + .villa-film { margin-top: 70px; }
.virtual-tour-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 40px;
	margin-bottom: 28px;
}
.virtual-tour-intro { max-width: 420px; }
.virtual-tour-intro p { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.virtual-tour-frame {
	background: #3a3f3d;
	border: 1px solid var(--line);
	box-shadow: 0 18px 40px rgba(24, 63, 59, .10);
}
.virtual-tour-frame iframe { display: block; width: 100%; height: 600px; border: 0; }

/* Self-hosted villa film (2.39:1), reuses the tour heading layout */
.villa-film { max-width: 1200px; }
.villa-film-frame {
	background: #0e1513;
	border: 1px solid var(--line);
	box-shadow: 0 18px 40px rgba(24, 63, 59, .10);
}
.villa-film-frame video { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 804; background: #0e1513; }

@media (max-width: 760px) {
	.virtual-tour-head { display: block; margin-bottom: 22px; }
	.virtual-tour-intro { margin-top: 18px; }
	.virtual-tour-frame iframe { height: 520px; }
	.virtual-tour + .villa-film { margin-top: 45px; }
}
