/* All three families are requested by the `extra_css` entry in mkdocs.yml, not
   from here. An `@import` would be worse than it looks: the browser cannot see
   it until this file has downloaded and parsed, so the font request starts a
   round trip late and the swap lands after first paint. The `privacy` plugin
   self-hosts the result, so the published site makes no third-party request. */

/* Brand tokens are ours alone, so :root is the right home for them. `ink` is a
   deep navy used as the page background — the brand navy is too saturated to
   read well across a full viewport, so it serves as a surface colour instead. */
:root {
  --cadasto-ink: #070e2b;
  --cadasto-ink-raised: #0d1640;
  --cadasto-navy: #0a1a66;
  --cadasto-navy-dark: #081452;
  --cadasto-blue: #5cb2ff;
  --cadasto-blue-dark: #007bb6;
  --cadasto-green: #24e363;

  --cadasto-fg: rgba(255, 255, 255, 0.88);
  --cadasto-fg-muted: rgba(255, 255, 255, 0.62);
  --cadasto-surface: rgba(255, 255, 255, 0.04);
  --cadasto-border: rgba(92, 178, 255, 0.16);
  --cadasto-border-strong: rgba(92, 178, 255, 0.4);
  --cadasto-display: "Fira Sans", Helvetica, Arial, sans-serif;

  /* `theme.font` is false, so the theme no longer sets these; it composes
     `--md-text-font-family` from them and falls back to a system stack. */
  --md-text-font: "Roboto";
  --md-code-font: "Roboto Mono";
}

/* The theme declares its scheme variables on the element carrying
   `data-md-color-scheme` — that is <body>, not <html>. A custom property set on
   <body> beats one inherited from :root, so these overrides must use the same
   selector or they are silently discarded. */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: var(--cadasto-blue);
  --md-primary-fg-color--light: var(--cadasto-blue);
  --md-primary-fg-color--dark: var(--cadasto-blue-dark);
  --md-accent-fg-color: var(--cadasto-green);
  --md-default-bg-color: var(--cadasto-ink);
  --md-default-fg-color: var(--cadasto-fg);
  --md-default-fg-color--light: var(--cadasto-fg-muted);
  --md-default-fg-color--lighter: rgba(255, 255, 255, 0.45);
  --md-typeset-color: var(--cadasto-fg);
  --md-typeset-a-color: var(--cadasto-blue);
  --md-code-bg-color: rgba(0, 0, 0, 0.4);
  --md-footer-bg-color: var(--cadasto-navy-dark);
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: var(--cadasto-display);
  font-weight: 500;
}

/* Documentation pages: brand the theme's own header. */
.md-header {
  background-color: var(--cadasto-navy);
}

.md-tabs {
  background-color: var(--cadasto-navy-dark);
}

/* The site name already sits in the header, next to the logo. On desktop the
   left sidebar repeated it as the navigation's title; with `toc.integrate` that
   column now carries the page's own contents, which is what a reader needs
   there. The label is still the drawer's heading on small screens, where the
   header is collapsed, so this is scoped to the desktop breakpoint. */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav--primary > .md-nav__title {
    display: none;
  }
}

/* --- Cadasto attribution (both footers) ---------------------------------- */

.cadasto-by {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cadasto-fg-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.cadasto-by:hover {
  color: var(--cadasto-green);
}

.cadasto-by strong {
  color: var(--cadasto-fg);
  font-weight: 600;
}

/* Intrinsic size is 884x630; the width/height attributes are present so the
   row does not reflow when the image lands. */
.cadasto-by img {
  width: 1.35rem;
  height: auto;
  flex: none;
}

/* ==========================================================================
   Landing page
   The landing template replaces the theme chrome, so everything below styles a
   bespoke page rather than overriding documentation styles.
   ========================================================================== */

/* The template empties the content blocks, leaving <main> with nothing but a
   script tag; without this it still contributes grid padding. */
.md-container:has(> .home) .md-main {
  display: none;
}

/* --- navigation ---------------------------------------------------------- */

.home-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7, 14, 43, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cadasto-border);
}

.home-nav__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.home-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--cadasto-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cadasto-fg);
  text-decoration: none;
}

.home-nav__brand img {
  width: 1.9rem;
  height: 1.9rem;
}

.home-nav__links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.82rem;
}

.home-nav__links a {
  color: var(--cadasto-fg-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.home-nav__links a:hover {
  color: var(--cadasto-blue);
}

.home-nav__repo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--cadasto-border-strong);
  border-radius: 2rem;
  color: var(--cadasto-fg) !important;
}

.home-nav__repo:hover {
  background: var(--cadasto-surface);
  border-color: var(--cadasto-blue);
}

.home-nav__repo svg {
  width: 1rem;
  height: 1rem;
  fill: currentcolor;
}

/* --- shared layout ------------------------------------------------------- */

.home {
  padding: 0 1.5rem 1rem;
}

.home > * {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

.md-typeset .section-title {
  font-family: var(--cadasto-display);
  text-align: center;
  font-size: 1.9rem;
  margin: 4.5rem 0 0.5rem;
}

/* --- hero ---------------------------------------------------------------- */

.home-hero {
  text-align: center;
  padding: 5rem 1rem 2rem;
}

.md-typeset .home-hero__mark {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.75rem;
  display: block;
}

.md-typeset .home-hero h1 {
  font-family: var(--cadasto-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--cadasto-blue);
  background: linear-gradient(100deg, var(--cadasto-blue) 0%, var(--cadasto-green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.md-typeset .home-tagline {
  color: var(--cadasto-fg-muted);
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 40rem;
  margin: 0 auto 2.25rem;
}

.home-cta {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sits directly under the buttons: the licence and the no-install path are the
   two objections a first-time visitor raises before clicking anything. */
.md-typeset .home-reassure {
  margin: 1.1rem auto 0;
  max-width: 34rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--cadasto-fg-muted);
}

.md-typeset .home-cta .md-button {
  border-radius: 2rem;
  padding: 0.6rem 1.6rem;
  font-weight: 600;
  border-width: 1px;
}

.md-typeset .home-cta .md-button--primary {
  color: var(--cadasto-ink);
  background: var(--cadasto-blue);
  border-color: var(--cadasto-blue);
}

.md-typeset .home-cta .md-button--primary:hover {
  background: var(--cadasto-green);
  border-color: var(--cadasto-green);
  color: var(--cadasto-ink);
}

/* --- feature cards ------------------------------------------------------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin: 2.5rem auto 1rem;
}

.feature-card {
  background: var(--cadasto-surface);
  border: 1px solid var(--cadasto-border);
  border-radius: 0.9rem;
  padding: 1.6rem 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.feature-card:hover {
  border-color: var(--cadasto-border-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
}

/* Icon chip — the icon itself is an inline SVG emitted by pymdownx.emoji. */
.md-typeset .feature-card .twemoji,
.md-typeset .product-card .twemoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 1rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, rgba(92, 178, 255, 0.22), rgba(36, 227, 99, 0.16));
  border: 1px solid var(--cadasto-border);
}

.md-typeset .feature-card .twemoji svg,
.md-typeset .product-card .twemoji svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: var(--cadasto-blue);
}

.md-typeset .feature-card h3,
.md-typeset .product-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
  color: var(--cadasto-fg);
}

.md-typeset .feature-card p {
  color: var(--cadasto-fg-muted);
  font-size: 0.87rem;
  line-height: 1.65;
  margin: 0;
}

/* --- product cards ------------------------------------------------------- */

.two-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.25rem;
  margin: 2.5rem auto 1rem;
}

.product-card {
  background: linear-gradient(160deg, var(--cadasto-ink-raised), var(--cadasto-surface));
  border: 1px solid var(--cadasto-border);
  border-left: 3px solid var(--cadasto-green);
  border-radius: 0.9rem;
  padding: 1.75rem;
}

.md-typeset .product-card p {
  color: var(--cadasto-fg-muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.md-typeset .product-card .md-button {
  border-radius: 2rem;
  padding: 0.4rem 1.2rem;
  font-size: 0.8rem;
}

/* --- quick start --------------------------------------------------------- */

.quick-start {
  max-width: 44rem !important;
  margin: 2.5rem auto 4rem;
  text-align: center;
}

.md-typeset .quick-start h2 {
  font-family: var(--cadasto-display);
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
}

.md-typeset .quick-start > p {
  color: var(--cadasto-fg-muted);
}

.quick-start .highlight {
  text-align: left;
}

.md-typeset .quick-start pre > code {
  border-radius: 0.75rem;
  border: 1px solid var(--cadasto-border);
  padding: 1.1rem 1.25rem;
}

/* --- footer -------------------------------------------------------------- */

.home-footer {
  border-top: 1px solid var(--cadasto-border);
  background: rgba(0, 0, 0, 0.25);
}

.home-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}

.home-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.home-footer__copyright {
  color: var(--cadasto-fg-muted);
  margin: 0;
}

.home-footer__links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.home-footer__links a {
  color: var(--cadasto-fg-muted);
  text-decoration: none;
}

.home-footer__links a:hover {
  color: var(--cadasto-blue);
}

/* --- narrow viewports ---------------------------------------------------- */

@media screen and (max-width: 48rem) {
  .home-nav__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .home-nav__links {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .home-hero {
    padding-top: 3rem;
  }

  .md-typeset .section-title {
    margin-top: 3rem;
  }
}
