/* ==========================================================================
   COURTBOOK LEGAL PAGES STYLESHEET
   Clean, editorial, premium legal document layout for Constitution of India
   ========================================================================== */

.legal-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.legal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.legal-brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.legal-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
}

.legal-brand-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.legal-brand-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: block;
}

.legal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.legal-back-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
  transform: translateX(-2px);
}

/* Legal Document Layout */
.legal-main {
  padding: 3rem 0 5rem;
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* Sidebar Navigation */
.legal-sidebar {
  position: sticky;
  top: 96px;
}

.legal-nav-menu {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
}

.legal-nav-menu-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.legal-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all 0.15s ease;
}

.legal-nav-item:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.legal-nav-item.active {
  color: var(--text-main);
  background: var(--bg-subtle);
  font-weight: 600;
  border-left: 3px solid #18181b;
}

.legal-sidebar-card {
  margin-top: 1.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  font-size: 0.82rem;
}

.legal-sidebar-card h5 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.legal-sidebar-card p {
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.legal-sidebar-email {
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  word-break: break-all;
}

/* Document Paper */
.legal-document {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 4rem;
  box-shadow: var(--shadow-sm);
}

.legal-doc-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.legal-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 1.25rem;
}

.legal-doc-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
}

.legal-doc-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.legal-doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.legal-doc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Document Prose */
.legal-prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-main);
}

.legal-prose p {
  color: var(--text-sub);
  margin-bottom: 1.4rem;
}

.legal-prose strong {
  color: var(--text-main);
}

.legal-prose h2,
.legal-prose h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.legal-prose h2:first-of-type,
.legal-prose h3:first-of-type {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: none;
}

.legal-prose ul,
.legal-prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-sub);
}

.legal-prose li {
  margin-bottom: 0.6rem;
}

.legal-prose a {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.legal-prose a:hover {
  opacity: 0.8;
}

.legal-alert {
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
  line-height: 1.6;
  font-size: 0.94rem;
}

.legal-alert-warning {
  background: #fefce8;
  border: 1px solid #fef08a;
  color: #713f12;
}

.legal-alert-warning strong {
  color: #854d0e;
}

.legal-alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.legal-alert-info strong {
  color: #1d4ed8;
}

.legal-contact-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  text-align: center;
  margin-top: 2.5rem;
}

.legal-contact-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 0.75rem 1.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin: 1.25rem 0;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.legal-contact-email-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--text-main);
}

.legal-quick-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.legal-quick-pill {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.82rem;
  color: var(--text-sub);
  text-decoration: none;
  transition: all 0.15s ease;
}

.legal-quick-pill:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .legal-sidebar {
    position: static;
  }
  .legal-nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .legal-nav-menu-title {
    width: 100%;
    margin-bottom: 0.25rem;
    padding-bottom: 0.4rem;
  }
  .legal-nav-item {
    margin-bottom: 0;
    padding: 0.4rem 0.75rem;
    border-left: none;
  }
  .legal-nav-item.active {
    border-left: none;
    background: var(--text-main);
    color: var(--text-light);
  }
  .legal-document {
    padding: 2.25rem 1.75rem;
  }
  .legal-doc-title {
    font-size: 1.9rem;
  }
}

/* Centered Single-Column Legal Page Layout (Reference Style) */
.legal-container-single {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.legal-nav-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.75rem 0 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.legal-nav-strip-item {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 1.05rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-sub);
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.legal-nav-strip-item:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.legal-nav-strip-item.active {
  color: #ffffff;
  background: #111827;
  border-color: #111827;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.legal-subtitle-quote {
  font-style: italic;
  color: #4b5563;
  font-size: 1.12rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  border-left: 3px solid #38bdf8;
  padding-left: 1rem;
}
