* {
    box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background: var(--background-color);
  font-family: var(--font-default);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.75;
  font-size: 1.1rem;
}

.doc-container {
    display: flex;
    justify-content: space-around;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

p {
  margin: 1rem 0;
}

.documentation {
  max-width: 1280px;
  margin-inline: auto;
  padding: 3rem 1rem;
}

.documentation > h1 {
  font-size: clamp(1.2rem, 1vw + 0.8rem, 1.6rem);
  font-weight: 600;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 2rem;
}

.documentation > h1 a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.documentation > h1 a:hover {
  color: var(--primary-color-hover);
  text-decoration: underline;
}

.documentation:has(> .doc-breadcrumb) > h1,
.documentation:has(> nav.doc-breadcrumb) > h1 {
  font-size: clamp(1.1rem, 0.9rem + 0.6vw, 1.5rem);
  margin-bottom: 1rem;
}

.doc-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--white-color);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s, transform 0.3s;
}

.doc-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-hover-shadow);
}

.doc-card h2 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

.doc-card h2 a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.doc-card h2 a:hover {
  color: var(--primary-color-hover);
}

.doc-card small {
  display: block;
  color: var(--subtext-color);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.doc-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-card li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.5rem;
}

.doc-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--primary-color);
  border-radius: 50%;
}

.doc-card li:last-child {
  margin-bottom: 0;
}

.doc-card li a {
  color: var(--text-color);
  font-size: 1.05rem;
  text-decoration: none;
  transition: color 0.2s;
}

.doc-card li a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.doc-card .doc-illustration {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.doc-content .page-title {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.8rem);
  color: var(--primary-color);
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.doc-sidebar {
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  padding: 1rem 0 1rem 1.5rem;
  border-left: 3px solid var(--primary-color);
  background: transparent;
  min-width: 220px;
}

.doc-sidebar h3 {
  font-size: 0.85rem;
  color: var(--subtext-color);
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-sidebar li + li {
  margin-top: 0.5rem;
}

.doc-sidebar a {
  display: block;
  padding: 0.3rem 0;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.doc-sidebar a:hover {
  color: var(--primary-color);
}

.doc-sidebar a.active {
  color: var(--primary-color);
  font-weight: 600;
  background: rgba(var(--primary-rgb), 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
}

.doc-content {
  max-width: 850px;
}

.doc-content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.doc-content p {
  margin-bottom: 2rem;
}

.doc-content ul {
  padding-left: 1.5rem;
}

.doc-content ul li {
  margin-bottom: 0.5rem;
}

.doc-content a {
  color: var(--primary-color);
  text-decoration: underline;
  transition: color 0.2s;
}

.doc-content a:hover {
  color: var(--primary-color-hover);
}

img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.6s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--tertiary-color);
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
  }
}

@media (max-width: 1024px) {
  .doc-sidebar {
    display: none;
  }

  .doc-content {
    max-width: 100%;
  }  
}

.doc-rules {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
}

.doc-rules__date {
  margin: 0;
  color: var(--subtext-color);
  font-size: 0.95rem;
}