/* ============================================================
   BICKFAYA & MHAYDSSEH MUNICIPALITY — CIVIC UPLIFT LAYER
   Additive. Loads AFTER main.css / polish.css and overrides
   the palette to the official logo teal (#009383), fixes
   contrast, adds the "I need to…" task bar, amber primary
   CTAs, and the handwriting ink treatment.
   Nothing here removes existing markup — safe to unlink.
   Version 1.0 | 2026
   ============================================================ */

/* ---- 1. Re-brand the token palette: forest green -> logo teal ---- */
:root {
  --primary:        #00564B;   /* deep teal — structural surfaces   */
  --primary-dark:   #003B34;
  --primary-deep:   #002E28;
  --primary-mid:    #007A6B;
  --primary-light:  #009383;   /* teal, contrast-safe for large UI  */
  --brand-teal:     #009383;   /* vivid logo teal — icons & fills   */

  /* Action accent — the ONE primary action per view */
  --amber:          #B45309;
  --amber-dark:     #006B5E;
  --amber-light:    #D2691E;

  /* Contrast fixes (old muted values failed WCAG on light bg) */
  --text-mid:       #2E4A43;
  --text-muted:     #45655B;

  /* Visible, on-brand hairlines (old gold @0.18 was invisible) */
  --border-color:   rgba(0,47,31, 0.28);
  --border-light:   rgba(0,47,31, 0.14);

  --overlay-green:  rgba(5, 41, 36, 0.82);
  --glass-bg:       rgba(5, 41, 36, 0.72);
  --theme-color:    #00564B;
}

/* ---- 2. Accessible focus ring (keyboard nav) ---- */
a:focus-visible,
button:focus-visible,
.civic-task:focus-visible,
.qa-card:focus-visible {
  outline: 3px solid var(--brand-teal);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- 3. Amber primary CTA (pops against both teal and white) ---- */
.civic-hero__cta--primary,
.btn-amber {
  background: linear-gradient(135deg, var(--amber-dark), var(--amber)) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 10px 30px rgba(180, 83, 9, 0.30);
}
.civic-hero__cta--primary:hover,
.btn-amber:hover { filter: brightness(1.06); transform: translateY(-2px); }

/* ============================================================
   4. "I NEED TO…" TASK BAR  (civic gateway — task-first)
   ============================================================ */
.civic-tasks {
  background: var(--off-white);
  padding: 26px 0 6px;
  position: relative;
  z-index: 3;
}
.civic-tasks__inner {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(5, 41, 36, 0.10);
  padding: 20px 22px;
  margin-top: -54px;               /* lift the card over the hero edge */
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.civic-tasks__lead {
  font-family: var(--font-en-head);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.civic-tasks__lead::before {
  content: "";
  width: 34px; height: 34px;
  border-radius: 9px;
  background:
    repeating-linear-gradient(-45deg, var(--brand-teal) 0 3px, transparent 3px 7px),
    var(--primary);                /* echoes the logo's diagonal shield */
  flex: none;
}
body.lang-ar .civic-tasks__lead { font-family: var(--font-ar); }

.civic-tasks__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  flex: 1 1 460px;
}
.civic-task {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: var(--light-bg);
  border: 1px solid transparent;
  color: var(--text-dark);
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.25;
  transition: var(--transition);
}
.civic-task i { font-size: 1.4rem; color: var(--brand-teal); transition: var(--transition); }
.civic-task:hover {
  background: #FFFFFF;
  border-color: var(--border-color);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(5, 41, 36, 0.12);
}
/* one primary action stands out */
.civic-task--primary {
  background: linear-gradient(150deg, var(--amber-dark), var(--amber));
  color: #FFFFFF;
}
.civic-task--primary i { color: #FFFFFF; }
.civic-task--primary:hover { filter: brightness(1.06); border-color: transparent; }

@media (max-width: 991px) {
  .civic-tasks__inner { margin-top: -32px; }
  .civic-tasks__grid  { grid-template-columns: repeat(3, 1fr); }
  .civic-tasks__lead  { width: 100%; }
}
@media (max-width: 520px) {
  .civic-tasks__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   5. HANDWRITING INK  (see assets/js/handwriting.js)
   ============================================================ */
.civic-ink {
  color: var(--brand-teal);
  display: inline-block;
  vertical-align: baseline;
}
.mayor-signature .civic-ink { color: var(--primary); }
/* Reserve line height so the SVG swap-in causes no layout shift */
.civic-hero__script {
  margin-top: 14px;
  font-family: var(--font-en-head);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  min-height: 1.6em;
}
.civic-hero__script .civic-ink { color: var(--gold-light); }
body.lang-ar .civic-hero__script { font-family: var(--font-ar); }

/* Respect reduced-motion — the JS also checks this and skips animation */
@media (prefers-reduced-motion: reduce) {
  .civic-task, .civic-task i,
  .civic-hero__cta--primary, .btn-amber { transition: none; }
}

/* ============================================================
   6. RTL FIX — Heritage timeline (index.php #heritage)
   main.css builds the timeline with physical left/right + 50%
   blocks, which collapse under direction:rtl. Keep the geometry
   in LTR so the centred spine, alternating columns and dots stay
   correct; flip only the text inside the cards back to RTL.
   ============================================================ */
body.lang-ar .heritage-timeline { direction: ltr; }
body.lang-ar .heritage-card { direction: rtl; text-align: right; }
