:root {
  --brand: #1d4ed8;
  --brand2: #f59e0b;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.12);
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
  --radius: 18px;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--brand);
}

a:hover {
  color: #1e40af;
}

/* Make bootstrap cards feel modern */
.card-soft {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.navbar-blur {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-brand:hover {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}

.btn-outline-brand {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline-brand:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.badge-brand {
  background: rgba(29, 78, 216, 0.1);
  color: var(--brand);
  border: 1px solid rgba(29, 78, 216, 0.25);
}

.badge-soft {
  background: rgba(17, 24, 39, 0.04);
  color: rgba(17, 24, 39, 0.72);
  border: 1px solid rgba(17, 24, 39, 0.10);
}

.text-muted-2 {
  color: var(--muted) !important;
}

.hero {
  border-radius: calc(var(--radius) + 10px);
  background: radial-gradient(1200px circle at 85% 20%, rgba(29, 78, 216, 0.18), transparent 50%),
    radial-gradient(900px circle at 15% 70%, rgba(245, 158, 11, 0.20), transparent 55%),
    #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-2 {
  position: relative;
}

.hero-search .form-control {
  background: rgba(240, 244, 255, 0.85);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-chip {
  flex: 1 1 140px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(17, 24, 39, 0.10);
  backdrop-filter: blur(10px);
}

.stat-num {
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.featured-card {
  position: relative;
  border-radius: calc(var(--radius) + 12px);
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.12);
  box-shadow: var(--shadow);
  min-height: 360px;
}

.featured-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.featured-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.08) 65%, rgba(0, 0, 0, 0));
}

.ticker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ticker-label {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #92400e;
  font-weight: 800;
  letter-spacing: .3px;
}

.ticker-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ticker-item {
  color: rgba(17, 24, 39, 0.82);
  font-weight: 700;
}

.ticker-item:hover {
  color: var(--brand);
}

.ticker-sep {
  color: rgba(17, 24, 39, 0.25);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.section-title {
  font-weight: 900;
}

.section-sub {
  font-size: 13px;
}

.scroll-x {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}

.scroll-card {
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit;
}

.scroll-cover img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.scroll-body {
  padding: 14px;
}

.hover-lift {
  transition: transform .18s ease, box-shadow .18s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.10);
}

/* Make horizontal scrolling feel nice */
.scroll-x::-webkit-scrollbar {
  height: 10px;
}

.scroll-x::-webkit-scrollbar-thumb {
  background: rgba(17, 24, 39, 0.18);
  border-radius: 999px;
}

.scroll-x::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.06);
  border-radius: 999px;
}

.hero .hero-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius) + 10px);
}

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(245, 158, 11, 0.55);
}

.avatar-lg {
  width: 120px;
  height: 120px;
}

.form-control,
.form-select {
  background-color: #f0f4ff;
  border-color: rgba(17, 24, 39, 0.12);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(29, 78, 216, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(29, 78, 216, 0.15);
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--brand);
}

/* RTL-friendly breadcrumb separator */
.breadcrumb-item + .breadcrumb-item::before {
  float: right;
}

/* -------------------------------------------------------------------------- */
/* Writers + Profile UI upgrades */
/* -------------------------------------------------------------------------- */

.page-hero {
  background: radial-gradient(900px circle at 90% 15%, rgba(29, 78, 216, 0.16), transparent 45%),
    radial-gradient(700px circle at 15% 90%, rgba(245, 158, 11, 0.14), transparent 55%),
    #ffffff;
}

.writer-card {
  cursor: pointer;
}

.writer-cover {
  height: 64px;
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.95), rgba(245, 158, 11, 0.85));
}

.writer-avatar {
  margin-top: -34px;
  width: 68px;
  height: 68px;
  border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.writer-bio {
  min-height: 44px;
  line-height: 1.7;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: rgba(17, 24, 39, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.pill-link {
  text-decoration: none;
}

.pill-link:hover {
  border-color: rgba(29, 78, 216, 0.35);
  color: var(--brand);
}

.profile-hero {
  background: #ffffff;
}

.profile-cover {
  height: 120px;
  background: radial-gradient(900px circle at 90% 10%, rgba(29, 78, 216, 0.28), transparent 52%),
    radial-gradient(700px circle at 15% 90%, rgba(245, 158, 11, 0.26), transparent 55%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 1));
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.profile-avatar {
  margin-top: -56px;
  border: 4px solid #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-tabs-modern {
  border-bottom: 1px solid rgba(17, 24, 39, 0.10);
}

.nav-tabs-modern .nav-link {
  border: none !important;
  border-radius: 999px !important;
  font-weight: 800;
  color: rgba(17, 24, 39, 0.68);
  padding: 10px 14px;
  margin-left: 8px;
}

.nav-tabs-modern .nav-link:hover {
  color: var(--brand);
  background: rgba(29, 78, 216, 0.07);
}

.nav-tabs-modern .nav-link.active {
  background: rgba(29, 78, 216, 0.12) !important;
  color: var(--brand) !important;
}

.article-card-cover img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.user-mini {
  transition: transform .18s ease, box-shadow .18s ease;
}

.user-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.10);
}

/* -----------------------------
   Responsive polish (RTL-safe)
-------------------------------- */

@media (max-width: 991.98px) {
  .navbar .navbar-collapse {
    padding-top: 10px;
  }

  /* Keep navbar elements clean on tablets/phones */
  .navbar .navbar-search {
    width: 100%;
  }

  .navbar .navbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .navbar .navbar-actions > .btn {
    width: 100%;
  }

  .navbar .navbar-nav .nav-link {
    padding: 10px 0;
  }

  .navbar .dropdown,
  .navbar .dropdown-toggle {
    width: 100%;
  }

  .navbar .dropdown-toggle {
    justify-content: space-between;
  }
}

/* Desktop navbar balance: prevent search from pushing buttons to a new line */
@media (min-width: 992px) {
  .navbar .navbar-search {
    width: 420px;
    flex: 0 1 420px;
  }

  .navbar .navbar-nav .nav-link {
    white-space: nowrap;
  }

  .navbar .navbar-actions {
    flex: 0 0 auto;
  }
}

@media (max-width: 575.98px) {
  /* Make hero search stack nicely on phones */
  .hero-search .input-group {
    flex-wrap: wrap;
  }

  .hero-search .input-group .form-control {
    flex: 1 1 100%;
    border-radius: 14px !important;
    margin-bottom: 10px;
  }

  .hero-search .input-group .btn {
    width: 100%;
    border-radius: 14px !important;
  }

  .featured-card {
    min-height: 260px;
  }
}
