/* gm-nav.css — guide-scoped left navigation tree (pairs with gm-nav.js) */

.gm-tree {
  font-size: 13.5px;
  line-height: 1.4;
  background: #fafbfc;
  border: 1px solid #d6dde4;
  border-radius: 8px;
  padding: 10px 8px 14px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 90px;
}

.gm-head { padding: 4px 8px 10px; border-bottom: 1px solid #e3e8ee; margin-bottom: 8px; }
.gm-guide-title {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
  color: #1b2733;
  text-decoration: none;
}
.gm-switch { font-size: 12px; color: #5c6b7a; margin-top: 4px; }
.gm-switch a { color: #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: 16px; }

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

.gm-twist {
  flex: none;
  width: 18px; height: 22px;
  background: none; border: none; padding: 0;
  cursor: pointer;
  position: relative;
}
.gm-twist::before {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 6px; height: 6px;
  border-right: 1.6px solid #5c6b7a;
  border-bottom: 1.6px solid #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-label {
  display: block;
  flex: 1;
  padding: 3px 8px;
  border-radius: 6px;
  color: #33414f;
  text-decoration: none;
}
.gm-sec > .gm-row > .gm-label { font-weight: 600; color: #1b2733; }
.gm-label:hover { background: #eef2f6; }

.gm-current > .gm-row > .gm-label,
.gm-current > .gm-label {
  background: #eaf3fb;
  color: #17568f;
  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: 260px; float: left; margin: 0 24px 24px 0; }
@media (max-width: 900px) {
  .gm-aside { width: auto; float: none; margin: 0 0 18px; }
  .gm-tree { position: static; max-height: 320px; }
}

/* inside Copenhagen's own article sidebar, fill the column */
.article-sidebar .gm-tree { border: none; background: transparent; padding: 0; }

/* 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; }

/* on-page TOC (right column on article pages) */
.gm-otp { width: 180px; flex: none; margin-left: 24px; position: sticky; top: 90px; align-self: flex-start; font-size: 12.5px; }
.gm-otp-title { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #5c6b7a; font-weight: 700; margin-bottom: 8px; }
.gm-otp a { display: block; color: #5c6b7a; text-decoration: none; padding: 3px 0; border-left: 2px solid #d6dde4; padding-left: 10px; }
.gm-otp a:hover { color: #17568f; }
.gm-otp-h3 { padding-left: 20px !important; }
@media (max-width: 1100px) { .gm-otp { display: none; } }

.gm-otp-current { color: #17568f !important; font-weight: 600; border-left-color: #1f6fb8 !important; }

/* 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 #d6dde4; border-radius: 8px; border-bottom: 1px solid #d6dde4 !important; }
.promoted-articles-item a, .promoted-articles-item a:visited { color: #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: #eaf3fb; color: #17568f; }

/* section pages: two-column layout via template mount point */
.gm-section-layout { display: flex; gap: 32px; align-items: flex-start; }
.gm-aside-col { flex: none; width: 260px; }
.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: #1b2733 !important; }
.gm-tree a.gm-label, .gm-tree a.gm-label:visited { color: #33414f; }
.gm-tree .gm-sec > .gm-row > a.gm-label, .gm-tree .gm-sec > .gm-row > a.gm-label:visited { color: #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: #17568f; }
.gm-switch a, .gm-switch a:visited { color: #1f6fb8 !important; }
