/* Photo Contest — sito */

.pct-contest,
.pct-vote,
.pct-leaderboard,
.pct-toast {
	--pct-heart: #e0245e;
	--pct-star: #f5a623;
	--pct-open: #1a7f37;
}

/* ---------- Stato del concorso ---------- */

.pct-banner {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 16px;
	padding: 14px 18px;
	border: 1px solid rgba(0, 0, 0, .08);
	border-left: 4px solid var(--pct-open);
	border-radius: 10px;
	background: rgba(26, 127, 55, .06);
	line-height: 1.45;
}

.pct-banner.pct-phase-soon {
	border-left-color: #2f5d8a;
	background: rgba(47, 93, 138, .07);
}

.pct-banner-icon svg {
	display: block;
}

.pct-phase-soon .pct-banner-icon {
	color: #2f5d8a;
}

/* Ultimi giorni: il riquadro "scalda" */
.pct-banner.pct-moment-chiusura {
	border-left-color: #c99400;
	background: rgba(242, 183, 5, .14);
}

.pct-banner.pct-moment-domani,
.pct-banner.pct-moment-ultimo {
	border-left-color: var(--pct-heart);
	background: rgba(224, 36, 94, .08);
}

.pct-banner.pct-moment-risultati {
	border-left-color: #c99400;
	background: rgba(242, 183, 5, .12);
}

.pct-banner-clock {
	display: flex;
	gap: 6px;
	margin-left: auto;
}

.pct-banner-clock[hidden] {
	display: none;
}

.pct-clock-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 52px;
	padding: 6px 4px;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
	line-height: 1.1;
}

.pct-clock-unit strong {
	font-size: 1.35em;
	font-variant-numeric: tabular-nums;
	color: var(--pct-heart);
}

.pct-clock-unit small {
	font-size: .75em;
	opacity: .75;
}

@media (max-width: 600px) {
	.pct-banner {
		flex-wrap: wrap;
	}

	.pct-banner-clock {
		margin-left: 54px;
	}
}

.pct-banner.pct-phase-closed {
	border-left-color: #6b7280;
	background: rgba(107, 114, 128, .07);
}

.pct-banner-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	color: var(--pct-heart);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.pct-phase-closed .pct-banner-icon {
	color: #c99400;
}

.pct-banner-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: .95em;
}

.pct-banner-status {
	font-size: 1.05em;
}

.pct-banner-rules,
.pct-banner-mine {
	opacity: .85;
}

.pct-banner-mine:empty {
	display: none;
}

.pct-banner-mine {
	font-weight: 600;
	opacity: 1;
}

/* ---------- Cuore sopra la foto ---------- */

.pgc-item:has(.pct-mini) {
	position: relative;
}

.pgc-item > .pgc-actions:has(> .pct-mini:only-child) {
	display: contents;
}

.pct-mini {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	margin: 0;
}

.pct-mini[hidden] {
	display: none;
}

.pct-mini-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 34px;
	margin: 0;
	padding: 0 10px 0 8px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	color: #333;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
	cursor: pointer;
	transition: transform .15s ease, background .15s ease;
	-webkit-tap-highlight-color: transparent;
}

.pct-mini-btn.is-static {
	cursor: default;
}

.pct-mini-btn:not(.is-static):hover,
.pct-mini-btn:focus-visible {
	transform: scale(1.06);
	background: #fff;
}

.pct-mini-btn:focus-visible {
	outline: 2px solid var(--pct-heart);
	outline-offset: 2px;
}

.pct-mini-btn .pct-n:empty {
	display: none;
}

.pct-mini-btn svg {
	flex: none;
}

/* Cuore: vuoto se non votato, pieno se votato. */
.pct-heart-path {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.pct-mini-btn .pct-heart-path {
	stroke: var(--pct-heart);
}

.pct-vote.is-voted .pct-heart-path,
.pct-mini-btn.is-static .pct-heart-path {
	fill: var(--pct-heart);
	stroke: var(--pct-heart);
}

.pct-mini-btn.is-static .pct-heart-path {
	fill: rgba(224, 36, 94, .85);
}

.pct-mini svg path:not(.pct-heart-path) {
	fill: var(--pct-star);
}

.pct-pop svg {
	animation: pct-pop .35s ease;
}

@keyframes pct-pop {
	40% { transform: scale(1.45); }
	100% { transform: scale(1); }
}

.pct-vote.is-busy {
	opacity: .7;
	pointer-events: none;
}

/* ---------- Pulsante grande (lightbox e pagina della foto) ---------- */

.pct-full {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 10px;
}

.pct-full[hidden] {
	display: none;
}

.pgc-lb-actions .pct-full {
	flex-basis: 100%;
	margin-bottom: 4px;
}

.pct-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: .6em 1.4em;
	border: 0;
	border-radius: 999px;
	background: var(--pct-heart);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(224, 36, 94, .35);
	transition: transform .15s ease, background .15s ease;
	-webkit-tap-highlight-color: transparent;
}

.pct-btn:hover,
.pct-btn:focus-visible {
	transform: translateY(-1px);
	background: #c81d52;
	color: #fff;
}

.pct-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pct-btn .pct-heart-path {
	stroke: #fff;
}

.pct-btn.is-voted {
	background: #fff;
	color: var(--pct-heart);
	box-shadow: inset 0 0 0 2px var(--pct-heart);
}

.pct-btn.is-voted .pct-heart-path {
	fill: var(--pct-heart);
	stroke: var(--pct-heart);
}

.pct-btn[disabled] {
	cursor: default;
	transform: none;
}

.pct-link {
	margin: 0;
	padding: 2px 4px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 13px;
	text-decoration: underline;
	opacity: .8;
	cursor: pointer;
}

.pct-link:hover {
	opacity: 1;
}

.pct-label,
.pct-meta {
	font-size: 13.5px;
	opacity: .85;
}

.pct-meta em {
	font-style: normal;
	opacity: .75;
}

/* Stelle */
.pct-stars {
	display: inline-flex;
	gap: 2px;
}

.pct-star {
	display: inline-grid;
	place-items: center;
	margin: 0;
	padding: 3px;
	border: 0;
	background: none;
	color: inherit;
	line-height: 0;
	cursor: default;
	-webkit-tap-highlight-color: transparent;
}

button.pct-star {
	cursor: pointer;
	padding: 5px;
}

.pct-star svg {
	width: 26px;
	height: 26px;
}

.pct-star path {
	fill: none;
	stroke: var(--pct-star);
	stroke-width: 1.6;
	stroke-linejoin: round;
	transition: fill .1s ease;
}

.pct-star.is-on path {
	fill: var(--pct-star);
}

/* Passando sopra: si accendono le stelle fino a quella sotto il mouse. */
@media (hover: hover) {
	.pct-stars.is-interactive:hover .pct-star path {
		fill: var(--pct-star);
	}

	.pct-stars.is-interactive .pct-star:hover ~ .pct-star path {
		fill: none;
	}
}

button.pct-star:focus-visible {
	outline: 2px solid var(--pct-star);
	border-radius: 4px;
}

/* Pagina della foto: sfondo chiaro */
.pct-page {
	margin: 4px 0 8px;
}

.pct-page .pct-btn.is-voted {
	background: transparent;
}

/* ---------- Podio ---------- */

.pct-podium {
	margin: 0 0 22px;
}

.pct-podium-list {
	display: grid;
	grid-template-columns: repeat(var(--pct-n, 3), minmax(0, 1fr));
	align-items: start;
	max-width: calc(var(--pct-n, 3) * 260px);
	margin-inline: auto !important;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pct-podium-item {
	margin: 0;
	padding-top: 25%; /* Il primo ha la foto più alta (4:5 invece di 1:1): le foto finiscono alla stessa altezza. */
}

.pct-podium-item.pct-rank-1 {
	padding-top: 0;
}

/* Il primo al centro e più alto. */
.pct-rank-1.pct-podium-item {
	order: 2;
}

.pct-rank-2.pct-podium-item {
	order: 1;
}

.pct-rank-3.pct-podium-item {
	order: 3;
}

.pct-podium-list[style*="--pct-n:1"] .pct-podium-item,
.pct-podium-list[style*="--pct-n:2"] .pct-podium-item {
	order: 0;
}

.pct-podium-link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: inherit;
	text-align: center;
	text-decoration: none;
}

.pct-podium-img {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	margin-bottom: 4px;
	border-radius: 10px;
	overflow: visible;
}

/* Il primo è più alto. */
.pct-rank-1 .pct-podium-img {
	aspect-ratio: 4 / 5;
}

.pct-podium-img img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 10px;
	box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
	transition: transform .2s ease;
}

.pct-podium-link:hover img {
	transform: translateY(-3px);
}

.pct-medal {
	position: absolute;
	left: 50%;
	bottom: -14px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #c99400;
	color: #fff;
	font-weight: 800;
	font-size: 15px;
	transform: translateX(-50%);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.pct-rank-2 .pct-medal {
	background: #8e9aa6;
}

.pct-rank-3 .pct-medal {
	background: #b06c37;
}

.pct-podium-title {
	margin-top: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.pct-podium-score {
	font-size: .9em;
	opacity: .8;
}

@media (max-width: 600px) {
	.pct-podium-list {
		gap: 8px;
	}

	.pct-podium-title {
		font-size: .85em;
	}

	.pct-podium-score {
		font-size: .78em;
	}

	.pct-medal {
		width: 28px;
		height: 28px;
		font-size: 13px;
		bottom: -12px;
	}
}

.pct-admin-only {
	margin: 0 0 8px;
	padding: 6px 10px;
	border-radius: 6px;
	background: #fff8e1;
	color: #6b5000;
	font-size: 13px;
}

/* ---------- Classifica ---------- */

.pct-lb-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pct-lb-row {
	display: grid;
	grid-template-columns: 2.2em 56px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 8px 4px;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.pct-lb-rank {
	font-size: 1.15em;
	font-weight: 800;
	text-align: center;
}

.pct-lb-row.pct-rank-1 .pct-lb-rank { color: #c99400; }
.pct-lb-row.pct-rank-2 .pct-lb-rank { color: #7d8893; }
.pct-lb-row.pct-rank-3 .pct-lb-rank { color: #b06c37; }

.pct-lb-thumb img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
}

.pct-lb-main {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.pct-lb-title {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pct-lb-bar {
	display: block;
	height: 6px;
	border-radius: 99px;
	background: rgba(0, 0, 0, .07);
	overflow: hidden;
}

.pct-lb-bar span {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: var(--pct-heart);
}

.pct-lb-score {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	font-size: .92em;
}

.pct-notice {
	padding: 12px 16px;
	border-radius: 8px;
	background: rgba(0, 0, 0, .04);
}

/* ---------- Avvisi ---------- */

.pct-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 99999;
	max-width: min(92vw, 460px);
	padding: 12px 18px;
	border-radius: 10px;
	background: #1d2327;
	color: #fff;
	font-size: 14.5px;
	line-height: 1.4;
	text-align: center;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition: opacity .2s ease, transform .2s ease;
}

.pct-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.pct-toast.is-error {
	background: #8a1c1c;
}

@media (prefers-reduced-motion: reduce) {
	.pct-pop svg,
	.pct-toast,
	.pct-podium-link:hover img {
		animation: none;
		transition: none;
		transform: none;
	}
	.pct-toast.is-visible {
		transform: translate(-50%, 0);
	}
}

/* Con il lightbox aperto l'avviso va in alto (in basso ci sono le miniature). */
body.lg-on .pct-toast {
	top: 64px;
	bottom: auto;
	transform: translate(-50%, -12px);
}

body.lg-on .pct-toast.is-visible {
	transform: translate(-50%, 0);
}

/* Autore e classe */
.pct-podium-by {
	font-size: .88em;
	opacity: .75;
}

.pct-lb-by {
	margin-top: -4px;
	font-size: .85em;
	opacity: .7;
}

/* Riconoscimenti sulle foto (con i risultati) */
.pgc-item:has(.pct-awards) {
	position: relative;
}

.pct-awards {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	max-width: calc(100% - 70px);
	pointer-events: none;
}

.pct-award {
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .94);
	color: #1d2327;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.pct-award.is-main {
	background: #f2b705;
	color: #1d2327;
}

.pct-award-line {
	flex-basis: 100%;
	color: #f2b705;
	font-weight: 700;
	text-align: center;
}

.pct-page .pct-award-line {
	color: #8a6100;
}

/* Vincitori: migliori di ogni classe e menzioni */
.pct-winners {
	margin: 0 0 22px;
}

.pct-winners-h {
	margin: 22px 0 10px;
	font-size: 1.15em;
}

.pct-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pct-card {
	margin: 0;
}

.pct-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: 10px;
	overflow: hidden;
	background: rgba(0, 0, 0, .035);
	color: inherit;
	text-decoration: none;
}

.pct-card-img {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.pct-card-img img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .2s ease;
}

.pct-card-link:hover img {
	transform: scale(1.04);
}

.pct-card-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px 12px;
	line-height: 1.35;
}

.pct-card-label {
	font-size: .78em;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #8a6100;
}

.pct-card-by,
.pct-card-score {
	font-size: .88em;
	opacity: .8;
}
