.avp-gallery {
	position: relative;
	width: 100%;
	height: 60vh; /* fallback */
	height: 60svh; /* stable viewport height (mobile address bar) */
	height: 60dvh; /* dynamic viewport height (mobile address bar) */
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #000;
	color: #fff;
	touch-action: manipulation;
}

.avp-gallery__stage {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.avp-gallery__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.avp-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	width: 56px;
	height: 56px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

.avp-gallery__nav:hover {
	background: rgba(0, 0, 0, 0.55);
}

.avp-gallery__nav--prev {
	left: 16px;
}

.avp-gallery__nav--next {
	right: 16px;
}

.avp-gallery__hud {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

.avp-gallery__meta {
	min-width: 0;
}

.avp-gallery__counter {
	font-size: 13px;
	opacity: 0.9;
}

.avp-gallery__filter {
	margin-top: 6px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.avp-gallery__filter-label {
	font-size: 12px;
	opacity: 0.8;
}

.avp-gallery__filter-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border-radius: 999px;
	padding: 6px 28px 6px 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	background: rgba(255, 255, 255, 0.10);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.22);
	cursor: pointer;
	background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.65) 50%),
		linear-gradient(135deg, rgba(255, 255, 255, 0.65) 50%, transparent 50%);
	background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.avp-gallery__filter-select:focus {
	outline: none;
	border-color: rgba(255, 215, 0, 0.55);
	box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.avp-gallery__filename {
	font-size: 12px;
	opacity: 0.75;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 55vw;
}

.avp-gallery__rating {
	text-align: right;
}

.avp-gallery__avg {
	font-size: 12px;
	opacity: 0.9;
}

.avp-gallery__stars {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	justify-content: flex-end;
	margin-top: 6px;
}

.avp-gallery__star {
	width: 20px;
	height: 20px;
	border: 0;
	padding: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.35);
	cursor: pointer;
	font-size: 20px;
	line-height: 20px;
}

.avp-gallery__star.is-clear {
	width: 26px;
	font-size: 12px;
	line-height: 20px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 6px;
	color: rgba(255, 255, 255, 0.75);
}

.avp-gallery__star.is-active-clear {
	border-color: rgba(255, 215, 0, 0.65);
	color: rgba(255, 215, 0, 0.95);
}

.avp-gallery__star.is-on {
	color: rgba(255, 215, 0, 0.95);
}

.avp-gallery__star.is-disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.avp-gallery__login-hint {
	display: none;
	font-size: 12px;
	opacity: 0.8;
	margin-top: 6px;
}

.avp-gallery.is-logged-out .avp-gallery__login-hint {
	display: block;
}

.avp-gallery__error {
	padding: 12px;
	background: #111;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.avp-gallery__lock {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.92));
}

.avp-gallery__lock-card {
	width: min(520px, 92vw);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(6px);
	padding: 18px 18px 16px;
	text-align: center;
}

.avp-gallery__lock-title {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 8px;
}

.avp-gallery__lock-msg {
	font-size: 14px;
	opacity: 0.9;
	line-height: 1.35;
	margin-bottom: 14px;
}

.avp-gallery__login-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.avp-gallery__login-btn:hover {
	background: rgba(255, 255, 255, 0.14);
}

/* Shell menu (Galería / Ranking) */
.avp-gallery-shell {
	font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	background: #f5f5f4; /* stone-100/50-ish */
	padding: 14px 14px 18px;
}

.avp-gallery-shell__menu {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	margin: 0 auto 12px;
	max-width: 980px;
}

.avp-gallery-shell__tab {
	border: 1px solid rgba(28, 25, 23, 0.14);
	background: rgba(255, 255, 255, 0.85);
	color: #1c1917;
	border-radius: 999px;
	padding: 10px 16px;
	font-weight: 600;
	letter-spacing: 0.08em;
	font-size: 12px;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 160ms ease;
}

.avp-gallery-shell__tab:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(28, 25, 23, 0.08);
}

.avp-gallery-shell__tab.is-active {
	background: #0c0a09;
	border-color: #0c0a09;
	color: #fff;
}

.avp-gallery-shell__panel {
	display: none;
}

.avp-gallery-shell__panel.is-active {
	display: block;
}

/* Gallery mode switch (slider / thumbs) */
.avp-gallery-modes {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	margin: 6px auto 14px;
	max-width: 980px;
}

.avp-gallery-modes__btn {
	border: 1px solid rgba(28, 25, 23, 0.14);
	background: rgba(255, 255, 255, 0.85);
	color: #1c1917;
	border-radius: 999px;
	padding: 10px 16px;
	font-weight: 700;
	letter-spacing: 0.08em;
	font-size: 12px;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 160ms ease;
}

.avp-gallery-modes__btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(28, 25, 23, 0.08);
}

.avp-gallery-modes__btn.is-active {
	background: #0c0a09;
	border-color: #0c0a09;
	color: #fff;
}

/* Ranking view */
.avp-ranking {
	color: #1c1917; /* stone-900 */
	padding: 4px 0 18px;
}

.avp-ranking__wrap {
	max-width: 720px;
	margin: 0 auto;
}

.avp-ranking__header {
	text-align: center;
	margin: 6px 0 18px;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(28, 25, 23, 0.12);
}

.avp-ranking__title {
	font-family: "Playfair Display", Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 38px;
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	margin: 0 0 6px;
}

.avp-ranking__subtitle {
	margin: 0;
	font-size: 18px;
	color: rgba(28, 25, 23, 0.55);
	font-style: italic;
}

.avp-ranking__views {
	margin-top: 16px;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
}

.avp-ranking__view {
	border: 1px solid rgba(28, 25, 23, 0.14);
	background: rgba(255, 255, 255, 0.85);
	color: #1c1917;
	border-radius: 999px;
	padding: 10px 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
	font-size: 12px;
	cursor: pointer;
	transition: all 160ms ease;
}

.avp-ranking__view:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(28, 25, 23, 0.08);
}

.avp-ranking__view.is-active {
	background: #0c0a09;
	border-color: #0c0a09;
	color: #fff;
}

.avp-ranking__refresh {
	margin-top: 16px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	border-radius: 999px;
	border: 0;
	background: #0c0a09;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(12, 10, 9, 0.15);
	transition: all 160ms ease;
}

.avp-ranking__refresh:hover {
	background: #1c1917;
}

.avp-ranking__refresh:active {
	transform: scale(0.98);
}

.avp-ranking__refresh:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.avp-ranking__refresh-icon.is-spinning {
	animation: avp-spin 2s linear infinite;
}

@keyframes avp-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.avp-ranking__error {
	margin: 0 0 14px;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid rgba(239, 68, 68, 0.35);
	background: rgba(254, 242, 242, 0.9);
	color: rgb(185, 28, 28);
	text-align: center;
	font-size: 13px;
}

.avp-ranking__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.avp-ranking__empty {
	text-align: center;
	padding: 18px 14px;
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid rgba(28, 25, 23, 0.12);
	border-radius: 14px;
	color: rgba(28, 25, 23, 0.6);
}

.avp-ranking__row {
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(28, 25, 23, 0.08);
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	align-items: center;
	box-shadow: 0 6px 18px rgba(28, 25, 23, 0.06);
	transition: box-shadow 180ms ease, transform 180ms ease;
}

.avp-ranking__row:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 26px rgba(28, 25, 23, 0.10);
}

.avp-ranking__row--photographer .avp-ranking__meta {
	flex-wrap: wrap;
	row-gap: 6px;
}

.avp-ranking__pos {
	background: rgba(250, 250, 249, 1);
	color: rgba(120, 113, 108, 0.55); /* stone-500-ish */
	padding: 10px 14px;
	font-size: 22px;
	font-weight: 700;
	min-width: 66px;
	text-align: center;
}

.avp-ranking__thumb {
	width: 96px;
	height: 96px;
	background: rgba(231, 229, 228, 0.85);
	flex: 0 0 auto;
	overflow: hidden;
}

.avp-ranking__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.avp-ranking__body {
	flex: 1 1 auto;
	padding: 14px 16px;
	min-width: 0;
}

.avp-ranking__name {
	font-weight: 600;
	font-size: 16px;
	color: #0c0a09;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.avp-ranking__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	color: rgba(120, 113, 108, 0.9);
}

.avp-ranking__stars {
	display: inline-flex;
	gap: 3px;
	align-items: center;
}

.avp-ranking__star--filled {
	color: #facc15;
	fill: #facc15;
}

.avp-ranking__star--empty {
	color: rgba(214, 211, 209, 1);
}

.avp-ranking__score {
	font-size: 13px;
	font-weight: 600;
	color: rgba(120, 113, 108, 0.9);
}

.avp-ranking__footer {
	margin-top: 28px;
	text-align: center;
	font-size: 12px;
	letter-spacing: 0.06em;
	color: rgba(120, 113, 108, 0.75);
}

@media (min-width: 768px) {
	.avp-ranking__thumb {
		width: 128px;
		height: 128px;
	}
	.avp-ranking__name {
		font-size: 18px;
	}
}

/* Thumbnails gallery */
.avp-thumbs {
	max-width: 1280px;
	margin: 0 auto;
}

.avp-thumbs__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 auto 16px;
	padding: 0 2px;
}

.avp-thumbs__filter {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.avp-thumbs__filter-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(28, 25, 23, 0.55);
}

.avp-thumbs__filter-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border-radius: 999px;
	padding: 8px 28px 8px 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	background: rgba(255, 255, 255, 0.92);
	color: #1c1917;
	border: 1px solid rgba(28, 25, 23, 0.14);
	cursor: pointer;
	background-image: linear-gradient(45deg, transparent 50%, rgba(28, 25, 23, 0.55) 50%),
		linear-gradient(135deg, rgba(28, 25, 23, 0.55) 50%, transparent 50%);
	background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.avp-thumbs__filter-select:focus {
	outline: none;
	border-color: rgba(12, 10, 9, 0.65);
	box-shadow: 0 0 0 3px rgba(12, 10, 9, 0.12);
}

.avp-thumbs__status {
	font-size: 12px;
	color: rgba(28, 25, 23, 0.55);
	font-weight: 600;
}

.avp-thumbs__grid {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (min-width: 1024px) {
	.avp-thumbs__grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.avp-thumbs__card {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 14px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.10);
	overflow: hidden;
	transition: transform 180ms ease, box-shadow 180ms ease;
	display: flex;
	flex-direction: column;
}

.avp-thumbs__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.10);
}

.avp-thumbs__img {
	aspect-ratio: 1 / 1;
	background: rgba(231, 229, 228, 0.85);
	overflow: hidden;
}

.avp-thumbs__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 500ms ease;
}

.avp-thumbs__card:hover .avp-thumbs__img img {
	transform: scale(1.06);
}

.avp-thumbs__body {
	padding: 12px 12px 14px;
}

.avp-thumbs__title {
	font-weight: 600;
	font-size: 14px;
	color: #0c0a09;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 8px;
}

.avp-thumbs__rating {
	display: flex;
	gap: 6px;
	align-items: center;
}

.avp-thumbs__star {
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font-size: 18px;
	line-height: 18px;
	color: rgba(209, 213, 219, 1);
	transition: transform 120ms ease;
}

.avp-thumbs__star:hover {
	transform: scale(1.18);
}

.avp-thumbs__star.is-on {
	color: #fbbf24;
}

.avp-thumbs__sentinel {
	height: 1px;
}

/* Thumbnails modal */
.avp-thumbs-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.88);
	backdrop-filter: blur(4px);
}

.avp-thumbs-modal.is-active {
	display: flex;
}

.avp-thumbs-modal__close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 28px;
	line-height: 42px;
	cursor: pointer;
}

.avp-thumbs-modal__close:hover {
	background: rgba(255, 255, 255, 0.22);
}

.avp-thumbs-modal__content {
	width: min(1000px, 96vw);
	max-height: 86vh;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: avp-modal-in 0.22s ease-out;
}

@keyframes avp-modal-in {
	from { transform: scale(0.97); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

@media (min-width: 768px) {
	.avp-thumbs-modal__content {
		flex-direction: row;
		height: 80vh;
	}
}

.avp-thumbs-modal__img-side {
	flex: 2;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.avp-thumbs-modal__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.avp-thumbs-modal__info-side {
	flex: 1;
	padding: 22px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 14px;
}

.avp-thumbs-modal__title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #111827;
	overflow-wrap: anywhere;
}

.avp-thumbs-modal__rating-box {
	background: #f3f4f6;
	border-radius: 12px;
	padding: 14px;
}

.avp-thumbs-modal__rating-label {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(107, 114, 128, 1);
	margin-bottom: 10px;
}

.avp-thumbs-modal__stars {
	display: flex;
	gap: 6px;
	align-items: center;
}

.avp-thumbs-modal__hint {
	margin-top: 10px;
	font-size: 12px;
	color: rgba(107, 114, 128, 1);
}

.avp-thumbs-modal__primary {
	background: #111827;
	color: #fff;
	border: 0;
	padding: 12px 14px;
	border-radius: 10px;
	font-weight: 700;
	cursor: pointer;
	width: 100%;
}
