/* Shkula Charity Foundation – public styles (CMS) */
:root {
  /**
   * Brand palette (reference):
   *   Green #2EA347 — primary brand
   *   Red   #D91F23 — secondary / donate CTA
   *   Gold  #E3CB37 — accent (borders, focus, small highlights)
   */
  --color-primary: #2d7a4f;
  --color-primary-hover: #1f6440;
  --color-primary-dark: #1a5c3e;
  --color-secondary: #c6a43f;
  --color-secondary-hover: #ac8e34;
  --color-accent: #d4b85c;

  --color-text: #2c2c2c;
  --color-text-muted: #5a5a5a;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7f6;
  --color-border: #e0e5e3;
  --font-sans: 'Poppins', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Dari/Pashto use Arabic script; Source Sans 3 has no glyphs (shows “?”). */
  --font-arabic: 'Vazirmatn', 'Noto Naskh Arabic', 'Noto Sans Arabic', Tahoma, 'Arial Unicode MS', sans-serif;
  --header-height: 72px;
  --container: min(1200px, 100% - 2rem);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.container {
  width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-donate { background: var(--color-secondary); color: #fff; white-space: nowrap; }
.btn-donate:hover { background: var(--color-secondary-hover); text-decoration: none; }
.btn-hero {
  background: var(--color-primary);
  color: #fff;
  padding: 0.85rem 2rem;
  margin-top: 1rem;
}
.btn-hero:hover { background: var(--color-primary-hover); text-decoration: none; }

.topbar {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  padding: 0.5rem 0;
  border-bottom: 3px solid var(--color-accent);
}
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.topbar a { color: inherit; }
.topbar a:hover { text-decoration: underline; }

/* Single public link to CMS (compact fixed pill — blends with page bg) */
.admin-login-fab {
  position: fixed;
  bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  right: max(0.65rem, env(safe-area-inset-right, 0px));
  z-index: 99999;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--color-text-muted) !important;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  line-height: 1.2;
}
.admin-login-fab:hover {
  color: var(--color-primary) !important;
  background: var(--color-bg-alt);
  border-color: var(--color-border);
  text-decoration: none;
}
[dir="rtl"] .admin-login-fab {
  right: auto;
  left: max(0.65rem, env(safe-area-inset-left, 0px));
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: var(--shadow);
  min-height: var(--header-height);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto auto;
  grid-template-areas:
    "logo gap lang cta"
    "nav nav nav nav";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.55rem;
  min-height: var(--header-height);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
.nav {
  grid-area: nav;
  width: 100%;
  min-width: 0;
}
.header-actions {
  grid-area: lang;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.btn-donate {
  grid-area: cta;
  justify-self: end;
  align-self: center;
}
.lang-switcher {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}
.lang-switcher__link {
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border: 1px solid transparent;
}
.lang-switcher__link:hover {
  color: var(--color-primary);
  text-decoration: none;
  border-color: var(--color-border);
}
.lang-switcher__link.is-active {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}
/* Arabic-script labels must use Noto on LTR (e.g. English) pages; RTL block alone is not enough */
.lang-switcher__link:lang(fa),
.lang-switcher__link:lang(ps) {
  font-family: var(--font-arabic);
}
.topbar-address { max-width: 100%; }
.logo {
  grid-area: logo;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  max-width: min(340px, 36vw);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.logo:hover { text-decoration: none; }
.logo__img {
  display: block;
  height: clamp(2rem, 5vw, 2.75rem);
  width: auto;
  max-width: min(200px, 45vw);
  object-fit: contain;
  object-position: left center;
}
[dir="rtl"] .logo__img { object-position: right center; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-list > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.2;
  transition: background-color .2s ease, color .2s ease;
}
.nav-list > li > a:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
  text-decoration: none;
}

/* Hero + slider */
.hero {
  position: relative;
  min-height: 420px;
  background: linear-gradient(180deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s;
  background-size: cover;
  background-position: center;
}
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(24, 89, 40, 0.72);
  z-index: 0;
}
.hero-slide .hero-content { position: relative; z-index: 1; }
.hero-content { text-align: center; padding: 2rem; max-width: 800px; }
.hero-content h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
}
.hero-slogan {
  margin: 0.5rem 0 1rem;
  font-size: 1.35rem;
  font-weight: 600;
  opacity: 0.95;
}
.hero-intro {
  max-width: 680px;
  margin: 0 auto 0.75rem;
  font-size: 1.05rem;
  line-height: 1.65;
}
.hero-content .btn-hero { background: #fff; color: var(--color-primary); }
.hero-content .btn-hero:hover { background: #f2f2f2; color: var(--color-primary-hover); }

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-nav:hover { background: rgba(255,255,255,0.35); }
.hero-nav-prev { left: 1rem; }
.hero-nav-next { right: 1rem; }

.hero-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 3;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.dot.active, .dot:hover { background: #fff; border-color: #fff; }

.section { padding: 3rem 0; }
.section-label {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}
.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-text);
}
.about-meta { margin: 0 0 1rem; padding: 0; }
.about-meta dt { font-weight: 600; color: var(--color-primary); margin-top: 0.5rem; }
.about-meta dt:first-child { margin-top: 0; }
.about-meta dd { margin: 0.15rem 0 0; color: var(--color-text-muted); }
.about-text { max-width: 720px; margin: 0 0 1rem; color: var(--color-text-muted); }
.subsection-title {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.2rem;
  color: var(--color-primary);
}
.objectives-list, .activities-list {
  margin: 0 0 0 1.25rem;
  padding: 0;
  max-width: 720px;
}
.objectives-list li, .activities-list li { margin-bottom: 0.4rem; }

/* Board Members – responsive grid, compact portrait cards */
.board-section {
  background: linear-gradient(180deg, #fff 0%, var(--color-bg-alt) 40%, var(--color-bg-alt) 100%);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}
.board-section__container { max-width: min(1180px, 100%); }
.board-section__header {
  max-width: 42rem;
  margin-bottom: 2.25rem;
}
.board-section__eyebrow { margin-bottom: 0.35rem; }
.board-section__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.board-section__lede {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.board-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 560px) {
  .board-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (min-width: 1024px) {
  .board-grid { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
}

.board-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .board-card:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(46, 163, 71, 0.08);
    border-color: rgba(46, 163, 71, 0.25);
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .board-card { transition: none; }
  .board-card:hover { transform: none; }
}

/* Portrait frame: fixed heights, crop from bottom — keep head/face visible (never center vertically) */
.board-card__media {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: 220px;
  background: linear-gradient(160deg, #e8f0eb 0%, var(--color-bg-alt) 100%);
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}
@media (min-width: 577px) {
  .board-card__media { height: 260px; }
}
@media (min-width: 993px) {
  .board-card__media { height: 320px; }
}
.board-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* horizontal center, vertical top → cropping removes bottom first, not forehead */
  object-position: center top;
  display: block;
}
.board-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
}
.board-card__placeholder-icon {
  font-size: 2.25rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 700;
  line-height: 1;
}

.board-card__body {
  padding: 1.15rem 1.2rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}
.board-card__name {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.board-card__role {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  line-height: 1.35;
}

.board-card__bio {
  margin: 0 0 0.75rem;
  flex: 1;
  min-height: 0;
}
.board-card__bio-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.board-card__more {
  margin: 0.45rem 0 0;
  border: 0;
  padding: 0;
}
.board-card__more-btn {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.board-card__more-btn::-webkit-details-marker { display: none; }
.board-card__more-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  transition: transform 0.2s ease;
}
.board-card__more[open] .board-card__more-btn::after {
  transform: rotate(180deg);
}
.board-card__bio-full {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.board-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.35rem;
}
.board-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: rgba(46, 163, 71, 0.08);
  border: 1px solid rgba(46, 163, 71, 0.18);
  font-size: 0.75rem;
  line-height: 1.3;
}
.board-chip--muted {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}
.board-chip__label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-size: 0.65rem;
}
.board-chip__value {
  color: var(--color-text);
  word-break: break-word;
}

.board-fallback {
  max-width: 640px;
  margin-top: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: var(--radius);
  border-left: 4px solid var(--color-primary);
  box-shadow: var(--shadow);
  color: var(--color-text-muted);
}
.board-fallback p { margin: 0; line-height: 1.6; }

.projects-section {
  background: var(--color-bg-alt);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.page-subtitle {
  margin: 0.35rem 0 0.8rem;
  color: var(--color-text-muted);
}
.projects-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}
.projects-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(46, 163, 71, 0.11);
  border: 1px solid rgba(46, 163, 71, 0.22);
}
.btn-sm-inline {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}
.empty-state {
  padding: 1rem;
  border: 1px dashed var(--color-border);
  border-radius: 10px;
  color: var(--color-text-muted);
  background: #fff;
}
.project-card-placeholder {
  height: 200px;
  background: #e8e8e8;
}
.project-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
}
.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #e8e8e8;
}
.project-card-body { padding: 1.25rem; }
.project-card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; color: var(--color-primary); }
.project-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.project-summary { font-size: 0.95rem; color: var(--color-text-muted); margin: 0 0 0.75rem; }
.project-desc { font-size: 0.95rem; color: var(--color-text); margin: 0; white-space: pre-wrap; }
.project-card-media {
  display: block;
  text-decoration: none;
}
.project-card-media:hover { text-decoration: none; }
.project-card h3 a {
  color: var(--color-primary);
  text-decoration: none;
}
.project-card h3 a:hover { text-decoration: underline; }
.project-card-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  text-decoration: none;
}
.project-card-link:hover { text-decoration: underline; }
.activities-projects-note {
  margin-top: 1.25rem;
  text-align: center;
}
.activity-card--text .activity-image .project-card-placeholder {
  min-height: 120px;
}

.project-detail-page {
  background: var(--color-bg-alt);
}
.project-detail-breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.project-detail-breadcrumb a {
  color: var(--color-primary);
  font-weight: 600;
}
.project-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}
.project-detail-hero {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.project-detail-hero img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}
.project-detail-intro h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-primary);
}
.project-detail-meta { margin-bottom: 0.75rem; }
.project-detail-summary {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0 0 1rem;
}
.project-detail-description {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--color-text);
}
.project-detail-gallery {
  margin-bottom: 2rem;
}
.project-detail-gallery h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--color-primary);
}
.project-detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}
.project-detail-gallery-item {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-detail-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  text-decoration: none;
}
.project-detail-gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.project-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
@media (max-width: 768px) {
  .project-detail-header {
    grid-template-columns: 1fr;
  }
  .project-detail-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: var(--shadow);
}
.gallery-item a {
  display: block;
}
.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.gallery-item:hover img {
  transform: scale(1.02);
}
.gallery-caption {
  padding: 0.85rem 1rem 1rem;
}
.gallery-caption h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--color-primary);
}
.project-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.project-gallery img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
}

.contact-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.contact-block p { margin: 0; color: var(--color-text-muted); }
.contact-block strong { color: var(--color-text); display: block; margin-bottom: 0.25rem; }
.contact-section { background: var(--color-bg-alt); }

.supporters-page .supporter-body {
  margin-top: 0.5rem;
  color: var(--color-text);
  line-height: 1.75;
  font-size: 0.98rem;
}
.supporters-page .supporter-external-wrap {
  margin: 1.25rem 0 0;
}
.supporters-page .supporter-external-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: #fff;
}
.supporters-page .supporter-external-link:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.mission {
  text-align: center;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
}
.mission h2 { color: inherit; }
.mission-text { max-width: 600px; margin: 0 auto 1.5rem; font-size: 1.1rem; }
.mission .btn-hero { background: #fff; color: var(--color-primary); }
.mission .btn-hero:hover { background: #f2f2f2; color: var(--color-primary-hover); }

.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.9);
  padding: 2rem 0 0;
}
.footer a { color: inherit; }
.footer a:hover { text-decoration: underline; }
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.footer h4 { margin: 0 0 0.75rem; font-size: 1rem; color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer ul li { margin-bottom: 0.35rem; }
.footer-contact p { margin: 0 0 0.35rem; font-size: 0.95rem; }
.footer-bottom { padding: 1rem 0; }
.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1.25rem;
}
.footer-copyright {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
  text-align: center;
}

/* Fixed bottom tab bar (mobile) */
.mobile-tab-bar {
  display: none;
}

.has-mobile-tab-bar {
  --mobile-tab-height: 3.85rem;
}

@media (max-width: 900px) {
  .has-mobile-tab-bar {
    padding-bottom: calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px));
  }
  .has-mobile-tab-bar .admin-login-fab {
    bottom: calc(var(--mobile-tab-height) + 0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .mobile-tab-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    min-height: var(--mobile-tab-height);
    padding: 0.3rem 0 calc(0.3rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
  }
  .mobile-tab-bar__scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.15rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 0.35rem;
  }
  .mobile-tab-bar__scroll::-webkit-scrollbar {
    display: none;
  }
  .mobile-tab-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    flex: 0 0 auto;
    min-width: 4.1rem;
    max-width: 5.75rem;
    padding: 0.28rem 0.35rem;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1.15;
    text-decoration: none;
    cursor: pointer;
    border-radius: 10px;
  }
  .mobile-tab-bar__item.is-active {
    color: var(--color-primary);
    background: var(--color-bg-alt);
  }
  .mobile-tab-bar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
  }
  .mobile-tab-bar__label {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }
  .mobile-tab-bar__item--lang {
    min-width: 3.5rem;
  }
  .mobile-nav-sheet {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
  }
  .mobile-nav-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .mobile-nav-sheet__panel {
    position: relative;
    width: min(100%, 480px);
    max-height: min(78vh, 560px);
    overflow: auto;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.28s ease;
    pointer-events: auto;
  }
  .mobile-nav-sheet.is-open {
    pointer-events: auto;
  }
  .mobile-nav-sheet.is-open .mobile-nav-sheet__backdrop {
    opacity: 1;
  }
  .mobile-nav-sheet.is-open .mobile-nav-sheet__panel {
    transform: translateY(0);
  }
  body.mobile-nav-sheet-open {
    overflow: hidden;
  }
  .mobile-nav-sheet__handle {
    width: 40px;
    height: 4px;
    margin: 0 auto 0.75rem;
    border-radius: 999px;
    background: var(--color-border);
  }
  .mobile-nav-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
  .mobile-nav-sheet__head h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--color-primary);
  }
  .mobile-nav-sheet__close {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: var(--color-bg-alt);
    color: var(--color-text);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }
  .mobile-nav-sheet__links {
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0;
  }
  .mobile-nav-sheet__links a {
    display: block;
    padding: 0.65rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
    color: var(--color-text);
  }
  .mobile-nav-sheet__links a:hover {
    background: var(--color-bg-alt);
    text-decoration: none;
  }
  .mobile-nav-sheet__lang {
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
  }
  .mobile-nav-sheet__cta {
    display: block;
    width: 100%;
    text-align: center;
  }
  .topbar {
    font-size: 0.78rem;
    padding: 0.4rem 0;
  }
  .topbar-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.3rem;
  }
  .topbar-address {
    line-height: 1.45;
  }
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo cta";
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .logo {
    grid-area: logo;
    max-width: 100%;
    min-width: 0;
    align-self: center;
  }
  .logo__text {
    display: none;
  }
  .logo__img {
    height: 2.35rem;
    max-width: min(150px, 42vw);
  }
  .header .nav {
    display: none !important;
  }
  .header-actions {
    display: none !important;
  }
  .nav-toggle {
    display: none !important;
  }
  .btn-donate {
    grid-area: cta;
    justify-self: end;
    align-self: center;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    line-height: 1.2;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 480px) {
  .btn-donate {
    max-width: 7.25rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.72rem;
  }
  .logo__img {
    height: 2.1rem;
    max-width: min(130px, 38vw);
  }
}
@media (max-width: 600px) {
  .hero { min-height: 360px; }
  .section { padding: 2rem 0; }
  .hero-nav { width: 36px; height: 36px; font-size: 1.2rem; }
  .projects-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .gallery-item img {
    height: 190px;
  }
}

/*
 * Phone/email on fa/ps: bidi must apply on the <a>, not only an inner span (WebKit/Firefox RTL).
 * html_ltr() adds LRI+LRM+PDI around the text; bidi-override on the anchor locks + and digit order.
 */
a.contact-link--ltr.phone-ltr,
a.contact-link--ltr.email-ltr {
  direction: ltr;
  unicode-bidi: bidi-override;
  display: inline-block;
  text-align: left;
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[dir="rtl"] a.contact-link--ltr.phone-ltr,
html[dir="rtl"] a.contact-link--ltr.email-ltr {
  direction: ltr;
  unicode-bidi: bidi-override;
}

.url-ltr,
.contact-value--ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  text-align: left;
}

[dir="rtl"] .url-ltr,
[dir="rtl"] .contact-value--ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Footer line with multiple numbers + neutral separator: keep whole row LTR */
.footer-phones-row {
  direction: ltr;
  unicode-bidi: isolate;
}

/* RTL (Dari / Pashto) */
html[dir="rtl"] {
  --font-sans: var(--font-arabic);
}
html[lang="fa"],
html[lang="ps"] {
  --font-sans: var(--font-arabic);
}
html[dir="rtl"] body,
html[dir="rtl"] .btn,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  font-family: var(--font-arabic);
}
html[lang="fa"] body,
html[lang="fa"] .btn,
html[lang="fa"] input,
html[lang="fa"] textarea,
html[lang="fa"] select,
html[lang="ps"] body,
html[lang="ps"] .btn,
html[lang="ps"] input,
html[lang="ps"] textarea,
html[lang="ps"] select {
  font-family: var(--font-arabic);
}

@media (max-width: 900px) {
  [dir="rtl"] .header-inner {
    flex-direction: row-reverse;
  }
}
[dir="rtl"] .topbar-inner {
  flex-direction: row-reverse;
}
[dir="rtl"] .nav-list {
  flex-direction: row-reverse;
}
@media (max-width: 900px) {
  [dir="rtl"] .nav-list {
    flex-direction: column;
  }
}
[dir="rtl"] .lang-switcher {
  flex-direction: row-reverse;
}
[dir="rtl"] .hero-nav-prev {
  left: auto;
  right: 1rem;
}
[dir="rtl"] .hero-nav-next {
  right: auto;
  left: 1rem;
}
[dir="rtl"] .about-meta dt,
[dir="rtl"] .about-meta dd,
[dir="rtl"] .board-card__body,
[dir="rtl"] .board-section__header,
[dir="rtl"] .board-chip,
[dir="rtl"] .project-card-body,
[dir="rtl"] .contact-block p,
[dir="rtl"] .footer-inner {
  text-align: right;
}
[dir="rtl"] .board-chip {
  align-items: flex-end;
}
[dir="rtl"] .board-card__chips {
  justify-content: flex-end;
}
[dir="rtl"] .board-card__more-btn {
  flex-direction: row-reverse;
}
[dir="rtl"] .board-card__more-btn::after {
  transform: scaleX(-1);
}
[dir="rtl"] .board-card__more[open] .board-card__more-btn::after {
  transform: scaleX(-1) rotate(180deg);
}
[dir="rtl"] .hero-content {
  text-align: center;
}
[dir="rtl"] .mission {
  text-align: center;
}
[dir="rtl"] .objectives-list,
[dir="rtl"] .activities-list {
  margin-right: 1.25rem;
  margin-left: 0;
}
[dir="rtl"] .footer-copyright {
  text-align: center;
}
