/* =============================================================
   DraftCP Manual — Design System
   Font: Inter (body) + Outfit (headings) via Google Fonts
   Palette: Dark Tech inspired by DraftCP logo
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-base:       #0d1117;
  --bg-surface:    #161b22;
  --bg-card:       #1c2230;
  --bg-hover:      #222d3e;
  --border:        #2d3748;
  --border-light:  #3d4d63;

  --text-primary:  #e6edf3;
  --text-muted:    #8b949e;
  --text-dim:      #4d5b72;

  --accent-blue:   #3d9cf0;
  --accent-orange: #f0a03d;
  --accent-cyan:   #39d4db;
  --accent-green:  #3dd68c;
  --accent-red:    #f85149;

  --sidebar-w: 270px;
  --header-h:  64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Header ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-logo {
  height: 36px;
  object-fit: contain;
}

.header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: .02em;
}

.header-version {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: auto;
}

.header-links {
  display: flex;
  gap: 8px;
}

.header-links a {
  font-size: .8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all .2s;
}

.header-links a:hover {
  background: var(--bg-hover);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* ── Layout Shell ── */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  overflow-y: auto;
  padding: 24px 0 48px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 20px 4px;
}

.sidebar nav ul {
  list-style: none;
}

.sidebar nav ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s;
  line-height: 1.3;
}

.sidebar nav ul li a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-left-color: var(--accent-blue);
}

.sidebar nav ul li a.active {
  color: var(--accent-blue);
  background: rgba(61,156,240,.08);
  border-left-color: var(--accent-blue);
  font-weight: 500;
}

.sidebar nav ul li a.soon {
  color: var(--text-dim);
  cursor: default;
  font-style: italic;
}

.sidebar nav ul li a.soon:hover {
  background: none;
  border-left-color: transparent;
  color: var(--text-dim);
}

.nav-icon {
  font-size: .9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: .62rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 32px 80px;
}

/* ── Section ── */
.doc-section {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 80px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.doc-section:last-child {
  border-bottom: none;
}

.section-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(57,212,219,.1);
  border: 1px solid rgba(57,212,219,.25);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 32px;
}

/* ── Typography ── */
h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 28px 0 10px;
}

p {
  color: var(--text-primary);
  margin-bottom: 14px;
  font-size: .95rem;
}

p + p { margin-top: 4px; }

ul, ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: var(--text-primary);
  font-size: .95rem;
}

ul li, ol li { margin-bottom: 6px; line-height: 1.7; }

strong { color: var(--text-primary); font-weight: 600; }

/* ── Command Badge ── */
.cmd {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent-orange);
  background: rgba(240,160,61,.1);
  border: 1px solid rgba(240,160,61,.3);
  border-radius: var(--radius-sm);
  padding: 1px 7px;
  letter-spacing: .05em;
}

/* ── Callout Boxes ── */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  font-size: .9rem;
  line-height: 1.6;
  border-left: 3px solid;
}

.callout-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.callout-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: .85rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.callout.tip {
  background: rgba(61,156,240,.07);
  border-color: var(--accent-blue);
}
.callout.tip .callout-content strong { color: var(--accent-blue); }
.callout.tip .callout-icon { color: var(--accent-blue); }

.callout.note {
  background: rgba(57,212,219,.07);
  border-color: var(--accent-cyan);
}
.callout.note .callout-content strong { color: var(--accent-cyan); }
.callout.note .callout-icon { color: var(--accent-cyan); }

.callout.warning {
  background: rgba(240,160,61,.08);
  border-color: var(--accent-orange);
}
.callout.warning .callout-content strong { color: var(--accent-orange); }
.callout.warning .callout-icon { color: var(--accent-orange); }

.callout.danger {
  background: rgba(248,81,73,.08);
  border-color: var(--accent-red);
}
.callout.danger .callout-content strong { color: var(--accent-red); }
.callout.danger .callout-icon { color: var(--accent-red); }

/* ── Workflow Steps ── */
.workflow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
  position: relative;
}

.workflow::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 40px;
  bottom: 40px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-orange));
  opacity: .3;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 14px 0;
  position: relative;
}

.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .9rem;
  color: var(--accent-blue);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.workflow-step:last-child .step-num {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.step-content {
  padding-top: 10px;
}

.step-content strong {
  display: block;
  font-size: .95rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-content span {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Media (image & video) ── */
.media-block {
  margin: 24px 0;
}

.media-block video {
  background: #000;
}

.media-caption {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

.media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: .88rem;
}

thead tr {
  background: var(--accent-blue);
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .04em;
  color: #fff;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:nth-child(even) { background: var(--bg-card); }
tbody tr:nth-child(even):hover { background: var(--bg-hover); }

tbody td {
  padding: 9px 14px;
  color: var(--text-primary);
  vertical-align: top;
}

/* ── Hero (Home) ── */
.hero {
  text-align: center;
  padding: 40px 0 48px;
}

.hero-logo {
  max-width: 520px;
  width: 100%;
  margin: 0 auto 24px;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(61,156,240,.15);
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hero-version {
  font-size: .82rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  display: inline-block;
  margin-bottom: 32px;
}

.hero-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(61,156,240,.35);
  transition: all .2s;
  margin-right: 12px;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(61,156,240,.5);
}

.hero-cta-sec {
  display: inline-block;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: .9rem;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all .2s;
}

.hero-cta-sec:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.requirements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.req-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-align: center;
}

.req-card .req-icon { font-size: 1.6rem; margin-bottom: 8px; }
.req-card .req-label {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: block;
  margin-bottom: 4px;
}
.req-card .req-value {
  font-weight: 600;
  font-size: .88rem;
  color: var(--text-primary);
}

/* ── Placeholder section ── */
.section-placeholder {
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.section-placeholder .ph-icon { font-size: 2.5rem; margin-bottom: 14px; opacity: .4; }
.section-placeholder h3 {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.section-placeholder p {
  font-size: .85rem;
  color: var(--text-dim);
  margin: 0;
}

/* ── Numbered Steps (how-to) ── */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  counter-reset: step-counter;
}

.steps-list li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 48px;
  margin-bottom: 18px;
  min-height: 32px;
  display: block;
  font-size: .95rem;
  line-height: 1.7;
}

.steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 2px;
  width: 30px;
  height: 30px;
  background: rgba(61,156,240,.15);
  border: 1px solid var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent-blue);
}

/* ── Footer ── */
.site-footer {
  margin-left: var(--sidebar-w);
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  font-size: .8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent-blue); }

/* ══════════════════════════════════════════
   RESPONSIVE — Mobile & Tablet
   ══════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar overlay backdrop ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {

  /* Hamburger visible */
  .hamburger { display: flex; }

  /* Header adjustments */
  .site-header { padding: 0 16px; gap: 10px; }
  .header-version { display: none; }

  /* Sidebar becomes a slide-in drawer */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(var(--sidebar-w), 80vw);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    display: block; /* always rendered, just off-screen */
  }
  .sidebar.open { transform: translateX(0); }

  /* Main content takes full width */
  .main-content {
    margin-left: 0;
    padding: 28px 20px 60px;
  }

  .site-footer {
    margin-left: 0;
    padding: 20px 20px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* Section typography scale-down */
  .section-title { font-size: 1.6rem; }
  .hero-title { font-size: 1.8rem; }
  .hero-sub { font-size: .95rem; }

  /* Requirements grid: 2 columns */
  .requirements-grid { grid-template-columns: 1fr 1fr; }

  /* Media grid: single column */
  .media-row { grid-template-columns: 1fr; }

  /* Tables: horizontal scroll wrapper */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Mobile (≤ 600px) ── */
@media (max-width: 600px) {

  :root { --header-h: 56px; }

  .site-header { padding: 0 12px; gap: 8px; }
  .header-title { font-size: .95rem; }
  .header-links { display: none; }

  .main-content { padding: 20px 14px 48px; }

  .section-title { font-size: 1.35rem; }
  .section-lead { font-size: .95rem; }

  .hero { padding: 24px 0 32px; }
  .hero-title { font-size: 1.5rem; }
  .hero-cta, .hero-cta-sec {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 0 10px;
  }

  /* Requirements: single column */
  .requirements-grid { grid-template-columns: 1fr; }

  /* Callout: stack icon + text */
  .callout { flex-direction: column; gap: 6px; }

  /* Steps: tighter */
  .steps-list li { padding-left: 40px; }

  /* Workflow */
  .workflow::before { left: 18px; }
  .step-num { width: 36px; height: 36px; font-size: .8rem; }

  h2 { font-size: 1.15rem; }
  h3 { font-size: .95rem; }

  /* FAQ */
  .faq-body { padding-left: 28px; }
}
/* ── Media size variants ── */
/* Immagini a piena larghezza (default) */
.media-block img,
.media-block video {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: block;
}

/* Immagine piccola: si mostra alla dimensione naturale (max 380px) centrata */
.media-sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px auto;
}
.media-sm img {
  max-width: min(380px, 100%);
  width: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* Immagine media: max 580px centrata */
.media-md {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px auto;
}
.media-md img {
  max-width: min(580px, 100%);
  width: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
/* ── FAQ accordion (Sezione 13) ── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item:hover { border-color: var(--accent-blue); }
.faq-item summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "›";
  font-size: 1.2rem;
  color: var(--accent-blue);
  transition: transform .2s;
  display: inline-block;
  width: 18px;
}
.faq-item[open] summary::before { transform: rotate(90deg); }
.faq-item[open] { border-color: var(--accent-blue); }
.faq-body {
  padding: 0 18px 16px 46px;
  color: var(--text-muted);
  font-size: .93rem;
  line-height: 1.7;
}
.faq-body p { margin-bottom: 8px; }
.faq-body ul { margin: 8px 0 0 16px; }
.faq-body li { margin-bottom: 4px; }