/*
Theme Name: Ferro Shaolin
Description: A custom block theme scaffolded by Studio Code.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ferro-shaolin
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts margin-block-start: var(--wp--style--block-gap) between the
   template's top-level sections (header part, main, footer part) — a gap that
   exists even when no markup asks for it. Zero it so sections butt edge-to-edge
   and own their vertical rhythm via padding; this does not affect block gaps
   inside nested layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* Gutter orizzontale: le sezioni di primo livello (dentro header, main, footer)
   ricevono un margine laterale così il contenuto non tocca i bordi. Gli sfondi
   colorati restano a tutta larghezza perché il padding è interno al gruppo. */
main > .wp-block-group,
.wp-block-template-part > .wp-block-group {
	padding-left: clamp(20px, 5vw, 40px);
	padding-right: clamp(20px, 5vw, 40px);
}

/* ===== Il Percorso — mappa a livelli animata ===== */
.fs-percorso {
	max-width: 480px;
	margin: 2.5rem auto 0;
}
.fs-percorso svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}
.fs-percorso .route {
	fill: none;
	stroke: #d9cdb3;
	stroke-width: 5;
	stroke-linecap: round;
	stroke-dasharray: 1 14;
}
.fs-percorso .route-done {
	fill: none;
	stroke: var(--wp--preset--color--rosso, #c1121f);
	stroke-width: 5;
	stroke-linecap: round;
	opacity: 0.85;
}
.fs-percorso .mk-corso {
	fill: #ffffff;
	stroke: #c9beaa;
	stroke-width: 2;
}
.fs-percorso .mk-liv {
	fill: #efe7d7;
	stroke: #c1121f;
	stroke-width: 3;
}
.fs-percorso .lab-t {
	font-family: "Cinzel", Georgia, serif;
	font-size: 14px;
	font-weight: 700;
	fill: #2a2622;
}
.fs-percorso .lab-s {
	font-family: "Noto Sans", sans-serif;
	font-size: 11px;
	fill: #8a837a;
}
.fs-percorso .roman,
.fs-percorso #fsToken text {
	font-family: "Noto Serif SC", serif;
	fill: #c1121f;
	font-size: 24px;
	text-anchor: middle;
}
.fs-percorso .node {
	transition: all 0.25s ease;
}
.fs-percorso .on .mk-corso,
.fs-percorso .on .mk-liv {
	fill: #c1121f;
	stroke: #8d0d17;
}
.fs-percorso .on .roman {
	fill: #f6f4f0;
}
.fs-percorso .on .lab-t {
	fill: #c1121f;
}

/* ===== Barra utente loggato ===== */
.fs-userbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	background: #1a1a1a;
	color: #f6f4f0;
	font-family: "Noto Sans", sans-serif;
	font-size: 14px;
	padding: 12px clamp(20px, 5vw, 40px);
	border-bottom: 2px solid #c1121f;
}
.fs-userbar-hi strong {
	color: #f6f4f0;
}
.fs-userbar-actions {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}
.fs-userbar-actions a {
	color: #e8e2d6;
	text-decoration: none;
	font-weight: 600;
}
.fs-userbar-actions a:hover {
	color: #ffffff;
}
.fs-userbar-actions a.cta {
	background: #c1121f;
	color: #ffffff;
	padding: 8px 16px;
	border-radius: 2px;
}
.fs-userbar-actions a.cta:hover {
	background: #8d0d17;
	color: #ffffff;
}

/* ===== Componenti premium ===== */
.media-ph {
	position: relative;
	background: #ece5d8;
	border: 1px solid #ddd3c0;
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: #8a837a;
	text-align: center;
	padding: 20px;
}
.media-ph.dark {
	background: #161616;
	border-color: #333333;
	color: #8f8a82;
}
.media-ph .play {
	width: 56px;
	height: 56px;
	line-height: 56px;
	border-radius: 50%;
	background: #c1121f;
	color: #ffffff;
	font-size: 20px;
	margin: 0 auto;
}
.media-ph small {
	opacity: 0.7;
}

.teaser {
	background: #ffffff;
	border: 1px solid #eae3d6;
	border-radius: 12px;
	overflow: hidden;
	height: 100%;
	padding-bottom: 22px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.teaser:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.10);
}
.teaser .media-ph {
	border: 0;
	border-radius: 0;
	min-height: 170px;
}
.teaser h3 {
	margin-bottom: 8px;
}
.more a {
	font-weight: 700;
	color: #c1121f;
	text-decoration: none;
}
.more a:hover {
	color: #8d0d17;
}

/* comparsa allo scroll — attiva solo con JS (niente flash / niente contenuto nascosto senza JS) */
.js-reveal .reveal {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-reveal .reveal.is-in {
	opacity: 1;
	transform: none;
}
@media (prefers-reduced-motion: reduce) {
	.js-reveal .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ===== "Il mio percorso" — area loggata (dark, stile Academy) ===== */
.mp {
	max-width: 640px;
	margin: 0 auto;
	color: #e8e2d6;
	font-family: "Noto Sans", sans-serif;
}
.mp-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 6px;
}
.mp-head h1 {
	font-family: "Cinzel", Georgia, serif;
	font-size: 30px;
	margin: 0;
	color: #f3ede1;
}
.mp-head .who { font-size: 13px; color: #8a837a; }
.mp-prog { font-size: 13px; color: #8a837a; }
.mp-bar { height: 6px; background: #2a2a2a; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.mp-bar > i { display: block; height: 100%; width: 33%; background: #c1121f; border-radius: 6px; }
.mp-lvl {
	font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
	color: #c1121f; font-weight: 700; margin: 26px 0 10px;
}
.mp-row {
	display: grid; grid-template-columns: 64px 1fr 52px; gap: 16px; align-items: center;
	background: #171717; border: 1px solid #2a2a2a; border-radius: 12px; padding: 14px 16px;
}
.mp-row + .mp-row { margin-top: 12px; }
.mp-thumb {
	width: 64px; height: 64px; border-radius: 10px; background: #222222;
	display: flex; align-items: center; justify-content: center;
	font-family: "Noto Serif SC", serif; color: #6a655e; font-size: 26px;
}
.mp-row.done .mp-thumb, .mp-row.cur .mp-thumb { background: #2a1414; color: #e0554f; }
.mp-ti { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 18px; margin: 0 0 4px; color: #f3ede1; }
.mp-meta { font-size: 13px; color: #8a837a; margin: 0; }
.mp-state {
	display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
	margin-top: 8px; padding: 4px 10px; border-radius: 20px;
}
.mp-state.d { background: #16301a; color: #5fbf6a; }
.mp-state.c { background: #2a1414; color: #e0554f; }
.mp-state.t { background: #222222; color: #8a837a; }
.mp-row.locked { opacity: 0.6; }
.mp-rail { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.mp-rail::before { content: ""; position: absolute; top: -18px; bottom: -18px; width: 2px; background: #333333; }
.mp-row:first-of-type .mp-rail::before { top: 50%; }
.mp-node {
	position: relative; width: 34px; height: 34px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 16px; font-weight: 700; background: #0f0f0f; border: 2px solid #3a3a3a; color: #6a655e;
}
.mp-row.done .mp-node { background: #c1121f; border-color: #8d0d17; color: #ffffff; }
.mp-row.cur .mp-node { border-color: #c1121f; color: #e0554f; box-shadow: 0 0 0 4px rgba(193, 18, 31, 0.18); }
.mp-cta {
	margin-top: 10px; display: inline-block; background: #c1121f; color: #ffffff;
	font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 4px; text-decoration: none;
}
.mp-cta:hover { background: #8d0d17; }
.mp-foot { margin-top: 22px; font-size: 12.5px; color: #8a837a; text-align: center; }

/* tappa finale ispirazionale del percorso (aperta, senza numeri finti) */
.mp-future { text-align: center; max-width: 460px; margin: 2.5rem auto 0.5rem; }
.mp-node-goal {
	width: 54px; height: 54px; font-size: 26px;
	margin: 0 auto 14px; background: #171717; border: 2px solid #c1121f; color: #c1121f;
	box-shadow: 0 0 0 6px rgba(193, 18, 31, 0.12);
}
.mp-future-t { font-family: "Cinzel", Georgia, serif; font-size: 22px; color: #f6f4f0; margin: 0 0 8px; }
.mp-future-s { font-size: 14px; line-height: 1.6; color: #b8b4ae; margin: 0; }

/* mappa percorso — ramo "avventura" (deviazione laterale) */
.fs-percorso .adv-link { stroke: #c1121f; stroke-width: 2; stroke-dasharray: 2 5; opacity: 0.7; }
.fs-percorso .mk-adv { fill: #ffffff; stroke: #c1121f; stroke-width: 2; stroke-dasharray: 3 3; }
.fs-percorso .adv-ico { fill: #c1121f; font-family: "Noto Serif SC", serif; font-size: 15px; }
.fs-percorso .on .mk-adv { fill: #c1121f; stroke: #8d0d17; }
.fs-percorso .on .adv-ico { fill: #f6f4f0; }

/* ===== Tutor LMS — vesti l'interfaccia col brand Ferro Shaolin ===== */
:root {
	--tutor-color-primary: #c1121f;
	--tutor-color-primary-hover: #8d0d17;
	--tutor-color-primary-rgb: 193, 18, 31;
	--tutor-color-brand: #c1121f;
	--tutor-primary-button-bg: #c1121f;
	--tutor-primary-button-bg-hover: #8d0d17;
}
.tutor-btn-primary,
.tutor-btn.tutor-btn-primary {
	background-color: #c1121f;
	border-color: #c1121f;
}
.tutor-btn-primary:hover,
.tutor-btn.tutor-btn-primary:hover {
	background-color: #8d0d17;
	border-color: #8d0d17;
}
.tutor-fs-4, .tutor-color-primary, a.tutor-color-primary { color: #c1121f; }

/* ===== Icona account nell'header (accanto al carrello) ===== */
.fs-account {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	color: var(--wp--preset--color--bianco, #f6f4f0);
	text-decoration: none;
	transition: opacity .15s ease;
}
.fs-account:hover,
.fs-account:focus {
	opacity: .7;
	color: var(--wp--preset--color--bianco, #f6f4f0);
}
.fs-account svg {
	display: block;
	width: 34px;
	height: 34px;
}
/* Utente loggato: pallino rosso con l'iniziale del nome */
.fs-account--in {
	width: 32px;
	height: 32px;
	background: var(--wp--preset--color--rosso, #c1121f);
	border-radius: 50%;
}
.fs-account__initial {
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
}


/* ===== Menu a tendina dell'account (utente loggato) ===== */
.fs-account-wrap {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}
.fs-account-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--wp--preset--color--rosso, #c1121f);
	cursor: pointer;
	font-family: inherit;
	transition: opacity .15s ease;
}
.fs-account-btn:hover { opacity: .85; }
.fs-account-menu {
	display: none;
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	min-width: 190px;
	background: var(--wp--preset--color--nero, #111);
	border: 1px solid rgba(246, 244, 240, .18);
	border-radius: 8px;
	padding: 6px 0;
	z-index: 9999;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.fs-account-wrap.is-open .fs-account-menu { display: block; }
.fs-account-menu a {
	display: block;
	padding: 10px 16px;
	color: var(--wp--preset--color--bianco, #f6f4f0);
	text-decoration: none;
	font-size: 15px;
	white-space: nowrap;
}
.fs-account-menu a:hover { background: rgba(246, 244, 240, .08); }


/* ===== Numerino articoli sul carrello ===== */
.wc-block-cart-link { position: relative; }
.fs-cart-badge {
	position: absolute;
	top: -5px;
	right: -7px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--wp--preset--color--rosso, #c1121f);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	box-sizing: border-box;
	pointer-events: none;
}


/* ===== Numero di articoli sull'icona del carrello ===== */
.wp-block-woocommerce-cart-link .wc-block-cart-link {
	position: relative;
	display: inline-flex;
	align-items: center;
}
.fs-cart-count {
	position: absolute;
	top: -1px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	box-sizing: border-box;
	background: var(--wp--preset--color--rosso, #c1121f);
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	letter-spacing: 0;
	pointer-events: none;
}
.fs-cart-count.is-empty {
	display: none;
}
