/* Post Showcase - stili frontend */

.ps-showcase {
	margin: 30px 0;
}

.ps-tabs-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
	border-bottom: 2px solid #ececec;
	padding-bottom: 14px;
	justify-content: flex-start;
}
.ps-align-center .ps-tabs-nav {
	justify-content: center;
}
.ps-align-right .ps-tabs-nav {
	justify-content: flex-end;
}
.ps-tab-btn {
	background: transparent;
	border: none;
	padding: 8px 18px;
	font-size: 15px;
	font-weight: 600;
	color: #555;
	cursor: pointer;
	border-radius: 999px;
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.ps-tab-btn:hover {
	background: #f2f2f2;
	color: #222;
}
.ps-tab-btn.is-active {
	background: #1a1a1a;
	color: #fff;
}

.ps-tab-panel {
	display: none;
}
.ps-tab-panel.is-active {
	display: block;
	animation: psFadeIn .25s ease;
}
@keyframes psFadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.ps-grid {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(3, 1fr);
}
.ps-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ps-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ps-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
	.ps-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
	.ps-grid { grid-template-columns: 1fr !important; }
	.ps-tabs-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.ps-tab-btn { flex: 0 0 auto; }
}

.ps-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,.06);
	transition: transform .2s ease, box-shadow .2s ease;
	display: flex;
	flex-direction: column;
}
.ps-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.ps-card-thumb {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f0f0f1;
}
.ps-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.ps-card:hover .ps-card-thumb img {
	transform: scale(1.06);
}
.ps-card-body {
	padding: 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ps-card-badge {
	align-self: flex-start;
	background: #eef2ff;
	color: #3949ab;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	padding: 3px 10px;
	border-radius: 999px;
}
.ps-card-title {
	margin: 0;
	font-size: 17px;
	line-height: 1.35;
}
.ps-card-title a {
	color: #1a1a1a;
	text-decoration: none;
}
.ps-card-title a:hover {
	color: #2271b1;
}
.ps-card-date {
	font-size: 12px;
	color: #888;
}
.ps-card-excerpt {
	font-size: 14px;
	color: #555;
	line-height: 1.55;
}

/* Variante: minimale */
.ps-style-minimal .ps-card {
	box-shadow: none;
	border: 1px solid #ececec;
	border-radius: 6px;
}
.ps-style-minimal .ps-card:hover {
	transform: none;
	box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

/* Variante: immagine con overlay testo */
.ps-style-overlay .ps-card {
	position: relative;
}
.ps-style-overlay .ps-card-thumb {
	aspect-ratio: 4 / 5;
	position: relative;
}
.ps-style-overlay .ps-card-body {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
	color: #fff;
}
.ps-style-overlay .ps-card-title a {
	color: #fff;
}
.ps-style-overlay .ps-card-date,
.ps-style-overlay .ps-card-excerpt {
	color: #eee;
}

.ps-empty {
	color: #888;
	font-style: italic;
}

/* Contenitore per gli elementi renderizzati con il template nativo di Download Manager:
   niente stili forzati su titolo/estratto, lasciamo che sia Download Manager a definire
   l'aspetto interno; ci limitiamo a farlo stare bene nella griglia. */
.ps-card-wpdm {
	width: 100%;
}

/* Fallback "login richiesto" quando Download Manager non genera un link di download valido. */
.ps-wpdm-login-required {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}
.ps-wpdm-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
}
.ps-wpdm-btn-disabled {
	background: #e5e5e5;
	color: #999;
	cursor: not-allowed;
	pointer-events: none;
}
.ps-wpdm-login-message {
	font-size: 13px;
	color: #666;
	margin: 0;
	line-height: 1.5;
}
.ps-wpdm-login-btn {
	background: #1a1a1a;
	color: #fff;
}
.ps-wpdm-login-btn:hover {
	background: #333;
	color: #fff;
}
.ps-wpdm-lock-icon {
	flex: 0 0 auto;
}

/* Sentinel per lo scroll infinito */
.ps-load-more {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 50px;
	margin-top: 20px;
}
.ps-load-more-spinner {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 3px solid rgba(0,0,0,.1);
	border-top-color: #1a1a1a;
	opacity: 0;
	animation: psSpin .7s linear infinite;
	transition: opacity .15s ease;
}
.ps-load-more.is-loading .ps-load-more-spinner {
	opacity: 1;
}
@keyframes psSpin {
	to { transform: rotate(360deg); }
}
.ps-error {
	color: #b32d2e;
	background: #fbeaea;
	padding: 10px 14px;
	border-radius: 6px;
}
