/*
AI THEME CONTRACT V2
This file must exist even if the generated theme mostly uses Tailwind.
Use it for custom refinements, variables, layout tweaks and polish.
*/

:root {
  --theme-primary: #2563eb;
  --theme-accent: #0f172a;
  --theme-bg: #f8fafc;
  --theme-surface: #ffffff;
  --theme-border: #e2e8f0;
  --theme-text: #0f172a;
  --theme-muted: #475569;
  --theme-soft: #eff6ff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--theme-bg);
  color: var(--theme-text);
}

.article-shell {
  position: relative;
}

.article-content {
  color: var(--theme-text);
  font-size: 1.05rem;
  line-height: 1.9;
}

.article-content > *:first-child {
  margin-top: 0 !important;
}

.article-content > *:last-child {
  margin-bottom: 0 !important;
}

.article-content h2 {
  margin: 2.8rem 0 1rem;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--theme-accent);
}

.article-content h3 {
  margin: 2rem 0 0.85rem;
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 800;
  color: #172554;
}

.article-content h4 {
  margin: 1.6rem 0 0.7rem;
  font-size: 1.15rem;
  line-height: 1.4;
  font-weight: 800;
  color: #1e293b;
}

.article-content p {
  margin: 1rem 0;
  color: #334155;
}

.article-content ul,
.article-content ol {
  margin: 1.15rem 0;
  padding-left: 1.4rem;
  color: #334155;
}

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

.article-content li {
  margin: 0.45rem 0;
  padding-left: 0.2rem;
}

.article-content li > ul,
.article-content li > ol {
  margin-top: 0.55rem;
  margin-bottom: 0.55rem;
  padding-left: 1.35rem;
}

.article-content a {
  color: var(--theme-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}

.article-content a:hover {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
}

.article-content blockquote {
  margin: 1.8rem 0;
  padding: 1.25rem 1.25rem 1.25rem 1.1rem;
  border-left: 4px solid var(--theme-primary);
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-radius: 1rem;
  color: #1e3a8a;
  font-weight: 600;
}

.article-content table {
  width: 100%;
  margin: 1.8rem 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 1rem;
  font-size: 0.98rem;
}

.article-content th,
.article-content td {
  border: 1px solid var(--theme-border);
  padding: 0.9rem 1rem;
  text-align: left;
}

.article-content th {
  background: #eff6ff;
  color: #172554;
  font-weight: 800;
}

.article-content td {
  background: #fff;
  color: #334155;
}

.article-content figure {
  margin: 1.8rem 0;
}

.article-content figcaption {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: #64748b;
  text-align: center;
}

.article-content code {
  padding: 0.15rem 0.4rem;
  border-radius: 0.45rem;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.92em;
}

.article-content pre {
  margin: 1.6rem 0;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-content hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--theme-border);
}

.article-toc {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem;
  border: 1px solid #bfdbfe;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
}

.article-toc-title {
  margin-bottom: 0.8rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1d4ed8;
}

.article-toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.article-toc li {
  margin: 0.35rem 0;
  padding-left: 0;
}

.article-toc li ul {
  margin-top: 0.35rem;
  margin-left: 0.9rem;
  padding-left: 0.9rem;
  border-left: 1px solid #bfdbfe;
}

.article-toc a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.8rem;
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 600;
}

.article-toc a:hover {
  background: rgba(255,255,255,0.8);
  color: #1d4ed8;
}

.article-excerpt h2,
.article-excerpt h3,
.article-excerpt h4 {
  margin: 0.5rem 0 0.6rem;
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 800;
  color: var(--theme-accent);
}

.article-excerpt p,
.article-excerpt ul,
.article-excerpt ol,
.article-excerpt li,
.article-excerpt a {
  color: #475569;
}

.article-excerpt a {
  color: var(--theme-primary);
  text-decoration: underline;
}

.mobile-menu-panel {
  animation: slidePanelIn .25s ease;
}

@keyframes slidePanelIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.kp-credit a {
  text-decoration: none;
}

input,
textarea,
select,
button {
  font: inherit;
}

form input,
form textarea,
form select {
  width: 100%;
  border: 1px solid var(--theme-border);
  border-radius: 1rem;
  background: #fff;
  padding: 0.9rem 1rem;
  color: var(--theme-text);
}

form input:focus,
form textarea:focus,
form select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #93c5fd;
}

form button,
.button,
[role="button"] {
  transition: all .2s ease;
}

@media (max-width: 767px) {
  .article-content {
    font-size: 1rem;
    line-height: 1.85;
  }

  .article-content h2 {
    font-size: 1.65rem;
  }

  .article-content h3 {
    font-size: 1.3rem;
  }
}
