/* CSS Variables for Light & Dark Mode */
:root {
  --bg-color: #faf9f8;
  --text-color: #323130;
  --text-secondary: #605e5c;
  --primary-color: #b7472a;
  --primary-hover: #a13e25;
  --primary-active: #8e331c;
  --border-color: #edebe9;
  --hover-bg: #f3f2f1;
  --card-bg: #ffffff;
  --nav-bg: rgba(250, 249, 248, 0.9);
  --selection-bg: #b7472a;
  --selection-text: #ffffff;
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --code-bg: #f3f2f1;

  /* Header specific variables to match Home.vue */
  --header-bg: rgba(250, 249, 248, 0.9);
  --header-border: #e5e7eb;
  --header-logo-text: #323130;
  --header-link-text: #6b7280;
  --header-link-hover-text: #111827;
  --header-link-hover-bg: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #020617; /* slate-950 */
    --text-color: #f1f5f9; /* slate-100 */
    --text-secondary: #94a3b8; /* slate-400 */
    --border-color: #1e293b; /* slate-800 */
    --hover-bg: #0f172a; /* slate-900 */
    --card-bg: #0f172a;
    --nav-bg: rgba(2, 6, 23, 0.85);
    --code-bg: #1e293b;

    /* Header specific dark mode variables to match Home.vue */
    --header-bg: rgba(2, 6, 23, 0.85);
    --header-border: #0f172a;
    --header-logo-text: #ffffff;
    --header-link-text: #94a3b8;
    --header-link-hover-text: #ffffff;
    --header-link-hover-bg: #0f172a;
  }
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html {
  font-size: 16px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 0.875rem; /* ~14px base font size */
  transition: background-color 0.2s ease, color 0.2s ease;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--selection-text);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Header & Nav */
.layout-wrapper > header {
  width: 100%;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--header-border);
}

.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--header-logo-text) !important;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.logo-link:hover {
  opacity: 0.85;
}

.logo-img {
  height: 1.75rem;
  width: auto;
}

.nav-menu {
  display: none;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
}

.nav-link {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--header-link-text) !important;
  padding: 0.5rem 1rem;
  transition: background-color 0.15s, color 0.15s;
  line-height: 1rem;
}

.nav-link:hover {
  background-color: var(--header-link-hover-bg);
  color: var(--header-link-hover-text) !important;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
  line-height: 1rem;
}

.nav-btn:hover {
  background-color: var(--primary-hover) !important;
}

.nav-btn:active {
  background-color: var(--primary-active) !important;
}

/* Layout */
.layout-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
  width: 100%;
  max-width: 56rem; /* ~900px for a more spacious layout */
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem 1.5rem; /* Increased top padding to prevent title from being right at the top */
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

/* Article Typography */
article {
  margin-bottom: 4rem;
}

.article-header {
  margin-bottom: 2rem;
}

.article-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.article-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.article-desc {
  font-size: 0.875rem; /* Match base body font size */
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.article-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-color);
}

.article-body p {
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 400;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  letter-spacing: 0.02em;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
  font-weight: 300;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body blockquote {
  border-left: 2px solid var(--primary-color);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body pre {
  background-color: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.article-body code {
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  background-color: var(--code-bg);
  padding: 0.15rem 0.35rem;
}

.article-body pre code {
  background-color: transparent;
  padding: 0;
  font-size: 0.825rem;
}

.article-body strong {
  font-weight: 600;
}

.article-body img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

/* Callout block */
.callout {
  padding: 1.25rem;
  background-color: var(--hover-bg);
  border-left: 3px solid var(--primary-color);
  margin-bottom: 1.5rem;
}

.callout p {
  margin-bottom: 0;
}

/* Footer */
footer {
  width: 100%;
  background-color: var(--bg-color);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  color: #94a3b8;
  font-size: 0.75rem;
}

.footer-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
  }
}

.footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-sep {
  color: var(--border-color);
}

.footer-link {
  color: #94a3b8;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--text-secondary);
}
