/* ============================================
   Detroit Software Developers — IDE Theme
   Catppuccin Mocha color palette
   ============================================ */

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

:root {
  /* Catppuccin Mocha */
  --crust: #11111b;
  --mantle: #181825;
  --base: #1e1e2e;
  --surface0: #313244;
  --surface1: #45475a;
  --overlay0: #6c7086;
  --subtext0: #a6adc8;
  --text: #cdd6f4;
  --green: #a6e3a1;
  --blue: #89b4fa;
  --pink: #f38ba8;
  --peach: #fab387;
  --yellow: #f9e2af;
  --teal: #94e2d5;

  /* Typography */
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --activity-bar-width: 48px;
  --sidebar-width: 220px;
  --status-bar-height: 28px;
  --tab-height: 40px;
  --breadcrumb-height: 28px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--base);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- IDE Shell --- */
.ide-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* --- Activity Bar --- */
.activity-bar {
  width: var(--activity-bar-width);
  background: var(--crust);
  border-right: 1px solid var(--surface0);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  gap: 4px;
  flex-shrink: 0;
}

.activity-bar-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--overlay0);
  font-size: 18px;
  cursor: default;
}

.activity-bar-icon.active {
  background: var(--surface0);
  color: var(--text);
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--mantle);
  border-right: 1px solid var(--surface0);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-header {
  color: var(--subtext0);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 16px 8px;
  font-family: var(--font-sans);
  font-weight: 600;
}

.sidebar-section {
  color: var(--subtext0);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 16px 6px;
  font-family: var(--font-sans);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--subtext0);
  text-decoration: none;
  transition: background 0.1s;
}

.sidebar-item:hover {
  background: var(--surface0);
  text-decoration: none;
}

.sidebar-item.active {
  background: var(--surface0);
  color: var(--blue);
}

.sidebar-item .icon {
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-divider {
  margin: 8px 16px;
  border-top: 1px solid var(--surface0);
}

/* --- Editor Area --- */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* --- Tabs --- */
.editor-tabs {
  display: flex;
  background: var(--crust);
  border-bottom: 1px solid var(--surface0);
  overflow-x: auto;
  flex-shrink: 0;
  height: var(--tab-height);
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--subtext0);
  border-right: 1px solid var(--surface0);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.editor-tab:hover {
  text-decoration: none;
  color: var(--text);
}

.editor-tab.active {
  background: var(--base);
  color: var(--text);
  border-bottom: 2px solid var(--blue);
}

.editor-tab .icon {
  font-size: 14px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 0 20px;
  background: var(--base);
  border-bottom: 1px solid var(--surface0);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtext0);
  line-height: var(--breadcrumb-height);
  flex-shrink: 0;
}

.breadcrumb-separator {
  color: var(--surface1);
  margin: 0 4px;
}

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

/* --- Content Area --- */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px 0;
}

.content-section {
  display: flex;
  padding: 0 24px 0 0;
  margin-bottom: 40px;
}

/* --- Line Number Gutter --- */
.line-gutter {
  width: 50px;
  text-align: right;
  padding-right: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--overlay0);
  line-height: 2;
  user-select: none;
  flex-shrink: 0;
}

.section-content {
  flex: 1;
  border-left: 1px solid var(--surface0);
  padding-left: 24px;
  min-width: 0;
}

/* --- Section Comment Headers --- */
.section-comment {
  font-family: var(--font-mono);
  color: var(--green);
  font-size: 12px;
  line-height: 2;
  margin-bottom: 12px;
}

/* --- Status Bar --- */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  background: var(--blue);
  color: var(--base);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  height: var(--status-bar-height);
  flex-shrink: 0;
}

.status-bar-group {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* --- Cards --- */
.card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 6px;
  padding: 20px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--surface1);
}

.card a {
  text-decoration: none;
}

.card-title {
  color: var(--blue);
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-sans);
}

.card-meta {
  color: var(--subtext0);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 6px;
}

/* --- Event Cards --- */
.event-card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 6px;
  padding: 24px;
}

.event-card--upcoming {
  border-left: 3px solid var(--green);
  border-radius: 0 6px 6px 0;
}

.event-badge {
  display: inline-block;
  background: var(--green);
  color: var(--base);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--subtext0);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  padding: 10px 24px;
  background: var(--blue);
  color: var(--base);
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* --- About Card (README style) --- */
.readme-card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 6px;
  padding: 24px;
  max-width: 700px;
}

.readme-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.readme-card p {
  color: var(--subtext0);
  line-height: 1.7;
}

.readme-stats {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* --- Key-Value Metadata --- */
.kv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--subtext0);
}

.kv-meta .key {
  color: var(--blue);
}

.kv-meta .value {
  color: var(--green);
}

/* --- Blog Post Content --- */
.prose {
  max-width: 700px;
  line-height: 1.8;
}

.prose h1,
.prose h2,
.prose h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
}

.prose h1 { font-size: 28px; }
.prose h2 { font-size: 22px; }
.prose h3 { font-size: 18px; }

.prose p {
  margin-bottom: 1em;
}

.prose code {
  background: var(--mantle);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose pre {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1em;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose ul,
.prose ol {
  padding-left: 24px;
  margin-bottom: 1em;
}

.prose img {
  max-width: 100%;
  border-radius: 6px;
}

/* --- Photo Gallery --- */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.photo-gallery a {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--surface0);
}

.photo-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.photo-gallery img:hover {
  opacity: 0.85;
}

/* --- Video Embed --- */
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 16px 0;
  border-radius: 6px;
  border: 1px solid var(--surface0);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Mobile Nav Toggle --- */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: var(--status-bar-height);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-nav-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .line-gutter {
    display: none;
  }

  .section-content {
    border-left: none;
    padding-left: 16px;
  }

  .content-section {
    padding-right: 16px;
  }

  .editor-tabs {
    display: none;
  }

  .breadcrumb {
    display: none;
  }

  /* Mobile top nav */
  .mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--crust);
    border-bottom: 1px solid var(--surface0);
  }

  .mobile-nav .logo {
    font-family: var(--font-mono);
    color: var(--blue);
    font-weight: 700;
    font-size: 16px;
  }
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none;
  }
}
