/* genome-spy-python documentation theme.
 *
 * Brands the Furo theme with the genomespy.app design language: Lato
 * body text, a Special Elite wordmark, brand blues (#3e8cb6 / #3797ce /
 * #7fbbdd), and an image-tile showcase on the landing page. */

@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Special+Elite&display=swap");

:root,
body[data-theme="light"],
body[data-theme="dark"] {
  --gs-brand: #3e8cb6;
  --gs-link: #3797ce;
  --gs-ring: #7fbbdd;
  --gs-signal: #c53b2c;
  --color-brand-primary: #3e8cb6;
  --color-brand-content: #3797ce;
  --font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Furo expands the desktop left drawer to centre the main content, then
   right-aligns the navigation within it. Centre the navigation instead, so
   the remaining gutter is shared equally on both sides. */
@media (min-width: 82em) {
  .sidebar-container {
    width: 15em;
  }

  .sidebar-drawer {
    justify-content: center;
  }
}

/* Give documentation pages more room for charts and code. The matching drawer
   width keeps the expanded content column centred between equal outer margins. */
@media (min-width: 95em) {
  .content {
    width: 58em;
    padding-inline: 2em;
  }

  .sidebar-drawer {
    width: calc((100% - 90em) / 2 + 15em);
  }
}

/* ---------- Landing hero ---------- */
.gs-hero {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}
.gs-hero__mark {
  font-family: "Special Elite", "Lato", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  line-height: 1.05;
  margin: 0;
}
.gs-hero__mark .gs-py {
  color: var(--gs-brand);
}
.gs-hero__tag {
  max-width: 42rem;
  margin: 1rem auto 0;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--color-foreground-muted);
}
p.lead {
  text-align: center;
  max-width: 46rem;
  margin: 1.5rem auto 2rem;
  font-size: 1.15rem;
}

/* Keep the emblem compact in Furo's sidebar brand lockup so the project name
   remains the heading rather than being pushed below the first viewport. */
.sidebar-logo {
  width: 5.5rem;
  height: auto;
}

.sidebar-logo-container {
  margin-bottom: 0.35rem;
}

.sidebar-brand-text {
  font-size: 1.4em;
}

/* Furo hides the theme toggle until its JavaScript initializes. Preserve its
   width during that brief interval so the adjacent GitHub button does not
   shift after the first paint. */
.no-js .theme-toggle-container {
  display: flex;
  visibility: hidden;
}

/* ---------- Showcase band ---------- */
#gs-showcase {
  margin: 1.5rem auto 2.5rem;
  position: relative;
}
.gs-showcase-track {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  line-height: 0;
}
.gs-showcase-track .preview {
  display: block;
  width: 172px;
  height: 100px;
  border-radius: 4px;
  background-size: cover;
  background-position: center top;
  background-color: #f4f8fb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gs-showcase-track .preview:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 0 3px var(--gs-ring), 0 8px 18px rgba(0, 0, 0, 0.2);
}

/* ---------- Intro cards on the landing page ---------- */
.gs-startpage-grid .sd-card {
  border: 1px solid rgba(62, 140, 182, 0.2);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.gs-startpage-grid .sd-card:hover {
  box-shadow: 0 6px 18px rgba(62, 140, 182, 0.22);
  transform: translateY(-2px);
}

/* ---------- Gallery grid of static image cards ---------- */
.gs-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0 2rem;
}
.gs-card {
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.gs-card:hover {
  box-shadow: 0 0 0 3px var(--gs-ring), 0 8px 22px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}
.gs-card__shot {
  display: block;
  /* Matches the 720x405 capture box in tools/render_thumbnails.py, so a
     contained thumbnail fills the card at every column width instead of
     leaving bars beside it. */
  aspect-ratio: 16 / 9;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fff;
  transition: transform 0.35s ease;
}
.gs-card:hover .gs-card__shot {
  transform: scale(1.05);
}
.gs-card__body {
  padding: 0.7rem 0.85rem 0.85rem;
  background: var(--color-background-primary, #fff);
}
.gs-card__title {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
}
.gs-card__tags {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.gs-tag {
  font-size: 0.68rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(62, 140, 182, 0.12);
  color: var(--gs-brand);
}

/* ---------- Live documentation embeds ---------- */
/* Render gallery and prose charts inline at the full available width. */
.gs-doc-embed {
  display: block;
  width: 100%;
  height: 400px;
  margin-inline: auto;
  margin: 1.25rem 0 0.5rem;
}

.gs-embed-actions {
  margin: 0.3rem 0 0.6rem;
  text-align: center;
  font-size: 0.82rem;
}

.gs-embed-action {
  border: 0;
  padding: 0;
  background: none;
  color: var(--color-link, var(--gs-link));
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.gs-embed-action:hover {
  color: var(--color-link--hover, var(--gs-brand));
  text-decoration: underline;
}

.gs-embed-spec-wrapper {
  position: relative;
  margin: 0.5rem 0 1rem;
}

.gs-embed-spec-wrapper[hidden] {
  display: none;
}

.gs-embed-spec {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: min(32rem, 70vh);
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--color-background-border);
  border-radius: 4px;
  background: var(--color-background-secondary);
  color: var(--color-foreground-primary);
  font-family: var(--font-stack--monospace);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: normal;
  tab-size: 2;
  white-space: pre;
  word-break: normal;
}

.gs-embed-spec code {
  display: block;
  min-width: max-content;
  color: inherit;
  font: inherit;
  white-space: inherit;
}

.gs-embed-copy {
  position: absolute;
  z-index: 1;
  top: 0.55rem;
  right: 0.55rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0.42rem;
  place-items: center;
  border: 1px solid var(--color-background-border);
  border-radius: 4px;
  background: var(--color-background-primary);
  color: var(--color-foreground-muted);
  cursor: pointer;
}

/* Autosummary tables otherwise shrink to the width of their longest entry,
   which makes adjacent API sections look unrelated. */
table.autosummary {
  width: 100%;
}

.gs-embed-copy:hover {
  color: var(--color-foreground-primary);
}

.gs-embed-copy svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.gs-embed-copy[data-copied="true"]::after {
  color: #20844a;
  content: "✓";
  font-size: 1rem;
  line-height: 1;
}

.gs-embed-copy[data-copied="true"] svg {
  display: none;
}

.gs-embed-copy-message {
  position: absolute;
  z-index: 1;
  top: 0.72rem;
  right: 3rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--color-background-primary);
  color: var(--color-foreground-muted);
  font-size: 0.75rem;
  line-height: 1.4;
  pointer-events: none;
}

.gs-embed-copy-message:empty {
  display: none;
}

/* GenomeSpy paints the tooltip on a light background but leaves its text color
   to the host page, so a dark page theme renders it light on light. The class
   is bundle-versioned: core 0.85.0 renamed `tooltip` to `gs-tooltip`. */
.gs-tooltip {
  color: #1a1a1a;
}
