/* ============================================
   Double Shore — Documentation Theme
   Brand: #2027B7 (blue), #CFFF5E (green), #F5F5FF (lilac)
   Font: GeneralSans
   ============================================ */

@font-face {
  font-family: 'GeneralSans';
  src: url('../assets/fonts/GeneralSans-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

/* --- CSS Variables --- */
:root {
  --ds-blue: #2027B7;
  --ds-blue-dark: #181e8f;
  --ds-blue-darker: #111566;
  --ds-green: #CFFF5E;
  --ds-lilac: #F5F5FF;
  --ds-foreground: #332848;
  --ds-grey-50: rgba(255, 255, 255, 0.05);
  --ds-grey-100: rgba(255, 255, 255, 0.1);
  --ds-grey-300: rgba(255, 255, 255, 0.3);
  --ds-grey-600: rgba(255, 255, 255, 0.6);
  --ds-grey-850: rgba(255, 255, 255, 0.85);

  --md-primary-fg-color: var(--ds-blue);
  --md-primary-fg-color--light: #3038d6;
  --md-primary-fg-color--dark: var(--ds-blue-dark);
  --md-accent-fg-color: var(--ds-blue);
  --md-typeset-a-color: var(--ds-blue);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: var(--ds-blue);
  --md-primary-fg-color--light: #3038d6;
  --md-primary-fg-color--dark: var(--ds-blue-dark);
  --md-accent-fg-color: var(--ds-green);
}

/* --- Typography --- */
body,
.md-typeset,
.md-nav,
.md-header,
.md-tabs,
.md-footer {
  font-family: 'GeneralSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.md-typeset {
  font-size: 0.85rem;
  line-height: 1.7;
}

.md-typeset h1 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.md-typeset h2 {
  font-weight: 600;
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--ds-blue);
  padding-bottom: 0.4rem;
  margin-top: 2.5rem;
}

.md-typeset h3 {
  font-weight: 500;
}

/* --- Layout --- */
.md-grid {
  max-width: 1680px;
  padding: 0 1.5rem;
}

/* --- Top Bar (Announce) --- */
.ds-topbar {
  background: linear-gradient(135deg, var(--ds-blue-dark) 0%, var(--ds-blue) 100%);
  border-bottom: 1px solid var(--ds-grey-100);
}

.ds-topbar__inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ds-topbar__logo {
  height: 22px;
  object-fit: contain;
  opacity: 0.95;
}

.ds-topbar__divider {
  width: 1px;
  height: 16px;
  background: var(--ds-grey-300);
}

.ds-topbar__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ds-grey-850);
  letter-spacing: 0.02em;
}

.ds-topbar__right {
  display: flex;
  align-items: center;
}

.ds-topbar__badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-blue-dark);
  background: var(--ds-green);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* --- Header --- */
.md-header {
  background: var(--ds-blue);
  box-shadow: 0 1px 0 var(--ds-grey-100);
}

.md-header__title {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
}

/* --- Tabs --- */
.md-tabs {
  background: var(--ds-blue);
  border-bottom: 1px solid var(--ds-grey-100);
}

.md-tabs__link--active {
  font-weight: 600;
}

/* --- Tables --- */
.md-typeset table:not([class]) {
  font-size: 0.8rem;
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.md-typeset table:not([class]) th {
  white-space: nowrap;
  background: var(--ds-blue);
  color: white;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.6rem 0.8rem;
}

.md-typeset table:not([class]) td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.md-typeset table:not([class]) tr:hover td {
  background: rgba(32, 39, 183, 0.03);
}

/* --- Mermaid --- */
.mermaid {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(32, 39, 183, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(32, 39, 183, 0.08);
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* --- Code --- */
.md-typeset code {
  border-radius: 4px;
  font-size: 0.82em;
}

.md-typeset pre {
  border-radius: 8px;
}

/* --- Admonitions --- */
.md-typeset .admonition,
.md-typeset details {
  font-size: 0.82rem;
  border-radius: 8px;
  border-left-width: 4px;
}

/* --- Footer --- */
.md-footer {
  background: var(--ds-blue-dark);
}

.md-footer-meta {
  background: var(--ds-blue-darker);
}

.ds-footer {
  padding: 0;
}

.ds-footer__inner {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.ds-footer__brand {
  display: flex;
  align-items: center;
}

.ds-footer__logo {
  height: 18px;
  opacity: 0.85;
}

.ds-footer__meta {
  font-size: 0.68rem;
  color: var(--ds-grey-600);
  font-weight: 400;
}

/* --- Active nav --- */
.md-nav__link--active {
  color: var(--ds-blue) !important;
  font-weight: 600;
}

/* --- Sidebar --- */
.md-nav--primary .md-nav__title {
  font-weight: 600;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--ds-blue);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ds-blue-dark);
}

/* --- Content width for better readability --- */
.md-content {
  max-width: none;
}

/* --- Search --- */
.md-search__input {
  font-family: 'GeneralSans', sans-serif;
}

/* --- TOC --- */
.md-sidebar--secondary .md-nav__link {
  font-size: 0.72rem;
}

/* --- Print --- */
@media print {
  .md-grid {
    max-width: 100%;
  }
  .mermaid svg {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
  .ds-topbar,
  .md-header,
  .md-tabs,
  .md-footer {
    display: none;
  }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .ds-topbar__badge {
    display: none;
  }
  .ds-topbar__label {
    font-size: 0.65rem;
  }
}
