/* Topic navigation has a separate composition for each edition. */
.desktop-navigation .nav-name { display: block; }
.nav-count { display: inline-grid; place-items: center; min-width: 26px; min-height: 26px; padding: 2px 6px; border-radius: 50%; font-size: .74rem; line-height: 1.2; font-weight: 600; background: var(--soft); color: var(--ink); }
.mobile-topics { padding: 8px 0 14px; }
.mobile-publication { padding-top: 10px; border-top: 1px solid var(--line); }
.mobile-publication a { font-weight: 400; }
.mobile-navigation .nav-home { border-bottom: 1px solid var(--line); }
.mobile-topics [aria-current] { font-weight: 700; color: var(--accent); background: var(--soft); }

@media (min-width: 761px) {
  /* Newspaper columns below a centred masthead. */
  .theme-journal .masthead-inner { min-height: 104px; position: relative; }
  .theme-journal .masthead-inner > .brand { margin-inline: auto; width: 310px; }
  .theme-journal .contact-link { position: absolute; right: 0; }
  .theme-journal .nav-journal { display: grid; grid-template-columns: .65fr repeat(6, minmax(0, 1fr)); gap: 0; min-height: 58px; border-top: 2px solid var(--ink); }
  .theme-journal .nav-journal a { display: grid; place-items: center; min-height: 44px; margin: 7px 0; padding: 6px 12px; border-left: 1px solid var(--line); text-align: center; font-family: Georgia, serif; font-size: .92rem; }
  .theme-journal .nav-journal a:first-child { border-left: 0; }
  .theme-journal .nav-journal a:hover { background: var(--soft); text-decoration: none; }
  .theme-journal .nav-journal [aria-current] { color: var(--accent); box-shadow: inset 0 -3px var(--accent); }

  /* A two-row control panel beside the hardware logo. */
  .theme-workbench .masthead-inner { display: grid; grid-template-columns: 205px minmax(0, 1fr) auto; gap: 30px; min-height: 118px; }
  .theme-workbench .masthead-inner > .brand { width: 205px; }
  .theme-workbench .masthead-inner .nav-workbench { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 14px 0; border: 0; min-height: 0; }
  .theme-workbench .nav-workbench a { display: flex; align-items: center; justify-content: flex-start; min-height: 40px; padding: 8px 13px; border: 1px solid #527166; background: #24453d; font-size: .84rem; line-height: 1.35; }
  .theme-workbench .nav-workbench a:hover { background: #355b4f; text-decoration: none; }
  .theme-workbench .nav-workbench [aria-current] { background: #f0cfb7; border-color: #f0cfb7; color: #18332e; }
  .theme-workbench .masthead-inner > .contact-link { max-width: 100px; text-align: right; }

  /* Paper tabs, attached to a continuous notebook rule. */
  .theme-notebook .masthead-inner { min-height: 94px; }
  .theme-notebook .nav-notebook { display: flex; justify-content: flex-start; align-items: flex-end; gap: 9px; min-height: 58px; padding-top: 9px; border-top: 0; border-bottom: 1px solid var(--line); }
  .theme-notebook .nav-notebook a { display: flex; align-items: center; justify-content: center; min-height: 47px; margin-bottom: -1px; padding: 12px 20px; border: 1px solid var(--line); border-radius: 9px 9px 0 0; background: #ecdfc9; font-family: 'Palatino Linotype', Palatino, Georgia, serif; font-size: .96rem; line-height: 1.4; }
  .theme-notebook .nav-notebook a:nth-child(even) { padding-top: 16px; }
  .theme-notebook .nav-notebook a:hover { background: #fffdf8; text-decoration: none; }
  .theme-notebook .nav-notebook [aria-current] { background: var(--surface); border-bottom-color: var(--surface); color: var(--accent); box-shadow: inset 0 3px var(--accent); }

  /* Rounded collection filters with real article counts. */
  .theme-gallery .masthead-inner { min-height: 94px; }
  .theme-gallery .nav-gallery { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 10px; min-height: 76px; padding: 12px 0 18px; border-top: 0; }
  .theme-gallery .nav-gallery a { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); font-size: .87rem; line-height: 1.4; }
  .theme-gallery .nav-gallery a:hover { border-color: var(--accent); text-decoration: none; }
  .theme-gallery .nav-gallery [aria-current] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
  .theme-gallery .nav-gallery [aria-current] .nav-count { background: #466b58; color: #fff; }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .theme-journal .nav-journal a { padding-inline: 8px; font-size: .84rem; }
  .theme-workbench .masthead-inner { grid-template-columns: 175px minmax(0, 1fr) auto; gap: 18px; }
  .theme-workbench .masthead-inner > .brand { width: 175px; }
  .theme-workbench .nav-workbench a { font-size: .79rem; padding-inline: 9px; }
  .theme-workbench .masthead-inner > .contact-link { max-width: 75px; font-size: .76rem; }
  .theme-notebook .nav-notebook { gap: 6px; }
  .theme-notebook .nav-notebook a { flex: 1; padding-inline: 11px; font-size: .85rem; }
  .theme-gallery .nav-gallery { gap: 8px; }
  .theme-gallery .nav-gallery a { font-size: .8rem; padding-inline: 11px; }
}

@media (max-width: 760px) {
  .theme-journal .masthead-inner > .brand { margin-inline: 0; }
  .mobile-topics a { min-height: 44px; }
  .theme-journal .mobile-topics a { border-bottom: 1px solid var(--line); padding-left: 13px; }
  .theme-journal .mobile-topics [aria-current] { border-left: 3px solid var(--accent); padding-left: 10px; }
  .theme-workbench .mobile-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 14px; }
  .theme-workbench .mobile-topics a { display: flex; align-items: center; padding: 10px; border: 1px solid var(--line); background: var(--soft); font-size: .9rem; line-height: 1.4; }
  .theme-workbench .mobile-topics [aria-current] { color: #fff; background: var(--ink); border-color: var(--ink); }
  .theme-notebook .mobile-topics { display: grid; gap: 6px; padding-top: 14px; }
  .theme-notebook .mobile-topics a { border: 1px solid var(--line); border-left: 4px solid #bba17e; border-radius: 0 8px 8px 0; background: #f2e8d8; }
  .theme-notebook .mobile-topics [aria-current] { border-left-color: var(--accent); background: var(--surface); }
  .theme-gallery .mobile-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 14px; }
  .theme-gallery .mobile-topics a { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 55px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 24px; font-size: .85rem; line-height: 1.35; }
  .theme-gallery .mobile-topics [aria-current] { color: #fff; background: var(--ink); }
  .theme-gallery .mobile-topics [aria-current] .nav-count { background: #466b58; color: #fff; }
}

/* Secondary topic lists echo the edition's primary navigation. */
.theme-workbench .footer-grid > nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.theme-workbench .footer-grid > nav h2 { grid-column: 1 / -1; }
.theme-workbench .footer-grid > nav a { padding: 7px 9px; border: 1px solid var(--line); }
.theme-notebook .footer-grid > nav a { padding-left: 12px; border-left: 2px solid var(--line); }
.theme-gallery .footer-grid > nav { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; }
.theme-gallery .footer-grid > nav h2 { flex-basis: 100%; }
.theme-gallery .footer-grid > nav a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 20px; }
.theme-notebook .topic-directory nav { grid-template-columns: 1fr; }
.theme-gallery .topic-directory nav { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 12px; }
.theme-gallery .topic-directory nav a { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border: 1px solid #6f8a76; border-radius: 28px; }
