/* GeoLattice home page. Colours come from the Bootstrap theme (cosmo or darkly). */

/* Hero: the intro and the nine chapter tiles over the animated map */
.gl-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0.5rem 0 2rem;
  padding: 1.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
}
.gl-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("no2_counties.gif") center / cover no-repeat;
  opacity: 0.4;
}

.gl-intro {
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  backdrop-filter: blur(3px);
}
.gl-intro h3 {
  margin-top: 0;
  border-bottom: none;
}
.gl-intro p:last-child { margin-bottom: 0; }

.gl-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
.gl-stats strong {
  font-size: 1.35rem;
  color: var(--bs-link-color);
  margin-right: 0.3rem;
}

.gl-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin-top: 0.75rem;
}
.gl-badges img { height: 20px; display: block; }
.gl-badges code { font-size: 0.85rem; margin-left: 0.25rem; }

/* Chapter tiles */
.gl-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
a.gl-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--bs-primary) 45%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bs-body-bg) 42%, transparent);
  color: var(--bs-body-color);
  text-decoration: none;
  /* a soft halo keeps the text readable over the map */
  text-shadow: 0 0 3px var(--bs-body-bg), 0 0 6px var(--bs-body-bg);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.gl-tile:hover,
a.gl-tile:focus-visible {
  transform: translateY(-3px);
  background: color-mix(in srgb, var(--bs-body-bg) 75%, transparent);
  border-color: var(--bs-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.gl-tile-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.gl-num {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.gl-name {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
}
.gl-desc {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  flex: 1;
}
.gl-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}
.gl-meta code {
  font-size: 0.8rem;
  background: none;
  padding: 0;
}

.gl-credit {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
  text-align: right;
  color: var(--bs-secondary-color);
}

/* Feature grid */
.gl-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.gl-feature {
  padding: 1rem 1.2rem;
  border: 1px solid var(--bs-border-color);
  border-left: 4px solid var(--bs-primary);
  border-radius: 8px;
}
.gl-feature p:last-child { margin-bottom: 0; }

.gl-qref {
  width: 100%;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
}

/* Number the chapters in the sidebar's Package Overview */
#quarto-sidebar-section-1 { counter-reset: chapter; }
#quarto-sidebar-section-1 .menu-text::before {
  counter-increment: chapter;
  content: counter(chapter) ".";
  display: inline-block;
  min-width: 1.6rem;
}

.navbar-brand .navbar-logo { max-height: 34px; }

@media (max-width: 1100px) {
  .gl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .gl-hero { padding: 1rem; }
  .gl-tiles, .gl-features { grid-template-columns: 1fr; }
}
