:root {
  --brand: #0f766e;
  --accent: #dc2626;
  --ink: #172033;
  --muted: #667085;
}

body {
  direction: rtl;
  text-align: right;
  font-family: var(--site-font, Tahoma, Arial, sans-serif);
  background: #f6f7f9;
  color: var(--ink);
}

html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .section-title::before {
  order: -1;
}

html[dir="ltr"] .me-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color .18s ease;
}

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

.article-card a:hover,
.small-news a:hover,
.hero-news a:hover {
  color: var(--accent) !important;
}

.image-link {
  display: block;
  overflow: hidden;
}

.image-link img {
  transition: transform .22s ease, filter .22s ease;
}

.image-link:hover img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.topbar {
  background: #111827;
  color: #fff;
  font-size: .92rem;
}

.topbar-contact {
  color: #e5e7eb;
}

.social-strip {
  row-gap: .45rem;
}

.social-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.social-icon:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}

.social-facebook:hover { background: #1877f2; }
.social-instagram:hover { background: #c13584; }
.social-youtube:hover { background: #ff0000; }
.social-tiktok:hover { background: #111; }
.social-twitter:hover { background: #000; }
.social-telegram:hover { background: #229ed9; }

.whatsapp-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .18);
  transition: transform .18s ease, background .18s ease;
}

.whatsapp-link:hover {
  transform: translateY(-2px);
  background: #12803c;
  color: #fff;
}

.language-switch {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: .25rem .75rem;
  border-radius: 999px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  font-weight: 700;
}

.language-switch:hover {
  color: #fff;
  background: rgba(255, 255, 255, .18);
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.navbar {
  border-bottom: 1px solid #e5e7eb;
}

.main-navbar {
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.brand-name {
  color: var(--ink);
  font-size: 1.2rem;
}

.category-nav {
  gap: .15rem;
  flex-wrap: nowrap;
}

.category-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 38px;
  padding: .4rem .68rem;
  border-radius: 999px;
  color: #334155;
  font-weight: 700;
  position: relative;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.category-nav .nav-link:hover {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, white);
}

.category-nav .nav-link.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(15, 118, 110, .22);
}

.header-search {
  width: 190px;
  min-width: 190px;
  gap: .3rem;
}

.header-search .form-control {
  border-radius: 999px;
  padding-inline: .65rem;
}

.header-search .btn {
  width: 34px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) and (max-width: 1199px) {
  .brand-name {
    font-size: 1.05rem;
  }

  .category-nav .nav-link {
    padding-inline: .55rem;
    font-size: .94rem;
  }

  .header-search {
    width: 160px;
    min-width: 160px;
  }
}

.article-card {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

.article-card img,
.article-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e5e7eb;
}

.article-main-image {
  height: var(--article-image-desktop-height, 520px);
  max-height: 900px;
  aspect-ratio: auto;
  object-fit: cover;
}

.article-content a,
.ck-content a {
  color: #0b63ce;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.article-content a:hover,
.ck-content a:hover {
  color: var(--accent);
}

.article-content img,
.ck-content img {
  max-width: 100%;
  height: auto;
}

.article-content figure,
.ck-content figure {
  max-width: 100%;
  margin: 1rem 0;
}

.article-content figure.media,
.ck-content figure.media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.article-content figure.media iframe,
.ck-content figure.media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.article-content table,
.ck-content table {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}

.article-content th,
.article-content td,
.ck-content th,
.ck-content td {
  border: 1px solid #d8dee8;
  padding: .55rem .7rem;
}

.article-content th,
.ck-content th {
  background: #f1f5f9;
}

.article-content hr,
.ck-content hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid #d8dee8;
  opacity: 1;
}

.category-badge {
  display: inline-flex;
  background: color-mix(in srgb, var(--brand) 12%, white);
  color: var(--brand);
  border-radius: 6px;
  padding: .18rem .55rem;
  font-size: .8rem;
  font-weight: 700;
}

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

.btn-brand:hover {
  background: #0b5f59;
  border-color: #0b5f59;
  color: #fff;
}

.section-title {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 2rem 0 1rem;
}

.section-title::before {
  content: "";
  width: 6px;
  height: 28px;
  border-radius: 2px;
  background: var(--accent);
}

.hero-news {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  padding: 1rem;
}

.ad-slot {
  width: min(100%, var(--ad-width));
  min-height: var(--ad-height);
  margin: 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
}

.ad-slot a,
.ad-slot img {
  display: block;
  max-width: 100%;
}

.ad-slot img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.ad-label {
  position: absolute;
  top: .35rem;
  inset-inline-start: .5rem;
  z-index: 1;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: rgba(15, 23, 42, .7);
  color: #fff;
  font-size: .72rem;
}

.adsense-test-box {
  width: 100%;
  min-height: max(70px, var(--ad-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  color: #475569;
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 12px, #eef2f7 12px, #eef2f7 24px);
  text-align: center;
}

.adsense-test-box strong {
  color: var(--brand);
}

.adsense-test-box span {
  font-size: .85rem;
}

.ad-medium_rectangle,
.ad-large_rectangle {
  display: inline-flex;
}

.small-news {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid #eef1f5;
}

.small-news img {
  width: 110px;
  height: 74px;
  object-fit: cover;
  border-radius: 6px;
}

.footer {
  margin-top: 3rem;
  padding: 2rem 0;
  background: #111827;
  color: #d1d5db;
}

.footer-about {
  color: #cbd5e1;
  line-height: 1.9;
}

.footer-title {
  color: #fff;
  font-weight: 800;
  margin-bottom: .9rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: .5rem;
}

.footer-links a {
  color: #d1d5db;
  transition: color .18s ease, padding .18s ease;
}

.footer-links a:hover {
  color: #fff;
  padding-inline-start: .25rem;
}

.footer-links-columns {
  columns: 2;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: #cbd5e1;
  margin-top: 1.5rem;
  padding-top: 1rem;
  font-size: .95rem;
}

.admin-sidebar {
  min-height: 100vh;
  background: #111827;
}

.admin-sidebar a {
  color: #d1d5db;
  display: block;
  padding: .7rem 1rem;
  border-radius: 6px;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.table img.thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
}

.thumb {
  display: block;
  max-width: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.article-image-preview {
  width: 320px;
  height: 180px;
  border: 1px solid #e5e7eb;
  background: #f1f5f9;
}

.ck-editor__editable,
.ck-editor__editable_inline,
.ck-content {
  min-height: 420px;
}

textarea.article-content-editor,
.ck-editor .ck-editor__editable[role="textbox"],
.ck-editor .ck-editor__editable_inline {
  min-height: 620px !important;
}

@media (max-width: 767px) {
  .topbar .container,
  .social-strip {
    justify-content: center;
  }

  .topbar-contact {
    width: 100%;
    justify-content: center;
  }

  .social-icon {
    width: 32px;
    height: 32px;
  }

  .category-nav {
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: .75rem;
  }

  .category-nav .nav-link {
    width: 100%;
    border-radius: 8px;
    justify-content: flex-start;
  }

  .header-search {
    min-width: 100%;
    width: 100%;
    margin-top: .75rem;
  }

  .small-news {
    grid-template-columns: 92px 1fr;
  }
  .small-news img {
    width: 92px;
    height: 64px;
  }

  .article-main-image {
    height: var(--article-image-mobile-height, 240px);
    max-height: 520px;
  }
}
