/* ─── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 243, 236, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-900);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  height: 40px;
  width: auto;
}

.primary-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.primary-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-900);
  opacity: 0.85;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.primary-nav a.is-active {
  opacity: 1;
  color: var(--ochre-600);
  border-bottom-color: var(--ochre-500);
}
.nav-divider {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--rule);
}
.search-btn {
  background: transparent;
  border: 0;
  color: var(--ink-900);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.7;
  padding: 0;
}
.search-btn kbd,
.search-btn .kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.lang-toggle {
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-900);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.lang-toggle .ar {
  font-family: "IBM Plex Sans Arabic", serif;
}
.lang-toggle .dim {
  opacity: 0.3;
}
.lang-toggle .inactive {
  opacity: 0.4;
}

.nav-mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Mobile nav is hidden at ALL viewports by default; only opens when
   .is-open is toggled by the menu button (and the button itself only
   shows at narrow widths). */
.mobile-nav {
  display: none;
  padding: 16px 0 28px;
  border-top: 1px solid var(--rule);
}
.mobile-nav.is-open {
  display: block;
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.mobile-nav a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-900);
}

@media (max-width: 880px) {
  .primary-nav {
    display: none;
  }
  .nav-mobile-toggle {
    display: inline-flex;
  }
}

/* Reading progress hairline */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100;
  pointer-events: none;
}
.reading-progress__bar {
  height: 100%;
  width: 0;
  background: var(--terracotta-600);
  transition: width 0.1s linear;
}

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 32, 28, 0.28);
  z-index: 100;
  display: none;
  justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(3px);
}
.search-overlay.is-open {
  display: flex;
}
.search-overlay__panel {
  width: min(640px, 92vw);
  background: var(--ivory-50);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--rule);
  overflow: hidden;
  align-self: flex-start;
}
.search-overlay__input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
}
.search-overlay input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink-900);
}
.search-overlay__esc {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.6;
  padding: 3px 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.search-overlay__results {
  max-height: 360px;
  overflow: auto;
}
.search-overlay__results .row {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.search-overlay__results .row:hover {
  background: var(--sand-100);
}
.search-overlay__results .row .title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-900);
}
.search-overlay__results .row .date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  align-self: center;
}

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--ink-900);
  color: var(--ivory-50);
  padding-top: 72px;
  padding-bottom: 36px;
}
.site-footer a {
  color: var(--ivory-50);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(239, 231, 214, 0.14);
}
.site-footer__subscribe h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 12px;
  line-height: 1.25;
}
.site-footer__subscribe p {
  font-size: 14px;
  color: rgba(239, 231, 214, 0.7);
  margin: 0 0 18px;
}
.site-footer__form {
  display: flex;
  gap: 6px;
  background: rgba(239, 231, 214, 0.06);
  border: 1px solid rgba(239, 231, 214, 0.16);
  border-radius: 999px;
  padding: 4px;
  max-width: 380px;
}
.site-footer__form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ivory-50);
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.site-footer__form input::placeholder {
  color: rgba(239, 231, 214, 0.5);
}
.site-footer__disclaimer {
  font-size: 12px;
  color: rgba(239, 231, 214, 0.5);
  margin: 12px 0 0;
}

.footer-col .eyebrow {
  color: rgba(239, 231, 214, 0.5);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.footer-col a {
  font-size: 14px;
  color: rgba(239, 231, 214, 0.85);
}
.footer-col a:hover {
  color: var(--ochre-500);
}

.site-footer__bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer__bottom .left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-footer__bottom .left img {
  height: 22px;
  filter: brightness(0) invert(1) opacity(0.94);
}
.site-footer__bottom .copy {
  font-size: 12px;
  color: rgba(239, 231, 214, 0.5);
}
.site-footer__bottom .legal {
  display: flex;
  gap: 22px;
  font-size: 12px;
  color: rgba(239, 231, 214, 0.55);
}

@media (max-width: 880px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .site-footer__bottom .legal {
    flex-wrap: wrap;
    gap: 14px 22px;
  }
}

/* Placeholder links — href="#" anchors are visually demoted and click-inert.
   Applied by scripts/home.js to any <a href="#"> on site-1 pages. */
a.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: auto; /* keep tooltip; click is preventDefault'd in JS */
}
a.is-disabled:hover,
a.is-disabled:focus {
  color: inherit !important;
  border-bottom-color: inherit !important;
  text-decoration: none !important;
}
