/* Local review: chapter navigation and the main footer only. */
/* Keep the original short desktop labels; mobile carries the chapter descriptions. */
.header #nav .nav-entry-title {
  display: inline;
  font: inherit;
  letter-spacing: inherit;
}
.header #nav .nav-short { display: inline; }
.header #nav :is(.nav-long, .nav-entry-description, .nav-entry-number) { display: none; }

/* Continue reading: three existing destinations, with a clear editorial hierarchy. */
footer.footer {
  display: block;
  padding-block: 40px 24px;
}
footer.footer .footer-continue-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 21px;
}
footer.footer .footer-continue-heading h2 {
  margin: 0;
  font: 400 14px/1.7 var(--sans);
  letter-spacing: .08em;
  color: var(--text);
}
footer.footer .footer-continue-heading p {
  max-width: 35em;
  margin: 0;
  font: 400 12px/1.8 var(--sans);
  letter-spacing: .015em;
  color: var(--soft);
}
footer.footer > .home-footer45-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  justify-content: initial;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0 0 29px;
}
footer.footer .home-footer45-nav > .footer-continue-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 7px 20px;
  min-width: 0;
  min-height: 112px;
  margin: 0;
  padding: 15px 30px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  white-space: normal;
  text-decoration: none;
  transition: color .3s ease;
}
footer.footer .home-footer45-nav > .footer-continue-card:first-child { padding-left: 0; }
footer.footer .home-footer45-nav > .footer-continue-card:last-child { padding-right: 0; }
footer.footer .home-footer45-nav > .footer-continue-card + .footer-continue-card {
  border-left: 1px solid var(--ui49-rule, var(--line));
}
footer.footer .home-footer45-nav > .footer-continue-card::after { content: none; }
footer.footer .footer-continue-card > .title {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font: 400 clamp(24px, 2.25vw, 32px)/1.5 var(--serif);
  letter-spacing: .025em;
  color: inherit;
}
footer.footer .footer-continue-card > small {
  display: block;
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  font: 400 12px/1.85 var(--sans);
  letter-spacing: .015em;
  color: var(--soft);
}
footer.footer .footer-continue-card > svg {
  display: block;
  grid-column: 2;
  grid-row: 1 / 3;
  width: 34px;
  height: 24px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: none;
  transition: transform .4s var(--ease, ease);
}
footer.footer .footer-brand-line {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--ui49-rule, var(--line));
}
footer.footer .footer-brand-line .footer-wordmark.brand--image {
  align-self: center;
  margin: 0;
}
footer.footer .footer-brand-line .footer-wordmark.brand--image .brand-logo-frame { width: 140px; }
footer.footer .footer-brand-line .footer-bottom {
  display: flex;
  grid-column: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  font: 400 11px/1.8 var(--sans);
  color: var(--soft);
}
footer.footer .footer-brand-line .footer-bottom > :not(a) {
  min-width: 0;
  max-width: 48em;
  overflow-wrap: anywhere;
}
footer.footer .footer-brand-line #ui48-backtop {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}
footer.footer :is(a, button):focus-visible {
  outline: 1px solid var(--ui49-celadon, var(--accent));
  outline-offset: 5px;
}

@media (hover: hover) and (pointer: fine) {
  footer.footer .footer-continue-card:hover { color: var(--ui49-celadon, var(--accent)); }
  footer.footer .footer-continue-card:hover > svg { transform: translateX(4px); }
}

@media (min-width: 761px) and (max-width: 1000px) {
  footer.footer .home-footer45-nav > .footer-continue-card { gap: 7px 12px; padding-inline: 20px; }
  footer.footer .home-footer45-nav > .footer-continue-card:first-child { padding-left: 0; }
  footer.footer .home-footer45-nav > .footer-continue-card:last-child { padding-right: 0; }
  footer.footer .footer-continue-card > .title { font-size: 24px; }
}

@media (max-width: 760px) {
  /* The menu remains a two-column chapter directory beneath the 72px header. */
  .header #nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(130px, 1fr));
    align-items: stretch;
    justify-content: initial;
    gap: 18px 22px;
    width: 100%;
    height: min(420px, 50svh);
    max-height: calc(100svh - 72px);
    margin: 0;
    padding: 24px 22px 27px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-bottom: 1px solid var(--ui49-rule, var(--line));
    background: var(--canvas);
    box-shadow: 0 18px 30px rgb(0 0 0 / 20%);
  }
  .header #nav.open { display: grid; }
  .header #nav > a {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-content: center;
    align-items: start;
    justify-content: start;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 130px;
    padding: 12px 0 18px;
    border: 0;
    border-bottom: 1px solid var(--ui49-rule, var(--line));
    border-radius: 0;
    background: none;
    text-align: left;
    white-space: normal;
    color: var(--soft);
  }
  .header #nav > a:nth-last-child(-n + 2) { border-bottom: 0; }
  .header #nav > a::after { content: none; }
  .header #nav .nav-entry-number {
    display: block;
    grid-row: 1;
    font: 400 11px/1.5 var(--numeric, var(--sans));
    letter-spacing: .11em;
    color: var(--soft);
    opacity: .8;
  }
  .header #nav .nav-entry-title {
    position: relative;
    display: block;
    grid-row: 2;
    width: fit-content;
    max-width: 100%;
    font: 400 22px/1.4 var(--serif);
    letter-spacing: .025em;
    color: var(--text);
  }
  .header #nav .nav-short { display: none; }
  .header #nav .nav-long { display: inline; }
  .header #nav .nav-entry-description {
    display: block;
    grid-row: 3;
    margin: 2px 0 0;
    font: 400 12.5px/1.8 var(--sans);
    letter-spacing: .01em;
    color: var(--soft);
  }
  .header #nav a.current .nav-entry-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 23px;
    height: 1px;
    background: var(--ui49-celadon, var(--accent));
  }
  .header #nav > a:focus-visible {
    outline: 1px solid var(--ui49-celadon, var(--accent));
    outline-offset: 4px;
  }

  footer.footer { padding-block: 31px 22px; }
  footer.footer .footer-continue-heading { display: block; margin-bottom: 13px; }
  footer.footer .footer-continue-heading h2 { font-size: 13px; }
  footer.footer .footer-continue-heading p { margin-top: 7px; font-size: 12px; }
  footer.footer > .home-footer45-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-bottom: 24px;
  }
  footer.footer .home-footer45-nav > .footer-continue-card {
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 5px 20px;
    min-height: 107px;
    padding: 20px 0;
  }
  footer.footer .home-footer45-nav > .footer-continue-card + .footer-continue-card {
    border-left: 0;
    border-top: 1px solid var(--ui49-rule, var(--line));
  }
  footer.footer .footer-continue-card > .title { font-size: 26px; line-height: 1.4; }
  footer.footer .footer-continue-card > small { font-size: 12px; line-height: 1.8; }
  footer.footer .footer-continue-card > svg { width: 32px; height: 24px; }
  footer.footer .footer-brand-line { grid-template-columns: 112px minmax(0, 1fr); gap: 24px; padding-top: 20px; }
  footer.footer .footer-brand-line .footer-wordmark.brand--image .brand-logo-frame { width: 112px; }
  footer.footer .footer-brand-line .footer-bottom { flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; font-size: 10px; line-height: 1.8; }
  footer.footer .footer-brand-line #ui48-backtop { gap: 8px; font-size: 11px; }
  footer.footer .footer-origin { display: block; }
}

@media (max-width: 360px) {
  .header #nav { gap: 14px 18px; padding-inline: 20px; }
  .header #nav .nav-entry-description { font-size: 12px; }
  footer.footer .footer-brand-line { gap: 16px; }
}

@media (max-width: 760px) and (max-height: 520px) {
  .header #nav { padding-block: 15px 20px; grid-template-rows: repeat(2, minmax(118px, 1fr)); gap: 14px 22px; }
  .header #nav > a { min-height: 118px; padding-block: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  footer.footer .footer-continue-card,
  footer.footer .footer-continue-card > svg { transition: none; }
  footer.footer .footer-continue-card:hover > svg { transform: none; }
}

/* Continue-reading directory was removed at the user's request. */
footer.footer { padding-block: 24px; }
footer.footer .footer-brand-line { padding-top: 0; border-top: 0; }
@media (max-width: 760px) {
  footer.footer { padding-block: 24px 22px; }
  footer.footer .footer-brand-line { padding-top: 0; }
}
