/* ------------------------------------------------------------
   Brand Lift Study – UI Styles (Desktop + Mobile)
   - Clean Montserrat typography
   - Primary blue palette
   - Carded layout with soft shadows
   - Print-ready (A4 landscape)
------------------------------------------------------------- */

/* Typeface to match slides */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap');

/* Theme tokens */
:root{
  --brand-blue: #3a4bbf;
  --brand-blue-dark: #22308f;
  --ink: #13161f;
  --muted: #6b7280;
  --muted-2: #4b5563;
  --border: #eef2f7;
  --bg: #ffffff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Layout */
.wrapper { max-width: 1180px; margin: 24px auto; padding: 0 16px; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 8px;
}
.h-title { margin: 0; font-weight: 800; font-size: 42px; letter-spacing: .5px; color: var(--brand-blue); }
.h-sub   { margin-top: 4px; color: #1f2937; font-weight: 600; }
.small   { color: var(--muted); font-size: 13px; }

.badge {
  background: rgba(58,75,191,.08);
  color: var(--brand-blue);
  padding: 6px 10px; border-radius: 10px; font-weight: 700;
  border: 1px solid rgba(58,75,191,.18);
}

/* Controls */
.controls { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 10px; align-items: center; }
.controls label { font-size: 12px; color: var(--muted-2); display: flex; flex-direction: column; gap: 6px; }

select, button {
  font: 600 14px/1 'Montserrat', sans-serif;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #111827;
}
button { cursor: pointer; transition: box-shadow .18s ease, transform .02s ease; }
button:active { transform: translateY(1px); }
button.primary { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
button.primary:hover { box-shadow: 0 6px 20px rgba(58,75,191,.25); }
button:hover { box-shadow: 0 4px 16px rgba(20,31,58,.08); }

/* Cards */
.card{
  background:#fff; border:1px solid var(--border); border-radius:18px;
  padding:18px 18px 12px; margin:14px 0;
  box-shadow:0 4px 20px rgba(20,31,58,.05);
}
.card h3{ margin:4px 0 10px; font-size:20px; color: var(--muted-2); }
.legend-note{ font-size:13px; color:var(--muted); margin-top:6px; }
.footer-note{ margin:16px 0 24px; color:#374151; font-size:14px; }

/* Charts */
.chart-wrap { padding: 8px; }
.canvas { width:100%; height:420px; }
.canvas.funnel { height:360px; }
.canvas.delta  { height:360px; }

/* Utilities */
hr.sep{ border:none; border-top:1px solid #f1f3f7; margin:10px 0; }
.avoid-break-inside { break-inside: avoid; page-break-inside: avoid; }
.screen-only { display: block; }

/* Print header/footer (hidden on screen) */
.print-header, .print-footer { display: none; }
.print-header, .print-footer { font-size: 12px; color: var(--muted-2); }
.print-footer .page-num::after { counter-reset: page; }

/* ------------------------------------------------------------
   PRINT LAYOUT
------------------------------------------------------------- */
@page { size: A4 landscape; margin: 12mm; }

@media print {
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .controls, .screen-only { display: none !important; }
  .wrapper { max-width: 100%; margin: 0; padding: 0; }
  .card { box-shadow: none; border: 0; padding-top: 8px; }

  .print-header, .print-footer {
    display: flex !important;
    align-items: center; justify-content: space-between;
    position: fixed; left: 12mm; right: 12mm;
  }
  .print-header { top: 6mm; }
  .print-footer { bottom: 6mm; }

  /* Page numbers */
  .print-footer .page-num::after { content: "Page " counter(page); }
}

/* ------------------------------------------------------------
   MOBILE LAYOUT
------------------------------------------------------------- */
@media (max-width: 768px){
  .wrapper{padding:0 12px}
  .header{flex-direction:column; align-items:flex-start; gap:6px}
  .h-title{font-size:28px}
  .h-sub{font-size:12px}
  .badge{align-self:flex-end}

  .controls{gap:8px; margin:14px 0 8px}
  .controls label{width:100%}
  .controls select{width:100%}
  .controls button{flex:1 1 calc(50% - 6px)}

  .card{padding:14px; border-radius:14px}
  .card h3{font-size:16px}
  .legend-note{font-size:12px}

  /* shorter charts on small screens */
  .canvas{height:300px}
  .canvas.funnel{height:360px}
  .canvas.delta{height:280px}
}
