/* hipobuy guide — foglio di stile condiviso (stile manifesto retrò americano) */
:root {
  --cream: #fff5e9;
  --cream-2: #f9e9d6;
  --cream-3: #f2dcc2;
  --ink: #1b1410;
  --ink-soft: #4b3c33;
  --ink-mute: #7a685c;
  --accent: #974032;
  --accent-dark: #7a3126;
  --wine: #6e2230;
  --denim: #33506b;
  --line: rgba(27, 20, 16, 0.14);
  --line-soft: rgba(27, 20, 16, 0.08);
  --nav-bg: rgba(12, 17, 25, 0.88);
  --radius: 14px;
  --shadow-soft: 0 10px 30px rgba(27, 20, 16, 0.08);
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.5;
  background-image: radial-gradient(rgba(27, 20, 16, 0.045) 1px, transparent 1px);
  background-size: 3px 3px;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--wine); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
li { margin-bottom: 0.4em; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Navigazione ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(9, 12, 18, 0.28);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-nav { background: #0d1219; }
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff8ee;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: #ffd9b0; }
.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff5e9;
  font-size: 15px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  flex: 1;
}
.nav-links > a,
.drop > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 999px;
  color: rgba(255, 248, 238, 0.86);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.drop > summary::-webkit-details-marker { display: none; }
.nav-links > a:hover,
.drop > summary:hover,
.drop[open] > summary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff8ee;
}
.drop { position: relative; }
.panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 12px;
  border-radius: 14px;
  background: rgba(12, 17, 25, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(9, 12, 18, 0.45);
}
.panel-wide { width: 460px; }
.panel-hint {
  margin: 2px 6px 8px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 248, 238, 0.55);
}
.panel-list { display: grid; grid-template-columns: 1fr; gap: 2px; }
.panel-wide .panel-list { grid-template-columns: 1fr 1fr; }
.panel-list a {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  color: rgba(255, 248, 238, 0.9);
  font-size: 13px;
  text-decoration: none;
  line-height: 1.3;
}
.panel-list a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff5e9;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-cta:hover { background: #a94a3a; color: #fff; }

/* ---------- Contenitore articolo ---------- */
.article-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 16px 60px;
}
.breadcrumb {
  font-size: 12.5px;
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

.article-head { max-width: 860px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff5e9;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.article-head h1 {
  font-size: clamp(28px, 4.2vw, 46px);
  margin: 14px 0 12px;
  max-width: 760px;
}
.article-head .lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 720px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-mute);
}
.article-meta span { display: inline-flex; align-items: center; gap: 5px; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 260px;
  gap: 44px;
  align-items: start;
  margin-top: 8px;
}
.article-body { font-size: 16.5px; line-height: 1.78; }
.article-body h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  margin-top: 40px;
  scroll-margin-top: 86px;
}
.article-body h3 { font-size: 18px; margin-top: 26px; scroll-margin-top: 86px; }
.article-body h2:first-child { margin-top: 0; }
.article-body a { color: var(--accent-dark); }
.article-body strong { font-weight: 600; }
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: var(--cream-3);
  padding: 1px 5px;
  border-radius: 5px;
}

.callout {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--cream-2);
  border-left: 4px solid var(--accent);
}
.callout p:last-child { margin-bottom: 0; }
.callout-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 6px;
  font-weight: 600;
}

.table-wrap {
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 14px; }
caption {
  caption-side: top;
  text-align: left;
  padding: 12px 14px 4px;
  font-size: 12px;
  color: var(--ink-mute);
}
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--cream-2); font-weight: 600; font-size: 12.5px; letter-spacing: 0.02em; }
tbody tr:last-child td { border-bottom: none; }

.checklist { list-style: none; padding: 0; margin: 20px 0; }
.checklist li {
  position: relative;
  padding: 9px 12px 9px 40px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 15px;
}
.checklist li::before {
  content: "\ea6e";
  font-family: remixicon;
  position: absolute;
  left: 13px;
  top: 9px;
  color: var(--accent);
  font-size: 16px;
}

.toc {
  position: sticky;
  top: 86px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--cream-2);
  border: 1px solid var(--line);
  font-size: 13px;
}
.toc h2 {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-body);
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 7px; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent-dark); text-decoration: underline; }

.related {
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.related h2 { font-size: 22px; }
.related-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.related-list a {
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fffdf9;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.related-list a:hover { border-color: var(--accent); background: var(--cream-2); }
.related-list span { display: block; font-size: 12px; font-weight: 400; color: var(--ink-mute); margin-top: 3px; }
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff5e9;
  font-size: 13.5px;
  text-decoration: none;
}
.back-home:hover { background: var(--accent); color: #fff5e9; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cream-3);
  border-top: 1px solid var(--line);
  padding: 40px 16px 32px;
  color: var(--ink-soft);
}
.footer-inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h2 { font-size: 18px; margin-bottom: 8px; }
.site-footer p { font-size: 13px; max-width: 380px; }
.footer-col h3 {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { color: var(--ink-soft); text-decoration: none; font-size: 13px; }
.footer-col a:hover { color: var(--accent-dark); text-decoration: underline; }
.footer-bottom {
  max-width: 1180px;
  margin: 26px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-mute);
}

/* ---------- Barra mobile + sheet ---------- */
.mobile-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: rgba(12, 17, 25, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-bar-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.mobile-bar a,
.mobile-bar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: rgba(255, 248, 238, 0.82);
  font-size: 11px;
  text-decoration: none;
}
.mobile-bar i { font-size: 19px; }
.mobile-bar a:hover,
.mobile-bar button:hover { color: #fff5e9; background: rgba(255, 255, 255, 0.08); }
.mobile-bar [aria-expanded="true"] { color: #ffd9b0; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 12, 18, 0.55);
  border: 0;
  padding: 0;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  background: #14100d;
  color: #fff8ee;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -14px 40px rgba(9, 12, 18, 0.4);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet[hidden],
.sheet-backdrop[hidden] { display: none; }
.sheet-grab {
  width: 46px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.35);
  margin: 10px auto 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  background: #14100d;
}
.sheet-head h2 { font-size: 18px; margin: 0; color: #fff8ee; }
.sheet-close {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff8ee;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sheet-body { overflow-y: auto; padding: 14px 16px 26px; overscroll-behavior: contain; }
.sheet-body .panel-list { gap: 4px; }
.sheet-body .panel-list a {
  padding: 12px 12px;
  font-size: 14.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.sheet-group-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 248, 238, 0.5);
  margin: 4px 0 8px;
}
body.is-locked { overflow: hidden; }

@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; order: -1; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .mobile-bar { display: block; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .nav-cta { padding: 8px 13px; font-size: 12px; }
  .article-shell { padding-bottom: 40px; }
  .article-body { font-size: 16px; }
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
  .panel-wide { width: 320px; }
  .panel-wide .panel-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}