:root {
  /* Brand Colors from baumplan.io AppTheme */
  --forest: #2d6a4f;
  --emerald: #40916c;
  --lime: #74c69d;
  --amber: #d97706;
  --apple: #e63946;
  
  /* Light Palette */
  --bg: #f4f7f5;
  --card: #ffffff;
  --text: #1b2e25;
  --text-muted: #526b5e;
  --border: #e1e9e4;
  --sidebar-bg: #ffffff;
  
  --primary: var(--forest);
  --accent: var(--lime);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1b1e;
    --card: #15272a;
    --text: #f0fdf4;
    --text-muted: #8fa89b;
    --border: rgba(255, 255, 255, 0.08);
    --sidebar-bg: #0d1b1e;
    --primary: #52b788;
    --accent: #74c69d;
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 290px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 2.5rem 1.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

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

.sidebar li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.93rem;
  font-weight: 400;
}

.sidebar li a:hover {
  background: rgba(45, 106, 79, 0.08);
  color: var(--primary);
  transform: translateX(4px);
}

.main {
  flex: 1;
  padding: 3.5rem 4.5rem;
  max-width: 960px;
}

.header {
  margin-bottom: 3.5rem;
}

.header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
}

.content h1, .content h2, .content h3 {
  margin-top: 2.5rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.content h2 {
  color: var(--primary);
  font-size: 1.65rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.content h3 {
  font-size: 1.25rem;
}

.content img {
  display: block;
  margin: 2rem auto 1rem;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 15px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}

.content p:has(img) {
  text-align: center;
}

.content img + em, 
.content p:has(img) + p em {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0;
  margin-bottom: 2rem;
}

.card {
  background: var(--card);
  padding: 1.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 25px -5px rgba(0,0,0,0.1);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(45, 106, 79, 0.3);
}

pre {
  background: var(--card);
  color: var(--text);
  padding: 1.25rem;
  border-radius: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
}

code:not(pre code) {
  background: rgba(45, 106, 79, 0.1);
  color: var(--primary);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

blockquote {
  border-left: 4px solid var(--primary);
  margin: 1.5rem 0;
  padding: 0.5rem 1.5rem;
  background: rgba(45, 106, 79, 0.05);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

table th, table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

table th {
  background: rgba(45, 106, 79, 0.08);
  color: var(--primary);
  font-weight: 700;
}

/* Carousel Styles */
.carousel-container {
  margin: 2.5rem -1rem;
  padding: 0 1rem;
  overflow: hidden;
}

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  scrollbar-width: thin;
}

.carousel::-webkit-scrollbar {
  height: 6px;
}

.carousel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 9999px;
}

.carousel-item {
  flex: 0 0 75%;
  scroll-snap-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-item img {
  max-width: 100%;
  max-height: 480px;
  width: auto;
  border-radius: 18px;
  display: block;
  margin: 0 auto !important;
  box-shadow: 0 12px 20px -4px rgba(0,0,0,0.15);
}

.carousel-caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

@media (min-width: 768px) {
  .carousel-item {
    flex: 0 0 45%;
  }
}

@media (max-width: 820px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
  }
  .main {
    padding: 2rem 1.5rem;
  }
}
