/* Match the docs to the banner and the app.
 *
 * banner.svg is a night sky from #000010 to #0d0025, the name in the pink
 * gradient #f43f5e -> #fb7185, and the tagline and rules in cyan #06b6d4 ->
 * #22d3ee. The app's dark theme uses the same pair (--accent #fb7185,
 * --accent-secondary #22d3ee) on a #06060f page. The header, the page, links
 * and buttons below use only those values, so the site, the banner and the
 * screenshots read as one product.
 */
:root {
  --md-primary-fg-color:        #000010;  /* banner sky, header bar */
  --md-primary-fg-color--light: #0d0025;  /* banner mid sky */
  --md-primary-fg-color--dark:  #000008;
  --md-primary-bg-color:        #e8e6f0;  /* app text on the header */
  --md-primary-bg-color--light: #a59cb5;  /* app muted text */

  --md-accent-fg-color:         #22d3ee;  /* banner cyan */
  --md-accent-fg-color--transparent: #22d3ee1a;
}

/* Dark scheme: the page body is the app's own background, so the screenshots
   sit on the page without a visible edge. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color:        #06060f;
  --md-code-bg-color:           #0e0e1a;
  --md-typeset-a-color:         #22d3ee;
}

/* Light scheme: #22d3ee on white is 1.7:1, unreadable. #0e7490 is the same hue
   at 5.4:1. */
[data-md-color-scheme="default"] {
  --md-typeset-a-color:         #0e7490;
  --md-accent-fg-color:         #0e7490;  /* hovered links, same contrast */
  --md-accent-fg-color--transparent: #0e74901a;
}

/* Fixed header logo size, so it does not crowd the site name. */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.6rem;
  width: 1.6rem;
}

/* The wordmark, matching banner.svg.
 *
 * The banner draws "CashPilot" in the pink gradient #f43f5e -> #fb7185 right
 * beside the sun mark, as one lockup. Only the FIRST topic is styled: Material
 * puts the site name in one .md-header__topic and the current page title in a
 * second one, swapping them on scroll, and painting both would turn every page
 * heading pink.
 */
.md-header__topic:first-child .md-ellipsis {
  background: linear-gradient(90deg, #f43f5e 0%, #fb7185 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Keep the mark and the wordmark close, the way the banner sets them. */
.md-header__button.md-logo {
  padding-right: 0.2rem;
}

.md-header__title {
  margin-left: 0.2rem;
}

/* Buttons.
 *
 * Material paints .md-button in --md-primary-fg-color, the header colour. On
 * the dark page that is next to the page background, so a button would show
 * as plain text. Outline buttons take the link colour; the primary button
 * takes a darker cut of the wordmark's rose (white on #f43f5e is 3.7:1,
 * #e11d48 -> #be123c keeps every point above 4.5:1). */
.md-typeset .md-button {
  color: var(--md-typeset-a-color);
  border-color: var(--md-typeset-a-color);
  border-radius: 0.5rem;
}

.md-typeset .md-button:focus,
.md-typeset .md-button:hover {
  background-color: var(--md-typeset-a-color);
  border-color: var(--md-typeset-a-color);
  color: #ffffff;
}

.md-typeset .md-button--primary,
.md-typeset .md-button--primary:focus,
.md-typeset .md-button--primary:hover {
  background: linear-gradient(90deg, #e11d48 0%, #be123c 100%);
  border-color: transparent;
  color: #ffffff;
}

.md-typeset .md-button--primary:focus,
.md-typeset .md-button--primary:hover {
  box-shadow: 0 0.2rem 0.8rem #e11d4859;
}

/* Grid cards: the border picks up the cyan on hover, matching links. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border-radius: 0.5rem;
}

.md-typeset .grid.cards > ul > li:focus-within,
.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:focus-within,
.md-typeset .grid > .card:hover {
  border-color: #22d3ee;
}

/* FAQ entries (??? question). Material draws them lime green, a colour that
   appears nowhere else in the product; use the cyan instead. */
.md-typeset .admonition.question,
.md-typeset details.question {
  border-color: #22d3ee;
}

.md-typeset .admonition.question:focus-within,
.md-typeset details.question:focus-within {
  box-shadow: 0 0 0 0.2rem #22d3ee1a;
}

.md-typeset .question > .admonition-title::after,
.md-typeset .question > summary::after {
  color: #22d3ee;
}

.md-typeset .question > .admonition-title,
.md-typeset .question > summary {
  background-color: #22d3ee1a;
}

.md-typeset .question > .admonition-title::before,
.md-typeset .question > summary::before {
  background-color: #22d3ee;
}

/* The home page keeps an H1 for search, screen readers and the browser tab.
   The banner under it already shows the name, so the H1 is hidden visually.
   Use it as: # CashPilot { .cp-visually-hidden } */
.md-typeset h1.cp-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Environment variable names in the guides' tables (EARNAPP_DEVICE_UUID)
   wrapped mid-word in a narrow column. Keep code on one line; a wide table
   scrolls sideways instead. */
.md-typeset table:not([class]) code {
  white-space: nowrap;
}

/* Ratings, All providers. Material draws tables as inline-block, so widths
   on cells did nothing and the worst con ran past the edge. A fixed layout
   at full width gives the short columns set widths and the worst con the
   rest, clamped to three lines (full text in the tooltip and the provider's
   section). On a phone the table keeps a minimum width and scrolls. */
.md-typeset .ratings-summary table:not([class]) {
  display: table;
  width: 100%;
  min-width: 32rem;
  table-layout: fixed;
}
.md-typeset .ratings-summary th,
.md-typeset .ratings-summary td {
  padding: 0.6em 0.7em;
}
.md-typeset .ratings-summary th:nth-child(1) { width: 6.5rem; }
.md-typeset .ratings-summary th:nth-child(2) { width: 3rem; }
.md-typeset .ratings-summary th:nth-child(3) { width: 3.6rem; }
.md-typeset .ratings-summary th:nth-child(4) { width: 4.2rem; }
.md-typeset .ratings-summary th:nth-child(6) { width: 4.8rem; }
.md-typeset .ratings-summary th:nth-child(n+2):nth-child(-n+4),
.md-typeset .ratings-summary td:nth-child(n+2):nth-child(-n+4),
.md-typeset .ratings-summary td:nth-child(6) {
  white-space: nowrap;
}
.md-typeset .ratings-summary .ratings-con {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Screenshots are dark on a dark page; a faint rim shows where they end. */
.md-typeset img[src*="screenshots/"] {
  border: 1px solid #ffffff14;
  border-radius: 0.4rem;
}

/* Phone screenshots on the home page: three in a row on a wide screen, as
   many as fit on a narrow one, each with a short caption. */
.md-typeset .cp-phone-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.8rem;
  margin: 1em 0;
}

/* Desktop screenshots on the home page: two per row. */
.md-typeset .cp-shot-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin: 1em 0;
}

.md-typeset .cp-phone-gallery figure,
.md-typeset .cp-shot-gallery figure {
  margin: 0;
}

.md-typeset .cp-phone-gallery figcaption,
.md-typeset .cp-shot-gallery figcaption {
  margin-top: 0.3rem;
  font-size: 0.7rem;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .cp-shot-gallery {
    grid-template-columns: 1fr;
  }
}
