/* =====================================================================
   COPIMAX MAGAZINE — Design system condiviso per tutti gli articoli
   Uso: <link rel="stylesheet" href="/blog/blog.css">
   Componenti: header, hero, quick answer, TOC, body, stat row, tabelle,
   bar chart, pull quote, compare cards, tip, figure, CTA, FAQ,
   business box, related cards, sticky WhatsApp, footer.
   ===================================================================== */

:root {
  --ink: #0f0f10;
  --ink-2: #2b2d31;
  --muted: #6b7078;
  --line: #e7e5df;
  --paper: #fbfaf7;
  --white: #ffffff;
  --lime: #cdff00;
  --lime-deep: #8fb300;
  --wa: #25d366;
  --radius: 18px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, system-ui, sans-serif;
  --read: 700px;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- HEADER ---------- */
.mg-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 15, 16, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.mg-header__inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.mg-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 900; letter-spacing: -.02em; }
.mg-logo img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.mg-logo small { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--lime); margin-left: 4px; }
.mg-nav { display: flex; align-items: center; gap: 22px; }
.mg-nav a { color: rgba(255, 255, 255, .78); text-decoration: none; font-size: .9rem; font-weight: 500; }
.mg-nav a:hover { color: #fff; }
.mg-nav .mg-btn-wa { background: var(--lime); color: var(--ink); padding: 9px 16px; border-radius: 999px; font-weight: 700; }
@media (max-width: 760px) { .mg-nav a:not(.mg-btn-wa) { display: none; } }

/* ---------- HERO ---------- */
.mg-hero {
  position: relative; min-height: 78vh; display: flex; align-items: flex-end;
  color: #fff; overflow: hidden; background: var(--ink);
}
.mg-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.mg-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,15,16,.15) 0%, rgba(15,15,16,.55) 45%, rgba(15,15,16,.96) 100%);
}
.mg-hero__content { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; padding: 120px 24px 64px; width: 100%; }
.mg-crumbs { font-size: .8rem; color: rgba(255,255,255,.65); margin-bottom: 18px; }
.mg-crumbs a { text-decoration: none; }
.mg-crumbs a:hover { color: var(--lime); }
.mg-kicker {
  display: inline-block; background: var(--lime); color: var(--ink);
  font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 4px; margin-bottom: 20px;
}
.mg-hero h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.3rem, 5.6vw, 4.4rem);
  line-height: 1.04; letter-spacing: -.025em; margin-bottom: 20px; max-width: 18ch;
}
.mg-hero h1 em { font-style: italic; color: var(--lime); }
.mg-dek { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: rgba(255,255,255,.85); max-width: 60ch; margin-bottom: 28px; }
.mg-byline { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .85rem; color: rgba(255,255,255,.7); }
.mg-byline strong { color: #fff; }

/* ---------- QUICK ANSWER ---------- */
.mg-quick {
  max-width: 1000px; margin: -36px auto 0; position: relative; z-index: 3;
  padding: 0 24px;
}
.mg-quick__box {
  background: var(--white); border-radius: var(--radius); padding: 30px 34px;
  box-shadow: 0 24px 60px rgba(15,15,16,.12); border-left: 6px solid var(--lime);
}
.mg-quick__label { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lime-deep); margin-bottom: 8px; }
.mg-quick__box p { font-size: 1.15rem; color: var(--ink); line-height: 1.6; }

/* ---------- LAYOUT + TOC ---------- */
.mg-layout {
  max-width: 1240px; margin: 0 auto; padding: 64px 24px 40px;
  display: grid; grid-template-columns: 240px minmax(0, var(--read)); gap: 64px; justify-content: center;
}
.mg-toc { position: sticky; top: 96px; align-self: start; font-size: .88rem; }
.mg-toc__title { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.mg-toc ol { list-style: none; counter-reset: toc; border-left: 2px solid var(--line); }
.mg-toc li { counter-increment: toc; }
.mg-toc a { display: block; padding: 7px 0 7px 16px; text-decoration: none; color: var(--muted); line-height: 1.35; margin-left: -2px; border-left: 2px solid transparent; }
.mg-toc a::before { content: counter(toc, decimal-leading-zero) "  "; font-weight: 700; color: var(--line); }
.mg-toc a:hover, .mg-toc a.is-active { color: var(--ink); border-left-color: var(--lime-deep); }
@media (max-width: 1000px) {
  .mg-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 48px; }
  .mg-toc { position: static; background: var(--white); border-radius: 14px; padding: 18px 20px; margin-bottom: 36px; border: 1px solid var(--line); }
}

/* ---------- BODY TYPOGRAPHY ---------- */
.mg-body > * + * { margin-top: 1.25em; }
.mg-body h2 {
  font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.15;
  color: var(--ink); letter-spacing: -.02em; margin-top: 2.4em; padding-top: .2em;
}
.mg-body h2 .mg-num { display: block; font-family: var(--sans); font-size: .8rem; font-weight: 800; letter-spacing: .14em; color: var(--lime-deep); margin-bottom: 6px; }
.mg-body h3 { font-size: 1.2rem; color: var(--ink); margin-top: 1.8em; }
.mg-body p, .mg-body li { color: var(--ink-2); }
.mg-body ul, .mg-body ol { padding-left: 1.3em; }
.mg-body li + li { margin-top: .4em; }
.mg-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--lime-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mg-body a:hover { background: var(--lime); }
.mg-body strong { color: var(--ink); }
.mg-dropcap::first-letter {
  font-family: var(--serif); float: left; font-size: 4.6em; line-height: .8;
  padding: .08em .12em 0 0; color: var(--ink); font-weight: 700;
}

/* ---------- STAT ROW ---------- */
.mg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 2em 0; }
.mg-stat { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 20px; }
.mg-stat__value { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--lime); font-weight: 700; }
.mg-stat__label { font-size: .85rem; color: rgba(255,255,255,.75); margin-top: 8px; line-height: 1.4; }
@media (max-width: 620px) { .mg-stats { grid-template-columns: 1fr; } }

/* ---------- TABLE ---------- */
.mg-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); }
.mg-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.mg-table th { background: var(--ink); color: #fff; text-align: left; padding: 14px 18px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.mg-table td { padding: 14px 18px; border-top: 1px solid var(--line); }
.mg-table td.mg-price { font-weight: 800; color: var(--ink); white-space: nowrap; }
.mg-table tr.is-hot td { background: #f6ffd6; }
.mg-table tr.is-hot td:first-child::after { content: "Más pedido"; margin-left: 8px; font-size: .68rem; font-weight: 800; background: var(--lime); padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.mg-table-note { font-size: .82rem; color: var(--muted); margin-top: .6em; }

/* ---------- BAR CHART ---------- */
.mg-bars { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px 18px; }
.mg-bars__title { font-weight: 800; color: var(--ink); margin-bottom: 18px; }
.mg-bar { display: grid; grid-template-columns: 150px 1fr 70px; gap: 12px; align-items: center; margin-bottom: 12px; font-size: .9rem; }
.mg-bar__track { background: #f0efe9; border-radius: 999px; height: 14px; overflow: hidden; }
.mg-bar__fill { height: 100%; background: var(--ink); border-radius: 999px; }
.mg-bar.is-us .mg-bar__fill { background: var(--lime-deep); }
.mg-bar.is-us { font-weight: 800; color: var(--ink); }
.mg-bar__val { text-align: right; font-weight: 700; }
@media (max-width: 560px) { .mg-bar { grid-template-columns: 1fr 60px; } .mg-bar__track { grid-column: 1 / -1; order: 3; } }

/* ---------- PULL QUOTE ---------- */
.mg-pull {
  font-family: var(--serif); font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.25;
  color: var(--ink); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line);
  padding: 26px 0; margin: 2.2em 0 !important; letter-spacing: -.01em;
}
.mg-pull::before { content: "“"; color: var(--lime-deep); font-size: 1.6em; line-height: 0; vertical-align: -.35em; margin-right: 4px; }
.mg-pull cite { display: block; font-family: var(--sans); font-style: normal; font-size: .8rem; color: var(--muted); margin-top: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- COMPARE CARDS ---------- */
.mg-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mg-compare__card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.mg-compare__card.is-win { background: var(--ink); color: #fff; border-color: var(--ink); }
.mg-compare__card.is-win h4, .mg-compare__card.is-win li { color: #fff; }
.mg-compare__tag { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mg-compare__card.is-win .mg-compare__tag { color: var(--lime); }
.mg-compare__card h4 { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); margin: 6px 0 12px; }
.mg-compare__card ul { list-style: none; padding: 0; font-size: .92rem; }
.mg-compare__card li { padding-left: 22px; position: relative; }
.mg-compare__card li::before { content: "→"; position: absolute; left: 0; color: var(--lime-deep); font-weight: 800; }
@media (max-width: 620px) { .mg-compare { grid-template-columns: 1fr; } }

/* ---------- TIP ---------- */
.mg-tip { background: #f6ffd6; border-radius: var(--radius); padding: 24px 26px; border: 1px solid #e3f5a3; }
.mg-tip__label { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lime-deep); margin-bottom: 6px; }
.mg-tip p { color: var(--ink); }

/* ---------- FIGURE ---------- */
.mg-figure { margin: 2.4em 0 !important; }
.mg-figure img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 10; object-fit: cover; }
.mg-figure figcaption { font-size: .82rem; color: var(--muted); margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--lime-deep); }
@media (min-width: 1001px) { .mg-figure--wide { margin-left: -80px !important; margin-right: -80px !important; } }

/* ---------- CTA ---------- */
.mg-cta {
  background: var(--ink); color: #fff; border-radius: 24px; padding: 38px 34px;
  position: relative; overflow: hidden; margin: 2.6em 0 !important;
}
.mg-cta::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: var(--lime); border-radius: 50%; opacity: .18; }
.mg-cta h3 { font-family: var(--serif); font-size: 1.8rem; line-height: 1.15; color: #fff; margin: 0 0 10px; max-width: 22ch; position: relative; }
.mg-cta p { color: rgba(255,255,255,.8); margin-bottom: 22px; max-width: 52ch; position: relative; }
.mg-btn {
  display: inline-flex; align-items: center; gap: 10px; background: var(--wa); color: #fff !important;
  font-weight: 800; padding: 15px 24px; border-radius: 999px; text-decoration: none !important; position: relative;
  box-shadow: 0 10px 24px rgba(37,211,102,.3); transition: transform .15s ease;
}
.mg-btn:hover { transform: translateY(-2px); background: var(--wa) !important; }
.mg-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- FAQ ---------- */
.mg-faq details { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
.mg-faq details + details { margin-top: 10px; }
.mg-faq summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); padding: 18px 30px 18px 0; position: relative; }
.mg-faq summary::-webkit-details-marker { display: none; }
.mg-faq summary::after { content: "+"; position: absolute; right: 0; top: 14px; font-size: 1.5rem; color: var(--lime-deep); transition: transform .2s; }
.mg-faq details[open] summary::after { transform: rotate(45deg); }
.mg-faq details p { padding-bottom: 18px; font-size: .97rem; }

/* ---------- BUSINESS BOX ---------- */
.mg-biz { display: grid; grid-template-columns: 180px 1fr; gap: 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; align-items: center; }
.mg-biz img { width: 100%; height: 180px; object-fit: cover; border-radius: 12px; }
.mg-biz h4 { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.mg-biz__stars { color: #e5a400; font-weight: 800; font-size: .95rem; margin: 4px 0 10px; }
.mg-biz ul { list-style: none; padding: 0; font-size: .9rem; }
.mg-biz li + li { margin-top: 4px; }
@media (max-width: 620px) { .mg-biz { grid-template-columns: 1fr; } }

/* ---------- RELATED ---------- */
.mg-related { background: var(--ink); color: #fff; padding: 70px 24px; margin-top: 40px; }
.mg-related__inner { max-width: 1240px; margin: 0 auto; }
.mg-related h2 { font-family: var(--serif); font-size: 2rem; margin-bottom: 28px; }
.mg-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mg-card { background: #1b1c1f; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff; transition: transform .2s; display: flex; flex-direction: column; }
.mg-card:hover { transform: translateY(-4px); }
.mg-card__img { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #26282c, #111); display: grid; place-items: center; font-family: var(--serif); font-size: 2.6rem; color: var(--lime); }
.mg-card__img img { width: 100%; height: 100%; object-fit: cover; }
.mg-card__body { padding: 20px 22px 24px; }
.mg-card__cat { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); }
.mg-card__title { font-family: var(--serif); font-size: 1.25rem; line-height: 1.25; margin-top: 8px; }
@media (max-width: 900px) { .mg-related__grid { grid-template-columns: 1fr; } }

/* ---------- STICKY WHATSAPP (mobile) ---------- */
.mg-sticky {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: none;
  background: var(--wa); color: #fff; text-decoration: none; font-weight: 800; text-align: center;
  padding: 15px; border-radius: 999px; box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
@media (max-width: 760px) { .mg-sticky { display: block; } body { padding-bottom: 76px; } }

/* ---------- FOOTER ---------- */
.mg-footer { background: #0a0a0b; color: rgba(255,255,255,.6); text-align: center; padding: 40px 24px; font-size: .85rem; }
.mg-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 14px; }
.mg-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.mg-footer a:hover { color: var(--lime); }

/* ---------- READING PROGRESS ---------- */
.mg-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--lime); width: 0; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
