/* RustWheel Magazine: stile del sito pubblico (anche dentro l'app, con ?app=1).
   Testata nera con il logo oro come l'app, zona di lettura chiara.
   La redazione usa ancora magazine.css + editor.css. */

:root {
  --ink: #141210;          /* nero del logo: titoli */
  --paper: #F4F3F0;        /* fondo pagina */
  --card: #FFFFFF;
  --line: #E0DCD4;
  --muted: #6A645C;
  --accent: #8C6A2F;       /* ottone scuro: link e dettagli su fondo chiaro */
  --gold: #C9A867;         /* oro del logo: pulsanti, testata */
  --gold-light: #D9BE86;
  --ad-bg: #EBE9E4;
  --ad-line: #CCC6BB;
  --display: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EEE9E1; --paper: #0F0E0D; --card: #1A1817; --line: #2E2A26; --muted: #A69D92;
    --accent: #D2B27A; --ad-bg: #181614; --ad-line: #3A3530; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }

.gutter { padding-left: 16px; padding-right: 16px; }
.wrap { max-width: 1280px; margin: 0 auto; }

/* ===== Testata (sempre nera, come lo sfondo del logo) ===== */
.top { background: #000000; color: #F3EFE8; position: sticky; top: 0; z-index: 20; }
.strip { border-bottom: 1px solid #221D19; font-size: 12px; color: #B9AFA4; padding-block: 6px; }
.strip .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.strip a { color: #F3EFE8; text-decoration: none; }
.strip a:hover { color: var(--gold); }

.bar { padding-block: 8px; }
.bar .wrap { display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-logo { height: 52px; width: auto; }
.brand-sub {
  font-weight: 600; font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); padding-left: 12px; border-left: 1px solid #3A322B;
}

.nav { display: flex; gap: 4px; flex: 1; align-items: center; }
.nav a, .nav-soon {
  text-decoration: none; font-weight: 600; font-size: 12.5px; letter-spacing: .12em;
  text-transform: uppercase; padding: 8px 12px; color: #D9D0C5;
}
.nav a:hover { color: #FFFFFF; }
.nav a[aria-current="page"] { color: #FFFFFF; box-shadow: inset 0 -2px 0 var(--gold); }
.nav-soon { color: #8D8379; cursor: default; }
.nav-soon small { font-size: 9.5px; letter-spacing: .08em; margin-left: 4px; }

.reserved {
  flex: none; text-decoration: none; font-weight: 700; font-size: 13px; padding: 9px 14px;
  border-radius: 4px; background: var(--gold); color: #141210; display: inline-flex; align-items: center; gap: 8px;
}
.reserved:hover { background: var(--gold-light); }

.menu-btn {
  display: none; margin-left: auto; background: none; border: 1px solid #3A322D; border-radius: 4px;
  padding: 7px 12px; color: #F3EFE8; cursor: pointer; font: 600 13px var(--sans);
}
.nav .reserved-mobile { display: none; }

@media (max-width: 900px) {
  .bar .wrap { flex-wrap: wrap; gap: 12px; }
  .brand-logo { height: 42px; }
  .menu-btn { display: inline-block; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; }
  .nav.open { display: flex; }
  .nav a, .nav-soon { padding: 12px 4px; border-top: 1px solid #221D19; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); padding-left: 12px; }
  .bar > .wrap > .reserved { display: none; }
  .nav .reserved-mobile { display: flex; justify-content: center; margin: 10px 0 6px; color: #141210; }
}

/* ===== Spazi pubblicitari ===== */
.ad {
  background: var(--ad-bg); border: 1px dashed var(--ad-line); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-align: center; max-width: 100%;
}
.ad b { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
.ad span { font-size: 11px; }
.leader-band { padding-block: 18px 0; }
.ad-leader { height: 90px; width: 728px; margin: 0 auto; }
.ad-box { height: 250px; }
.ad-tall { height: 600px; }
.ad-feed { height: 120px; grid-column: 1 / -1; }
.ad-club { min-height: 180px; }
@media (max-width: 760px) { .ad-leader { width: 320px; height: 50px; } }

/* ===== Pagine ===== */
.page { padding-block: 24px 56px; }
.page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 22px; }
.eyebrow { font-weight: 700; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.page-head h1 { margin: 0; font-weight: 700; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; }
.page-head p { margin: 0; color: var(--muted); font-size: 17px; max-width: 62ch; }

.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.article-layout, .about-layout { grid-template-columns: minmax(0, 1fr) 300px; }
.in-app-layout { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1180px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr); }
  .article-layout, .about-layout, .in-app-layout { grid-template-columns: minmax(0, 1fr); }
  .rail-right { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
  .ad-tall { display: none; }
}
@media (max-width: 820px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* ===== Filtri ===== */
.filters { position: sticky; top: 112px; display: flex; flex-direction: column; gap: 18px; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; color: var(--muted);
}
.search input { border: 0; background: transparent; padding: 10px 0; width: 100%; font: 400 14px var(--sans); color: var(--ink); outline: none; }
.search:focus-within { border-color: var(--gold); }
.f-group h3 { margin: 0 0 8px; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: 14.5px; }
.cat-list a:hover { background: var(--card); }
.cat-list a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.cat-list .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cat-list .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-list a[aria-current="true"] .count { color: inherit; opacity: .7; }

.more-filters { display: flex; flex-direction: column; }
.more-filters summary { display: none; }
.more-filters > .f-group + .f-group { margin-top: 18px; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.brand-chips a { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 11px; font-size: 13px; text-decoration: none; }
.brand-chips a[aria-current="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sort { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); }
.sort a { flex: 1; text-align: center; padding: 8px 6px; font-size: 13px; font-weight: 600; text-decoration: none; }
.sort a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* Su schermi larghi "Marche e ordine" viene aperto da uno script in fondo alla pagina. */
@media (max-width: 820px) {
  .filters { position: static; gap: 12px; }
  .cat-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .cat-list a { white-space: nowrap; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; }
  .cat-list .count { margin-left: 6px; }
  .f-group h3 { display: none; }
  .more-filters summary {
    align-self: flex-start;
    display: inline-flex; cursor: pointer; border: 1px solid var(--line); background: var(--card);
    border-radius: 6px; padding: 7px 12px; font-size: 13px; font-weight: 600; list-style: none;
  }
  .more-filters summary::-webkit-details-marker { display: none; }
  .more-filters[open] > .f-group h3 { display: block; margin-top: 12px; }
}

/* ===== Articoli ===== */
.feed { min-width: 0; }
.feed-tools { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.result { font-size: 13px; color: var(--muted); }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.active-filters a { background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; text-decoration: none; }
.active-filters .clear { background: none; color: var(--accent); text-decoration: underline; }

.cover { position: relative; overflow: hidden; aspect-ratio: 16 / 10; max-width: 100%; background: #1A1714; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.no-cover { display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #2A2420 0%, #0E0C0B 70%); }
.no-cover img { width: 64px; height: 64px; opacity: .55; }

.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; }
.kicker-link { text-decoration: none; }
.meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.sep { opacity: .5; margin: 0 4px; }
.meta .sep { margin: 0; }

.lead {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  text-decoration: none; margin-bottom: 22px;
}
.lead .cover { aspect-ratio: auto; min-height: 320px; }
.lead .body { padding: 26px; display: flex; flex-direction: column; gap: 10px; justify-content: center; min-width: 0; }
.lead h2 { margin: 0; font-weight: 700; font-size: clamp(25px, 2.5vw, 32px); line-height: 1.12; }
.lead p { margin: 0; font-size: 16.5px; color: var(--muted); }
@media (max-width: 680px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead .cover { min-height: 0; aspect-ratio: 16 / 10; }
  .lead .body { padding: 18px; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20, 18, 16, .10); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.card h3 { margin: 0; font-weight: 700; font-size: 20px; line-height: 1.18; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 4px; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; font-size: 14px; font-weight: 600; }
.pager a { text-decoration: none; color: var(--accent); }
.page-no { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ===== Colonna destra ===== */
.rail-right { display: flex; flex-direction: column; gap: 20px; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.side-card h3 { margin: 0; font-weight: 700; font-size: 19px; }
.side-card p { margin: 0; font-size: 14px; color: var(--muted); }
.app-card { background: #0E0C0B; color: #F3EFE8; border-color: #0E0C0B; }
.app-card p { color: #C8BEB2; }
.app-card .tag { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px;
  border-radius: 6px; font-weight: 700; font-size: 13.5px; text-decoration: none; border: 0;
}
.btn.gold { background: var(--gold); color: #141210; }
.btn.gold:hover { background: var(--gold-light); }
.btn.gold.disabled { opacity: .65; cursor: default; }
.btn.line { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.copy { user-select: all; }

/* ===== Articolo ===== */
.post { min-width: 0; max-width: 740px; }
.post-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.post-head h1 { margin: 0; font-weight: 700; font-size: clamp(32px, 5vw, 50px); line-height: 1.06; }
.dek { margin: 0; font-size: 19px; color: var(--muted); line-height: 1.45; }
.byline { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.byline strong { color: var(--ink); }
.byline a { color: var(--accent); }
.post-cover { margin: 0 0 28px; }
.post-cover img { width: 100%; max-height: 540px; object-fit: cover; border-radius: 6px; }

.prose { font-size: 18px; line-height: 1.75; }
.prose p { margin: 0 0 1.1em; }
.prose > p:first-child::first-letter {
  font-family: var(--display); font-weight: 700; float: left; font-size: 3.7em; line-height: .8;
  padding: .08em .08em 0 0; color: var(--accent);
}
.prose h2 { font-weight: 700; font-size: 1.5em; line-height: 1.2; margin: 1.6em 0 .5em; }
.prose h3 { font-family: var(--sans); font-weight: 700; font-size: .85em; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 1.6em 0 .4em; }
.prose blockquote {
  margin: 1.6em 0; padding: .1em 0 .1em 1.1em; border-left: 3px solid var(--gold);
  font-family: var(--display); font-style: italic; font-size: 1.25em; line-height: 1.45; color: var(--ink);
}
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose figure { margin: 1.6em 0; }
.prose figure img { width: 100%; border-radius: 4px; }
.prose figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.prose a { color: var(--accent); text-underline-offset: 2px; }

.draft-banner, .editor-link { font-size: 14px; margin-bottom: 16px; }
.draft-banner { background: #FFF3C4; color: #4A3B05; border: 1px solid #E6CF73; padding: 10px 14px; border-radius: 6px; }
.editor-link { text-align: right; }
.editor-link a { color: var(--accent); }

section.more { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
section.more h2 { margin: 0 0 16px; font-weight: 700; font-size: 26px; }
.all-link { text-align: center; margin: 32px 0 0; font-weight: 600; }
.all-link a { text-decoration: none; color: var(--accent); }

/* ===== Chi siamo / Club / Area riservata ===== */
.prose-page { max-width: 760px; display: flex; flex-direction: column; gap: 18px; font-size: 17px; line-height: 1.7; min-width: 0; }
.prose-page p { margin: 0; }
.prose-page h2 { margin: 12px 0 0; font-weight: 700; font-size: 26px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.fact b { display: block; font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--accent); font-variant-numeric: tabular-nums; }
.fact span { font-size: 13px; color: var(--muted); line-height: 1.4; display: block; }
.fact small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 4px; letter-spacing: .06em; text-transform: uppercase; }

.clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.club { border: 1px dashed var(--line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; min-height: 180px; color: var(--muted); }
.club b { color: var(--ink); font-family: var(--display); font-size: 19px; }
.partner-band { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 22px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.partner-band h2 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.partner-band p { margin: 0; color: var(--muted); max-width: 56ch; }

.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.who-card { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; text-decoration: none; }
a.who-card:hover { border-color: var(--gold); }
.who-card.off { opacity: .7; }
.who-card .ico { width: 42px; height: 42px; border-radius: 8px; background: #0E0C0B; color: var(--gold); display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.who-card h3 { margin: 0 0 2px; font-size: 19px; font-weight: 700; }
.who-card p { margin: 0; font-size: 14px; color: var(--muted); }
.who-card div { flex: 1; min-width: 0; }
.who-card .go { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ===== Piede ===== */
footer { background: #0E0C0B; color: #C8BEB2; padding-block: 36px 40px; font-size: 13.5px; }
footer .wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 24px; }
footer h4 { margin: 0 0 10px; color: #F3EFE8; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
footer a { color: #C8BEB2; text-decoration: none; display: block; padding: 3px 0; }
footer a:hover { color: var(--gold); }
footer .legal { grid-column: 1 / -1; border-top: 1px solid #2E2723; padding-top: 16px; font-size: 12px; color: #8D8379; }
footer .legal a { display: inline; padding: 0; color: #C8BEB2; text-decoration: underline; text-underline-offset: 2px; }
.prose-page a { color: var(--accent); text-underline-offset: 2px; overflow-wrap: anywhere; }
.prose-page h2 { line-height: 1.2; }
.privacy-note { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ===== Dentro l'app ===== */
body.in-app .page { padding-top: 16px; }
body.in-app .filters { position: static; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
