/* WELL DONE ETS – componenti del plugin core */
:root {
	--wd-navy: #0f2d4e;
	--wd-blue: #1e6fb8;
	--wd-teal: #16897b;
	--wd-yellow: #f2c230;
	--wd-red: #d7263d;
	--wd-magenta: #b4488f;
	--wd-orange: #ee8434;
	--wd-ink: #1a2433;
	--wd-muted: #556274;
	--wd-line: #dde3ea;
	--wd-soft: #f3f6f9;
	--wd-radius: 10px;
	--wd-shadow: 0 1px 2px rgba(15, 45, 78, .06), 0 6px 18px rgba(15, 45, 78, .07);
}

/* ---------- Griglie e schede ---------- */
.wd-grid { display: grid; gap: 24px; }
.wd-grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.wd-grid--4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.wd-card {
	display: flex; flex-direction: column; background: #fff; border: 1px solid var(--wd-line);
	border-radius: var(--wd-radius); overflow: hidden; box-shadow: var(--wd-shadow);
	transition: transform .2s ease, box-shadow .2s ease;
}
.wd-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15, 45, 78, .12); }
.wd-card[hidden] { display: none; }
.wd-card__media { display: block; aspect-ratio: 3 / 2; background: var(--wd-soft); overflow: hidden; }
.wd-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wd-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.wd-card__title { font-size: 1.2rem; line-height: 1.3; margin: 0; }
.wd-card__title a { color: var(--wd-navy); text-decoration: none; }
.wd-card__title a:hover { color: var(--wd-blue); text-decoration: underline; }
.wd-card__text { color: var(--wd-muted); margin: 0; font-size: .95rem; }
.wd-card__more { margin-top: auto; font-weight: 600; color: var(--wd-blue); text-decoration: none; }
.wd-card__more::after { content: " →"; }
.wd-card__meta { font-size: .875rem; color: var(--wd-muted); margin: 0; }
.wd-card--need { border-top: 4px solid var(--wd-teal); }
.wd-card--need .wd-card__body p { margin: 0; }
.wd-card--boat .wd-card__title { font-size: 1.05rem; }

.wd-specs { margin: 0; display: grid; gap: 4px; font-size: .85rem; }
.wd-specs div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--wd-line); padding: 3px 0; }
.wd-specs dt { color: var(--wd-muted); margin: 0; }
.wd-specs dd { margin: 0; font-weight: 600; text-align: right; color: var(--wd-ink); }

/* ---------- Badge ---------- */
.wd-badge {
	align-self: flex-start; display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
	text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--wd-soft); color: var(--wd-navy);
}
.wd-badge--attivo { background: #dff3ee; color: #0c5f55; }
.wd-badge--in-sviluppo { background: #fdf1cf; color: #7a5a00; }
.wd-badge--stand-by { background: #eceff3; color: #485465; }
.wd-badge--todo { background: #fff4e5; color: #8a4b00; text-transform: none; letter-spacing: 0; font-weight: 600; }
.wd-badge--na { background: #eceff3; color: #485465; text-transform: none; letter-spacing: 0; font-weight: 600; }

/* ---------- Filtro ---------- */
.wd-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.wd-filter button {
	border: 1px solid var(--wd-line); background: #fff; color: var(--wd-navy); border-radius: 999px;
	padding: 8px 16px; font-weight: 600; cursor: pointer; font-size: .9rem;
}
.wd-filter button.is-active, .wd-filter button:hover { background: var(--wd-navy); border-color: var(--wd-navy); color: #fff; }

/* ---------- Contatori ---------- */
.wd-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.wd-stats__item { background: #fff; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); padding: 22px; text-align: center; }
.wd-stats__num { display: block; font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--wd-navy); }
.wd-stats__label { display: block; margin-top: 8px; color: var(--wd-muted); font-size: .9rem; }
.wd-stats__item--attivo .wd-stats__num { color: var(--wd-teal); }
.wd-stats__item--in-sviluppo .wd-stats__num { color: #b78a00; }

/* ---------- Liste di definizione (dati dell'Ente) ---------- */
.wd-dl { margin: 0; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); overflow: hidden; background: #fff; }
.wd-dl__row { display: grid; grid-template-columns: minmax(160px, 32%) 1fr; border-bottom: 1px solid var(--wd-line); }
.wd-dl__row:last-child { border-bottom: 0; }
.wd-dl dt { background: var(--wd-soft); padding: 12px 16px; font-weight: 600; color: var(--wd-navy); margin: 0; }
.wd-dl dd { padding: 12px 16px; margin: 0; }
@media (max-width: 640px) { .wd-dl__row { grid-template-columns: 1fr; } }

/* ---------- Tabelle ---------- */
.wd-table-wrap { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); }
.wd-table-wrap:focus { outline: 2px solid var(--wd-blue); outline-offset: 2px; }
.wd-table { width: 100%; border-collapse: collapse; font-size: .92rem; background: #fff; margin: 0; }
.wd-table th, .wd-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--wd-line); border-left: 0; border-right: 0; border-top: 0; }
.wd-table thead th { background: var(--wd-navy); color: #fff; font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.wd-table tbody tr:nth-child(even) { background: #fafbfd; }
.wd-table tbody th { font-weight: 600; color: var(--wd-ink); }
.wd-table tfoot th, .wd-table tfoot td { font-weight: 700; background: var(--wd-soft); }
.wd-table__note { display: block; font-weight: 400; color: var(--wd-muted); font-size: .85rem; margin-top: 4px; }
.wd-table--matrix td { text-align: center; }
.wd-check { color: var(--wd-teal); font-size: 1.1rem; }
@media (max-width: 720px) {
	.wd-table--docs thead { position: absolute; left: -9999px; }
	.wd-table--docs tr { display: block; border-bottom: 2px solid var(--wd-line); }
	.wd-table--docs th, .wd-table--docs td { display: flex; gap: 12px; border: 0; padding: 6px 14px; }
	.wd-table--docs td::before { content: attr(data-label); flex: 0 0 110px; font-weight: 600; color: var(--wd-muted); }
}

.wd-file { display: inline-flex; flex-direction: column; text-decoration: none; font-weight: 600; color: var(--wd-blue); }
.wd-file::before { content: "⬇ "; }
.wd-file__meta { font-size: .78rem; font-weight: 400; color: var(--wd-muted); }

.wd-notice { border-left: 4px solid var(--wd-blue); background: #eef5fc; padding: 14px 18px; border-radius: 0 var(--wd-radius) var(--wd-radius) 0; margin: 0 0 1.5em; color: var(--wd-ink); }
.wd-norma { border: 1px solid var(--wd-line); background: var(--wd-soft); border-radius: var(--wd-radius); padding: 14px 18px; margin: 0 0 1.5em; font-size: .92rem; }
.wd-norma strong:first-child { display: block; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; color: var(--wd-muted); margin-bottom: 4px; }

/* ---------- Donazioni ---------- */
.wd-donate { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.wd-donate__item { background: #fff; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); padding: 24px; box-shadow: var(--wd-shadow); }
.wd-donate__item h3 { margin-top: 0; font-size: 1.15rem; color: var(--wd-navy); }
.wd-donate__code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.15rem; font-weight: 700; background: var(--wd-soft); padding: 10px 12px; border-radius: 6px; letter-spacing: .04em; word-break: break-all; }
.wd-donate__code--todo { font-family: inherit; font-size: 1rem; color: #8a4b00; background: #fff4e5; letter-spacing: 0; }
.wd-btn { display: inline-block; padding: 10px 18px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.wd-btn--ghost { border: 2px solid var(--wd-navy); color: var(--wd-navy); }
.wd-btn--ghost:hover { background: var(--wd-navy); color: #fff; }

/* ---------- Trasparenza ---------- */
.wd-breadcrumb ol { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; }
.wd-breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--wd-muted); }
.wd-breadcrumb a { color: var(--wd-blue); }
.wd-breadcrumb [aria-current] { color: var(--wd-muted); }

.wd-at__layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 960px) { .wd-at__layout { grid-template-columns: 1fr; } .wd-at__nav { order: 2; } }
.wd-at__nav { position: sticky; top: 24px; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); background: #fff; font-size: .9rem; }
.wd-at__nav-title { margin: 0; padding: 14px 16px; background: var(--wd-navy); border-radius: var(--wd-radius) var(--wd-radius) 0 0; }
.wd-at__nav-title a { color: #fff; font-weight: 700; text-decoration: none; }
.wd-at__tree, .wd-at__tree ul { list-style: none; margin: 0; padding: 0; }
.wd-at__tree > li { border-top: 1px solid var(--wd-line); }
.wd-at__tree a { display: flex; gap: 10px; padding: 10px 16px; color: var(--wd-ink); text-decoration: none; line-height: 1.35; }
.wd-at__tree a:hover { background: var(--wd-soft); color: var(--wd-blue); }
.wd-at__tree a[aria-current] { background: #eef5fc; color: var(--wd-navy); font-weight: 700; box-shadow: inset 4px 0 0 var(--wd-blue); }
.wd-at__tree ul a { padding-left: 46px; font-size: .86rem; }
.wd-at__num { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--wd-soft); color: var(--wd-navy); font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.wd-at__tree .is-open > a .wd-at__num { background: var(--wd-navy); color: #fff; }

.wd-at__main > h2 { font-size: 1.45rem; margin-top: 1.6em; padding-bottom: 8px; border-bottom: 2px solid var(--wd-line); color: var(--wd-navy); }
.wd-at__main > h2:first-child { margin-top: 0; }
.wd-at__main > h3 { font-size: 1.15rem; color: var(--wd-navy); }
.wd-at__meta { margin-top: 48px; border-top: 2px solid var(--wd-navy); padding-top: 18px; font-size: .88rem; }
.wd-at__meta dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.wd-at__meta dt { color: var(--wd-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.wd-at__meta dd { margin: 2px 0 0; font-weight: 600; }
.wd-at__report { margin: 16px 0 0; color: var(--wd-muted); }

.wd-at-index { list-style: none; counter-reset: sez; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.wd-at-index__item { counter-increment: sez; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); padding: 20px 22px 18px 64px; position: relative; background: #fff; }
.wd-at-index__item::before { content: counter(sez); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--wd-navy); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.wd-at-index__title { font-size: 1.1rem !important; margin: 0 0 6px !important; border: 0 !important; padding: 0 !important; }
.wd-at-index__title a { color: var(--wd-navy); text-decoration: none; }
.wd-at-index__title a:hover { text-decoration: underline; }
.wd-at-index__desc { color: var(--wd-muted); font-size: .88rem; margin: 0 0 8px; }
.wd-at-index ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.wd-at-index ul a { color: var(--wd-blue); }

.wd-subsections { list-style: none; padding: 0; margin: 0 0 1.5em; display: grid; gap: 10px; }
.wd-subsections a { display: block; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); padding: 14px 18px; text-decoration: none; background: #fff; }
.wd-subsections a:hover { border-color: var(--wd-blue); }
.wd-subsections strong { display: block; color: var(--wd-navy); }
.wd-subsections span { display: block; color: var(--wd-muted); font-size: .88rem; margin-top: 2px; }

/* ---------- Scheda iniziativa ---------- */
.wd-init-head { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; padding: 16px 20px; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); background: var(--wd-soft); margin-bottom: 32px; font-size: .92rem; }
.wd-init-head .wd-badge { align-self: center; }
.wd-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.wd-chips li { background: #fff; border: 1px solid var(--wd-line); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.wd-init-foot { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--wd-line); }
.wd-init-foot h2 { font-size: 1.3rem; }

/* Schede tecniche: etichetta sopra il valore (testi lunghi come cantiere/modello) */
.wd-specs div { display: block; padding: 6px 0; }
.wd-specs dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.wd-specs dd { text-align: left; font-weight: 600; }
