/* =====================================================================
   Top bar · centred classic masthead
   Row 1: language on the start side, logo and name centred, Donate on the end side.
   Row 2: the page links, centred in one line, separated by small dots.
   Phones (760px and below): one row with a menu button and a dropdown list.
   ===================================================================== */
.topbar {
  border-bottom: 1px solid #e3d8e8;
  background: color-mix(in srgb, var(--cream) 90%, transparent);
}
.topbar.is-scrolled { box-shadow: 0 8px 26px #3d2e4214; }

/* Logo badge */
.topbar .brand { gap: 12px; letter-spacing: -.02em; }
.topbar .brand-mark {
  width: 44px;
  height: 44px;
  padding: 7px;
  border-radius: 50%;
  background: var(--sun-soft, #fcefc4);
  color: var(--deep);
  stroke-width: 2.2;
  box-shadow: inset 0 0 0 1px #f0dc9e;
  transition: width 300ms, height 300ms, padding 300ms;
}

/* Language: a quiet text button with a globe */
.topbar .lang-btn {
  height: 40px;
  padding: 0 4px;
  gap: 7px;
  background: transparent;
  color: var(--deep);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  border-radius: 0;
}
.topbar .lang-btn .ico { width: 17px; height: 17px; }
.topbar .lang-btn:hover { color: var(--plum); border-bottom-color: currentColor; }
.topbar .support-link { height: 40px; padding: 0 18px; gap: 8px; font-size: 14px; }

/* ------------------------------------------------------------ Wide screens */
@media (min-width: 761px) {
  .topbar .nav-wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
      "lang brand actions"
      "nav  nav   nav";
    align-items: center;
    gap: 0 16px;
    min-height: 0;
    padding-top: 14px;
    transition: padding 300ms;
  }
  .topbar .lang-btn { grid-area: lang; justify-self: start; }
  .topbar .brand { grid-area: brand; justify-self: center; font-size: 32px; transition: font-size 300ms; }
  .topbar .nav-actions { grid-area: actions; justify-self: end; gap: 10px; }
  .topbar .menu-btn { display: none; }

  .topbar .nav-links {
    grid-area: nav;
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid #e8dfeb;
  }
  .topbar .nav-links a {
    position: relative;
    padding: 13px 22px 14px;
    color: #4a3d50;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  [dir="rtl"] .topbar .nav-links a { font-size: 15px; letter-spacing: 0; font-weight: 600; }
  .topbar .nav-links a:hover { color: var(--plum); }
  .topbar .nav-links a[aria-current="page"] { color: var(--deep); }
  /* Small dot between links */
  .topbar .nav-links a + a::before {
    content: "";
    position: absolute;
    inset-inline-start: -2px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: #d3c3d9;
  }
  /* Short yellow line under the current page */
  .topbar .nav-links a::after {
    inset-inline: 22px;
    bottom: 7px;
    height: 2px;
    border-radius: 2px;
    background: var(--sun-strong, var(--plum));
    transform-origin: center;
  }
  [dir="rtl"] .topbar .nav-links a::after { transform-origin: center; }

  /* After scrolling, the masthead slims down to save space. */
  .topbar.is-scrolled .nav-wrap { padding-top: 8px; }
  .topbar.is-scrolled .brand { font-size: 25px; }
  .topbar.is-scrolled .brand-mark { width: 36px; height: 36px; padding: 5px; }
  .topbar.is-scrolled .nav-links { margin-top: 8px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .topbar .nav-links a { padding-inline: 14px; letter-spacing: .08em; }
  .topbar .nav-links a::after { inset-inline: 14px; }
  .topbar .brand { font-size: 28px; }
}

/* ----------------------------------------------------------------- Phones */
@media (max-width: 760px) {
  .topbar .nav-wrap {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "brand lang actions";
    align-items: center;
    gap: 8px;
    min-height: 64px;
  }
  .topbar .brand { grid-area: brand; font-size: 21px; gap: 8px; min-width: 0; }
  .topbar .brand-mark { width: 34px; height: 34px; padding: 5px; }
  .topbar .lang-btn { grid-area: lang; height: 44px; padding: 0 8px; }
  .topbar .nav-actions { grid-area: actions; gap: 8px; }
  .topbar .support-link { height: 44px; padding: 0 14px; }
  .topbar .menu-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    border: 1px solid #dccfe2;
    border-radius: 12px;
    background: #ffffffa8;
    color: var(--deep);
  }
  .topbar .menu-btn[aria-expanded="true"] { background: var(--lavender); border-color: #b99cc3; }

  .topbar .nav-links {
    padding: 6px 19px 14px;
    background: var(--paper);
    border-bottom: 1px solid #e6dcea;
    box-shadow: 0 18px 30px #3d2e4214;
  }
  .topbar .nav-links.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .topbar .nav-links.is-open a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 4px;
    border-bottom: 1px solid #efe6f1;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
  }
  .topbar .nav-links.is-open a:last-child { border-bottom: 0; }
  .topbar .nav-links.is-open a::before { display: none; }
  .topbar .nav-links.is-open a::after {
    content: "";
    width: 8px;
    height: 8px;
    border: solid #b6a3bd;
    border-width: 2px 2px 0 0;
    rotate: 45deg;
  }
  [dir="rtl"] .topbar .nav-links.is-open a::after { rotate: -135deg; }
}
@media (max-width: 420px) {
  .topbar .brand { font-size: 18px; }
  .topbar .brand-mark { width: 30px; height: 30px; padding: 4px; }
  .topbar .lang-btn .ico { display: none; }
  .topbar .support-link { padding: 0 11px; }
  .topbar .support-link .ico { display: none; }
}
@media (max-width: 380px) { .topbar .nav-links { padding-inline: 15px; } }

/* The masthead is taller, so jumps to a spot on a page leave more room above it. */
@media (min-width: 761px) {
  html { scroll-padding-top: 150px; }
  .request-aside { top: 150px; }
}

/* Buttons in the header stay still on hover (no lift), so the pointer never slips
   off their edge and makes them flicker. The colour and glow still change. */
.topbar :is(.support-link, .lang-btn, .menu-btn, .brand),
.topbar :is(.support-link, .lang-btn, .menu-btn, .brand):hover { translate: none; transform: none; }
.topbar { overflow-anchor: none; }

/* Narrow tablets: the longer page names still fit on one line. */
@media (min-width: 761px) and (max-width: 1000px) {
  .topbar .nav-links a { padding-inline: 9px; font-size: 11.5px; letter-spacing: .04em; }
  .topbar .nav-links a::after { inset-inline: 9px; }
  [dir="rtl"] .topbar .nav-links a { font-size: 14.5px; padding-inline: 11px; }
}

/* Phone menu: the words take turns, golden yellow then violet.
   Every line between rows is violet. Rows keep the plain background. */
@media (max-width: 760px) {
  .topbar .nav-links.is-open a {
    border-bottom: 2px solid #b99cc3;
    color: #a8780c;            /* golden yellow, dark enough to read on the light menu */
  }
  .topbar .nav-links.is-open a:nth-child(even) { color: var(--plum, #6d4a7c); }
  .topbar .nav-links.is-open a:last-child { border-bottom: 0; }
  .topbar .nav-links.is-open a::after { border-color: #a8780c; }
  .topbar .nav-links.is-open a:nth-child(even)::after { border-color: var(--plum, #6d4a7c); }
  .topbar .nav-links.is-open a[aria-current="page"] { font-weight: 800; }
}

/* The heart-and-hands logo: shown as it is, without the round badge behind it. */
.brand .brand-logo {
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  object-fit: contain;
}
@media (min-width: 761px) {
  .topbar .brand .brand-logo { width: 52px; height: 52px; }
  .topbar.is-scrolled .brand .brand-logo { width: 42px; height: 42px; padding: 0; }
}
@media (max-width: 760px) { .topbar .brand .brand-logo { width: 40px; height: 40px; padding: 0; } }
@media (max-width: 420px) { .topbar .brand .brand-logo { width: 36px; height: 36px; } }
footer .brand .brand-logo { width: 44px; height: 44px; }

/* ---------------------------------------------------------------- Brand name
   "From The Heart" in Fraunces, a soft, warm serif that stays clear at small sizes;
   "من القلب" in Aref Ruqaa calligraphy. */
.brand > span {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -.005em;
}
[dir="rtl"] .brand > span {
  font-family: "Aref Ruqaa", "Noto Naskh Arabic", serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

/* ---------------------------------------------------------------- Footer
   One centred block across the full width: logo and name, motto, tagline. */
footer .footer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: 44px 30px;
}
footer .footer-brand { display: flex; flex-direction: column; align-items: center; width: 100%; }
footer .footer-brand .brand { font-size: 30px; gap: 12px; }
footer .brand .brand-logo { width: 56px; height: 56px; }
footer .footer-tagline { max-width: none; margin-inline: auto; }
footer .footer-motto { margin-top: 14px; font-size: 17px; }
footer .footer-tagline:not(.footer-motto) { margin-top: 4px; font-size: 15px; }
[dir="rtl"] footer .footer-motto { font-size: 18px; }
@media (max-width: 670px) {
  footer .footer-wrap { padding-block: 34px 22px; }
  footer .footer-brand .brand { font-size: 26px; }
  footer .footer-motto { font-size: 15.5px; }
}

/* The logo never gets the old round yellow badge, on any screen size. */
.brand-mark.brand-logo,
.topbar .brand-mark.brand-logo,
footer .brand-mark.brand-logo {
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
