/* The Tech-Smart Family — printable lead magnets
   Screen: readable page + Print button
   Print: clean A4, economic ink, hide chrome/CTAs
*/

:root {
  --red: #c63934;
  --red-dark: #a02824;
  --red-soft: #f8e8e7;
  --ink: #1f1a19;
  --ink-soft: #3d3836;
  --muted: #5c5654;
  --line: #d4ccc9;
  --line-soft: #e8dfdd;
  --bg: #faf7f5;
  --surface: #ffffff;
  --font: system-ui, -apple-system, "Segoe UI", "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red-dark); }

/* —— Screen chrome —— */
.screen-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(250, 247, 245, 0.96);
  border-bottom: 1px solid var(--line-soft);
  border-top: 3px solid var(--red);
  backdrop-filter: blur(8px);
}

.screen-bar .brand {
  font-weight: 700;
  color: var(--red-dark);
  text-decoration: none;
  font-size: 0.95rem;
}

.screen-bar .brand span {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
}

.screen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.2;
}

.btn-print {
  background: var(--red);
  color: #fff;
  border-color: var(--red-dark);
}

.btn-print:hover { background: var(--red-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--red); color: var(--red-dark); }

.btn-amazon {
  background: var(--red-dark);
  color: #fff;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

/* —— Sheet (printable unit) —— */
.sheet-wrap {
  width: min(100% - 2rem, 210mm);
  margin: 1.25rem auto 2rem;
}

.sheet {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  box-shadow: 0 12px 36px rgba(160, 40, 36, 0.08);
  overflow: hidden;
  page-break-inside: avoid;
}

.sheet + .sheet {
  margin-top: 1.5rem;
}

.sheet-header {
  background: var(--red);
  color: #fff;
  padding: 1rem 1.35rem 1.05rem;
  position: relative;
}

.sheet-header::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--red-dark);
  position: absolute;
  left: 0; right: 0; top: 0;
}

.sheet-header h1 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sheet-header .subtitle {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.95;
  font-weight: 400;
}

.sheet-header .meta {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
  font-weight: 600;
}

.sheet-body {
  padding: 1.15rem 1.35rem 1.25rem;
}

.intro {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.note-soft {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.75rem;
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Sections */
.section {
  margin: 0.85rem 0 0.65rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red-dark);
  letter-spacing: -0.01em;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 1.05em;
  background: var(--red);
  border-radius: 1px;
  flex-shrink: 0;
}

.section-title.plain::before { display: none; }

h3.subhead {
  margin: 0.55rem 0 0.3rem;
  font-size: 0.88rem;
  color: var(--ink);
}

/* Age / card bands */
.band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.5rem 0 0.75rem;
}

.band {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.65rem 0.75rem 0.55rem;
  background: #fff;
  border-top: 3px solid var(--red);
}

.band h2, .band .band-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--red-dark);
  font-weight: 700;
}

.band .band-meta {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}

.band ul {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.band li { margin: 0.15rem 0; }

/* Checklists */
ul.check, .check {
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
}

ul.check li, .check-item {
  display: grid;
  grid-template-columns: 1.05em 1fr;
  gap: 0.45rem;
  align-items: start;
  margin: 0.28rem 0;
  font-size: 0.88rem;
  color: var(--ink);
}

.box {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  border: 1.5px solid var(--red);
  border-radius: 2px;
  margin-top: 0.15em;
  background: #fff;
  flex-shrink: 0;
}

/* Fill-in fields */
.fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0.4rem 0 0.75rem;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 8rem;
  flex: 1;
}

.field.grow { flex: 2; min-width: 12rem; }

.field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.uline {
  border: none;
  border-bottom: 1.5px solid var(--line);
  background: transparent;
  min-height: 1.55rem;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0.15rem 0.2rem;
}

.uline:focus {
  outline: none;
  border-bottom-color: var(--red);
}

.write-lines {
  margin: 0.25rem 0 0.6rem;
}

.write-lines .line {
  border-bottom: 1px solid var(--line);
  height: 1.45rem;
  margin: 0.15rem 0;
}

/* Tables / grids */
.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.78rem;
  margin: 0.4rem 0 0.75rem;
}

.table th {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  padding: 0.4rem 0.3rem;
  text-align: center;
  border: 1px solid var(--red-dark);
}

.table th:first-child,
.table td:first-child {
  text-align: left;
  padding-left: 0.45rem;
  font-weight: 700;
  color: var(--red-dark);
  background: var(--red-soft);
  width: 18%;
}

.table td {
  border: 1px solid var(--line);
  vertical-align: top;
  height: 2.6rem;
  padding: 0.25rem;
  background: #fff;
}

.table tr:nth-child(even) td:not(:first-child) {
  background: #fffaf9;
}

.table .inner-lines {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.35rem;
}

.table .inner-lines span {
  display: block;
  border-bottom: 1px solid var(--line-soft);
  height: 0;
}

/* Two-col helpers */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.cols-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65rem;
}

.panel {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  background: #fff;
}

.panel.tint { background: var(--red-soft); border-color: #efd5d3; }

.panel h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--red-dark);
}

.tip {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--red);
  border-radius: 6px;
  background: #fffaf9;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.tip strong { color: var(--red-dark); }

.sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.1rem;
  margin-top: 0.4rem;
}

.sig-box label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.sig-box .uline { margin-bottom: 0.45rem; }

.rating {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin: 0.35rem 0 0.5rem;
  flex-wrap: wrap;
}

.rating .circle {
  width: 1.5rem;
  height: 1.5rem;
  border: 1.5px solid var(--red);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.sheet-footer {
  margin-top: 0.85rem;
  padding-top: 0.55rem;
  border-top: 2px solid var(--red);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sheet-footer strong { color: var(--red-dark); }

/* Amazon CTA — screen only */
.amazon-band {
  width: min(100% - 2rem, 210mm);
  margin: 0 auto 2.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--red-soft);
  border: 1px solid #efd5d3;
  border-radius: 10px;
  text-align: center;
}

.amazon-band p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.amazon-band .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Gallery index */
.gallery {
  width: min(100% - 2rem, 52rem);
  margin: 1.5rem auto 2.5rem;
}

.gallery-hero {
  margin-bottom: 1.5rem;
}

.gallery-hero h1 {
  margin: 0.2rem 0 0.5rem;
  font-size: 1.75rem;
  color: var(--red-dark);
  letter-spacing: -0.02em;
}

.gallery-hero .lead {
  color: var(--ink-soft);
  max-width: 40rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 1.1rem 1.15rem;
  border-top: 4px solid var(--red);
  box-shadow: 0 8px 24px rgba(160, 40, 36, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.card h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.card p {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.card .btn { align-self: flex-start; margin-top: 0.35rem; }

.print-note {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px dashed var(--red);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .band-grid, .cols-2, .cols-3, .sig-grid { grid-template-columns: 1fr; }
  .sheet-header h1 { font-size: 1.25rem; }
}

/* ========== PRINT ========== */
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  html, body {
    background: #fff !important;
    color: #000;
    font-size: 11.5pt;
    line-height: 1.35;
  }

  .no-print,
  .screen-bar,
  .amazon-band,
  .btn-print,
  .screen-actions {
    display: none !important;
  }

  .sheet-wrap {
    width: 100%;
    margin: 0;
    max-width: none;
  }

  .sheet {
    border: none;
    box-shadow: none;
    border-radius: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .sheet.allow-break,
  .sheet.page-2 {
    break-inside: auto;
    page-break-inside: auto;
  }

  .sheet + .sheet,
  .sheet.page-2 {
    break-before: page;
    page-break-before: always;
    margin-top: 0;
  }

  .sheet-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 8mm 0 5mm;
    background: #fff !important;
    color: var(--red-dark) !important;
    border-bottom: 2.5pt solid var(--red);
  }

  .sheet-header::before {
    height: 3.5pt;
    background: var(--red-dark);
  }

  .sheet-header h1 {
    font-size: 16pt;
    color: var(--red-dark) !important;
  }

  .sheet-header .subtitle,
  .sheet-header .meta {
    color: #333 !important;
    opacity: 1;
  }

  .sheet-body {
    padding: 5mm 0 0;
  }

  .intro { font-size: 10pt; margin-bottom: 3.5mm; }

  .section-title { font-size: 11pt; color: var(--red-dark) !important; }

  .band {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border-top-color: var(--red);
    padding: 3mm 3.5mm;
  }

  .band ul, ul.check li, .check-item { font-size: 9.5pt; }

  .band-grid { gap: 3mm; }

  .table {
    font-size: 8.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table th {
    background: var(--red) !important;
    color: #fff !important;
    padding: 2mm 1.5mm;
  }

  .table td { height: 11mm; }

  .table td:first-child,
  .table th:first-child {
    background: var(--red-soft) !important;
    color: var(--red-dark) !important;
  }

  .box {
    border-color: var(--red);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .uline, .write-lines .line {
    border-bottom-color: #999;
  }

  .panel.tint, .note-soft, .tip {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheet-footer {
    border-top-color: var(--red);
    font-size: 8pt;
    margin-top: 4mm;
  }

  a { color: inherit; text-decoration: none; }

  /* Avoid overflow */
  img, table, .band, .panel { max-width: 100%; }
}


/* Extra print density for long checklists */
@media print {
  .cols-3 { gap: 2.5mm; }
  .panel { padding: 2.5mm 3mm; }
  ul.check li, .check-item { margin: 0.9mm 0; font-size: 9pt; }
  .section { margin: 2.5mm 0 2mm; }
  .table td { height: 12mm; }
  .sheet-header h1 { font-size: 15pt; }
  .band-grid { gap: 2.5mm; }
  /* Keep 3-col age snapshots readable */
  .band-grid[style*="1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr 1fr !important; }
}
