/* =====================================================================
   МійДроп docs — refresh aligned with the app redesign
   Design language: Inter, near-black text, brand blue accent,
   soft neutral surfaces, rounded geometry, subtle elevation.
   ===================================================================== */

:root {
  /* Neutral surface system (mirrors the app's base.css tokens) */
  --ui-bg:            #f7f8fa;
  --ui-surface:       #ffffff;
  --ui-surface-muted: #f4f5f7;
  --ui-border:        #e6e8eb;
  --ui-border-strong: #d6d9de;

  /* Text */
  --ui-text:          #1a1d21;
  --ui-text-muted:    #6b7280;

  /* Accent */
  --ui-primary:        #2563eb;
  --ui-primary-hover:  #1d4ed8;
  --ui-primary-active: #1e40af;
  --ui-focus-ring:     rgba(37, 99, 235, 0.18);

  /* Geometry */
  --ui-radius-sm: 6px;
  --ui-radius:    9px;
  --ui-radius-lg: 14px;

  /* Elevation */
  --ui-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --ui-shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --ui-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12), 0 4px 8px rgba(16, 24, 40, 0.06);

  --ui-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Material variable mapping ----------------------------------- */
:root, [data-md-color-scheme="default"] {
  --md-primary-fg-color:        var(--ui-text);
  --md-primary-fg-color--light: #3a3f47;
  --md-primary-fg-color--dark:  #101215;
  --md-primary-bg-color:        #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.72);

  --md-accent-fg-color:         var(--ui-primary);
  --md-accent-fg-color--transparent: var(--ui-focus-ring);

  --md-typeset-a-color:         var(--ui-primary);

  --md-default-fg-color:        var(--ui-text);
  --md-code-bg-color:           var(--ui-surface-muted);
  --md-code-fg-color:           #24292f;

  --md-footer-bg-color:         var(--ui-text);
  --md-footer-bg-color--dark:   #101215;
}

/* ---- Typography --------------------------------------------------- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.006em;
  font-feature-settings: "cv11", "ss01";
}

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

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--ui-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.md-typeset h1 {
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.md-typeset h2 {
  font-weight: 600;
  margin-top: 2.2rem;
}

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

/* Links: keep the underline for scan-ability, but softer + on-brand */
.md-typeset a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(37, 99, 235, 0.35);
  transition: color 0.14s var(--ui-ease), text-decoration-color 0.14s var(--ui-ease);
}
.md-typeset a:hover {
  color: var(--ui-primary-hover);
  text-decoration-color: var(--ui-primary);
}
.md-typeset .headerlink {
  text-decoration: unset;
}

/* ---- Header ------------------------------------------------------- */
.md-header {
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  /* NB: no backdrop-filter here — a filter on the header turns it into the
     containing block for the position:fixed .md-search__inner, which on
     mobile collapses the search overlay to header height and hides results.
     The header is opaque anyway, so a blur would be invisible. */
}
.md-header[data-md-state="shadow"],
.md-header--shadow {
  box-shadow: var(--ui-shadow-sm);
}

.md-search__form {
  border-radius: var(--ui-radius-sm);
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}
.md-search__form:hover {
  background-color: rgba(255, 255, 255, 0.18);
}
[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  border-radius: var(--ui-radius-sm) var(--ui-radius-sm) 0 0;
}
.md-search__output {
  border-radius: 0 0 var(--ui-radius) var(--ui-radius);
}

/* ---- Navigation tabs (top) --------------------------------------- */
.md-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.md-tabs__link {
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0.72;
  transition: opacity 0.14s var(--ui-ease);
}
.md-tabs__link:hover,
.md-tabs__link--active {
  opacity: 1;
}

/* ---- Sidebar navigation ------------------------------------------ */
.md-nav {
  font-size: 0.72rem;
}
.md-nav__title {
  color: var(--ui-text-muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.md-nav__link {
  border-radius: var(--ui-radius-sm);
  padding: 0.28em 0.55em;
  margin: 0.05em 0;
  transition: background-color 0.12s var(--ui-ease), color 0.12s var(--ui-ease);
}
.md-nav__item .md-nav__link:hover {
  background-color: var(--ui-surface-muted);
  color: var(--ui-text);
}
.md-nav__link--active,
.md-nav__link--active:hover,
.md-nav__item .md-nav__link--active {
  color: var(--ui-primary);
  font-weight: 600;
  background-color: rgba(37, 99, 235, 0.08);
}

/* Table-of-contents rail on the right */
.md-nav--secondary .md-nav__link--active {
  background-color: transparent;
}

/* Drop Material's blurred glow mask on both sticky section titles
   (left "lifted" item + right TOC title). The solid background still
   hides items scrolling behind; only the soft veil is removed. */
.md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link,
.md-nav--secondary .md-nav__title {
  box-shadow: none;
}

/* ---- Buttons ------------------------------------------------------ */
.md-typeset .md-button {
  border-radius: var(--ui-radius-sm);
  border-width: 1px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background-color 0.16s var(--ui-ease),
              border-color 0.16s var(--ui-ease),
              color 0.16s var(--ui-ease),
              transform 0.1s var(--ui-ease);
}
.md-typeset .md-button:active {
  transform: translateY(0.5px);
}
.md-typeset .md-button--primary {
  background-color: var(--ui-primary);
  border-color: var(--ui-primary);
  color: #fff;
}
.md-typeset .md-button--primary:hover,
.md-typeset .md-button--primary:focus {
  background-color: var(--ui-primary-hover);
  border-color: var(--ui-primary-hover);
  color: #fff;
}
.md-typeset .md-button:not(.md-button--primary):hover,
.md-typeset .md-button:not(.md-button--primary):focus {
  background-color: var(--ui-primary);
  border-color: var(--ui-primary);
  color: #fff;
}

/* ---- Code --------------------------------------------------------- */
.md-typeset code {
  border-radius: var(--ui-radius-sm);
  padding: 0.12em 0.4em;
  font-size: 0.84em;
  background-color: var(--ui-surface-muted);
}
.md-typeset pre > code {
  border-radius: var(--ui-radius);
}
.md-typeset .highlight,
.md-typeset pre {
  border-radius: var(--ui-radius);
}
.highlight .filename,
.md-typeset .highlighttable .linenos {
  border-radius: var(--ui-radius) var(--ui-radius) 0 0;
}

/* ---- Admonitions -------------------------------------------------- */
.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--ui-radius);
  border-width: 1px;
  border-left-width: 3px;
  box-shadow: var(--ui-shadow-sm);
  font-size: 0.74rem;
}
.md-typeset .admonition-title,
.md-typeset summary {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---- Tables ------------------------------------------------------- */
.md-typeset table:not([class]) {
  border-radius: var(--ui-radius);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
}
.md-typeset table:not([class]) th {
  background-color: var(--ui-surface-muted);
  color: var(--ui-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.md-typeset table:not([class]) td {
  border-top-color: var(--ui-border);
}
.md-typeset table:not([class]) tr:hover {
  background-color: var(--ui-surface-muted);
}

/* ---- Images / lightbox ------------------------------------------- */
.md-typeset img,
.md-typeset .glightbox img {
  border-radius: var(--ui-radius);
}
.glightbox {
  cursor: zoom-in;
}

/* ---- Footer ------------------------------------------------------- */
.md-footer-meta {
  background-color: #101215;
}
.md-footer__link {
  border-radius: var(--ui-radius);
}

/* ---- Scrollbars in sidebars -------------------------------------- */
.md-sidebar__scrollwrap:focus-within,
.md-sidebar__scrollwrap:hover {
  scrollbar-color: var(--ui-border-strong) transparent;
}

/* =====================================================================
   Preserved project rules
   ===================================================================== */

/* Custom numbered-list plugin renders its own markers */
.md-typeset ol,
.md-typeset ol li {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.md-typeset ol li {
  display: block !important;
  text-indent: 0 !important;
  margin-left: 0 !important;
}

/* Tags are used for search/meta only, not shown on the page */
.md-tags {
  display: none !important;
}
