/* ============================================================
   AfricanConnect – Comprehensive Responsive Fix
   Fixes: mobile layout, text readability, color contrast
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   1. GLOBAL TEXT READABILITY FIXES
══════════════════════════════════════════════════════════ */

/* Force all text to be readable on dark background */
body,
body * {
  box-sizing: border-box;
}

/* All headings white by default */
h1, h2, h3, h4, h5, h6 {
  color: var(--ac-white);
}

/* Paragraphs readable gray */
p {
  color: var(--ac-white2);
}

/* Links always green */
a {
  color: var(--ac-blue);
  text-decoration: none;
}

/* Inputs readable */
input, textarea, select {
  color: var(--ac-white) !important;
  background-color: var(--ac-black3) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--ac-gray) !important;
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   2. CONTAINER — MOBILE PADDING
══════════════════════════════════════════════════════════ */

.ac-container {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ac-spacing-xl);
  padding-right: var(--ac-spacing-xl);
}

/* ══════════════════════════════════════════════════════════
   3. HEADER — MOBILE FIX
══════════════════════════════════════════════════════════ */

.ac-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}

/* Hide desktop nav on mobile */
@media (max-width: 992px) {
  .ac-nav { display: none !important; }
  .ac-menu-toggle { display: flex !important; }
  .ac-header-actions .ac-btn { display: none; }
  .ac-search-toggle,
  .ac-dark-toggle { display: flex !important; }
}

/* ══════════════════════════════════════════════════════════
   4. HERO — MOBILE FIX
══════════════════════════════════════════════════════════ */

.ac-hero {
  padding-top: 100px;
  padding-left: 16px;
  padding-right: 16px;
  min-height: 100svh;
}

.ac-hero__title {
  font-size: clamp(28px, 6vw, 72px) !important;
  line-height: 1.1 !important;
  color: var(--ac-white) !important;
}

.ac-hero__subtitle {
  font-size: clamp(14px, 2.5vw, 20px) !important;
  color: var(--ac-gray) !important;
}

.ac-hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.ac-hero__stat .num {
  font-size: clamp(20px, 4vw, 36px) !important;
  color: var(--ac-orange) !important;
}

.ac-hero__stat .lbl {
  color: var(--ac-gray) !important;
  font-size: 11px;
}

@media (max-width: 768px) {
  .ac-hero {
    padding-top: 88px;
    padding-left: 16px;
    padding-right: 16px;
    min-height: 100svh;
  }

  .ac-hero__actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .ac-hero__actions .ac-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .ac-hero__stat {
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .ac-hero {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ac-hero__stats {
    gap: 16px;
  }
}

/* ══════════════════════════════════════════════════════════
   5. TICKER — MOBILE
══════════════════════════════════════════════════════════ */

.ac-ticker {
  background: linear-gradient(90deg, #0d1a0d, #1a1200) !important;
  color: var(--ac-white) !important;
}

.ac-ticker__label {
  color: var(--ac-white) !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.ac-ticker__item {
  color: var(--ac-white2) !important;
}

@media (max-width: 480px) {
  .ac-ticker__label { font-size: 10px; }
  .ac-ticker__item  { font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════
   6. MODULES GRID — MOBILE
══════════════════════════════════════════════════════════ */

.ac-modules-grid {
  display: grid;
  gap: var(--ac-spacing-md);
}

@media (min-width: 993px) {
  .ac-modules-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 601px) and (max-width: 992px) {
  .ac-modules-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .ac-modules-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Module card text */
.ac-module-card {
  background: var(--ac-black2) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

.ac-module-card h3 {
  color: var(--ac-white) !important;
}

.ac-module-card p {
  color: var(--ac-gray) !important;
}

/* ══════════════════════════════════════════════════════════
   7. SECTION HEADERS — TEXT COLORS
══════════════════════════════════════════════════════════ */

.ac-section-header h2,
.ac-section-title {
  color: var(--ac-white) !important;
}

.ac-section-subtitle {
  color: var(--ac-gray) !important;
}

/* ══════════════════════════════════════════════════════════
   8. CARDS — FORCE DARK BG + READABLE TEXT
══════════════════════════════════════════════════════════ */

.ac-card {
  background: var(--ac-black2) !important;
  border-color: rgba(255,255,255,0.06) !important;
  color: var(--ac-white2) !important;
}

.ac-card h2, .ac-card h3, .ac-card h4 {
  color: var(--ac-white) !important;
}

.ac-card p, .ac-card span {
  color: var(--ac-white2);
}

/* ══════════════════════════════════════════════════════════
   9. RADIO STICKY BAR — MOBILE FIX
══════════════════════════════════════════════════════════ */

.ac-radio-sticky {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 56px;
  gap: 10px;
  background: linear-gradient(90deg, #050f05, #0a0a00) !important;
  color: var(--ac-white) !important;
  overflow: hidden;
}

.ac-radio-station-name,
.ac-radio-info *,
.ac-radio-now-title {
  color: var(--ac-white) !important;
}

@media (max-width: 600px) {
  .ac-radio-sticky {
    padding: 0 8px;
    gap: 8px;
    height: 52px;
  }

  .ac-radio-sponsor-badge { display: none !important; }
  .ac-radio-volume        { display: none !important; }

  #ac-radio-now-title {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px !important;
  }

  .ac-radio-station-name {
    font-size: 11px !important;
  }
}

@media (max-width: 400px) {
  .ac-radio-whatsapp-btn span { display: none !important; }
  .ac-radio-whatsapp-btn { min-width: 36px; padding: 0 8px !important; }
}

/* ══════════════════════════════════════════════════════════
   10. BUZZ GRID — MOBILE
══════════════════════════════════════════════════════════ */

.ac-buzz-grid,
.ac-events-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 993px) {
  .ac-buzz-grid   { grid-template-columns: repeat(3, 1fr); }
  .ac-events-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 601px) and (max-width: 992px) {
  .ac-buzz-grid   { grid-template-columns: repeat(2, 1fr); }
  .ac-events-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .ac-buzz-grid   { grid-template-columns: 1fr; }
  .ac-events-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   11. WEBTV GRID — MOBILE
══════════════════════════════════════════════════════════ */

.ac-webtv-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 993px) {
  .ac-webtv-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 601px) and (max-width: 992px) {
  .ac-webtv-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .ac-webtv-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   12. FOOTER — MOBILE
══════════════════════════════════════════════════════════ */

.ac-footer {
  background: #050505 !important;
  color: var(--ac-white2) !important;
}

.ac-footer h3, .ac-footer h4 {
  color: var(--ac-white) !important;
}

.ac-footer p, .ac-footer li, .ac-footer a {
  color: var(--ac-gray) !important;
}

.ac-footer a:hover {
  color: var(--ac-blue) !important;
}

.ac-footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 993px) {
  .ac-footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (min-width: 601px) and (max-width: 992px) {
  .ac-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .ac-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .ac-footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 12px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   13. MEMBERSHIP PAGE — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Hero grid 2 cols → 1 col */
  .ac-membership-page div[style*="grid-template-columns:1fr 1fr"],
  .ac-membership-page div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .ac-pass-card {
    max-width: 100% !important;
  }

  .ac-pass-price {
    font-size: 36px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   14. COMMUNITY — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
  .ac-community-layout {
    grid-template-columns: 1fr !important;
  }

  .ac-community-sidebar {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    max-height: 220px;
    overflow-y: auto;
  }
}

/* ══════════════════════════════════════════════════════════
   15. BLOG / SINGLE — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ac-blog-layout,
  .ac-single-layout {
    grid-template-columns: 1fr !important;
  }

  .ac-blog-layout aside,
  .ac-single-layout aside {
    display: none !important;
  }

  article.ac-post-card {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════════
   16. GENERIC GRID FIX — any 2-col inline style on mobile
══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  /* Override ALL inline style grids on very small screens */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  div[style*="grid-template-columns:repeat(2"],
  div[style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns:repeat(4"],
  div[style*="grid-template-columns: repeat(4"],
  div[style*="grid-template-columns:repeat(6"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Flex rows → columns */
  div[style*="display:flex"][style*="gap"],
  div[style*="display: flex"][style*="gap"] {
    flex-wrap: wrap !important;
  }
}

@media (max-width: 400px) {
  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns:repeat(4"],
  div[style*="grid-template-columns:repeat(6"] {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════════
   17. BUTTONS — READABLE ON DARK
══════════════════════════════════════════════════════════ */

.ac-btn--primary {
  background: linear-gradient(135deg, var(--ac-blue), #00a844) !important;
  color: #000 !important;
}

.ac-btn--outline {
  border-color: rgba(255,255,255,0.2) !important;
  color: var(--ac-white) !important;
  background: transparent !important;
}

.ac-btn--outline:hover {
  border-color: var(--ac-blue) !important;
  color: var(--ac-blue) !important;
}

.ac-btn--gold, .ac-btn--orange {
  background: linear-gradient(135deg, var(--ac-gold), var(--ac-gold2)) !important;
  color: #000 !important;
}

.ac-btn--whatsapp {
  background: #25d366 !important;
  color: #fff !important;
}

@media (max-width: 480px) {
  .ac-btn {
    font-size: 13px !important;
    padding: 10px 16px !important;
  }

  .ac-btn--lg {
    font-size: 14px !important;
    padding: 12px 20px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   18. BADGES — ALWAYS READABLE
══════════════════════════════════════════════════════════ */

.ac-badge {
  font-size: 10px !important;
  padding: 3px 10px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

.ac-badge--live {
  background: var(--ac-red) !important;
  color: #fff !important;
}

.ac-badge--gold {
  background: rgba(255,215,0,0.15) !important;
  color: var(--ac-orange) !important;
  border: 1px solid rgba(255,215,0,0.3) !important;
}

.ac-badge--green {
  background: rgba(0,200,83,0.12) !important;
  color: var(--ac-blue) !important;
  border: 1px solid rgba(0,200,83,0.25) !important;
}

/* ══════════════════════════════════════════════════════════
   19. POLLS — READABLE TEXT
══════════════════════════════════════════════════════════ */

.ac-poll-option {
  color: var(--ac-white2) !important;
  background: rgba(255,255,255,0.04) !important;
}

.ac-opt-label {
  color: var(--ac-white2) !important;
}

.ac-opt-pct {
  color: var(--ac-blue) !important;
}

/* ══════════════════════════════════════════════════════════
   20. NAVIGATION DROPDOWN — MOBILE MENU
══════════════════════════════════════════════════════════ */

.ac-mobile-menu {
  background: #111111 !important;
}

.ac-mobile-menu .ac-nav a {
  color: var(--ac-white2) !important;
  font-size: 15px !important;
  padding: 12px 16px !important;
  display: block !important;
  border-radius: 8px !important;
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
}

.ac-mobile-menu .ac-nav a:hover {
  background: rgba(0,200,83,0.08) !important;
  color: var(--ac-blue) !important;
}

/* ══════════════════════════════════════════════════════════
   21. RADIO PAGE — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
  .ac-radio-page {
    grid-template-columns: 1fr !important;
  }

  .ac-radio-interact {
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
  }
}

/* ══════════════════════════════════════════════════════════
   22. WEBTV PAGE — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
  .ac-webtv-layout {
    grid-template-columns: 1fr !important;
  }

  .ac-webtv-sidebar {
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
    max-height: 350px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   23. SINGLE ARTICLE — MOBILE
══════════════════════════════════════════════════════════ */

.ac-post-content {
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: var(--ac-white2) !important;
}

.ac-post-content h2,
.ac-post-content h3 {
  color: var(--ac-white) !important;
}

.ac-post-content a {
  color: var(--ac-blue) !important;
}

/* ══════════════════════════════════════════════════════════
   24. EVENT CARDS — MOBILE
══════════════════════════════════════════════════════════ */

.ac-event-card {
  background: var(--ac-black2) !important;
}

.ac-event-title {
  color: var(--ac-white) !important;
}

.ac-event-meta span {
  color: var(--ac-gray) !important;
}

.ac-event-price {
  color: var(--ac-orange) !important;
}

/* ══════════════════════════════════════════════════════════
   25. CHAT MESSAGES — READABLE
══════════════════════════════════════════════════════════ */

.ac-chat-text {
  color: var(--ac-white2) !important;
}

.ac-chat-author {
  color: var(--ac-blue) !important;
}

/* ══════════════════════════════════════════════════════════
   26. SECTION BACKGROUNDS — ENSURE DARK
══════════════════════════════════════════════════════════ */

.ac-section-bg,
.ac-modules-section,
.ac-buzz-section,
.ac-events-section,
.ac-membership-cta,
.ac-community-section {
  background-color: var(--ac-black2);
}

/* Alternating sections */
.ac-section-alt {
  background-color: var(--ac-black3);
}

/* ══════════════════════════════════════════════════════════
   27. CONTAINER MOBILE PADDING
══════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
  .ac-container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

@media (max-width: 480px) {
  .ac-container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   28. SEARCH RESULTS — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  article.ac-card[style*="display:flex"] {
    flex-direction: column !important;
  }

  article.ac-card img {
    width: 100% !important;
    height: 160px !important;
    border-radius: 8px 8px 0 0 !important;
  }
}

/* ══════════════════════════════════════════════════════════
   29. DASHBOARD — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ac-dashboard {
    grid-template-columns: 1fr !important;
  }

  .ac-dashboard-sidebar {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  }

  .ac-stat-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 400px) {
  .ac-stat-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════════
   30. CONTACT/ABOUT — INLINE GRIDS MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  .ac-single-layout,
  .ac-blog-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════════
   31. ADMIN BAR — OFFSET FIX ON MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 782px) {
  .ac-header {
    top: 46px !important; /* WordPress mobile admin bar height */
  }

  .logged-in .ac-mobile-menu {
    top: 46px !important;
  }
}

.admin-bar .ac-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .ac-header {
    top: 46px;
  }
}

/* ══════════════════════════════════════════════════════════
   32. PRINT — HIDE DECORATIVE
══════════════════════════════════════════════════════════ */

@media print {
  .ac-ticker,
  .ac-radio-sticky,
  .ac-mobile-menu,
  .ac-mobile-overlay,
  .ac-cookie-notice,
  .ac-ad-popup-overlay,
  nav { display: none !important; }
}
