/* Shared public navigation and footer, based on the restored homepage. */
:root {
  --header-height: 76px;
}
.navbar,
.site-footer {
  font-family: "Noto Sans TC", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
.site-footer .container-center {
  width: min(calc(100% - 80px), 1280px);
  margin-inline: auto;
}
.site-footer .brand-container h2 {
  font-family: "Noto Serif TC", serif;
  font-weight: 600;
  line-height: 1.28;
}
.site-footer .footer-grid h3 {
  font-weight: 600;
  line-height: 1.28;
}
.navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  display: flex;
  align-items: center;
  min-height: 92px;
  padding: 16px max(32px, 4vw);
  color: var(--white);
  transition:
    min-height 0.35s var(--ease),
    background 0.35s ease,
    box-shadow 0.35s ease;
}
.navbar.scrolled,
body:not(.page-index) .navbar {
  min-height: 76px;
  background: var(--ink);
  box-shadow: 0 1px 0 var(--line-light);
  /* This opaque header must not contain the fixed, full-viewport menu.
     backdrop-filter creates a containing block and clips it to header height. */
  backdrop-filter: none;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: var(--white);
  font-family: "Noto Serif TC", serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
}
.site-brand img {
  width: 42px;
  height: 34px;
  object-fit: contain;
  filter: none;
}
.site-brand span {
  color: var(--gold-light);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 34px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  position: relative;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--gold-light);
}
.nav-links a:not(.nav-cta)::after {
  position: absolute;
  right: 100%;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--gold);
  content: "";
  transition: right 0.25s var(--ease);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  right: 0;
}
.nav-links .nav-cta {
  padding: 9px 15px;
  border: 1px solid var(--gold);
  color: var(--gold-light);
}
.nav-links .nav-cta:hover {
  border-color: var(--gold-light);
  background: var(--gold-light);
  color: var(--ink);
}
.lang-switch {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
  margin-left: 18px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.lang-switch a {
  white-space: nowrap;
  padding: 6px 7px;
  color: var(--on-dark-muted);
  font-family: Inter, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s ease;
}
.lang-switch a:hover,
.lang-switch a[aria-current="page"] {
  color: var(--gold);
}
.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 11px 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 28px;
  height: 1px;
  margin: 6px auto;
  background: var(--white);
  transition: 0.3s ease;
}
.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.site-footer {
  padding: 44px 0 24px;
  background: var(--ink);
  color: var(--on-dark-muted);
  border-top: 1px solid var(--gold-dark);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) repeat(3, minmax(130px, 0.55fr));
  gap: 36px;
}
.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.brand-container h2 {
  margin: 0;
  color: var(--gold-light);
  font-size: 1.18rem;
  letter-spacing: 0.12em;
}
.footer-logo {
  width: 44px;
  height: 36px;
  object-fit: contain;
  filter: none;
}
.footer-address {
  max-width: 430px;
  font-size: 0.84rem;
  line-height: 1.8;
}
.footer-address a {
  color: inherit;
  text-decoration: none;
}
.footer-address {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
}
.footer-address > div {
  display: grid;
  grid-template-columns: minmax(70px, 0.65fr) minmax(0, 2fr);
  gap: 14px;
  align-items: baseline;
}
.footer-address dt {
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 500;
}
.footer-address dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.footer-address dd a {
  text-underline-offset: 4px;
}
.footer-address dd a:hover {
  text-decoration: underline;
}
.footer-grid h3 {
  margin-bottom: 12px;
  color: var(--white);
  font-family: Inter, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-grid li {
  margin-bottom: 6px;
}
.footer-grid a {
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-grid a:hover {
  color: var(--gold-light);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
  font-size: 0.72rem;
}
.footer-bottom p {
  margin: 0;
}
.footer-links {
  display: flex;
  gap: 22px;
}
.footer-links a {
  color: inherit;
  text-decoration: none;
}
@media (max-width: 1100px) {
  .navbar {
    padding-inline: 24px;
  }
  .nav-links {
    gap: 15px;
  }
  .nav-links a {
    font-size: 0.73rem;
  }
  .lang-switch {
    margin-left: 9px;
    padding-left: 8px;
  }
  .lang-switch a {
    padding-inline: 4px;
  }
  .footer-grid {
    grid-template-columns: 1.3fr repeat(3, 0.55fr);
    gap: 34px;
  }
}
@media (max-width: 860px) {
  .site-footer .container-center {
    width: min(calc(100% - 40px), 1280px);
  }
  .navbar {
    min-height: 76px;
  }
  .site-brand {
    order: 1;
  }
  .lang-switch {
    position: relative;
    z-index: 2;
    order: 2;
    margin-left: auto;
    margin-right: 8px;
  }
  .menu-toggle {
    display: block;
    position: relative;
    z-index: 2;
    order: 3;
  }
  .nav-links {
    order: 4;
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 80px 28px 32px;
    background: var(--ink);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease;
  }
  .nav-links.active {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .nav-links li {
    width: min(440px, 100%);
  }
  .nav-links a {
    display: block;
    padding: 13px 0;
    border-bottom: 1px solid var(--line-light);
    font-family: "Noto Serif TC", serif;
    font-size: 1.25rem;
  }
  .nav-links .nav-cta {
    margin-top: 12px;
    text-align: center;
  }
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-brand {
    grid-column: 1/-1;
  }
}
@media (max-width: 600px) {
  .site-footer .container-center {
    width: min(calc(100% - 28px), 1280px);
  }
  .navbar {
    padding-inline: 14px;
  }
  .site-brand {
    gap: 8px;
    font-size: 0.92rem;
  }
  .site-brand img {
    width: 36px;
    height: 30px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1/-1;
  }
  .footer-bottom {
    flex-direction: column;
    margin-top: 32px;
  }
}
.navbar :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold-light);
}
.navbar {
  background: var(--ink);
}
.page-index:not(.menu-open) .navbar:not(.scrolled) {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.nav-links a {
  color: var(--on-dark);
}
.nav-links a[aria-current="location"] {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 8px;
}
@media (max-width: 1200px) {
  .navbar {
    min-height: 76px;
  }
  .site-brand {
    position: relative;
    z-index: 2;
    order: 1;
  }
  .lang-switch {
    position: relative;
    z-index: 2;
    order: 2;
    margin-left: auto;
    margin-right: 8px;
  }
  .menu-toggle {
    display: block;
    position: relative;
    z-index: 2;
    order: 3;
  }
  .nav-links {
    order: 4;
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 80px 28px 32px;
    background: var(--ink);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease;
  }
  .nav-links.active {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .nav-links li {
    width: min(440px, 100%);
  }
  .nav-links a {
    display: block;
    padding: 13px 0;
    border-bottom: 1px solid var(--line-light);
    font-family: "Noto Serif TC", serif;
    font-size: 1.25rem;
  }
  .nav-links .nav-cta {
    margin-top: 12px;
    text-align: center;
  }
  .nav-links {
    justify-content: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
  }
  .nav-links.active {
    visibility: visible;
  }
}
/* Source-language labels remain readable within cards and article dialogs. */
.news-language-note { display: block; margin: 6px 0; font: 400 .8rem/1.5 "Noto Sans TC", sans-serif; color: var(--muted, #686b65); letter-spacing: 0; text-transform: none; white-space: normal; }
