/* ==========================================================================
   TATA TERTIB & KEBIJAKAN - CLEAN & OFFICIAL WEB CARD STYLESHEET
   Institut Kesehatan Karsa Husada Garut
   ========================================================================== */

.rules-section {
  padding: 3.5rem 0 5rem 0;
  background-color: #f8fafc;
}

.rules-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.25rem;
  align-items: start;
}

/* ==========================================================================
   Sidebar: Navigasi Daftar Butir Aturan
   ========================================================================== */
.rules-nav {
  position: sticky;
  top: calc(var(--header-height, 80px) + 1.5rem);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
}

.rules-nav-header {
  margin-bottom: 0.875rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.rules-nav-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #09a89e;
  background: #eef6f5;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.rules-nav-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.15rem 0;
}

.rules-nav-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.rules-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding-right: 4px;
}

.rules-menu::-webkit-scrollbar {
  width: 3px;
}
.rules-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.rules-menu-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

.rules-menu-link .nav-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: #09a89e;
  min-width: 22px;
}

.rules-menu-link .nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.rules-menu-link:hover {
  background: #f8fafc;
  color: #0f172a;
  border-left-color: #09a89e;
}

.rules-menu-link.active {
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
  border-left-color: #09a89e;
}

/* ==========================================================================
   MASTER CARD: BUTIR-BUTIR TATA TERTIB RESMI
   ========================================================================== */
.rules-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

/* Header Card */
.rules-card-header {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: #ffffff;
}

.rules-header-content {
  flex: 1;
  min-width: 260px;
}

.rules-header-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #09a89e;
  background: #eef6f5;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.65rem;
}

.rules-header-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.45rem 0;
  line-height: 1.3;
}

.rules-header-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

.rules-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Body: Daftar Butir Aturan */
.rules-card-body {
  display: flex;
  flex-direction: column;
}

.rule-row {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid #f1f5f9;
  align-items: flex-start;
  scroll-margin-top: calc(var(--header-height, 80px) + 2rem);
  transition: background-color 0.15s ease;
}

.rule-row:last-child {
  border-bottom: none;
}

.rule-row:hover {
  background-color: #fafcfc;
}

.rule-row.rule-highlight-active {
  background-color: #f0fdfa !important;
}

.rule-number {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #09a89e;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.rule-content {
  flex: 1;
}

.rule-text {
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.65;
  font-weight: 500;
  margin: 0;
}

/* Sub-Poin (untuk aturan poin 5 atau lainnya yang memiliki sub-list) */
.rule-sub-list {
  margin-top: 0.65rem;
  padding-left: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rule-sub-item {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  font-size: 0.9125rem;
  color: #334155;
  line-height: 1.6;
}

.rule-sub-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #09a89e;
  margin-top: 8px;
  flex-shrink: 0;
}

.rule-sub-text {
  flex: 1;
}

/* Footer: Klausul Sanksi & Catatan Penutup */
.rules-card-footer {
  padding: 1.5rem 2.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
}

.footer-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef6f5;
  color: #09a89e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-body {
  flex: 1;
}

.footer-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.3rem 0;
}

.footer-text {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.65;
  margin: 0;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .rules-layout {
    grid-template-columns: 250px 1fr;
    gap: 1.75rem;
  }
  .rules-card-header,
  .rule-row,
  .rules-card-footer {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

@media (max-width: 900px) {
  .rules-layout {
    grid-template-columns: 1fr;
  }
  .rules-nav {
    position: static;
    margin-bottom: 1.5rem;
  }
  .rules-menu {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.35rem;
  }
}

@media (max-width: 640px) {
  .rules-section {
    padding: 2rem 0 3.5rem 0;
  }
  .rules-card-header,
  .rule-row,
  .rules-card-footer {
    padding: 1.25rem;
  }
  .rules-header-title {
    font-size: 1.25rem;
  }
  .rule-row {
    gap: 0.85rem;
  }
  .rules-card-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
}
