/* Main site navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: 80px;
  padding-inline: max(3%, calc((100vw - 1440px) / 2));
  gap: clamp(12px, 2vw, 30px);
  background: #fffefa;
  border-bottom: 1px solid #dfeae3;
  box-shadow: none;
}
.topbar .brand {
  min-width: 174px;
}
.topbar .brand-wordmark-shell {
  width: 116px;
  height: 50px;
  border-radius: 12px;
}
.topbar .brand-wordmark-shell img { width: 108px; }
.topbar .brand small { font-size: 11px; }
.topbar .primary-nav {
  flex: 0 1 auto;
  min-width: 0;
  height: auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border: 1px solid #e1ebe3;
  border-radius: 18px;
  background: #f6f9f5;
  box-shadow: none;
}
.topbar .primary-nav > a,
.topbar .nav-create > summary {
  height: 43px;
  padding: 0 clamp(10px, 1.1vw, 18px);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #244d42;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.topbar .primary-nav > a:hover,
.topbar .nav-create > summary:hover {
  background: #e8f1e8;
  color: #075c4c;
}
.topbar .primary-nav > a.active,
.topbar .nav-create.active > summary,
.topbar .nav-create[open] > summary {
  background: #0b5c50;
  color: white;
  box-shadow: none;
}
.topbar .primary-nav > a.active::after { display: none; }
.topbar .primary-nav a:focus-visible,
.topbar .nav-create summary:focus-visible,
.topbar .social:focus-visible,
.mobile-nav a:focus-visible {
  outline: 3px solid #47ae9a;
  outline-offset: 3px;
}
.topbar .nav-create { position: relative; }
.topbar .nav-create > summary { cursor: pointer; list-style: none; }
.topbar .nav-create > summary::-webkit-details-marker { display: none; }
.nav-chevron { width: 7px; height: 7px; flex: none; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.nav-create[open] .nav-chevron { transform: translateY(2px) rotate(225deg); }
.topbar .nav-create-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  z-index: 90;
  width: 310px;
  padding: 12px;
  border: 1px solid #dce9df;
  border-radius: 19px;
  background: #fffefa;
  box-shadow: none;
}
.topbar .nav-create-menu::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 34px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-top: 1px solid #dce9df;
  border-left: 1px solid #dce9df;
  background: #fffefa;
}
.nav-menu-label {
  display: block;
  padding: 4px 9px 11px;
  color: #7e9184;
  font-size: 11px;
  font-weight: 600;
}
.topbar .nav-create-menu a {
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 13px;
  color: #214b3d;
}
.topbar .nav-create-menu a:hover,
.topbar .nav-create-menu a[aria-current="page"] { background: #ebf6ed; }
.nav-menu-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #e0f1e6;
  color: #0b7460;
  font-size: 22px;
}
.topbar .nav-create-menu a strong,
.topbar .nav-create-menu a small { display: block; }
.topbar .nav-create-menu a strong { font-size: 13px; }
.topbar .nav-create-menu a small { color: #7a8e80; font-size: 11px; font-weight: 400; margin-top: 2px; }
.nav-menu-arrow { margin-inline-start: auto; color: #82a999; font-size: 18px; }
.topbar .social {
  flex: 0 0 auto;
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid #a9d2bf;
  border-radius: 13px;
  background: #e9f6ec;
  color: #0a6350;
  font-size: 13px;
  transition: transform .2s ease, background .2s ease;
}
.topbar .social:hover { transform: translateY(-2px); background: #d9efe0; }
@media (max-width: 1120px) {
  .topbar { padding-inline: 2%; gap: 10px; }
  .topbar .primary-nav > a,
  .topbar .nav-create > summary { padding-inline: 10px; font-size: 13px; }
  .topbar .social { padding-inline: 10px; }
}
@media (max-width: 960px) {
  .topbar .social { display: none; }
  .topbar { justify-content: space-between; }
}
@media (max-width: 820px) {
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .topbar { position: relative; height: 66px; justify-content: center; padding: 8px 4%; }
  .topbar .brand { min-width: 0; margin: auto; }
  .topbar .brand-wordmark-shell { width: 112px; height: 48px; }
  .topbar .brand-wordmark-shell img { width: 103px; }
  .topbar .primary-nav,
  .topbar .social { display: none !important; }
  .mobile-nav,
  body[data-page="home"] .mobile-nav,
  body[data-page="prayer"] .mobile-nav {
    position: fixed;
    z-index: 100;
    right: 10px;
    left: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-width: 720px;
    margin-inline: auto;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 6px;
    overflow: visible;
    border: 1px solid #d1e5d9;
    border-radius: 20px;
    background: #fffefa;
    box-shadow: none;
  }
  .mobile-nav a {
    min-width: 0;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 4px 1px;
    border-radius: 14px;
    color: #637c6b;
    text-align: center;
    font-size: 10px;
    line-height: 1.35;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
  }
  .mobile-nav a span { font-size: 21px; line-height: 1.1; }
  .mobile-nav a:hover { background: #ecf5ed; color: #0b6655; }
  .mobile-nav a.active { background: #0b5c50; color: #fff; font-weight: 700; }
}
@media (max-width: 360px) {
  .mobile-nav { right: 5px; left: 5px; gap: 0; padding: 5px 3px; }
  .mobile-nav a { font-size: 9px; }
  .mobile-nav a span { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar .primary-nav > a,
  .topbar .nav-create > summary,
  .topbar .social,
  .mobile-nav a,
  .nav-chevron { transition: none; }
}
