/* ===========================================================================
   CLUB MAESTRO — VAULT
   Stili per archivio Vault (/vault/) e singola entry.
   =========================================================================== */

/* ===========================================================================
   VAULT — SOTTOMENU ORIZZONTALE CATEGORIE (sticky)
   =========================================================================== */

.cm-vault-subnav {
	position: sticky;
	top: 0; /* Offset calcolato via JS in archive-vault.php */
	z-index: 100;
	background: var(--cm-ivory);
	border-bottom: 2px solid var(--cm-border-soft);
	box-shadow: 0 2px 10px rgba(0,17,58,0.06);
}

.cm-vault-subnav-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	gap: 0;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.cm-vault-subnav-inner::-webkit-scrollbar {
	display: none;
}

.cm-vault-subnav-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 14px 18px;
	font-family: var(--cm-font-body);
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--cm-text);
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s ease, border-color 0.15s ease;
	flex-shrink: 0;
}

.cm-vault-subnav-item:hover {
	color: var(--cm-navy);
	text-decoration: none;
	border-bottom-color: var(--cm-border);
}

.cm-vault-subnav-item.active {
	color: var(--cm-navy);
	border-bottom-color: var(--cm-gold);
}

.cm-vault-subnav-count {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 700;
	background: var(--cm-border-soft);
	color: var(--cm-text);
	padding: 1px 6px;
	border-radius: 10px;
	line-height: 1.4;
	transition: background 0.15s, color 0.15s;
}

.cm-vault-subnav-item.active .cm-vault-subnav-count {
	background: var(--cm-gold);
	color: var(--cm-navy);
}

@media (max-width: 640px) {
	.cm-vault-subnav-item {
		padding: 12px 14px;
		font-size: 0.78rem;
	}
}

/* ===========================================================================
   VAULT — SEZIONI PER CATEGORIA (homepage vault) — LEGACY, non più in uso
   =========================================================================== */

/* --- Sezione categoria --- */
.cm-vault-section {
	margin-bottom: 64px;
}

.cm-vault-section:last-of-type {
	margin-bottom: 0;
}

.cm-vault-section-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
	padding-bottom: 14px;
	border-bottom: 2px solid var(--cm-navy);
}

.cm-vault-section-titles {
	min-width: 0;
}

.cm-vault-section-title {
	font-family: var(--cm-font-display);
	font-style: italic;
	font-weight: 300;
	font-size: 1.5rem;
	color: var(--cm-navy) !important;
	margin: 0 0 3px;
	line-height: 1.2;
}

.cm-vault-section-subtitle {
	font-family: var(--cm-font-body);
	font-size: 0.78rem;
	color: var(--cm-text);
	margin: 0;
	font-style: normal;
	letter-spacing: 0.02em;
}

.cm-vault-section-link {
	font-family: var(--cm-font-body);
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--cm-gold-soft);
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	letter-spacing: 0.02em;
	transition: color 0.15s ease;
	padding-bottom: 1px;
}

.cm-vault-section-link:hover {
	color: var(--cm-navy);
	text-decoration: none;
}

/* Riga di card per categoria — max 4, adattiva */
.cm-vault-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}

@media (max-width: 1024px) {
	.cm-vault-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	.cm-vault-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.cm-vault-section { margin-bottom: 48px; }
	.cm-vault-section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* --- Link "← Vault" nell'hero di singola categoria --- */
.cm-vault-back-hero {
	font-family: var(--cm-font-body);
	font-size: 0.82rem;
	margin: 0 0 14px;
}

.cm-vault-back-hero a {
	color: rgba(255,255,255,0.65) !important;
	text-decoration: none;
	letter-spacing: 0.03em;
}

.cm-vault-back-hero a:hover {
	color: var(--cm-gold) !important;
	text-decoration: none;
}

/* --- Paginazione --- */
.cm-pagination {
	text-align: center;
	margin-top: 48px;
}

.cm-pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	margin: 0 3px;
	border: 1px solid var(--cm-border);
	border-radius: 4px;
	font-size: 0.85rem;
	color: var(--cm-navy);
	text-decoration: none;
	transition: all 0.15s ease;
}

.cm-pagination .page-numbers.current,
.cm-pagination .page-numbers:hover {
	background: var(--cm-navy);
	border-color: var(--cm-navy);
	color: var(--cm-white) !important;
	text-decoration: none;
}

/* --- Tipo contenuto nelle card --- */
.cm-vault-card-type {
	font-size: 0.72rem;
	color: var(--cm-text);
	opacity: 0.75;
}

/* ===========================================================================
   LUCCHETTO FOMO
   Overlay posizionato dentro .cm-vault-card-thumb (position: relative)
   =========================================================================== */

.cm-vault-lock-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 17, 58, 0.78);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	z-index: 2;
	transition: background 0.2s ease;
}

.cm-vault-card:hover .cm-vault-lock-overlay {
	background: rgba(0, 17, 58, 0.88);
}

.cm-vault-lock-icon {
	font-size: 1.5rem;
	line-height: 1;
	display: block;
}

.cm-vault-lock-label {
	font-family: var(--cm-font-body);
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--cm-gold);
	display: block;
	padding: 3px 8px;
	border: 1px solid rgba(233,193,118,0.4);
	border-radius: 20px;
}

/* Card bloccata: thumbnail desaturata, testo corpo attenuato */
.cm-vault-card-locked .cm-vault-card-thumb img {
	filter: grayscale(0.6) brightness(0.85);
}

.cm-vault-card-locked .cm-vault-card-type-icon {
	filter: grayscale(0.5);
	opacity: 0.7;
}

.cm-vault-card-locked .cm-vault-card-body {
	opacity: 0.55;
}

.cm-vault-card-locked .cm-vault-card-title {
	color: var(--cm-text) !important;
}

/* Rimuovi il vecchio ::after (sostituito da .cm-vault-lock-overlay) */
.cm-vault-card-locked .cm-vault-card-thumb::after {
	display: none !important;
}

/* ===========================================================================
   BARRA FILTRI (usata in taxonomy per navigare i tipi)
   =========================================================================== */
/* --- Barra filtri --- */
.cm-vault-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 36px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--cm-border-soft);
}

.cm-filter-btn {
	display: inline-block;
	padding: 7px 18px;
	border: 1px solid var(--cm-border);
	border-radius: 20px;
	font-family: var(--cm-font-body);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--cm-text);
	background: var(--cm-white);
	cursor: pointer;
	text-decoration: none;
	transition: all 0.18s ease;
}

.cm-filter-btn:hover,
.cm-filter-btn.active {
	background: var(--cm-navy);
	border-color: var(--cm-navy);
	color: var(--cm-white);
}

/* --- Grid card vault --- */
.cm-vault-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 28px;
}

@media (max-width: 640px) {
	.cm-vault-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

/* --- Card singola --- */
.cm-vault-card {
	background: var(--cm-white);
	border: 1px solid var(--cm-border-soft);
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	position: relative;
}

.cm-vault-card:hover {
	box-shadow: 0 8px 28px rgba(0,17,58,0.1);
	transform: translateY(-2px);
}

/* Thumbnail / copertina */
.cm-vault-card-thumb {
	position: relative;
	aspect-ratio: 16/9;
	background: var(--cm-navy);
	overflow: hidden;
}

.cm-vault-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.85;
}

/* Icona tipo contenuto centrata sulla thumb */
.cm-vault-card-type-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.4rem;
}

/* Overlay "locked" per tier superiore */
.cm-vault-card-locked .cm-vault-card-thumb::after {
	content: '🔒';
	position: absolute;
	inset: 0;
	background: rgba(0, 17, 58, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
}

.cm-vault-card-locked {
	opacity: 0.75;
}

.cm-vault-card-locked .cm-vault-card-thumb::after {
	display: flex;
	font-size: 2rem;
}

/* Corpo card */
.cm-vault-card-body {
	padding: 20px;
}

.cm-vault-card-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.cm-vault-card-duration {
	font-size: 0.75rem;
	color: var(--cm-text);
	opacity: 0.7;
}

.cm-vault-card-title {
	font-family: var(--cm-font-display);
	font-style: italic;
	font-weight: 300;
	font-size: 1.15rem;
	color: var(--cm-navy);
	margin: 0 0 8px;
	line-height: 1.35;
}

.cm-vault-card-excerpt {
	font-size: 0.85rem;
	color: var(--cm-text);
	line-height: 1.6;
	margin: 0 0 16px;
}

.cm-vault-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 12px;
	border-top: 1px solid var(--cm-border-soft);
}

.cm-vault-card-date {
	font-size: 0.75rem;
	color: var(--cm-text);
	opacity: 0.6;
}

/* Link card completa */
.cm-vault-card a.cm-card-link {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Stato vuoto (nessun contenuto) */
.cm-vault-empty {
	text-align: center;
	padding: 80px 24px;
	color: var(--cm-text);
}

.cm-vault-empty h3 {
	font-family: var(--cm-font-display);
	font-style: italic;
	font-size: 1.5rem;
	color: var(--cm-navy);
	margin-bottom: 12px;
}

/* Categoria label nelle card */
.cm-vault-card-cat {
	font-size: 0.72rem;
	color: var(--cm-text);
	opacity: 0.6;
	font-style: italic;
}

/* ===========================================================================
   SINGLE VAULT ENTRY
   =========================================================================== */

.cm-single-vault {
	max-width: 800px;
	margin: 0 auto;
	padding: 48px 24px 80px;
}

/* Breadcrumb */
.cm-single-vault-breadcrumb {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 28px;
	font-size: 0.82rem;
}

.cm-breadcrumb-sep {
	color: var(--cm-border);
}

.cm-breadcrumb-cat {
	color: var(--cm-text);
	text-decoration: none;
	opacity: 0.75;
}

.cm-breadcrumb-cat:hover {
	color: var(--cm-navy);
	opacity: 1;
}

/* Meta header dell'entry */
.cm-entry-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.cm-entry-meta-item {
	font-size: 0.85rem;
	color: var(--cm-text);
}

.cm-entry-meta-muted {
	opacity: 0.65;
	font-size: 0.8rem;
}

/* Featured image (contenuti senza video/audio) */
.cm-entry-featured-img {
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 32px;
	box-shadow: 0 4px 20px rgba(0,17,58,0.1);
}

.cm-entry-featured-img img {
	width: 100%;
	height: auto;
	display: block;
}

/* Excerpt in evidenza quando non c'è contenuto completo */
.cm-entry-excerpt-solo {
	background: var(--cm-white);
	border-left: 3px solid var(--cm-gold);
	padding: 24px 28px;
	border-radius: 0 8px 8px 0;
	margin: 0 0 32px;
	font-family: var(--cm-font-display);
	font-style: italic;
	font-weight: 300;
	font-size: 1.2rem;
	line-height: 1.75;
	color: var(--cm-text-strong);
}

/* ===========================================================================
   CONTENUTI CORRELATI (in fondo alla singola entry)
   =========================================================================== */

.cm-related-content {
	margin-top: 64px;
	padding-top: 40px;
	border-top: 2px solid var(--cm-border-soft);
}

.cm-related-title {
	font-family: var(--cm-font-display);
	font-style: italic;
	font-weight: 300;
	font-size: 1.25rem;
	color: var(--cm-navy) !important;
	margin: 0 0 28px;
}

.cm-related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

@media (max-width: 768px) {
	.cm-related-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

.cm-entry-title {
	font-family: var(--cm-font-display);
	font-style: italic;
	font-weight: 300;
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	color: var(--cm-navy);
	margin: 0 0 16px;
	line-height: 1.25;
}

/* Contenitore video responsive */
.cm-video-wrap {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	height: 0;
	overflow: hidden;
	border-radius: 6px;
	margin-bottom: 32px;
	background: var(--cm-navy);
}

.cm-video-wrap iframe,
.cm-video-wrap video,
.cm-video-wrap .presto-player-wrap {
	position: absolute;
	top: 0; left: 0;
	width: 100%;
	height: 100%;
}

/* Player audio */
.cm-audio-wrap {
	background: var(--cm-white);
	border: 1px solid var(--cm-border);
	border-radius: 8px;
	padding: 24px;
	margin-bottom: 32px;
}

.cm-audio-wrap audio {
	width: 100%;
}

/* Contenuto testuale */
.cm-entry-content {
	font-size: 1.05rem;
	line-height: 1.8;
	color: var(--cm-text);
}

.cm-entry-content p { margin-bottom: 1.2em; }
.cm-entry-content h2,
.cm-entry-content h3 { color: var(--cm-navy); margin: 2em 0 0.6em; }

/* Blocco "accesso negato" — tier insufficiente */
.cm-access-denied {
	background: var(--cm-navy);
	color: var(--cm-white);
	border-radius: 8px;
	padding: 40px;
	text-align: center;
	margin: 32px 0;
}

.cm-access-denied h3 {
	font-family: var(--cm-font-display);
	font-style: italic;
	font-weight: 300;
	font-size: 1.5rem;
	color: var(--cm-gold);
	margin: 0 0 12px;
}

.cm-access-denied p {
	color: rgba(255,255,255,0.75);
	margin: 0 0 24px;
	font-size: 0.95rem;
}

/* Navigazione precedente/successivo */
.cm-entry-nav {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--cm-border-soft);
}

.cm-entry-nav a {
	font-size: 0.85rem;
	color: var(--cm-gold-soft);
	text-decoration: none;
	font-weight: 600;
}

.cm-entry-nav a:hover { color: var(--cm-navy); }

/* Back to vault link */
.cm-back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	color: var(--cm-text);
	text-decoration: none;
	margin-bottom: 28px;
}

.cm-back-link:hover { color: var(--cm-navy); }
.cm-back-link::before { content: '←'; }
