/* ==========================================================================
   Fam7 Minimal — layout details theme.json can't express, plus the lightbox.
   ========================================================================== */

:root {
	--f7-wide: var(--wp--style--global--wide-size, 1180px);
	--f7-photo-max-h: 85vh;
	--f7-radius: 4px;
}

html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; }

/* ---------- Header ---------- */
.site-header .wp-block-site-title a:hover { text-decoration: none; }
.site-header .wp-block-navigation a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.site-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent); }

/* ---------- Home grid ---------- */
.post-card .wp-block-post-featured-image { overflow: hidden; border-radius: var(--f7-radius); background: var(--wp--preset--color--line); }
.post-card .wp-block-post-featured-image img { transition: transform .5s ease; }
.post-card .wp-block-post-featured-image a:hover img { transform: scale(1.025); }
.post-card .wp-block-post-title { line-height: 1.25; }
.wp-block-post-date a { text-decoration: none; }
.post-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); margin-top: 0; }
.post-card .wp-block-post-excerpt__more-link { display: inline-block; margin-top: .4rem; font-size: var(--wp--preset--font-size--small); font-weight: 600; text-decoration: none; }
.wp-block-query-pagination { font-size: var(--wp--preset--font-size--small); }
.wp-block-query-pagination a { text-decoration: none; }

/* ---------- Single post ---------- */
.entry-header .wp-block-post-terms a { color: var(--wp--preset--color--muted); text-decoration: none; }
.entry-header .wp-block-post-terms { text-transform: uppercase; letter-spacing: .08em; }
.entry-header .wp-block-post-terms::before { content: "·"; margin-right: .75rem; color: var(--wp--preset--color--muted); }
.entry-header .wp-block-post-terms:empty::before { content: none; }
.entry-content > p { font-size: 1.0625rem; }
.post-nav { font-size: var(--wp--preset--font-size--small); gap: 1rem; }
.post-nav a { text-decoration: none; }

/*
 * Photos: break out of the 700px text column up to the wide size, and fill it.
 * Tall (portrait) photos are capped at 85% of the screen height so you never
 * have to scroll to see a whole picture.
 */
.entry-content > .wp-block-image:not(.alignleft):not(.alignright),
.entry-content > figure.wp-caption:not(.alignleft):not(.alignright),
.entry-content > p > img.size-large,
.entry-content > p > img.size-full {
	max-width: var(--f7-wide);
	margin-left: auto !important;
	margin-right: auto !important;
}

.entry-content > .wp-block-image:not(.alignleft):not(.alignright) {
	display: block;
	text-align: center;
}

.entry-content > .wp-block-image:not(.alignleft):not(.alignright) > img,
.entry-content > .wp-block-image:not(.alignleft):not(.alignright) > a > img,
.entry-content > figure.wp-caption:not(.alignleft):not(.alignright) img {
	display: block;
	width: 100% !important;
	height: auto !important;
	max-height: var(--f7-photo-max-h);
	object-fit: contain;
	margin: 0 auto;
}

/* Galleries keep WordPress's own grid but use the wide width too. */
.entry-content > .wp-block-gallery,
.entry-content > .tiled-gallery,
.entry-content > .gallery {
	max-width: var(--f7-wide);
	margin-left: auto !important;
	margin-right: auto !important;
}
.entry-content .wp-block-gallery.has-nested-images { --wp--style--unstable-gallery-gap: .75rem; gap: .75rem; }

/* Captions sit centred under the photo, in the text column's width. */
.entry-content > .wp-block-image figcaption,
.entry-content > figure.wp-caption .wp-caption-text,
.entry-content > .wp-block-gallery > .blocks-gallery-caption {
	display: block;
	max-width: 700px;
	margin: .65rem auto 0;
	text-align: center;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	line-height: 1.5;
}

.entry-content > .wp-block-image,
.entry-content > .wp-block-gallery { margin-top: 2.25rem; margin-bottom: 2.25rem; }

/* Anything the lightbox can open gets a zoom cursor. */
.f7-zoomable { cursor: zoom-in; }

/* Hide WordPress's own "enlarge" button in case a post still has it switched on. */
.wp-lightbox-container .lightbox-trigger { display: none !important; }

/* ==========================================================================
   Lightbox
   ========================================================================== */

html.f7lb-open, html.f7lb-open body { overflow: hidden; }

.f7lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) 72px;
	grid-template-rows: 56px minmax(0, 1fr) auto;
	grid-template-areas:
		"top   top   top"
		"prev  stage next"
		"cap   cap   cap";
	background: rgba(12, 12, 11, .985);
	color: #f2f0eb;
	opacity: 0;
	transition: opacity .2s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: pan-y pinch-zoom;
}
.f7lb[hidden] { display: none; }
.f7lb.is-visible { opacity: 1; }

.f7lb__top {
	grid-area: top;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 .5rem 0 1.25rem;
	font: 500 .8125rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: .06em;
	color: rgba(242, 240, 235, .7);
}

.f7lb__stage {
	grid-area: stage;
	position: relative;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	min-width: 0;
}

.f7lb__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
	transition: opacity .18s ease, transform .18s ease;
}
.f7lb__img.is-switching { opacity: 0; }

.f7lb__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 2px solid rgba(255, 255, 255, .2);
	border-top-color: rgba(255, 255, 255, .85);
	border-radius: 50%;
	animation: f7lb-spin .8s linear infinite;
	opacity: 0;
	transition: opacity .2s;
	pointer-events: none;
}
.f7lb.is-loading .f7lb__spinner { opacity: 1; transition-delay: .25s; }
@keyframes f7lb-spin { to { transform: rotate(360deg); } }

.f7lb__caption {
	grid-area: cap;
	min-height: 4.25rem;
	max-height: 30vh;
	overflow-y: auto;
	padding: .9rem 1.25rem 1.25rem;
	text-align: center;
	font: 400 1rem/1.5 "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
	color: #f2f0eb;
}
.f7lb__caption:empty::after { content: "\00a0"; }
.f7lb__caption-inner { max-width: 760px; margin: 0 auto; }

.f7lb button {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	margin: 0;
	padding: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
}
.f7lb button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.f7lb__close {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	color: #f2f0eb;
}
.f7lb__close:hover { background: rgba(255, 255, 255, .1); }

.f7lb__nav {
	align-self: center;
	justify-self: center;
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, .08) !important;
	color: #f2f0eb;
	transition: background .15s ease, transform .15s ease;
	z-index: 2;
}
.f7lb__nav:hover { background: rgba(255, 255, 255, .2) !important; }
.f7lb__nav:active { transform: scale(.94); }
.f7lb__nav--prev { grid-area: prev; }
.f7lb__nav--next { grid-area: next; }
.f7lb__nav svg, .f7lb__close svg { width: 24px; height: 24px; display: block; }

.f7lb.is-single .f7lb__nav,
.f7lb.is-single .f7lb__count { visibility: hidden; }

/* Phones: the photo uses the full width and the arrows float over its edges. */
@media (max-width: 700px) {
	.f7lb {
		grid-template-columns: 0 minmax(0, 1fr) 0;
		grid-template-rows: 52px minmax(0, 1fr) auto;
	}
	.f7lb__nav {
		position: absolute;
		top: 50%;
		margin-top: -22px;
		width: 44px;
		height: 44px;
		background: rgba(0, 0, 0, .45) !important;
	}
	.f7lb__nav--prev { left: 8px; }
	.f7lb__nav--next { right: 8px; }
	.f7lb__img { box-shadow: none; }
	.f7lb__caption { font-size: .9375rem; min-height: 3.75rem; }
}

@media (prefers-reduced-motion: reduce) {
	.f7lb, .f7lb__img, .post-card .wp-block-post-featured-image img { transition: none; }
}
