/* UI fixes from the visual audit (Nov 2026). Loaded after design.css so the original
   design files stay as they were; every rule here is a targeted correction, measured
   in the browser before and after. */

/* 1. Mobile hero ticker: polish.css lets the text wrap, but it was still absolutely
      positioned and scrolling, so it spilled above and below its pill. */
@media (max-width: 768px) {
  .hero-breaking-news .breaking-content-scroll {
    position: static;
    left: auto;
    animation: none;
  }
}

/* 2. News article "مرئيات" gallery: the button around each image had no size, so images
      showed at their natural size with big gaps instead of a tidy grid. */
.news-detail__thumb { aspect-ratio: auto; }
.news-detail__thumb-button {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.news-detail__thumb figcaption {
  padding: 0.5rem 0.25rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 3. The floating social rail covered text, headings and the carousel arrow on
      1280–1500px screens: tuck it closer to the edge there. */
@media (min-width: 901px) and (max-width: 1500px) {
  html[dir="rtl"] .floating-social { right: 0.375rem; }
}

/* 4. Mobile header: the site title wrapped one word per line (header 95px tall). */
@media (max-width: 560px) {
  .brand-text { padding-inline-start: 0.4rem; margin-inline-start: 0.4rem; }
  .site-header .header-content { gap: 0.35rem; }
  .header-controls { gap: 0.2rem; }
  .brand-title { font-size: 0.8rem; }
  .language-switcher__link { padding-inline: 0.35rem; }
}

/* 5. Mobile tap targets of at least 40px without changing how the controls look. */
@media (max-width: 900px) {
  .search-trigger,
  .language-switcher__link { position: relative; }
  .search-trigger::after,
  .language-switcher__link::after {
    content: "";
    position: absolute;
    inset: -4px;
  }
}
@media (max-width: 560px) {
  .theme-toggle-btn { width: 40px; height: 40px; }
}

/* 6. Contact page: the featured phone number ran past its card on desktop. */
.contact-overview__card--featured .contact-overview__title {
  font-size: clamp(1.15rem, 1.55vw, 1.8rem);
}

/* 7. Programs: the meta rows wrapped differently in every card. */
.program__meta {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

/* 9. 404 page was 16px off-centre with a sideways scroll on phones. */
.error-page .container { width: 100%; }

/* 10. Desktop nav dropped "من نحن / تواصل معنا" to a second row at 1280–1420px. */
@media (min-width: 1280px) and (max-width: 1420px) {
  .site-nav__list { flex-wrap: nowrap; }
  .site-nav__list a,
  .nav-dropdown__trigger,
  .nav-link-btn { padding-inline: 0.3rem; font-size: 0.8rem; }
  .nav-btn-special { padding: 0.3rem 0.55rem; }
  .header-controls { gap: 0.3rem; }
  .brand-subtitle { display: none; }
}

/* 11. Search result dates/types were below AA contrast. */
.search-result__meta,
.search-card__meta { color: color-mix(in srgb, currentColor 70%, transparent); }

/* 13. Dark-mode slips: carousel arrows stayed white, CTA button text ignored the accent. */
html[data-theme="dark"] .swiper-button-next,
html[data-theme="dark"] .swiper-button-prev { background: var(--surface-card); }
.section--cta .btn--primary { color: var(--walnut-900, #3e1a09); }

/* 14. In right-to-left pages the "external" arrow should point up-left. */
html[dir="rtl"] a.portal-directory-card__link::after,
html[dir="rtl"] .najaf-feature-card__cta::after,
html[dir="rtl"] .icon--external::before { content: "↖"; }
html[dir="rtl"] .holy-site-card__action::after { content: " ↖"; }

/* 15. CTA contacts read "الهاتف:+964…" with no space after the label. */
.cta__contacts li > span { margin-inline-end: 0.35rem; }
