/* =========================================
   Industrial Steel Safety Theme
   Palette B:
   - Charcoal / Steel grays as base
   - Muted safety yellow accents
   - Hazard orange CTAs
========================================= */

:root {
  --brand-yellow: #facc15;     /* safety amber */
  --brand-yellow-soft: #fef3c7;
  --brand-orange: #f97316;     /* hazard orange */
  --nav-bg-start: #020617;     /* near-black slate */
  --nav-bg-end: #111827;       /* charcoal */
  --page-bg: #f1f5f9;          /* light steel */
  --card-bg: #ffffff;
  --border-subtle: #e5e7eb;
  --text-main: #0f172a;
  --text-muted: #4b5563;
  --shadow-soft: 0 18px 35px rgba(15, 23, 42, 0.14);
}

/* Reset-ish bits */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--page-bg);
  color: var(--text-main);
}

/* Let footer sit at bottom on tall screens */
body > .page-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  flex: 1 0 auto;
}

/* =========================================
   Navbar
========================================= */

.navbar {
  background: linear-gradient(135deg, var(--nav-bg-start), var(--nav-bg-end));
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.navbar-brand {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--brand-yellow) !important;
}

.navbar-brand:hover {
  color: #fde047 !important;
}

.navbar-nav .nav-link {
  font-size: 0.9rem;
  color: #e5e7eb;
  position: relative;
  padding-bottom: 0.2rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus-visible {
  color: #ffffff;
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--brand-yellow);
  transition: width 0.18s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link:focus-visible::after {
  width: 100%;
}

/* Bootstrap toggler icon on dark background */
.navbar-toggler {
  border-color: rgba(248, 250, 252, 0.4);
}

/* =========================================
   Global layout + sections
========================================= */

.site-main {
  padding-top: 1.75rem;
  padding-bottom: 2.5rem;
}

.page-section {
  margin-bottom: 3rem;
}

.page-header {
  margin-bottom: 2.25rem;
}

/* =========================================
   Hero / Intro (index)
========================================= */

.hero-card {
  background-color: #ffffff;
  border: 1px solid rgba(71, 85, 105, 0.45); /* slate-600-ish */
  border-left: 5px solid var(--brand-yellow); /* safety stripe indicator */
  border-radius: 0.75rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.hero-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 640px;
}

.hero-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #64748b; /* slate-500 */
  font-weight: 600;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .hero-card {
    padding: 2rem;
  }
  .hero-title {
    font-size: 1.9rem;
  }
}

@media (max-width: 575.98px) {
  .hero-card {
    padding: 1.4rem 1.25rem;
  }
}

/* =========================================
   INDEX PAGE — Talk Cards (category + title in dark header)
========================================= */

.talk-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f8fafc; /* subtle steel tint, like talk sections */
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease;
}

/* Full-width dark header bar with category + title */
.talk-card-header {
  background: #0f172a;  /* same as talk-section headings / navbar */
  padding: 0.55rem 1.3rem 0.75rem;
}

/* Override talk-card header colors */
.talk-card-header .topic-category {
  color: #a5a5a5 !important;   /* white category */
}

.talk-card-header .talk-title {
  color: var(--brand-yellow) !important;  /* yellow title */
}

.talk-card-header .topic-category {
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 0.18rem;
  color: var(--brand-yellow); /* safety yellow */
}

.talk-card-header .talk-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #f9fafb;          /* light text on dark header */
}

/* White body for summary + footer */
.talk-card-body {
  background: #ffffff;
  padding: 1.0rem 1.3rem 1.2rem;
}

.talk-card-body .talk-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

/* Footer row inside card */
.talk-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #6b7280;
}

.talk-card-footer .talk-meta {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.talk-card-footer .talk-link {
  font-weight: 600;
  color: var(--brand-orange);
}

/* Animated gradient sweep on hover */
.talk-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--brand-yellow), var(--brand-orange));
  transition: width 0.25s ease-in-out;
}

.talk-card:hover::before,
.talk-card:focus-visible::before {
  width: 100%;
}


/* Hover / focus animation (same feel as before) */
.talk-card:hover,
.talk-card:focus-visible {
  border-color: rgba(250, 204, 21, 0.9);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
  transform: translateY(-0px);
  background-color: #f9fafb;
}

.talk-card:hover .talk-link,
.talk-card:focus-visible .talk-link {
  color: #ea580c;
}

/* Compact padding on very small screens */
@media (max-width: 575.98px) {
  .talk-card-header {
    padding: 0.5rem 1.1rem 0.7rem;
  }

  .talk-card-body {
    padding: 0.9rem 1.1rem 1.1rem;
  }
}


/* =========================================
   Buttons (overriding Bootstrap primary)
========================================= */

.btn-primary {
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: #ea580c;
  border-color: #ea580c;
}

.btn-outline-primary {
  color: var(--brand-orange);
  border-color: var(--brand-orange);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #f9fafb;
}

/* =========================================
   Safety talk article page
========================================= */

.safety-talk-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

.safety-talk header {
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.safety-talk h1 {
  font-size: 1.85rem;
  margin-bottom: 0.4rem;
  color: #0f172a;
  line-height: 1.25;
}

.talk-meta {
  letter-spacing: 0.12em;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.82rem;
}

.safety-talk .lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 55ch;
}

/* Base section heading (no styling, just typography) */
.section-heading {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.8rem;
  text-transform: none;
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* Body text */
.safety-talk p {
  line-height: 1.7;
  margin-bottom: 0.9rem;
  max-width: 70ch;
}

/* Bullets */
.safety-talk ul {
  padding-left: 1.2rem;
  margin-bottom: 1.1rem;
}

.safety-talk ul li {
  margin-bottom: 0.45rem;
  line-height: 1.6;
}

/* Yellow sign-in CTA */
.safety-signin-cta {
  border-radius: 0.85rem;
  border: 1px dashed rgba(250, 204, 21, 0.95);
  background: var(--brand-yellow-soft);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.safety-signin-cta h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.safety-signin-cta p {
  margin-bottom: 0;
  color: #475569;
}

/* =========================================
   Talk sections as cards (talk page)
========================================= */
/* Base section heading (used outside cards too) */
.section-heading {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.8rem;
  text-transform: none;
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}
/* Talk sections as cards on the talk page */
.talk-section-card {
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0;                         /* no padding here */
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
  margin-bottom: 1.5rem;
  overflow: hidden;                   /* header bar follows radius */
}

/* Full-width dark header bar */
.talk-section-card .section-heading {
  display: block;
  width: 100%;
  margin: 0;
  background: #0f172a;
  color: #facc15;
  padding: 0.55rem 1.35rem;
  border-radius: 0.9rem 0.9rem 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Inner body padding so text doesn’t touch edges */
.talk-section-body {
  padding: 1.1rem 1.35rem 1.35rem;
}

.talk-section-body p {
  margin-bottom: 0.8rem;
}

.talk-section-body ul {
  padding-left: 1.15rem;
  margin-bottom: 0;
}

.talk-section-body ul li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

/* =========================================
   Related topics list
========================================= */

.related-topics ul {
  list-style: none;
  padding-left: 0;
  margin-top: 0.4rem;
}

.related-topics li + li {
  margin-top: 0.25rem;
}

.related-topics a {
  text-decoration: none;
  color: var(--brand-dark);
}

.related-topics a:hover {
  text-decoration: underline;
}

/* =========================================
   Sign-in sheet page
========================================= */

.sign-in-sheet-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.sign-in-sheet header p.text-muted {
  font-size: 0.95rem;
}

.sign-in-sheet .form-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.sign-in-sheet .border {
  border-radius: 0.4rem;
  border-color: rgba(148, 163, 184, 0.9) !important;
}

.sign-in-table th,
.sign-in-table td {
  font-size: 0.9rem;
}

/* =========================================
   Footer
========================================= */

footer {
  flex-shrink: 0;
  background-color: #0b1120;
  color: rgba(248, 250, 252, 0.7);
}

footer .container {
  font-size: 0.8rem;
}

/* =========================================
   Print tweaks
========================================= */

@media print {
  nav,
  footer {
    display: none !important;
  }

  body {
    background-color: #ffffff;
  }

  main.site-main {
    padding-top: 0;
    padding-bottom: 0;
  }

  .hero-card {
    box-shadow: none;
  }
}

/* Small heading utility (for sign-in CTA) */
h2.h6 {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Index topics count */
.topics-count {
  font-size: 0.8rem;
  color: #6b7280;
}

/* =========================================
   QR card on talk page
========================================= */

.qr-card {
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #ffffff;
}

#qr-container canvas,
#qr-container img {
  width: 140px;
  height: 140px;
}

/* Slight tweak on small screens */
@media (max-width: 575.98px) {
  .qr-card {
    margin-top: 0.5rem;
  }
}

.qr-toggle-btn {
  font-size: 0.82rem;
}

/* --- Custom Pagination Theme (Safety Talk Library) --- */

.talk-pagination .page-link {
  color: #f7882f; /* orange text */
  border-color: #f7882f;
  background-color: transparent;
}

.talk-pagination .page-link:hover {
  background-color: #f7882f;
  color: #fff;
  border-color: #f7882f;
}

.talk-pagination .page-item.active .page-link {
  background-color: #f7882f;
  border-color: #f7882f;
  color: #fff;
}

.talk-pagination .page-item.disabled .page-link {
  color: #ccc;
  border-color: #ddd;
  background-color: #f8f9fa;
  pointer-events: none;
}

.talk-pagination .page-link {
  border-radius: 0.4rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
}

.sign-line {
  border-bottom: 1px solid #ccc;
  height: 1.8rem;
}

.qr-box {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

.sign-table th,
.sign-table td {
  border-color: #ddd;
  height: 1.8rem;
}

/* Hide print button when printing */
@media print {
  .d-print-none {
    display: none !important;
  }
}
