/* Google Foto albumi */
.gfa { --gfa-gap: 14px; --gfa-radius: 8px; margin: 1.5em 0; }
.gfa *, .gfa *::before, .gfa *::after { box-sizing: border-box; }

/* Albumu pārskats */
.gfa-albums {
	display: grid;
	grid-template-columns: repeat(var(--gfa-cols, 3), minmax(0, 1fr));
	gap: calc(var(--gfa-gap) * 1.4);
}
.gfa-album {
	display: block;
	text-decoration: none !important;
	color: inherit !important;
	box-shadow: none !important;
}
.gfa-album-cover {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--gfa-radius);
	background: rgba(127, 127, 127, .15);
}
.gfa-album-cover img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.gfa-album:hover .gfa-album-cover img,
.gfa-album:focus-visible .gfa-album-cover img { transform: scale(1.05); }
.gfa-album-meta { display: block; padding: .55em .1em 0; line-height: 1.3; }
.gfa-album,
.gfa-album-meta,
.gfa-album-title {
	white-space: normal !important;
	min-width: 0;
}
.gfa-album-title {
	display: block;
	font-weight: 600;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
	hyphens: auto;
}
.gfa-album-count { display: block; font-size: .85em; opacity: .65; }

.gfa-all-link { margin: 1em 0 0; text-align: right; }

/* Viena albuma skats */
.gfa-album-head { margin-bottom: 1em; }
.gfa-back { display: inline-block; margin-bottom: .6em; text-decoration: none; }
.gfa-album-heading { margin: 0 0 .15em !important; }
.gfa-photos {
	display: grid;
	grid-template-columns: repeat(var(--gfa-cols, 4), minmax(0, 1fr));
	gap: var(--gfa-gap);
}
.gfa-photo {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: calc(var(--gfa-radius) * .6);
	background: rgba(127, 127, 127, .15);
	box-shadow: none !important;
}
.gfa-photo img {
	width: 100%; height: 100%;
	object-fit: cover; display: block;
	transition: transform .3s ease, opacity .2s;
}
.gfa-photo:hover img { transform: scale(1.04); opacity: .92; }

@media (max-width: 900px) {
	.gfa-albums { grid-template-columns: repeat(min(var(--gfa-cols, 3), 2), minmax(0, 1fr)); }
	.gfa-photos { grid-template-columns: repeat(min(var(--gfa-cols, 4), 3), minmax(0, 1fr)); }
}
@media (max-width: 520px) {
	.gfa { --gfa-gap: 6px; }
	.gfa-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.gfa-photos { grid-template-columns: repeat(min(var(--gfa-cols, 4), 3), minmax(0, 1fr)); }
}

/* Pilnekrāna skatītājs */
.gfa-lb {
	position: fixed; inset: 0; z-index: 999999;
	background: rgba(8, 8, 10, .96);
	display: flex; align-items: center; justify-content: center;
	opacity: 0; transition: opacity .2s ease;
	touch-action: pan-y pinch-zoom;
	user-select: none; -webkit-user-select: none;
}
.gfa-lb.is-open { opacity: 1; }
.gfa-lb-img {
	max-width: calc(100vw - 120px); max-height: calc(100vh - 90px);
	object-fit: contain; display: block;
	transition: opacity .2s ease;
}
.gfa-lb-img.is-loading { opacity: .25; }
.gfa-lb button {
	position: absolute; border: 0; cursor: pointer;
	background: rgba(255, 255, 255, .08); color: #fff;
	width: 48px; height: 48px; border-radius: 50%;
	font-size: 26px; line-height: 48px; padding: 0; text-align: center;
	transition: background .15s;
}
.gfa-lb button:hover, .gfa-lb button:focus-visible { background: rgba(255, 255, 255, .22); outline: none; }
.gfa-lb-close { top: 14px; right: 14px; }
.gfa-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.gfa-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.gfa-lb-counter {
	position: absolute; top: 24px; left: 20px;
	color: rgba(255, 255, 255, .75); font: 14px/1 system-ui, sans-serif;
}
.gfa-lb-open {
	position: absolute; bottom: 18px; right: 20px;
	color: rgba(255, 255, 255, .6) !important; font: 13px/1 system-ui, sans-serif;
	text-decoration: none !important;
}
.gfa-lb-open:hover { color: #fff !important; }
body.gfa-lb-active { overflow: hidden; }

@media (max-width: 700px) {
	.gfa-lb-img { max-width: 100vw; max-height: calc(100vh - 110px); }
	.gfa-lb-prev, .gfa-lb-next { top: auto; bottom: 14px; transform: none; }
	.gfa-lb-prev { left: calc(50% - 60px); }
	.gfa-lb-next { right: calc(50% - 60px); }
	.gfa-lb-open { display: none; }
}

/* Vecākiem pārlūkiem bez aspect-ratio atbalsta */
@supports not (aspect-ratio: 1 / 1) {
	.gfa-album-cover, .gfa-photo { position: relative; height: 0; padding-bottom: 100%; }
	.gfa-album-cover img, .gfa-photo img { position: absolute; top: 0; left: 0; }
}
