/* =========================
   Base layout
   ========================= */

:root {
  --columbia-navy: #1f3a5f;
  --columbia-blue: #9bddf5;
  --columbia-light: #e6f4fb;
  --text-main: #2c3e50;
  --text-muted: #6b7280;
  --border-light: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background: #ffffff;
  line-height: 1.55;
}

.content {
  padding: 1em;
}

/* =========================
   Header
   ========================= */

header {
  background: var(--columbia-navy);
  color: white;
  padding: 20px 24px;
  border-bottom: 4px solid var(--columbia-blue);
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

header p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* =========================
   Main content
   ========================= */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* =========================
   Collections
   ========================= */

section {
  margin-bottom: 48px;
}

section > h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
  color: var(--columbia-navy);
}

section > p {
  margin-top: 0;
  max-width: 800px;
  color: var(--text-muted);
}

/* =========================
   Items / datasets
   ========================= */

.item {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--columbia-light);
  border-left: 5px solid var(--columbia-blue);
  border-radius: 4px;
}

.item h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--columbia-navy);
}

.item .description {
  margin: 8px 0 12px;
  white-space: pre-line; /* preserves newlines from STAC abstracts */
}

/* =========================
   Asset links
   ========================= */

.assets {
  padding-left: 0;
  margin: 12px 0 0;
}

.assets li {
  list-style: none;
  margin-bottom: 6px;
}

.assets a {
  color: var(--columbia-navy);
  text-decoration: none;
  font-weight: 500;
}

.assets a:hover {
  text-decoration: underline;
  color: #16304d;
}

/* =========================
   Utility elements
   ========================= */

.loading {
  color: var(--text-muted);
  font-style: italic;
}

.error {
  color: #b91c1c;
  font-weight: 500;
}

/* =========================
   Responsive tweaks
   ========================= */

@media (max-width: 768px) {
  main {
    padding: 20px 16px 40px;
  }

  header h1 {
    font-size: 1.35rem;
  }

  .item {
    padding: 16px;
  }
}



/* --- dropdown --- */
/* ---------- Base ---------- */

.node {
  position: relative;
  margin-left: 1.2rem;
  padding-left: 1rem;
  border-left: 1px solid #e0e0e0;
}

.node-header {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  margin: 0.4rem 0;
}

/* ---------- Levels ---------- */

.level-catalog {
  margin-left: 0;
  padding-left: 2em;
  border-left: none;
}

.catalog-header {
  font-size: 1.4rem;
  color: #1b5e20;
}

.level-collection {
  margin-left: 1.5rem;
}

.collection-header {
  font-size: 1.1rem;
  color: #2e7d32;
}

.level-item {
  margin-left: 1.5rem;
}

.item-header {
  font-size: 0.95rem;
  font-weight: 500;
  color: #37474f;
}

/* ---------- Disclosure arrows ---------- */

.node-header::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  color: #666;
}

.node-header.open::before {
  content: "▾";
}

/* ---------- Item body ---------- */

.item > div {
  margin-left: 1rem;
}



/* ---------- Assets ---------- */

.item-map {
  width: 300px;
  height: 300px;
  max-width: 100%;
  margin: 0.75rem 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}


.item ul {
  margin: 0.4rem 0 0.6rem 1rem;
  padding-left: 0.5rem;
}

.item li {
  font-size: 0.85rem;
}

/* ---------- Search ---------- */

#search {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}


/* ---------- radiant rendering ---------- */
.item-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #333;
  margin-bottom: 0.75rem;
}

.item-description p {
  margin: 0.4rem 0;
}

.item-description ul {
  margin: 0.4rem 0 0.6rem 1.2rem;
  padding-left: 1rem;
}

.item-description li {
  margin: 0.2rem 0;
}

.item-description h2,
.item-description h3,
.item-description h4 {
  margin: 0.6rem 0 0.3rem;
  font-weight: 600;
}

/* ---------- collection metadata ---------- */
.node-metadata {
  font-size: 0.9rem;
  color: #333;
  margin: 0.4rem 0 0.8rem 0.8rem;
  padding-left: 0.8rem;
  border-left: 2px solid #e0e0e0;
}

.node-description p {
  margin: 0.3rem 0;
}

.node-metadata ul {
  margin: 0.3rem 0 0.6rem 1.2rem;
  padding-left: 0.8rem;
}

.node-metadata li {
  margin: 0.2rem 0;
}

.keywords {
  margin-top: 0.3rem;
}

.keyword {
  display: inline-block;
  background: #eef3f7;
  color: #37474f;
  border-radius: 3px;
  padding: 2px 6px;
  margin: 2px 4px 2px 0;
  font-size: 0.75rem;
}



/* =========================
   Item two-column layout
   ========================= */

.item {
  padding-right: 1.5rem;
}

/* Grid container */
.item-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

/* Columns */
.item-col {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.item-left {}
.item-right {}

/* =========================
   Item blocks
   ========================= */

.item-block {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
}

.item-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* =========================
   Assets
   ========================= */

.asset-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.asset {
  margin-bottom: 0.75rem;
}

.asset-title a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--columbia-navy);
  text-decoration: none;
}

.asset-title a:hover {
  text-decoration: underline;
}

.asset-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.asset img {
  display: block;
  max-width: 100%;
  margin-top: 0.4rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
}

/* =========================
   Fix layout conflicts
   ========================= */

/* Prevent grid from being offset by old rule */
.item > div {
  margin-left: 0;
}

/* =========================
   Responsive behavior
   ========================= */

@media (max-width: 900px) {
  .item-layout {
    grid-template-columns: 1fr;
  }
}

.textblock {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.5;
}

