/* gm-nav.css — guide-scoped left navigation tree (pairs with gm-nav.js)
 * Visual language: pill-style items, grey active state, no boxed panel.
 * Design tokens come from gm-design.css (--gm-*); fallbacks are inline. */

.gm-tree {
  font-size: var(--gm-fs-sm, 14px);
  line-height: 1.4;
  background: none;
  border: 0;
  padding: 0;
  position: sticky;
  top: calc(var(--gm-header-h, 72px) + 24px);
  max-height: calc(100vh - var(--gm-header-h, 72px) - 48px);
  display: flex;
  flex-direction: column;
}

/* only the list scrolls: the guide title stays pinned at the top */
.gm-tree > .gm-top {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0 6px 24px 0;
}

.gm-head { flex: none; padding: 0 0 10px; margin-bottom: 4px; }
.gm-guide-title {
  display: block;
  font-weight: 700;
  font-size: var(--gm-fs-h3, 17px);
  line-height: 1.3;
  color: var(--gm-ink, #1b2733);
  text-decoration: none;
}
.gm-guide-title:hover { text-decoration: none; color: var(--gm-blue, #1f6fb8); }
.gm-switch { font-size: 12.5px; color: var(--gm-muted, #5c6b7a); margin-top: 6px; }
.gm-switch a { color: var(--gm-blue, #1f6fb8); text-decoration: none; }
.gm-switch a:hover { text-decoration: underline; }

.gm-tree ul { list-style: none; margin: 0; padding: 0; }
.gm-kids .gm-kids { padding-left: 14px; }
.gm-kids > li { margin: 3px 0; }

.gm-row { display: flex; align-items: center; gap: 0; }

.gm-twist {
  flex: none;
  width: 20px; height: 28px;
  background: none; border: none; padding: 0;
  cursor: pointer;
  position: relative;
  border-radius: 4px;
}
.gm-twist:hover { background: var(--gm-grey, #f3f5f7); }
.gm-twist::before {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 6px; height: 6px;
  border-right: 1.6px solid var(--gm-muted, #5c6b7a);
  border-bottom: 1.6px solid var(--gm-muted, #5c6b7a);
  transform: translate(-60%, -60%) rotate(-45deg);
  transition: transform .15s ease;
}
.gm-twist[aria-expanded="true"]::before { transform: translate(-50%, -70%) rotate(45deg); }
.gm-twist.gm-none { cursor: default; }
.gm-twist.gm-none::before { display: none; }
.gm-twist.gm-none:hover { background: none; }

.gm-label {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--gm-blue, #1f6fb8);
  font-weight: 500;
  text-decoration: none;
  line-height: 1.35;
}
.gm-sec > .gm-row > .gm-label { font-weight: 600; color: var(--gm-ink, #1b2733); }
.gm-label:hover { background: var(--gm-grey, #f3f5f7); text-decoration: none; }

.gm-current > .gm-row > .gm-label,
.gm-current > .gm-label {
  background: var(--gm-grey-2, #e9edf1);
  color: var(--gm-ink, #1b2733);
  font-weight: 600;
}

.gm-sec > .gm-kids { display: none; }
.gm-sec.gm-open > .gm-kids { display: block; }

/* left-column layout on pages where the script injects its own aside */
.gm-aside { width: 256px; float: left; margin: 0 24px 24px 0; }
@media (max-width: 900px) {
  .gm-aside { width: auto; float: none; margin: 0 0 18px; }
}
@media (max-width: 1023px) {
  .gm-tree {
    position: static; max-height: 360px; display: block;
    border: 1px solid var(--gm-line, #e3e8ee); border-radius: 8px;
    padding: 12px 12px 14px; margin-bottom: 24px;
    overflow-y: auto;
  }
  .gm-tree > .gm-top { overflow: visible; padding: 0; }
}

/* inside Copenhagen's own article sidebar, fill the column */
.article-sidebar .gm-tree { width: 100%; }

/* no flash of stock sidebar: hidden until the tree mounts; JS re-shows it on failure */
.article-sidebar > *:not(.gm-tree) { display: none; }
html.gm-nav-failed .article-sidebar > * { display: block; }

/* promoted-articles: card grid (overrides stock widths) + platform badges */
.promoted-articles { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 16px; }
.promoted-articles-item { width: auto !important; max-width: none !important; margin: 0 !important; padding: 14px 18px !important; border: 1px solid var(--gm-line, #e3e8ee); border-radius: 8px; border-bottom: 1px solid var(--gm-line, #e3e8ee) !important; }
.promoted-articles-item a, .promoted-articles-item a:visited { color: var(--gm-blue, #1f6fb8) !important; text-decoration: none; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gm-plat-badge { flex: none; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--gm-blue-tint, #eaf3fb); color: var(--gm-blue-dark, #17568f); }

/* section pages: two-column layout via template mount point */
.gm-section-layout { display: flex; gap: 40px; align-items: stretch; }
.gm-aside-col { flex: none; width: 256px; }
.gm-aside-col:empty { display: none; }
.gm-section-layout .section-content { flex: 1; min-width: 0; }
@media (max-width: 900px) { .gm-section-layout { display: block; } .gm-aside-col { width: auto; margin-bottom: 18px; } }

/* tree links must beat stock a / a:visited colors */
.gm-tree a.gm-guide-title, .gm-tree a.gm-guide-title:visited { color: var(--gm-ink, #1b2733); }
.gm-tree a.gm-label, .gm-tree a.gm-label:visited { color: var(--gm-blue, #1f6fb8); }
.gm-tree .gm-sec > .gm-row > a.gm-label, .gm-tree .gm-sec > .gm-row > a.gm-label:visited { color: var(--gm-ink, #1b2733); }
.gm-tree .gm-current > .gm-row > a.gm-label, .gm-tree .gm-current > a.gm-label,
.gm-tree .gm-current > .gm-row > a.gm-label:visited, .gm-tree .gm-current > a.gm-label:visited { color: var(--gm-ink, #1b2733); }
.gm-switch a, .gm-switch a:visited { color: var(--gm-blue, #1f6fb8) !important; }
