/* ============================================================
   PowerMemory Docs Theme — aligned with powermemory.ai landing
   Dark mode · IBM Plex Sans + JetBrains Mono · teal #00BFA5
   ============================================================ */

[data-md-color-scheme="slate"] {
  /* Backgrounds */
  --md-default-bg-color:          #0D1117;
  --md-default-bg-color--light:   #161B22;
  --md-default-bg-color--lighter: #21262D;
  --md-default-bg-color--lightest:#30363D;

  /* Text */
  --md-default-fg-color:           #C9D1D9;
  --md-default-fg-color--light:    #8B949E;
  --md-default-fg-color--lighter:  #484F58;
  --md-default-fg-color--lightest: #30363D;

  /* Primary (header/nav) — dark, not teal bar */
  --md-primary-fg-color:        #161B22;
  --md-primary-fg-color--light: #21262D;
  --md-primary-fg-color--dark:  #0D1117;
  --md-primary-bg-color:        #C9D1D9;
  --md-primary-bg-color--light: #8B949E;

  /* Accent + links */
  --md-accent-fg-color:        #00BFA5;
  --md-typeset-a-color:        #00BFA5;

  /* Code */
  --md-code-bg-color:          #161B22;
  --md-code-fg-color:          #C9D1D9;

  /* Typeset */
  --md-typeset-color:          #C9D1D9;
  --md-typeset-mark-color:     rgba(0, 191, 165, 0.25);

  /* Footer */
  --md-footer-bg-color:        #0a0d12;
  --md-footer-bg-color--dark:  #08090d;
}

/* Subtle grid background (landing signature) */
.md-main {
  background-color: #0D1117;
  background-image:
    linear-gradient(rgba(0,191,165,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,191,165,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Header: dark + teal brand */
.md-header {
  border-bottom: 1px solid #30363D;
  box-shadow: none;
}
.md-header__title { font-weight: 600; }

/* Links: teal + hover glow */
.md-typeset a {
  color: #00BFA5;
  transition: color .15s, text-shadow .15s;
}
.md-typeset a:hover {
  text-shadow: 0 0 12px rgba(0,191,165,0.4);
}

/* Nav active item teal */
.md-nav__link--active {
  color: #00BFA5 !important;
  font-weight: 600;
}
.md-tabs__link:hover, .md-nav__link:hover { color: #00BFA5; }

/* Headings: IBM Plex Sans tight */
.md-typeset h1, .md-typeset h2, .md-typeset h3 {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.md-typeset h1 { color: #fafafa; }

/* Code blocks: surface + teal accent */
.md-typeset code { font-family: 'JetBrains Mono', monospace; }
.md-typeset pre {
  border: 1px solid #30363D;
  border-radius: 8px;
}
.md-typeset .highlight { border-left: 2px solid #00BFA5; }

/* Admonitions teal-tinted */
.md-typeset .admonition, .md-typeset details {
  border-radius: 8px;
  border-left-width: 3px;
}
.md-typeset .admonition.tip, .md-typeset .admonition.note {
  border-left-color: #00BFA5;
}

/* Search box dark */
.md-search__input {
  background-color: rgba(48,54,61,0.5);
  border-radius: 8px;
}
.md-search__input::placeholder { color: #8B949E; }

/* Tables clean dark */
.md-typeset table:not([class]) {
  border: 1px solid #30363D;
  border-radius: 8px;
}
.md-typeset table:not([class]) th {
  background-color: #161B22;
  color: #C9D1D9;
  font-weight: 600;
}

/* Screenshot placeholders (restyled) */
.pm-screenshot {
  border: 1px dashed #30363D;
  border-radius: 8px;
  padding: 24px;
  color: #8B949E;
  background: #161B22;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin: 1.5rem 0;
}

/* Custom scrollbar dark + teal */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0D1117; }
::-webkit-scrollbar-thumb { background: #30363D; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #00BFA5; }

/* Footer */
.md-footer { background-color: #0a0d12; }
.md-footer-meta { background-color: #08090d; }

/* ============================================================
   Sidebar nav hierarchy — distinguish title + section headers
   ============================================================ */

/* Site title — prominent brand */
.md-nav__title {
  color: #fafafa;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Language section headers (English / Romana) — teal uppercase dividers */
.md-nav__item--section > .md-nav__link {
  color: #00BFA5 !important;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #30363D;
  opacity: 1;
}

/* Individual page links — normal weight, muted */
.md-nav__item:not(.md-nav__item--section) > .md-nav__link {
  color: #C9D1D9;
  font-weight: 400;
}

/* Active page link stays teal (override from earlier rule preserved) */
.md-nav__link--active {
  color: #00BFA5 !important;
  font-weight: 600;
}

/* ============================================================
   Homepage hero + choose-your-path cards
   ============================================================ */

.pm-hero {
  padding: 2rem;
  border: 1px solid #30363D;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,191,165,0.08), rgba(22,27,34,0.7));
  margin: 1.5rem 0 2.5rem;
}
.pm-hero p { margin: 0 0 1.2rem; font-size: 1.05rem; }

.pm-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.pm-card {
  border: 1px solid #30363D;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  background: rgba(22,27,34,0.65);
  transition: border-color 0.15s, transform 0.15s;
}
.pm-card:hover {
  border-color: rgba(0,191,165,0.4);
  transform: translateY(-2px);
}
.pm-card h3 { margin-top: 0.3rem; }

@media (max-width: 760px) {
  .pm-card-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Buttons — teal solid primary + teal outline secondary
   (override Material default which inherits dark header color)
   ============================================================ */

.md-typeset .md-button {
  color: #00BFA5;
  border: 1px solid #00BFA5;
  background: transparent;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.md-typeset .md-button:hover,
.md-typeset .md-button:focus {
  background: rgba(0, 191, 165, 0.1);
  border-color: #00BFA5;
  color: #00BFA5;
}

.md-typeset .md-button--primary {
  background: transparent;
  border: 1px solid #00BFA5;
  color: #00BFA5;
  font-weight: 600;
}
.md-typeset .md-button--primary:hover,
.md-typeset .md-button--primary:focus {
  background: rgba(0, 191, 165, 0.1);
  border-color: #00BFA5;
  color: #00BFA5;
  box-shadow: 0 0 16px rgba(0, 191, 165, 0.2);
}

/* ============================================================
   Hero button row — flex layout (fix overlap + even spacing)
   ============================================================ */

.pm-hero > p:last-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 0;
}
.pm-hero .md-button { margin: 0; }

@media (max-width: 480px) {
  .pm-hero > p:last-of-type { flex-direction: column; }
  .pm-hero .md-button { width: 100%; text-align: center; }
}

/* ============================================================
   Content screenshots — subtle border matching theme (skip emoji)
   ============================================================ */

.md-typeset img:not(.twemoji):not(.emojione) {
  border: 1px solid #30363D;
  border-radius: 10px;
  margin: 1.25rem 0;
  max-width: 100%;
}

/* Back-to-Connect breadcrumb */
.md-typeset .pm-back-link {
  display: inline-block;
  margin-bottom: 1.5em;
  font-size: 0.9rem;
  color: #00BFA5;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(0,191,165,0.4);
  background: rgba(0,191,165,0.06);
  transition: all 0.2s ease;
  font-weight: 500;
}
.md-typeset .pm-back-link:hover {
  background: rgba(0,191,165,0.15);
  border-color: #00BFA5;
  transform: translateX(-3px);
}
