/* Wiki e Blog – si appoggia alle variabili di style.css */

.narrow { width: min(780px, 100% - 2.5rem); }
.back { display: inline-block; font-family: var(--font-head); font-size: .88rem; color: #dbdae3; margin-bottom: 1.4rem; }
.back:hover { color: #fff; }
.article-hero h1 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
.article-section { padding-top: 0; }
.article-cover { margin: -3.5rem 0 3rem; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(54,66,96,.45); position: relative; z-index: 1; }
.article-cover img { width: 100%; max-height: 460px; object-fit: cover; }

/* Testo articolo */
.prose { font-size: 1.08rem; line-height: 1.8; color: #1d1d1b; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose h2 { font-size: clamp(1.45rem, 2.4vw, 1.85rem); margin: 2.2em 0 .2em; }
.prose h3 { font-size: 1.3rem; margin: 1.8em 0 .1em; }
.prose h4 { font-size: 1.08rem; margin: 1.6em 0 0; color: var(--orange-600); }
.prose a { color: var(--orange-600); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--orange); }
.prose strong { color: var(--ink-900); }
.prose blockquote { margin-left: 0; padding: .4em 1.4em; border-left: 3px solid var(--orange); color: var(--muted); font-style: italic; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: 16px; width: 100%; height: auto; }
.prose figcaption { font-size: .88rem; color: var(--muted); margin-top: .6em; text-align: center; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .6em .8em; text-align: left; }

/* Card articoli */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.post-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; color: var(--text); text-decoration: none !important; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(234,141,48,.45); box-shadow: 0 30px 60px -30px rgba(54,66,96,.35); }
.post-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-img img { transform: scale(1.04); }
.post-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.post-body time { font-family: var(--font-head); font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-600); }
.post-body h3 { font-size: 1.12rem; line-height: 1.3; margin: .55rem 0 .6rem; }
.post-body p { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.post-body .more { margin-top: auto; font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--orange-600); }
.post-card--big { grid-column: 1 / -1; flex-direction: row; }
.post-card--big .post-img { flex: 1.15; aspect-ratio: auto; min-height: 340px; }
.post-card--big .post-body { flex: 1; padding: 2.4rem; justify-content: center; }
.post-card--big h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.post-card--big p { font-size: 1.02rem; }
@media (max-width: 980px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .post-grid { grid-template-columns: 1fr; } .post-card--big { flex-direction: column; } .post-card--big .post-img { min-height: 220px; } .post-card--big .post-body { padding: 1.5rem; } }

/* Wiki */
.wiki-search {
  display: flex; align-items: center; gap: .7rem; margin-top: 2rem; max-width: 560px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: .2rem .4rem .2rem 1.1rem;
}
.wiki-search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(234,141,48,.18); }
.wiki-search svg { width: 20px; height: 20px; color: #c9cad8; flex: none; }
.wiki-search input { flex: 1; background: none; border: 0; outline: none; color: #fff; font: inherit; font-size: 1rem; padding: .8em 0; }
.wiki-search input::placeholder { color: #a4a6b8; }

.wiki-nav { position: sticky; top: 72px; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.wiki-nav .container { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0; scrollbar-width: none; }
.wiki-nav a { flex: none; font-family: var(--font-head); font-size: .88rem; font-weight: 500; color: var(--ink-900); padding: .5em 1em; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.wiki-nav a:hover { border-color: var(--orange); }
.wiki-nav a span { color: var(--orange-600); font-weight: 600; margin-left: .2em; }
.wiki { padding-top: 3.5rem; }
.wiki-cat { scroll-margin-top: 150px; }
.wiki-cat + .wiki-cat { margin-top: 4.5rem; }
.wiki-cat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.wiki-cat-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0; }
.wiki-cat-head p { margin: 0; color: var(--muted); }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.doc {
  display: flex; gap: 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem;
  scroll-margin-top: 150px; transition: border-color .2s, box-shadow .2s;
}
.doc:hover, .doc:target { border-color: rgba(234,141,48,.5); box-shadow: 0 20px 40px -28px rgba(54,66,96,.4); }
.doc:target { box-shadow: 0 0 0 4px rgba(234,141,48,.2); }
.doc-ico { flex: none; width: 48px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(140deg, var(--ink-700), var(--navy)); color: var(--orange-2); }
.doc-ico svg { width: 26px; height: 26px; }
.doc-body { flex: 1; min-width: 0; }
.doc h3 { font-size: 1.05rem; margin: .1rem 0 .3rem; }
.doc .lang { font-size: .65rem; font-weight: 700; letter-spacing: .06em; vertical-align: middle; padding: .2em .55em; border-radius: 6px; background: var(--bg-soft); color: var(--navy); border: 1px solid var(--line); }
.doc-meta { font-size: .84rem; color: var(--muted); margin: 0 0 .9rem; }
.doc-actions { display: flex; gap: .5rem; }
.btn--sm { padding: .5em 1.05em; font-size: .84rem; }
.btn--ghost-d { color: var(--ink-900); background: var(--bg-soft); border-color: transparent; }
.btn--ghost-d:hover { background: var(--line); }

.doc-grid--video { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.doc--video { flex-direction: column; padding: 0; overflow: hidden; }
.doc--video video { width: 100%; aspect-ratio: 1424 / 892; background: #000; display: block; }
.doc--video .doc-body { padding: 1.2rem 1.4rem 1.5rem; }
.doc-text { font-size: .93rem; color: var(--muted); line-height: 1.6; }
.doc-text p + p { margin-top: .6em; }
.doc-text p { margin: 0; }

.wiki-empty { text-align: center; color: var(--muted); padding: 2rem 0; }
[hidden] { display: none !important; }
