/* =========================================================================
   components.css
   --------------
   Reusable UI components: navbar, buttons, cards, forms, footer, badges,
   and the site's signature "woven divider" motif.
   ========================================================================= */

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.75em;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--fs-body);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--color-primary);
  color: var(--espresso);
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { background: var(--color-highlight); box-shadow: var(--shadow-strong); }

.btn--outline {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn--outline:hover { background: rgba(255, 255, 255, 0.12); }

.btn--dark {
  background: var(--espresso);
  color: var(--cream);
}
.btn--dark:hover { background: var(--mahogany); }

.btn--sm { padding: 0.55em 1.2em; font-size: var(--fs-small); }

.btn--whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}
.btn--whatsapp:hover {
  background: #20ba59;
  border-color: #20ba59;
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn--instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.25);
}
.btn--instagram:hover {
  opacity: 0.92;
  color: #fff;
  box-shadow: 0 6px 20px rgba(220, 39, 67, 0.4);
}


/* ---- Navbar ------------------------------------------------------------ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  z-index: 200;
  background: rgba(255, 247, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-fast);
}

.navbar.is-scrolled { box-shadow: var(--shadow-soft); }

.navbar__inner {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-sm);
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--espresso);
}

/* .navbar__brand img sizing is handled by .logo-circle img below */

/* ---- Circular logo frame (shared: navbar + footer) ------------------- */
.logo-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Gradient ring via background + padding + border-radius */
  background: linear-gradient(135deg, var(--amber) 0%, var(--sherry) 60%, var(--mahogany) 100%);
  border-radius: 50%;
  padding: 3px;           /* thickness of the colour ring */
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(58, 35, 17, 0.22);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.logo-circle::after {
  /* White/cream gap between the ring and the photo */
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2.5px solid var(--cream);
  pointer-events: none;
  z-index: 1;
}

.navbar__brand:hover .logo-circle {
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 8px 24px rgba(58, 35, 17, 0.30);
}

.logo-circle img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;   /* sits above the ::after cream ring */
}

/* Footer variant — larger, gold ring glows against dark bg */
.footer__brand .logo-circle {
  background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 55%, var(--sherry) 100%);
  box-shadow: 0 0 0 1px rgba(255, 215, 122, 0.35),
              0 6px 20px rgba(0, 0, 0, 0.35);
  padding: 3px;
}

.footer__brand .logo-circle::after {
  border-color: var(--espresso);
}

.footer__brand .logo-circle img {
  width: 48px;
  height: 48px;
}


.navbar__brand span small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--color-text-soft);
  text-transform: uppercase;
}

/* Always hidden — only shown inside mobile full-screen drawer (when toggled via JS) */
.navbar__drawer-head {
  display: none;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 600;
  font-size: 0.95rem;
}

.navbar__links a {
  position: relative;
  padding-block: 0.3em;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.navbar__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  height: 2px;
  width: 0;
  background: var(--color-accent);
  transition: width var(--transition-fast);
}

.navbar__links a:hover,
.navbar__links a.is-active { color: var(--color-primary-dark); }
.navbar__links a:hover::after,
.navbar__links a.is-active::after { width: 100%; }

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.navbar__toggle span {
  width: 24px;
  height: 2px;
  background: var(--espresso);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

@media (max-width: 480px) {
  .navbar__inner { height: 68px; padding-inline: max(0.75rem, 2.5vw); }
  .navbar__brand span small { display: block; font-size: 0.62rem; letter-spacing: 0.04em; }
  .navbar__brand { font-size: 1rem; gap: 0.45rem; }
}

@media (max-width: 900px) {
  .navbar__toggle { display: flex; }

  /* Standard floating dropdown popover card */
  .navbar__links {
    position: absolute;
    top: calc(100% + 8px);
    right: max(1rem, 3.5vw);
    left: auto;
    width: 240px;
    max-width: 82vw;
    height: auto;
    max-height: calc(100vh - 90px);
    background: #ffffff;
    color: var(--espresso);
    z-index: 250;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 0.65rem 0.85rem;
    gap: 0.25rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    box-shadow: 0 14px 40px rgba(58, 35, 17, 0.18),
                0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.22s ease;
  }

  .navbar__links.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  /* Standard Popup Nav Links */
  .navbar__links a:not(.btn) {
    color: var(--espresso);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background var(--transition-fast), color var(--transition-fast);
  }

  .navbar__links a:not(.btn):hover,
  .navbar__links a:not(.btn).is-active {
    color: var(--mahogany);
    background: rgba(230, 165, 32, 0.15);
  }

  .navbar__links a:not(.btn)::after {
    display: none;
  }

  .navbar__links .btn {
    margin-top: 0.35rem;
    width: 100%;
  }

  .navbar.is-menu-open .navbar__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar.is-menu-open .navbar__toggle span:nth-child(2) { opacity: 0; }
  .navbar.is-menu-open .navbar__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---- Cards -------------------------------------------------------------- */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-strong); }

.card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-med);
}

.card:hover .card__media img { transform: scale(1.06); }

.card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card__meta {
  font-size: var(--fs-small);
  color: var(--color-text-soft);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card__title { font-size: 1.25rem; margin-bottom: 0.2rem; }

/* ---- Badges --------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--ongoing { background: rgba(232, 112, 58, 0.15); color: var(--sherry); }
.badge--completed { background: rgba(62, 125, 78, 0.15); color: var(--color-success); }
.badge--gold { background: rgba(230, 165, 32, 0.18); color: var(--mahogany); }

/* ---- Forms ------------------------------------------------------------ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--space-sm);
}

.form-field label {
  font-weight: 600;
  font-size: 0.92rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.85em 1em;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 16px; /* 16px prevents mobile iOS auto-zoom on input focus */
  background: #fff;
  color: var(--color-text);
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(230, 165, 32, 0.18);
  outline: none;
}

.form-field .field-error {
  color: var(--color-error);
  font-size: 0.85rem;
}

.form-field .field-help {
  color: var(--color-text-soft);
  font-size: 0.82rem;
}

.alert {
  padding: 1em 1.25em;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  font-weight: 600;
  border-left: 4px solid var(--color-success);
  background: rgba(62, 125, 78, 0.10);
  color: #285736;
}

.alert--error {
  border-left-color: var(--color-error);
  background: rgba(180, 64, 44, 0.10);
  color: #7C2A1B;
}

/* ---- Toast Notifications (fixed, always visible) ----------------------- */
.toast-container {
  position: fixed;
  top: calc(76px + 1rem); /* sits just below the fixed navbar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(92vw, 520px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  pointer-events: all;
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  background: #fff;
  border-left: 5px solid var(--color-success);
  color: #1a4026;
}

.toast--error {
  border-left-color: var(--color-error);
  color: #7C2A1B;
  background: #fff5f5;
}

.toast__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(62, 125, 78, 0.15);
  color: var(--color-success);
}

.toast--error .toast__icon {
  background: rgba(180, 64, 44, 0.12);
  color: var(--color-error);
}

.toast__text { flex: 1; }

.toast__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: currentColor;
  opacity: 0.5;
  padding: 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast__close:hover { opacity: 1; }

.toast--hide {
  animation: toast-out 0.35s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

@media (max-width: 480px) {
  .toast-container {
    top: calc(68px + 0.75rem);
  }
}

/* ---- Footer ------------------------------------------------------------- */
.footer {
  background: var(--espresso);
  color: var(--cream);
  padding-top: var(--space-xl);
  padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom, var(--space-xl)));
  margin-top: auto;
}

.footer a { transition: color var(--transition-fast); }
.footer a:hover { color: var(--color-highlight); }

.footer__grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 780px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.footer__brand img {
  /* sizing now handled by .logo-circle img */
}

.footer h4 {
  color: var(--color-highlight);
  font-size: 1rem;
  font-family: var(--font-body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.footer__links li { margin-bottom: 0.6rem; }
.footer__bottom {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.85rem;
  color: #C9B79B;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* ---- Signature element: woven divider ----------------------------------
   A thin repeating arc pattern referencing the interlocking basket-weave
   patterns common to the Ruhaama/Ntungamo region — used sparingly as a
   section transition instead of a plain rule.
*/
.divider-weave {
  height: 22px;
  width: 100%;
  background-image: radial-gradient(circle at 10px 0, transparent 9px, var(--color-accent) 9.5px, var(--color-accent) 10.5px, transparent 11px);
  background-size: 20px 22px;
  background-repeat: repeat-x;
  background-position: center top;
  opacity: 0.55;
}

.section--dark .divider-weave { opacity: 0.4; }

/* ---- Empty state ---------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
  color: var(--color-text-soft);
}

/* ---- Filter pills (activities page) ---------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: var(--space-lg);
}

@media (max-width: 600px) {
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    margin-inline: calc(var(--space-sm) * -1);
    padding-inline: var(--space-sm);
  }
  .filter-pill { flex-shrink: 0; }
}

.filter-pill {
  padding: 0.5em 1.2em;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.filter-pill:hover { border-color: var(--color-primary); }

.filter-pill.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--espresso);
}

/* ---- Publication list ------------------------------------------------- */
.pub-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast);
  width: 100%;
  overflow: hidden;
}

.pub-card:hover { transform: translateY(-4px); }

.pub-card__icon {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: rgba(230,165,32,0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--mahogany);
  font-weight: 700;
}

.pub-card__body { flex: 1; min-width: 0; word-break: break-word; }
.pub-card__title { font-weight: 700; margin-bottom: 0.15rem; word-break: break-word; }

@media (max-width: 520px) {
  .pub-card {
    flex-direction: row;
    gap: 0.85rem;
    padding: 1rem;
  }
  .pub-card__icon {
    width: 46px;
    height: 46px;
    font-size: 0.82rem;
  }
}

