/* =========================
   Base
========================= */
body {
  /* ===== FONT TESTING – uncomment ONE at a time ===== */

  /* 1️⃣ Inter (recommended default) */
  /* font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; */

  /* 2️⃣ Source Sans 3 (government / compliance feel) */
  font-family: "Source Sans 3", system-ui, Arial, sans-serif;

  /* 3️⃣ IBM Plex Sans (structured / technical) */
  /* font-family: "IBM Plex Sans", system-ui, Arial, sans-serif; */

  /* 4️⃣ System UI (fastest, zero external fonts) */
  /* font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; */

  background: #f4f6f8;
  margin: 0;
  padding: 0;
}

/* =========================
   Header
========================= */
header {
  background: #004b8d;
  color: #fff;
  text-align: center;
  padding: 1.5rem 1rem;
}

.logo {
  width: 220px;        /* primary size */
  max-width: 90%;      /* prevents overflow on mobile */
  height: auto;        /* preserves aspect ratio */
  display: block;
  margin: 0 auto 0.7rem;
}

/* =========================
   Main Width Control
========================= */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* =========================
   Section Titles (Index Page)
========================= */
.section-title {
  max-width: 1200px;
  margin: 2.5rem auto 1rem;
  padding: 0 1.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #000;
  text-align: center;
  border-bottom: 1px solid #e1e6ec;
  padding-bottom: 0.5rem;
}

/* =========================
   Gallery Grid
========================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

/* =========================
   Cards (Checklist Buttons)
========================= */
.card {
  background: white;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);

  text-align: center;
  text-decoration: none;
  color: #004b8d;

  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;

  min-height: 78px;

  display: flex;
  align-items: center;
  justify-content: center;

  word-wrap: break-word;
  hyphens: auto;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  background: #e9f2ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* =========================
   Category Accent Colors
   (applied via wrapper sections)
========================= */

/* General Industry / Warehouse */
.category-industry .card {
  border-top: 4px solid #004b8d;
}

/* HR / Employee Lifecycle */
.category-hr .card {
  border-top: 4px solid #6b4fa3;
}

/* Ergonomics – English */
.category-ergo-en .card {
  border-top: 4px solid #1b8f6a;
}

/* Ergonomics – Spanish */
.category-ergo-es .card {
  border-top: 4px solid #c23b22;
}

/* =========================
   Checklist Container
========================= */
.container {
  background: white;
  margin: 1.5rem auto;
  padding: 1.5rem 2rem;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* =========================
   Buttons
========================= */
.btn {
  background: #0077cc;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
}

.btn:hover {
  background: #005fa3;
}

.btn-secondary {
  background: #999;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #777;
}

/* =========================
   Checklist Sections
========================= */
.section {
  margin-bottom: 1.5rem;
}

.section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.25rem 0 0.5rem;
  padding-bottom: 0.25rem;
  color: #004b8d;
  border-bottom: 1px solid #e1e6ec;
}

.item {
  display: flex;
  align-items: center;
  margin: 0.25rem 0;
}

.item label {
  flex: 1;
}

.citation {
  font-size: 0.85rem;
  color: gray;
  margin-left: 1.5rem;
}

.back-link {
  text-align: center;
  margin-top: 2rem;
}

/* =========================
   PDF Header / Footer
========================= */
.pdf-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;                /* tighter logo–title spacing */
  border-bottom: 2px solid #004b8d;
  padding-bottom: 0.25rem;    /* reduces header height */
  margin-bottom: 0.4rem;      /* pulls content closer */
}

.pdf-header h1 {
  margin: 0;
  line-height: 1.05;          /* tighter title block */
  font-size: 1.6rem;          /* optional: slightly smaller */
}

.logo-small {
  width: 50px;                /* smaller = less vertical drag */
  height: auto;
}

.subtitle {
  color: gray;
  margin: 0;
  font-size: 0.9rem;          /* keeps subtitle compact */
}

.pdf-footer {
  border-top: 2px solid #004b8d;
  margin-top: 1.25rem;        /* tighter than before */
  padding-top: 0.4rem;
  font-size: 0.8rem;
  color: gray;
  text-align: center;
}

/* =========================
   Sign-Off Section
========================= */
.signoff-section {
  border-top: 2px solid #004b8d;
  margin-top: 2rem;
  padding-top: 1rem;
}

.signoff-section label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
  margin-top: 0.5rem;
}

.sign-input {
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 0.25rem;
  max-width: 200px;
}

/* Input formatting */
#userInitials {
  text-transform: uppercase;
  letter-spacing: 1px;
}

#printName {
  width: 300px;
  text-transform: capitalize;
}

/* Signature */
.sig-wrapper {
  border: 2px dashed #004b8d;
  background: #f9fafc;
  width: 400px;
  height: 150px;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* =========================
   Mobile Tuning
========================= */
@media (max-width: 768px) {
  .section-title {
    text-align: center;
  }

  .card {
    font-size: 1rem;
    padding: 1rem;
    min-height: auto;
  }

  .section h2 {
    text-align: center;
    font-size: 1.15rem;
  }
  
  .logo {
    width: 100px;
    margin-bottom: 0.5rem;
  }
}

/* =========================
   Print / PDF
========================= */
@media print {
  body {
    background: white !important;
  }

  .btn,
  .back-link,
  #clearSigBtn {
    display: none !important;
  }

  .container {
    box-shadow: none;
    border: none;
    margin: 0;
    padding-top: 0.1in !important;
    padding-right: 1in !important;
    padding-bottom: 0.75in !important;
    padding-left: 1in !important;
  }

  .pdf-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0.2rem !important;
    padding-bottom: 0.1rem !important;
  }

  .pdf-header h1 {
    margin: 0 !important;
    line-height: 1.05 !important;
  }

  .section {
    page-break-inside: avoid;
  }

  .pdf-footer {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: gray;
  }
}
