/* === GeoSpatial ML — cosmo overrides with earthy palette === */

/* Import Space Grotesk + JetBrains Mono */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Tokens --- */
:root {
  --geo-accent: #2563eb;
  --geo-accent-2: #3b82f6;
  --geo-earth-green: #2a7a6a;
  --geo-rust: #7a3322;
  --geo-bg: #f5efe6;
  --geo-bg-card: #ebe5db;
  --geo-surface: #e0dace;
  --geo-border: #d4cdc2;
  --geo-text: #2d2926;
  --geo-text-dim: #6b6560;
  --geo-mono: 'JetBrains Mono', monospace;
}

/* --- Typography (5: smaller base font) --- */
html {
  font-size: 15px;
}

body {
  font-family: 'Space Grotesk', 'Source Sans Pro', system-ui, sans-serif;
  background-color: var(--geo-bg);
  color: var(--geo-text);
}

code, pre, .sourceCode {
  font-family: var(--geo-mono) !important;
}

/* --- Navbar --- */
.navbar {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background-color: #1a2332 !important;
  border-bottom: 2px solid #1a4f5e;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.navbar-dark .navbar-nav .nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: var(--geo-accent-2) !important;
}

/* --- Links (2: blueish color) --- */
a {
  color: var(--geo-accent);
  transition: color 0.15s;
}
a:hover {
  color: var(--geo-accent-2);
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--geo-text);
  letter-spacing: -0.02em;
}

/* --- Hide anchor links in post cards --- */
.post-card h3 .anchorjs-link,
.post-card h3.anchored .anchor-section-link,
.post-card h3.anchored::after,
.post-card .anchorjs-link {
  display: none !important;
}

/* --- Hero section (home page) --- */
.hero {
  text-align: center;
  padding: 2rem 0 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1a4f5e;
  margin-bottom: 0.75rem;
}

.hero > p {
  color: var(--geo-text);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.authors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

a.author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--geo-border);
  border-radius: 10px;
  background: transparent;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--geo-text);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
a.author:hover {
  border-color: #1a4f5e;
  background: var(--geo-bg-card);
  color: var(--geo-text);
}

.author-sep {
  color: var(--geo-text-dim);
  font-size: 1.1rem;
}

a.subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.6rem 1.4rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff !important;
  background: #1a4f5e;
  border: 1px solid #1a4f5e;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
a.subscribe-btn:hover {
  background: #15707e;
  border-color: #15707e;
  transform: translateY(-1px);
  color: #fff !important;
}

/* --- Posts section (home page) --- */
.posts-section {
  max-width: 720px;
  margin: 0 auto;
}

.section-heading {
  font-size: 0.8rem !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--geo-rust) !important;
  font-weight: 700;
  margin-bottom: 1.5rem !important;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--geo-border);
}

/* --- Post cards (home page listing) --- */
.post-card a {
  display: block;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--geo-border);
  border-radius: 10px;
  margin-bottom: 0.65rem;
  background: var(--geo-bg-card);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.post-card a:hover {
  border-color: #1a4f5e;
  background: var(--geo-surface);
  transform: translateY(-1px);
}

.post-card time {
  font-family: var(--geo-mono);
  font-size: 0.75rem;
  color: var(--geo-text-dim);
  text-transform: none;
}

.post-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: none;
  color: var(--geo-text);
  margin-top: 0.2rem;
  margin-bottom: 0;
}

.post-card .post-desc {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--geo-text-dim);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  margin-bottom: 0;
  line-height: 1.5;
  text-transform: none;
}

/* --- Article content --- */
.quarto-title-block .quarto-title .title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.quarto-title-meta-contents {
  font-family: var(--geo-mono);
  font-size: 0.82rem;
}

/* --- Code blocks --- */
pre.sourceCode {
  border: 1px solid var(--geo-border);
  border-radius: 10px;
  padding: 1.25rem;
  font-size: 0.82rem;
}

div.sourceCode {
  border-radius: 10px;
  border: 1px solid var(--geo-border);
  width: 98%;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

/* Copy button inside code blocks */
.code-copy-button {
  position: absolute !important;
  top: 6px;
  right: 6px;
}

code:not(.sourceCode) {
  background: var(--geo-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* --- Cell output styling with left border accent --- */
.cell-output {
  margin-left: 20px;
  border-left: 2px solid salmon;
}

/* --- TOC sidebar --- */
nav[id="TOC"] a {
  color: var(--geo-text-dim);
  font-size: 0.82rem;
}
nav[id="TOC"] a:hover,
nav[id="TOC"] a.active {
  color: var(--geo-accent);
}

/* --- Blockquotes --- */
blockquote {
  border-left: 3px solid var(--geo-accent) !important;
  color: var(--geo-text-dim);
}

/* --- Citation block --- */
#quarto-appendix.default {
  background: var(--geo-bg);
  border-top: 1px solid var(--geo-border);
}

#quarto-appendix .quarto-appendix-heading {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--geo-text);
}

/* Hide "For attribution" label and the formatted citation */
.quarto-appendix-citeas {
  display: none !important;
}

/* Style ALL secondary labels, then override the first one */
#quarto-citation .quarto-appendix-secondary-label {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--geo-text-dim);
}

/* Hide the "For attribution" label (second one) */
.quarto-appendix-bibtex ~ .quarto-appendix-secondary-label {
  display: none !important;
}

/* Replace "BibTeX citation:" with custom text */
#quarto-citation .quarto-appendix-secondary-label:first-child {
  visibility: hidden;
  position: relative;
  height: 1.5em;
  font-style: italic;
}

#quarto-citation .quarto-appendix-secondary-label:first-child::after {
  content: "If you've found this post useful for your own research, please consider citing:";
  visibility: visible;
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

/* Style the BibTeX code block */
pre.quarto-appendix-bibtex {
  background: var(--geo-bg-card) !important;
  border: 1px solid var(--geo-border) !important;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: var(--geo-mono);
  font-size: 0.78rem;
  color: var(--geo-text) !important;
  position: relative;
  cursor: text;
}

/* Hide Quarto's default copy button on BibTeX block */
pre.quarto-appendix-bibtex + .code-copy-button,
pre.quarto-appendix-bibtex .code-copy-button {
  display: none !important;
}

/* Copy button for BibTeX citation */
.bibtex-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  color: var(--geo-text-dim);
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  line-height: 0;
}
.bibtex-copy-btn:hover {
  opacity: 1;
  color: var(--geo-text);
}

pre.quarto-appendix-bibtex code {
  background: transparent !important;
  color: var(--geo-text) !important;
  font-family: var(--geo-mono);
}

.quarto-appendix-default code {
  background: var(--geo-surface);
  font-family: var(--geo-mono);
  font-size: 0.78rem;
}

/* --- Tables (1: 60% size, 8: centered) --- */
.table {
  font-size: 0.72rem;
  width: auto;
  margin-left: auto;
  margin-right: auto;
}
.table thead {
  border-bottom: 2px solid var(--geo-border);
}
.table th {
  color: var(--geo-accent);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table td, .table th {
  padding: 0.35rem 0.6rem;
}

/* --- Images / Figures (3: smaller, centered) --- */
.quarto-figure {
  text-align: center;
}
.quarto-figure img {
  border-radius: 10px;
  max-width: 70%;
  height: auto;
}

img:not(.navbar-logo, .thumbnail-image) {
  max-width: 70%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 10px;
}

/* Captions centered */
.figure-caption, figcaption {
  text-align: center !important;
  font-size: 0.82rem;
}

/* --- Footer --- */
.nav-footer {
  background-color: var(--geo-bg);
  border-top: 1px solid var(--geo-border);
  color: var(--geo-text-dim);
}

/* --- Search --- */
.aa-DetachedSearchButton {
  border-color: rgb(255 255 255 / 30%) !important;
}

/* --- Acknowledgments helper --- */
.acknowledgments {
  font-size: 0.85em !important;
  opacity: 0.75;
}

/* --- Responsive --- */
@media (width <= 600px) {
  html { font-size: 14px; }
  .quarto-title-block .quarto-title .title {
    font-size: 1.6rem;
  }
  .quarto-figure img,
  img:not(.navbar-logo, .thumbnail-image) {
    max-width: 95%;
  }
}
