/* =========================================================
   Employee Handbook - Mobile-optimized styles.css
   Drop-in replacement
   ========================================================= */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #ffffff;
  overflow-x: hidden;
}

/* Layout */
.dashboard-container {
  /* IMPORTANT: let the page scroll normally (no nested scroll container) */
  display: block;
  min-height: 100vh;
}

.dashboard-header {
  background-color: #561414;
  color: #fff;
  padding: 16px 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

  display: flex;
  align-items: center;
  gap: 14px;

  /* Sticky removed */
  position: static;
  top: auto;
  z-index: auto;
}

.header-logo {
  height: 52px;
  width: auto;
  max-width: 180px;
  flex: 0 0 auto;
}

.dashboard-header h1 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
  flex: 1 1 auto;
}

.dashboard-content {
  /* Mobile-friendly padding by default */
  padding: 20px 14px;
  background-color: #fff;

  /* Readability width */
  max-width: 900px;
  margin: 0 auto;
  width: 100%;

  /* Ensure no internal scrolling */
  overflow: visible;
}

/* Typography - Main Sections */
.main-section {
  margin-top: 34px;
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 3px solid #561414;
}

.main-section h1 {
  font-size: 30px;
  color: #561414;
  margin-bottom: 14px;
  padding: 12px 0 10px;
  font-weight: 700;

  /* Sticky removed */
  position: static;
  top: auto;
  background: transparent;
  z-index: auto;

  border-bottom: 1px solid rgba(86, 20, 20, 0.18);
}

/* Typography - Sub Sections */
.sub-section {
  margin-top: 22px;
  margin-bottom: 16px;
}

.sub-section h2 {
  font-size: 22px;
  color: #333;
  margin-bottom: 10px;
  padding: 10px 0 8px;
  font-weight: 700;

  /* Sticky removed */
  position: static;
  top: auto;
  background: transparent;
  z-index: auto;

  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

h3 {
  font-size: 18px;
  color: #561414; /* fixed typo from ##561414 */
  margin-top: 18px;
  margin-bottom: 10px;
  font-weight: 700;
}

/* Paragraphs */
p {
  margin-bottom: 14px;

  /* IMPORTANT: justified text looks bad on phones */
  text-align: left;

  font-size: 16px;
  color: #333;
}

/* Bold and Underlined Text */
b,
strong {
  font-weight: 700;
}

u {
  text-decoration: underline;
}

b u,
u b,
strong u,
u strong {
  font-weight: 700;
  text-decoration: underline;
}

/* Lists */
ul,
ol {
  margin: 0 0 18px 22px;
  font-size: 16px;
}

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

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

/* Nested Lists */
ul ul,
ol ol {
  margin-top: 8px;
  margin-bottom: 8px;
  margin-left: 18px;
}

ul ul {
  list-style-type: circle;
}

ol ol {
  list-style-type: lower-alpha;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: 16px;

  /* Prevent horizontal overflow on small screens */
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table th {
  background-color: #8b0000;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  border: 1px solid #660000;
  white-space: nowrap;
}

table td {
  padding: 10px 12px;
  border: 1px solid #ddd;
  white-space: nowrap;
}

table tr:nth-child(even) {
  background-color: #f8f9fa;
}

table tr:nth-child(odd) {
  background-color: #ffffff;
}

/* Table of Contents */
.toc-section {
  background-color: #ffffff;
  padding: 18px 16px;
  margin-bottom: 26px;
  border-radius: 8px;
  border-left: 5px solid #8b0000;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.toc-section h2 {
  font-size: 22px;
  color: #8b0000;
  margin-bottom: 12px;
  font-weight: 700;
}

.toc-list {
  list-style-type: none;
  margin-left: 0;
}

.toc-list li {
  margin-bottom: 10px;
}

.toc-list a {
  color: #8b0000;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.3;
  display: inline-block;
  padding: 2px 0;
}

.toc-list a:hover {
  text-decoration: underline;
  color: #a52a2a;
}

.toc-list .toc-main {
  font-weight: 700;
  font-size: 17px;
  margin-top: 12px;
  margin-bottom: 6px;
}

.toc-list .toc-sub {
  margin-left: 14px;
  font-size: 16px;
}

/* =========================================================
   Responsive adjustments
   ========================================================= */
@media (min-width: 769px) {
  .dashboard-content {
    padding: 34px 28px;
  }

  .dashboard-header h1 {
    font-size: 28px;
  }

  .main-section h1 {
    font-size: 34px;
  }

  .sub-section h2 {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    padding: 12px 14px;
  }

  .header-logo {
    height: 40px;
    max-width: 140px;
  }

  .dashboard-header h1 {
    font-size: 18px;
  }

  .dashboard-content {
    padding: 16px 12px;
  }
}
