:root { --sjb-primary:#1976d2; }
a{color:var(--sjb-primary)}
.btn-primary{background:var(--sjb-primary);border-color:var(--sjb-primary)}

/* Cards & layout */
.card{background-color:transparent}
.sjb-block-card{border:1px solid #e2e3e7;background:#ffffff;border-radius:16px;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.sjb-title{line-height:1.6;color:#1f2937}
.sjb-title:hover{text-decoration:underline}
.sjb-logo-box{width:80px;height:80px;display:flex;align-items:center;justify-content:center;border:1px dashed #d1d5db;border-radius:12px;background:#ffffff;overflow:hidden}
.sjb-logo-box img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.sjb-cat-link{color:#374151}
.sjb-cat-link:hover{text-decoration:underline}

/* Recent widget */
.sjb-recent-widget li{border-bottom:1px solid rgba(0,0,0,.06);padding-bottom:.5rem}
.sjb-recent-widget li:last-child{border-bottom:0}
.sjb-thumb-80{width:80px;height:80px;display:block;overflow:hidden;border-radius:12px;background:#e9ecef}
.sjb-thumb-80 img{width:100%;height:100%;object-fit:cover;display:block}

/* Header menu look + centered */
.site-header{background:#111827 !important}
.site-header .sjb-header-menu{margin:0;padding:0;justify-content:center}
.site-header .sjb-header-menu li{position:relative;display:flex;align-items:center}
.site-header .sjb-header-menu li + li::before{content:"|";opacity:.35;margin-inline:.5rem;color:#e5e7eb}
.site-header .sjb-header-menu a{color: #ffffff;text-decoration:none;padding:.35rem .6rem;border-radius:.5rem;display:flex;align-items:center;gap:.35rem}
.site-header .sjb-header-menu a:hover{background:#374151;color:#fff}
.site-header .sjb-header-menu .current-menu-item > a,
.site-header .sjb-header-menu .current_page_item > a{background:#374151;color:#ffffff}
.site-footer{background:#111827 !important}

/* Force site background to light gray */
html, body, main, .site{background:#f3f4f6}

/* below-header spacing */
.bg-body-tertiary .widget{margin-inline-end:1rem}

/* Header/Footer links white */
.site-header a{color:#ffffff !important}
.site-footer a{color:#ffffff !important}
.site-header a:hover,.site-footer a:hover{opacity:.9}


/* Make header/footer text white on dark background */
.site-header, .site-header .widget,
.site-header .navbar-brand,
.site-header .sjb-header-menu li,
.site-header .sjb-header-menu a,
.site-header .sjb-header-menu a span,
.site-header .sjb-header-menu li::before {
  color:#ffffff !important;
}
.site-footer, .site-footer .widget,
.site-footer p, .site-footer li, .site-footer h6,
.site-footer a, .site-footer a span {
  color:#ffffff !important;
}
/* keep primary buttons readable */
.site-header .btn, .site-footer .btn { color: #ffffff; }


/* === Force white links in header & footer (high specificity) === */
.site-header, .site-footer{
  --bs-link-color: #ffffff;
  --bs-link-hover-color: #ffffff;
}
.site-header a:link,
.site-header a:visited,
.site-header a:hover,
.site-header a:active,
.site-footer a:link,
.site-footer a:visited,
.site-footer a:hover,
.site-footer a:active {
  color:#ffffff !important;
  text-decoration: none;
}
.site-header a:hover, .site-footer a:hover { text-decoration: underline; opacity:.95 }
/* Ensure menu anchors are white regardless of prior rules */
.site-header .sjb-header-menu a{ color:#ffffff !important }


.sjb-block-card svg, .widget svg { vertical-align: -2px; fill: currentColor; }


/* === Contrast Enhancements (WCAG) === */
:root { --sjb-primary:#0b63c7; }      /* strong link color */
a{ color: var(--sjb-primary); }

/* Titles & category links */
.sjb-title{ color:#111827; }          /* near-black for readability */
.sjb-cat-link{ color:#0b63c7; }
.sjb-cat-link:hover{ text-decoration: underline; }

/* Make muted text darker for readability */
.small, .text-muted{ color:#374151 !important; } /* gray-700 */

/* Widgets/cards on light bg */
.widget.bg-body-tertiary{ background:#e5e7eb !important; color:#111827; }
.widget.bg-body-tertiary a{ color:#0b63c7; }
.widget .widget-title{ color:#111827; }

/* Tag badges */
.bg-primary-subtle{ background: #d9e7f8 !important; }
.text-primary-emphasis{ color:#0b63c7 !important; }
.sjb-tag-link{ font-weight:600; }

/* Ensure readable muted text inside cards/widgets */
.card .text-muted, .widget .text-muted{ color:#374151 !important; }
.card a.text-decoration-none{ color:#0b63c7; }



/* === Contrast Pass 2 === */

/* Category links everywhere (cards, widgets, footer widgets) */
.sjb-cat-link{ color:#0b63c7 !important; font-weight:600; }
.sjb-cat-link:hover{ color:#094e9c !important; text-decoration: underline; }

/* Post titles links should be near-black for max contrast on light bg */
a.fw-bold.d-block{ color:#111827 !important; }
a.fw-bold.d-block:hover{ text-decoration: underline; }

/* Random/Latest widget container on light gray background */
.widget_sjb_random_recent.bg-body-tertiary{ background:#e5e7eb !important; }
.widget_sjb_random_recent a{ color:#0b63c7 !important; }

/* Footer widgets: force white links and readable muted text */
.site-footer .widget a{ color:#ffffff !important; }
.site-footer .widget a:hover{ text-decoration: underline; opacity:.95; }
.site-footer .widget .text-muted{ color:#e5e7eb !important; }

/* Generic muted -> darker for readability across the site */
.text-muted{ color:#374151 !important; }

/* Focus visibility for keyboard users */
a:focus-visible{ outline: 2px solid #0b63c7; outline-offset: 2px; border-radius: 4px; }



/* === Footer Contrast Fix === */
.site-footer, .site-footer p, .site-footer span, .site-footer small { color:#f3f4f6 !important; }
.site-footer a { color:#ffffff !important; }
.site-footer a:hover { text-decoration: underline; opacity:.95; }
/* Avoid half-transparent whites */
.site-footer .text-white-50, .site-footer .opacity-75, .site-footer .opacity-50 { opacity:1 !important; color:#e5e7eb !important; }



/* === Contrast Hardening (Footer & Footer Widgets) === */
.site-footer{ background-color:#111827 !important; }
.site-footer, .site-footer * { color:#ffffff !important; } /* force white text everywhere in footer */
.site-footer a{ color:#ffffff !important; }
.site-footer a:hover{ text-decoration:underline; opacity:.95; }

/* Footer widgets that use light cards need darker link color for AA on #e5e7eb */
.site-footer .widget.bg-body-tertiary{ background:#e5e7eb !important; color:#111827 !important; }
.site-footer .widget.bg-body-tertiary a,
.site-footer .widget.bg-body-tertiary .sjb-cat-link { color:#083c96 !important; } /* darker blue for >4.5:1 */
.site-footer .widget.bg-body-tertiary .text-muted,
.site-footer .widget.bg-body-tertiary small,
.site-footer .widget.bg-body-tertiary span { color:#1f2937 !important; } /* gray-800 */



/* === Touch Tap Targets (Lighthouse) === */
@media (pointer: coarse) {
  /* Category links (e.g., 'Uncategorized', 'تجربة') */
  .sjb-cat-link {
    display: inline-block;
    padding: 8px 10px;
    line-height: 1.2;
    border-radius: 10px;
    margin-inline: 2px;
  }

  /* Post title links in cards */
  a.fw-bold.d-block {
    padding-block: 8px;
    line-height: 1.3;
    border-radius: 8px;
  }

  /* Thumbnails / logos act as 80x80 tap targets already, ensure anchors match */
  a.sjb-thumb-80,
  a.sjb-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    border-radius: 12px;
  }

  /* Avoid crowding adjacent inline links */
  .card .card-body a.sjb-cat-link + a.sjb-cat-link,
  .widget a + a {
    margin-inline-start: 6px;
  }

  /* Random/Latest widget list items: ensure vertical spacing */
  section.widget_sjb_random_recent ul.list-unstyled > li.d-flex {
    gap: 10px;
    padding-block: 6px;
  }
}



/* === Tap Targets Plus (broader selectors) === */
@media (pointer: coarse) {
  /* Any category links (even without sjb-cat-link) */
  .card .card-body a[href*="/category/"],
  .widget a[href*="/category/"] {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 10px;
    line-height: 1.3;
    margin-inline: 2px;
  }

  /* Post titles (already block) */
  a.fw-bold.d-block {
    padding-block: 10px; /* a bit more padding */
    min-height: 48px;
    border-radius: 8px;
  }

  /* Thumbnails / logos */
  a.sjb-thumb-80,
  a.sjb-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    border-radius: 12px;
  }

  /* Increase spacing between adjacent inline links and elements */
  .card .card-body, section.widget_sjb_random_recent ul.list-unstyled > li.d-flex {
    gap: 12px;
  }
  .card .card-body a + a,
  .widget a + a {
    margin-inline-start: 8px;
  }

  /* Ensure small/muted metadata rows are not too tight */
  .sjb-meta, .card .card-body .small, .card .card-body .text-muted {
    line-height: 1.6;
  }
}

