/* jpcite docs — brand overrides.
 * Accent pulled from site/styles.css (--accent: #1e3a8a) so the docs surface
 * matches the landing page exactly. Deep-blue on white, high contrast.
 */

:root {
  --md-primary-fg-color:        #1e3a8a;
  --md-primary-fg-color--light: #2b4fad;
  --md-primary-fg-color--dark:  #172b6b;
  --md-accent-fg-color:         #1e3a8a;
}

[data-md-color-scheme="default"] {
  --md-typeset-a-color: #1e3a8a;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #2b4fad;
  --md-typeset-a-color:         #9dbcff;
}

/* Tighten line-height for dense Japanese text (matches landing page body). */
.md-typeset {
  line-height: 1.75;
}

/* Kill rounded edges on content area — landing page uses sharp corners. */
.md-typeset pre > code,
.md-typeset code {
  border-radius: 2px;
}

/* Code blocks — match landing page --code-bg: #0f172a. */
.md-typeset pre > code {
  background-color: #0f172a;
  color: #e2e8f0;
}

.md-typeset pre {
  max-width: 100%;
  overflow-x: auto;
}

.md-typeset pre > code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Admonition — subtle, no heavy fill. */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 2px;
}

/* Footer link row should inherit brand color. */
.md-footer-meta a {
  color: #e5e5e5;
}

/* feedback FAB right-edge clipping defense on phones.
   The widget injects `.am-fb-fab` with right:20px/bottom:20px via
   inline <style>. On <=480px tighten the offset and cap max-width
   so the pill never extends past the readable edge of the docs body
   (Material adds a 16px gutter on .md-content at mobile). */
@media (max-width: 480px) {
  .am-fb-fab {
    right: 12px !important;
    bottom: 12px !important;
    max-width: calc(100vw - 24px);
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body:not([data-md-state="search"]) .md-search__options {
    display: none;
  }

  #__drawer:not(:checked) ~ .md-container .md-sidebar--primary {
    display: none;
  }

  .md-typeset__table {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
  }

  .md-typeset__table table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }

  .md-typeset__table th,
  .md-typeset__table td {
    min-width: 0 !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .md-typeset a,
  .md-typeset li,
  .md-typeset p,
  .md-typeset code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip;
  }

  .md-main,
  .md-main__inner,
  .md-grid,
  .md-content,
  .md-content__inner,
  .md-sidebar,
  .md-sidebar__scrollwrap,
  .md-sidebar__inner,
  .md-nav,
  .md-nav__list,
  .md-nav__item {
    max-width: 100%;
    min-width: 0;
  }

  .md-sidebar__scrollwrap,
  .md-nav {
    overflow-x: hidden;
  }

  .md-nav__link {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .md-nav__link .md-ellipsis {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .md-search__options {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .md-typeset a.headerlink,
  .md-typeset a.footnote-ref,
  .md-typeset a[href^="#"],
  .md-typeset p > a:not(.headerlink),
  .md-typeset li > a:not(.headerlink),
  .md-content a[href="/"],
  .md-content a[href="/docs/"],
  .md-content nav[data-nav="jpcite-doc-nav"] a,
  .md-nav__link,
  .md-top.md-icon,
  .md-skip,
  .md-search__icon.md-icon,
  .am-fb-fab,
  .md-clipboard.md-icon,
  .back-btn,
  .md-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
  }

  .md-content nav[data-nav="jpcite-doc-nav"] a,
  .back-btn,
  .md-skip {
    padding: 8px 12px !important;
  }

  .md-top.md-icon,
  .am-fb-fab {
    min-height: 44px !important;
  }

  .md-typeset a.headerlink,
  .md-typeset p > a:not(.headerlink),
  .md-typeset li > a:not(.headerlink),
  .md-clipboard.md-icon {
    padding: 10px;
  }

  .md-typeset a:not(.headerlink) {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .md-search__options > button.md-search__icon.md-icon {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
    transform: none !important;
  }
}
