hirhanyo-footer {
  display: block;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  color: var(--color-text);
  font-family: var(--font-body);
}

hirhanyo-footer .hf-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

hirhanyo-footer .hf-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: 32px;
}

hirhanyo-footer .hf-main {
  border-bottom: 1px solid var(--color-border);
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), color-mix(in srgb, var(--hud-grid) 40%, transparent) calc(100% - 1px));
}

hirhanyo-footer .hf-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, .8fr)) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  min-height: 280px;
  padding-block: 28px 24px;
}

hirhanyo-footer .hf-brand,
hirhanyo-footer .hf-link-group,
hirhanyo-footer .hf-contact {
  min-width: 0;
}

hirhanyo-footer .hf-brand {
  position: relative;
  min-height: 210px;
  overflow: hidden;
}

/* The brand of the footer, the compact logo: the emblem, the wordmark and the slogan with its
 * cursor, one line on what the site is, and the three words. Behind them the outline of the emblem
 * as a watermark. */
hirhanyo-footer .hf-brand-lockup {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--color-text);
}

hirhanyo-footer .hf-emblem {
  width: 92px;
}

hirhanyo-footer .hf-brand-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

hirhanyo-footer .hf-brand-wordmark {
  font-family: var(--font-wordmark);
  font-size: 28px;
  font-weight: var(--font-wordmark-weight);
  line-height: 1;
  letter-spacing: var(--font-wordmark-tracking);
}

hirhanyo-footer .hf-tagline {
  color: var(--color-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

hirhanyo-footer .hf-tagline-cursor {
  margin-left: 2px;
  animation: hf-cursor 1.2s steps(1, end) infinite;
}

@keyframes hf-cursor {
  50% { opacity: 0; }
}

hirhanyo-footer .hf-brand-desc {
  position: relative;
  z-index: 1;
  max-width: 34ch;
  margin: 16px 0 12px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.55;
}

hirhanyo-footer .hf-brand-caption {
  position: relative;
  z-index: 1;
  color: var(--color-muted);
  font-size: 8px;
  letter-spacing: .08em;
}

hirhanyo-footer .hf-brand-caption span {
  color: var(--color-primary);
}

hirhanyo-footer .hf-watermark {
  position: absolute;
  right: -34px;
  bottom: -40px;
  width: 190px;
  height: 190px;
  color: var(--color-primary);
  opacity: .07;
  pointer-events: none;
}

hirhanyo-footer .hf-link-group summary,
hirhanyo-footer .hf-contact h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  margin: 0 0 13px;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  list-style: none;
}

hirhanyo-footer .hf-link-group summary {
  cursor: default;
}

hirhanyo-footer .hf-link-group summary::-webkit-details-marker {
  display: none;
}

hirhanyo-footer .hf-link-group summary > .icon {
  display: none;
  width: 15px;
  height: 15px;
  color: var(--color-muted);
  font-size: 15px;
  transition: transform .18s ease;
}

hirhanyo-footer .hf-link-group ul,
hirhanyo-footer .hf-contact ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

hirhanyo-footer .hf-link-group li {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

hirhanyo-footer .hf-link-group .hf-list-marker {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  font-size: 14px;
}

hirhanyo-footer .hf-link-group li > a,
hirhanyo-footer .hf-link-group li > button {
  flex: 1 1 auto;
  min-width: 0;
}

hirhanyo-footer .hf-link-group--about .hf-list-marker {
  color: var(--color-primary);
}

hirhanyo-footer .hf-link-group--services .hf-list-marker {
  color: var(--color-accent);
}

hirhanyo-footer .hf-link-group--legal .hf-list-marker {
  color: var(--color-secondary);
}

hirhanyo-footer .hf-link-group a,
hirhanyo-footer .hf-link-group button,
hirhanyo-footer .hf-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
}

hirhanyo-footer .hf-link-group a:hover,
hirhanyo-footer .hf-link-group button:hover,
hirhanyo-footer .hf-contact-link:hover {
  color: var(--color-primary);
}

hirhanyo-footer .hf-contact h2 {
  margin-bottom: 11px;
}

hirhanyo-footer .hf-contact-link {
  overflow-wrap: anywhere;
}

hirhanyo-footer .hf-contact-link .icon {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
  font-size: 14px;
}

hirhanyo-footer .hf-social-links {
  display: flex;
  align-items: center;
  gap: 7px;
}

hirhanyo-footer .hf-social-link {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}

hirhanyo-footer .hf-social-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-surface-elevated);
}

hirhanyo-footer .hf-social-link .icon {
  width: 15px;
  height: 15px;
  font-size: 15px;
}

hirhanyo-footer .hf-contact-note {
  color: var(--color-note);
  font-size: 10px;
  line-height: 1.5;
}

hirhanyo-footer .hf-system-status {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

hirhanyo-footer .hf-system-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.35fr);
  align-items: center;
  gap: 14px;
  min-height: 44px;
}

hirhanyo-footer .hf-system-brand {
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 9px;
  letter-spacing: .045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

hirhanyo-footer .hf-system-brand span {
  padding-inline: 4px;
  color: var(--color-primary);
}

hirhanyo-footer .hf-copyright {
  color: var(--color-muted);
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
}

hirhanyo-footer .hf-system-readout {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--color-muted);
  font-size: 8px;
  white-space: nowrap;
}

hirhanyo-footer .hf-system-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-success);
}

hirhanyo-footer .hf-system-online i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: hf-signal-pulse 2.4s ease-in-out infinite;
}

@keyframes hf-signal-pulse {
  50% { opacity: .48; }
}

@media (max-width: 1200px) {
  hirhanyo-footer .hf-container {
    padding-inline: 24px;
  }
}

@media (max-width: 1100px) {

  hirhanyo-footer .hf-main-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 20px;
    padding-block: 24px;
  }

  hirhanyo-footer .hf-brand {
    min-height: 150px;
  }

  hirhanyo-footer .hf-system-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  hirhanyo-footer .hf-copyright {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 8px;
    text-align: left;
  }
}

@media (max-width: 760px) {
  hirhanyo-footer .hf-container {
    padding-inline: 18px;
  }

  hirhanyo-footer .hf-main-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 16px;
  }

  hirhanyo-footer .hf-brand {
    grid-column: 1 / -1;
    min-height: 104px;
    padding: 3px 0 12px;
    border-bottom: 1px solid var(--color-border);
  }

  hirhanyo-footer .hf-system-inner {
    gap: 8px 12px;
  }
}

@media (max-width: 640px) {
  hirhanyo-footer .hf-container {
    padding-inline: 14px;
  }

  hirhanyo-footer .hf-main-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-block: 20px;
  }

  hirhanyo-footer .hf-brand {
    min-height: 100px;
    margin-bottom: 8px;
  }

  hirhanyo-footer .hf-link-group {
    border-bottom: 1px solid var(--color-border);
  }

  hirhanyo-footer .hf-link-group summary {
    min-height: 44px;
    margin: 0;
    cursor: pointer;
  }

  hirhanyo-footer .hf-link-group summary > .icon {
    display: inline-flex;
  }

  hirhanyo-footer .hf-link-group[open] summary > .icon {
    transform: rotate(180deg);
  }

  hirhanyo-footer .hf-link-group ul {
    gap: 0;
    padding: 0 0 10px 10px;
  }

  hirhanyo-footer .hf-link-group a,
  hirhanyo-footer .hf-link-group button {
    min-height: 34px;
    font-size: 11px;
  }

  hirhanyo-footer .hf-contact {
    padding: 18px 0;
  }

  hirhanyo-footer .hf-contact h2 {
    min-height: 22px;
    margin-bottom: 9px;
  }

  hirhanyo-footer .hf-system-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 54px;
    padding-block: 8px;
  }

  hirhanyo-footer .hf-system-brand {
    font-size: 7px;
  }

  hirhanyo-footer .hf-system-readout {
    gap: 8px;
  }

  hirhanyo-footer .hf-refresh,
  hirhanyo-footer .hf-response {
    display: none;
  }

  hirhanyo-footer .hf-copyright {
    padding: 0 0 2px;
    font-size: 8px;
  }
}

@media (max-width: 360px) {
  hirhanyo-footer .hf-system-brand span {
    display: none;
  }

  hirhanyo-footer .hf-system-readout {
    gap: 6px;
    font-size: 6px;
  }

}

@media (prefers-reduced-motion: reduce) {
  hirhanyo-footer .hf-tagline-cursor {
    animation: none;
  }

  hirhanyo-footer *,
  hirhanyo-footer *::before,
  hirhanyo-footer *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Quick access strip (Django: web/includes/footer.html; variants in components/frame.html) ----------
 * The reader's own shortcuts with their counts (saved, read later, unread notifications,
 * settings), then what today holds on the site (news, stories, the press review, the last
 * collection) and a way back to the top. A guest sees a sign-in link instead of the
 * notifications (footer.js, from hirhanyo-nav[data-authenticated]). Variants: with the article
 * to continue, icons only. Unscoped, so the gallery shows it outside the footer. */
.hq { container: quick-access / inline-size; border-bottom: 1px solid var(--color-border); background: var(--color-surface-elevated); }
.hq-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; min-height: 64px; padding-block: 10px; }
.hq-title { flex: none; margin: 0; color: var(--color-muted); font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .07em; white-space: nowrap; }
.hq-title .accent { color: var(--color-primary); }
.hq-links { display: flex; flex: 1 1 auto; align-items: center; gap: 4px; min-width: 0; }
.hq-link { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 2px; color: var(--color-text); font-size: 12px; font-weight: 600; white-space: nowrap; transition: background-color .16s ease, border-color .16s ease; }
.hq-link .icon { color: var(--color-primary); font-size: 16px; }
.hq-link:hover, .hq-link[aria-pressed="true"] { border-color: color-mix(in srgb, var(--color-primary) 40%, transparent); background: color-mix(in srgb, var(--color-primary) 8%, transparent); color: var(--color-primary); }
.hq-count { min-width: 18px; padding: 1px 5px; border: 1px solid var(--color-border); border-radius: 9px; color: var(--color-muted); font-family: var(--font-mono); font-size: 9px; font-weight: 600; line-height: 1.4; text-align: center; }
.hq-count.is-new { border-color: var(--color-primary); background: var(--color-primary); color: var(--accent-ink, var(--color-background)); }
.hq-link.hq-login { border-color: var(--color-border); color: var(--color-muted); font-weight: 500; }
.hq-link.hq-login strong { color: var(--color-primary); font-weight: 600; }
.hq-today { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 34px; padding-left: 18px; border-left: 1px solid var(--color-border); color: var(--color-muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; white-space: nowrap; }
.hq-live { display: inline-flex; align-items: center; gap: 6px; color: var(--color-primary); font-weight: 600; }
.hq-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 20%, transparent); }
.hq-stat { display: inline-flex; align-items: baseline; gap: 5px; color: var(--color-muted); }
.hq-stat strong { color: var(--color-text); font-size: 12px; font-weight: 600; }
.hq-stat .icon { align-self: center; color: var(--color-primary); font-size: 13px; }
a.hq-stat:hover, a.hq-stat:hover strong { color: var(--color-primary); }
.hq-top { display: grid; flex: none; place-items: center; width: 34px; height: 34px; margin-left: auto; border: 1px solid var(--color-border); border-radius: 2px; color: var(--color-muted); }
.hq-top .icon { font-size: 16px; }
.hq-top:hover { border-color: var(--color-primary); color: var(--color-primary); }
[data-guest-only][hidden], [data-auth-only][hidden] { display: none; }

/* Variant: the article to continue, before the shortcuts */
.hq-continue { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; max-width: 420px; padding: 6px 12px 6px 8px; border: 1px solid var(--color-border); border-left: 2px solid var(--color-primary); color: var(--color-text); }
.hq-continue .source-avatar { grid-row: span 2; width: 26px; height: 26px; }
.hq-continue small { color: var(--color-muted); font-family: var(--font-mono); font-size: 8px; letter-spacing: .06em; }
.hq-continue b { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hq-continue:hover b { color: var(--color-primary); }

/* Variant: icons only, the labels for screen readers and as tooltips */
.hq--icons .hq-link span:not(.hq-count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hq--icons .hq-link { padding: 0 8px; }

@container quick-access (max-width: 1240px) {
  .hq:not(.hq--icons) .hq-today { order: 3; flex-basis: 100%; padding: 8px 0 0; border-top: 1px solid var(--color-border); border-left: 0; }
  .hq-continue { max-width: none; flex: 1 1 100%; }
}

@container quick-access (max-width: 760px) {
  .hq-title { display: none; }
  .hq-links { flex: 1 1 0; overflow-x: auto; scrollbar-width: none; }
  .hq-links::-webkit-scrollbar { display: none; }
  .hq-link { flex: none; padding: 0 8px; font-size: 11px; }
  .hq-today { gap: 4px 12px; }
}
