/* ========================================
   Sudoku Legal Site — style-sudoku.css
   ======================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light mode colors */
  --bg: #FFFFFF;
  --header-bg: rgba(255, 255, 255, 0.85);
  --surface: #F8F9FA;
  --surface-alt: #F1F3F5;
  --border: #E5E7EB;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --accent: #6C5CE7;
  --accent-soft: rgba(108, 92, 231, 0.08);
  --error: #EF4444;
  --error-soft: rgba(239, 68, 68, 0.08);
  --success: #10B981;
  --warning: #F59E0B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --max-w: 780px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode colors */
    --bg: #0F172A;
    --header-bg: rgba(15, 23, 42, 0.85);
    --surface: #1E293B;
    --surface-alt: #273449;
    --border: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --accent: #8B7CF6;
    --accent-soft: rgba(139, 124, 246, 0.12);
    --error: #F87171;
    --error-soft: rgba(248, 113, 113, 0.12);
    --success: #34D399;
    --warning: #FBBF24;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

/* ---- Layout Container ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 0;
  transition: background-color 0.3s, border-color 0.3s;
}

/* Background transparency with backdrop-filter */
@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .header {
    background-color: var(--header-bg);
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 24px;
  height: 24px;
  background-color: var(--accent);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.logo-grid span {
  background-color: #FFFFFF;
  border-radius: 1px;
}

@media (prefers-color-scheme: dark) {
  .logo-grid span {
    background-color: #0F172A;
  }
}

.logo span.logo-text {
  font-weight: 800;
}

.logo span.logo-accent {
  color: var(--accent);
}

/* ---- Document Layout ---- */
.doc-page {
  padding: 60px 0;
}

.doc-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.doc-nav-back:hover {
  color: var(--accent);
}

/* Header Info */
.doc-header {
  margin-bottom: 40px;
}

.doc-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background-color: var(--accent-soft);
  border: 1px solid rgba(139, 124, 246, 0.2);
  border-radius: var(--radius-md);
  color: var(--accent);
  margin-bottom: 20px;
}

.doc-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.75px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.doc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.doc-meta .tag {
  background-color: var(--surface-alt);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Table of Contents */
.toc {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 48px;
}

.toc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.toc ol {
  list-style-type: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

@media (max-width: 600px) {
  .toc ol {
    grid-template-columns: 1fr;
  }
}

.toc li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
  display: block;
}

.toc li a:hover {
  color: var(--accent);
}

/* Sections */
.doc-section {
  margin-bottom: 48px;
  position: relative;
  padding-top: 16px;
}

.doc-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--accent);
  border-radius: 99px;
}

.section-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin-bottom: 16px;
}

.doc-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.doc-section strong {
  color: var(--text-primary);
}

.doc-section ul {
  margin-left: 20px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.doc-section li {
  margin-bottom: 8px;
}

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

.info-table th, .info-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.info-table th {
  background-color: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
}

.info-table td {
  color: var(--text-secondary);
}

.info-table tbody tr:hover {
  background-color: var(--surface-alt);
}

/* Highlight / Box */
.highlight-box {
  background-color: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14.5px;
}

.highlight-box strong {
  color: var(--text-primary);
}

.contact-section {
  background-color: var(--accent-soft);
  border: 1px solid rgba(139, 124, 246, 0.15);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-top: 40px;
}

.contact-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.contact-section p {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 14.5px;
}

.contact-section a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.contact-section a:hover {
  text-decoration: underline;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 60px;
  background-color: var(--surface);
  font-size: 13px;
  color: var(--text-muted);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  .footer .container {
    flex-direction: column;
    text-align: center;
  }
}
