/* ============================================================
   Data Integration Mastery™ — Architecture Patterns Docs
   Brand: DIM | Documentation Theme
   ============================================================ */

:root {
  --font-heading: 'Roboto Slab', Georgia, serif;
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', 'Monaco', monospace;

  --color-brand: #5A6B8A;
  --color-heading: #A55A82;
  --color-highlight: #FFF9C4;
  --color-body-text: #3A506B;
  --color-link: #5A6B8A;
  --color-button-text: #FFFFFF;
  --color-card-bg: #FFFFFF;
  --color-page-bg: #6D6D7A;
  --color-sidebar-bg: #f5f5f8;
  --color-border: #e2e2e8;
  --color-code-bg: #f4f4f9;

  --max-width: 72rem;
  --content-width: 48rem;
  --sidebar-width: 16rem;
  --card-radius: 1rem;
  --spacing: 2rem;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-body-text);
  background-color: var(--color-page-bg);
  line-height: 1.7;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-link);
  text-decoration: underline;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--color-heading);
  text-decoration: none;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-brand);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  z-index: 10000;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.translate-hint {
  background: #f0f4f8;
  border-bottom: 1px solid #d0dae8;
  color: #5a6b8a;
  font-size: 0.8rem;
  padding: 5px 1rem;
  text-align: center;
}

/* --- Site Header / Navbar --- */
.site-header {
  background: #2c2c3a;
  color: #fff;
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
}
.header-brand:hover { color: var(--color-highlight); }

.header-brand img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.header-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}
.header-nav a:hover { color: #fff; }

/* --- Page Layout --- */
.docs-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - 60px);
}

/* --- Sidebar --- */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-card-bg);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-heading);
}

.sidebar-section { margin-bottom: 1.25rem; }

.sidebar-section-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-body-text);
  margin-bottom: 0.35rem;
  display: block;
  text-decoration: none;
}
.sidebar-section-title:hover { color: var(--color-heading); }

.sidebar-links {
  list-style: none;
  padding-left: 0;
}

.sidebar-links li { margin-bottom: 0.15rem; }

.sidebar-links a {
  display: block;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  color: var(--color-body-text);
  text-decoration: none;
  border-radius: 0.25rem;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.sidebar-links a:hover {
  background: rgba(165,90,130,0.08);
  color: var(--color-heading);
}
.sidebar-links a.active {
  background: rgba(165,90,130,0.12);
  color: var(--color-heading);
  font-weight: 700;
}

/* --- Main Content --- */
.docs-content {
  flex: 1;
  min-width: 0;
  background: var(--color-card-bg);
  padding: 2.5rem 3rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--color-link); }
.breadcrumb .sep { margin: 0 0.4rem; color: #ccc; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.25;
}

.docs-content h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--color-heading);
}

.docs-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.docs-content h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.docs-content h4 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.docs-content p {
  margin-bottom: 1rem;
}

.docs-content ul, .docs-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.35rem;
}

.docs-content li ul, .docs-content li ol {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

/* --- Code --- */
.docs-content code {
  font-family: var(--font-mono);
  background: var(--color-code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 0.2rem;
  font-size: 0.88em;
}

.docs-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* --- Tables --- */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.docs-content th, .docs-content td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.docs-content th {
  background: var(--color-sidebar-bg);
  font-weight: 700;
  color: var(--color-body-text);
}

/* --- Callout Boxes --- */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
  border-left: 4px solid;
}

.callout-info {
  background: #eff6ff;
  border-color: #5A6B8A;
}

.callout-tip {
  background: #f0fdf4;
  border-color: #22c55e;
}

.callout-warning {
  background: #fff7ed;
  border-color: #f59e0b;
}

/* --- Pattern Card Grid (for index/category pages) --- */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.pattern-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 1.25rem 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.pattern-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--color-heading);
  color: inherit;
}

.pattern-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--color-heading);
}

.pattern-card p {
  font-size: 0.88rem;
  color: var(--color-body-text);
  line-height: 1.55;
  margin: 0;
}

/* --- Category Header --- */
.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.category-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

/* --- Value Proposition Box --- */
.value-box {
  background: linear-gradient(135deg, #f8f6ff 0%, #fff9f5 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 1.75rem 2rem;
  margin: 1.5rem 0 2rem;
}

.value-box h2 {
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  border: none;
  padding: 0;
}

.value-box ul {
  margin-bottom: 0;
}

/* --- Back to Top --- */
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-top: 2rem;
  padding: 0.4rem 0.75rem;
  background: var(--color-sidebar-bg);
  border-radius: 0.3rem;
  text-decoration: none;
}

/* --- Footer --- */
.site-footer {
  background: #2c2c3a;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
}

.site-footer a {
  color: rgba(255,255,255,0.8);
}

/* --- Intro Page Special Styles --- */
.docs-hero {
  text-align: center;
  padding: 2rem 0 1rem;
}

.docs-hero h1 {
  border: none;
  font-size: 2.4rem;
}

.docs-hero .subtitle {
  font-size: 1.15rem;
  color: var(--color-body-text);
  max-width: 36rem;
  margin: 0.75rem auto 0;
  line-height: 1.6;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-heading);
}

.stat-label {
  font-size: 0.85rem;
  color: #888;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

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

  .docs-content {
    padding: 1.75rem 1.5rem;
  }

  .docs-layout {
    display: block;
  }

  .pattern-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  html { font-size: 14px; }

  .docs-content {
    padding: 1.25rem 1rem;
  }

  .docs-content h1 {
    font-size: 1.7rem;
  }

  .docs-content h2 {
    font-size: 1.25rem;
  }

  .header-title {
    font-size: 0.95rem;
  }

  .header-nav a {
    font-size: 0.8rem;
  }

  .value-box {
    padding: 1.25rem;
  }
}
