.adf-albums,
.adf-albums * {
	box-sizing: border-box;
}

.adf-albums-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}

.adf-album-card {
	margin: 0;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.adf-album-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.adf-card-button {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.adf-card-button:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 3px;
}

.adf-card-image {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: #ececec;
	overflow: hidden;
}

.adf-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.adf-card-button:hover .adf-card-image img {
	transform: scale(1.04);
}

.adf-no-cover {
	display: block;
	width: 100%;
	height: 100%;
	background:
		linear-gradient(135deg, transparent 45%, rgba(255,255,255,.35) 45%, rgba(255,255,255,.35) 55%, transparent 55%),
		#d7d7d7;
}

.adf-card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.12) 20%,
		rgba(0, 0, 0, 0.72) 100%
	);
	transition: background 0.25s ease;
}

.adf-card-button:hover .adf-card-overlay {
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.2) 20%,
		rgba(0, 0, 0, 0.82) 100%
	);
}

.adf-card-title {
	position: absolute;
	z-index: 1;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
	padding: 24px 20px 20px;
	color: #fff;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.adf-modal[hidden] {
	display: none;
}

.adf-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.adf-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
}

.adf-modal-panel {
	position: relative;
	width: min(1120px, 100%);
	max-height: 90vh;
	border-radius: 12px;
	background: #fff;
	overflow: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.adf-modal-header {
	position: sticky;
	z-index: 2;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 18px 24px;
	border-bottom: 1px solid #e4e4e4;
	background: #fff;
}

.adf-modal-header h2 {
	margin: 0;
	font-size: 1.5rem;
}

.adf-modal-close {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #efefef;
	color: #222;
	font-size: 30px;
	line-height: 38px;
	cursor: pointer;
}

.adf-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	padding: 24px;
}

.adf-gallery-item {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 6px;
	background: #eee;
	overflow: hidden;
}

.adf-gallery-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.adf-gallery-item:hover img {
	transform: scale(1.04);
}

.adf-empty-gallery {
	grid-column: 1 / -1;
	margin: 20px;
	text-align: center;
}

body.adf-modal-open {
	overflow: hidden;
}

.adf-pagination {
	margin-top: 36px;
}

.adf-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.adf-pagination a,
.adf-pagination span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid #d3d3d3;
	border-radius: 6px;
	text-decoration: none;
}

.adf-pagination .current {
	border-color: #222;
	background: #222;
	color: #fff;
}

.adf-no-albums {
	text-align: center;
}

.adf-latest-album,
.adf-latest-album * {
	box-sizing: border-box;
}

.adf-latest-album {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 28px;
	width: 100vw;
	max-width: 100vw;
	margin-right: calc(50% - 50vw);
	margin-left: calc(50% - 50vw);
	padding: 0 24px;
	background: transparent;
}

.adf-latest-hero {
	display: block;
	width: 100%;
	max-width: 1440px;
	height: auto;
	margin: 0 auto;
	padding: 0;
	background: transparent;
	overflow: hidden;
	line-height: 0;
}

.adf-latest-hero-image {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0;
	object-fit: contain;
	transition: transform 0.35s ease;
}

.adf-latest-hero:hover .adf-latest-hero-image {
	transform: scale(1.025);
}

.adf-latest-hero:hover,
.adf-latest-hero:focus {
	border-color: transparent !important;
	background: transparent !important;
	box-shadow: none !important;
}

.adf-latest-thumbnails {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-content: start;
	gap: 12px;
	width: 100%;
	max-width: none;
	height: auto;
	min-height: 0;
	margin: 0 !important;
	padding: 0 !important;
}

.adf-latest-thumbnail {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	padding: 0;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 4px;
	background: transparent;
	box-shadow: none !important;
	appearance: none;
	cursor: pointer;
	overflow: hidden;
}

.adf-latest-thumbnail:hover {
	border-color: transparent !important;
	background: transparent !important;
	box-shadow: none !important;
	opacity: 1;
}

.adf-latest-thumbnail:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
}

.adf-latest-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.adf-latest-thumbnail:hover img {
	transform: scale(1.055);
}

.adf-latest-lightbox-panel {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(1500px, 94vw);
	height: 92vh;
}

.adf-latest-lightbox-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.adf-latest-lightbox-stage img {
	display: block;
	max-width: 100%;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
}

.adf-latest-lightbox-close,
.adf-latest-lightbox-arrow {
	position: absolute;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	cursor: pointer;
}

.adf-latest-lightbox-close {
	top: 10px;
	right: 10px;
	width: 46px;
	height: 46px;
	font-size: 32px;
}

.adf-latest-lightbox-arrow {
	top: 50%;
	width: 52px;
	height: 52px;
	font-size: 30px;
	transform: translateY(-50%);
}

.adf-latest-lightbox-prev {
	left: 12px;
}

.adf-latest-lightbox-next {
	right: 12px;
}

.adf-latest-lightbox-counter {
	position: absolute;
	right: 50%;
	bottom: 12px;
	padding: 5px 12px;
	border-radius: 16px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 14px;
	transform: translateX(50%);
}

@media (max-width: 800px) {
	.adf-albums-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}

	.adf-gallery-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.adf-latest-thumbnails {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.adf-latest-album {
		gap: 20px;
	}

	.adf-latest-lightbox-arrow {
		width: 44px;
		height: 44px;
	}
}

@media (max-width: 520px) {
	.adf-albums-grid,
	.adf-gallery-grid {
		grid-template-columns: 1fr;
	}

	.adf-modal {
		padding: 10px;
	}

	.adf-modal-header,
	.adf-gallery-grid {
		padding: 16px;
	}

	.adf-latest-album {
		gap: 16px;
		padding-right: 12px;
		padding-left: 12px;
	}
}
