/*
Theme Name: Arab Sky Tech Pro
Version: 3.4
Author: Arab Sky Tech
Description: قالب عربي مستقل احترافي بواجهة مجلاتية، دعم إعلانات مرن، شريط أخبار، وضع ليلي وتجربة قراءة محسنة.
Text Domain: arabskytech
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
*/

/* =========================
   Reset & Base
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  direction: rtl;
  font-family: 'Tajawal', sans-serif;
  font-weight: 400;
  line-height: 1.9;
  color: #1f2937;
  background: #f8fbff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

iframe,
embed,
video {
  max-width: 100%;
}

/* =========================
   Container
========================= */

.custom-container {
  width: min(1280px, 92%);
  margin: 0 auto;
}

/* =========================
   Header — Desktop (RTL)
   Layout: [logo] [nav] [tools]
   Grid: logo | nav | tools
========================= */

.custom-site-header {
  position: relative;
  width: 100%;
  z-index: 9999;
  background: #f3f8fc;
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.custom-header-row {
  display: grid;
  /*
    RTL order: logo (right) | nav (centre) | tools (left)
    We use named areas so changing direction is just one place.
  */
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo nav tools";
  align-items: center;
  gap: 24px;
  min-height: 100px;
}

/* Mobile toggle hidden on desktop */
.mobile-menu-toggle {
  display: none;
}

/* ── Logo ── */
.custom-logo-box {
  grid-area: logo;
  /* RTL: logo sits on the right */
}

.custom-logo-box a {
  display: inline-flex;
  align-items: center;
  color: #111827;
  font-family: 'Cairo', sans-serif;
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}

.custom-logo-box img {
  max-height: 75px;
  max-width: 240px;
  width: auto;
  display: block;
}

/* ── Nav ── */
.custom-main-nav {
  grid-area: nav;
  min-width: 0;
}

/* Reset WordPress ul */
.custom-main-menu,
.custom-main-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Top-level menu row */
.custom-main-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;            /* gap between items; ::before handles underline */
}

/* ── Top-level <li> ── */
.custom-main-menu > li {
  position: relative;
  display: flex;
  align-items: center;
}

/* ── Top-level <a> ── */
.custom-main-menu > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #111827;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 12px;
  white-space: nowrap;
  transition: color 0.25s ease;
}

/*
  UNDERLINE: use ::before  (avoids clash with submenu arrow ::after)
  Animates from width:0 to width:100% on hover / active
*/
.custom-main-menu > li > a::before {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 2px;
  left: 12px;
  height: 2px;
  background: linear-gradient(90deg, #ef4444, #2563eb);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.3s ease;
  border-radius: 2px;
}

.custom-main-menu > li > a:hover,
.custom-main-menu > li.current-menu-item > a,
.custom-main-menu > li.current-menu-ancestor > a {
  color: #2563eb;
}

.custom-main-menu > li > a:hover::before,
.custom-main-menu > li.current-menu-item > a::before,
.custom-main-menu > li.current-menu-ancestor > a::before {
  transform: scaleX(1);
}

/* ── Submenu toggle button (injected by Walker) ── */
.submenu-toggle {
  display: none; /* hidden on desktop; shown on mobile via media query */
}

/*
  ARROW on items that have children — desktop only.
  We append a chevron AFTER the <a> using ::after on the <li>
  so it never conflicts with the <a>'s own pseudo-elements.
*/
.custom-main-menu > li.menu-item-has-children > a::after {
  content: "\f078"; /* fa-chevron-down */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 10px;
  margin-right: 5px;  /* RTL: space between text and chevron */
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.25s ease;
  line-height: 1;
}

/* Rotate arrow when sub-menu is open (hover on desktop) */
.custom-main-menu > li.menu-item-has-children:hover > a::after,
.custom-main-menu > li.menu-item-has-children:focus-within > a::after,
.custom-main-menu > li.menu-item-has-children.submenu-open > a::after {
  transform: rotate(180deg);
}

/* ── Sub-menu — Desktop ── */
.custom-main-menu .sub-menu {
  position: absolute;
  /*
    top:100% بدون gap — الـ padding-top يعطي مسافة بصرية
    بينما يبقى hover ممتداً لأن الـ sub-menu ملاصق للـ <li>
  */
  top: 100%;
  right: 0;
  min-width: 210px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.13);
  border: 1px solid #e5e7eb;
  padding: 10px 6px 6px; /* padding-top = المسافة البصرية بدون gap حقيقي */
  z-index: 9999;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

/* جسر شفاف يغطي المسافة بين الـ <a> والـ sub-menu ليمنع انقطاع الـ hover */
.custom-main-menu > li.menu-item-has-children > a::after {
  /* نُبقي هذا فارغاً ليحل محل bridge — الـ ::after للسهم فقط */
}

/* bridge مرئي بـ ::before على الـ sub-menu نفسه */
.custom-main-menu .sub-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 0;
  left: 0;
  height: 8px;
  background: transparent; /* شفاف لكنه يبقي الـ hover متصلاً */
}

/* Reveal on hover and focus-within (keyboard navigation) */
.custom-main-menu > li:hover > .sub-menu,
.custom-main-menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.custom-main-menu .sub-menu li {
  position: relative;
}

.custom-main-menu .sub-menu a {
  display: flex;
  align-items: center;
  color: #1f2937;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.custom-main-menu .sub-menu a:hover {
  background: #eff6ff;
  color: #2563eb;
}

/* Nested sub-sub-menus */
.custom-main-menu .sub-menu .sub-menu {
  top: 0;
  right: 100%;
  left: auto;
  margin-right: 4px;
}

.custom-main-menu .sub-menu li:hover > .sub-menu,
.custom-main-menu .sub-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* ── Header Tools ── */
.custom-header-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  position: relative;
}

/* Search toggle button */
.search-toggle {
  border: 0;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  background: #2563eb;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}

.search-toggle:hover {
  background: #1d4ed8;
}

/* Search box dropdown */
.header-search-box {
  position: absolute;
  top: calc(100% + 12px);
  /* RTL: align to left side of tools area */
  left: 0;
  width: 400px;
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.13);
  display: none;
  z-index: 99999;
}

/* Arrow pointer */
.header-search-box::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 20px;
  width: 16px;
  height: 16px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(15, 23, 42, 0.03);
}

.header-search-box.active {
  display: block;
}

.header-search-box form,
.header-search-box .search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.header-search-box input[type="search"],
.header-search-box .search-field {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  outline: none;
  direction: rtl;
}

.header-search-box input[type="search"]:focus,
.header-search-box .search-field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.header-search-box input[type="submit"],
.header-search-box button[type="submit"],
.header-search-box .search-submit {
  width: 52px;
  height: 50px;
  flex: 0 0 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.25s ease;
}

.header-search-box input[type="submit"]:hover,
.header-search-box button[type="submit"]:hover,
.header-search-box .search-submit:hover {
  background: #1d4ed8;
}

/* ── Follow Dropdown ── */
.follow-dropdown {
  position: relative;
}

.follow-btn {
  background: linear-gradient(135deg, #2563eb, #ef4444);
  color: #fff;
  padding: 0 22px;
  height: 52px;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.follow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.follow-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  min-width: 175px;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  border: 1px solid #e5e7eb;
  display: none;
  z-index: 99999;
}

.follow-dropdown:hover .follow-menu,
.follow-dropdown:focus-within .follow-menu {
  display: block;
}

.follow-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #1f2d3d;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  transition: background 0.2s ease, color 0.2s ease;
}

.follow-menu a:hover {
  background: #eff6ff;
  color: #2563eb;
}

/* ── Sticky Header ── */
.custom-site-header.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.10);
}

.custom-site-header.sticky .custom-header-row {
  min-height: 72px;
}

.custom-site-header.sticky .custom-logo-box img {
  max-height: 56px;
}

/* =========================
   Reading Progress
========================= */

#reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #ef4444);
  z-index: 999999;
  transition: width 0.1s linear;
}

/* =========================
   Section Title
========================= */

.section-title {
  text-align: right;
  font-family: 'Cairo', sans-serif;
  font-size: 28px;
  margin: 0 0 30px;
  color: #ef4444;
  border-bottom: 3px solid #ef4444;
  display: inline-block;
  padding-bottom: 10px;
}

/* =========================
   Buttons
========================= */

.read-more-btn,
.load-more-btn {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  display: inline-block;
  background: linear-gradient(135deg, #2563eb, #ef4444);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
  transition: transform 0.3s ease, color 0.2s ease;
  border: 0;
  cursor: pointer;
}

.read-more-btn {
  padding: 11px 24px;
}

.read-more-btn:hover,
.load-more-btn:hover {
  color: #fff;
  transform: translateY(-2px);
}

.load-more-btn {
  min-width: 260px;
  padding: 14px 25px;
  font-size: 15px;
  text-align: center;
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.load-more-wrap {
  text-align: center;
  margin-top: 45px;
}

/* =========================
   Home Page
========================= */

.custom-home-page {
  background: #f8fbff;
}

.home-main-featured {
  padding: 40px 0 45px;
}

.main-featured-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 38px;
  align-items: center;
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  direction: ltr;
}

.main-featured-content {
  direction: rtl;
  grid-column: 1;
  min-width: 0;
}

.main-featured-image {
  grid-column: 2;
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
}

.main-featured-image img {
  width: 100%;
  height: 265px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.main-featured-image:hover img {
  transform: scale(1.05);
}

.main-featured-image span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: #2563eb;
  color: #fff;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 5px;
}

.main-featured-content h1 {
  font-family: 'Cairo', sans-serif;
  font-size: 32px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.main-featured-content h1 a {
  color: #111827;
  text-decoration: none;
  background-image: linear-gradient(90deg, #2563eb, #ef4444);
  background-repeat: no-repeat;
  background-size: 0% 3px;
  background-position: right 100%;
  padding-bottom: 6px;
  transition: color 0.25s ease, background-size 0.25s ease;
}

.main-featured-content h1 a:hover {
  color: #2563eb;
  background-size: 100% 3px;
}

.main-featured-content p {
  font-size: 15px;
  line-height: 1.9;
  color: #4b5563;
  margin-bottom: 20px;
}

/* Trending */
.home-trending {
  padding: 30px 0;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.trending-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.trending-card:hover {
  transform: translateY(-4px);
}

.trending-card a {
  text-decoration: none;
  display: block;
}

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

.trending-card h3 {
  color: #111827;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  padding: 10px;
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

/* News Grid */
.home-news-section {
  padding: 35px 0 60px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* Post Card */
.post-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.post-thumb {
  position: relative;
  display: block;
  height: 210px;
  overflow: hidden;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.post-card:hover .post-thumb img {
  transform: scale(1.06);
}

.post-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.25), transparent);
}

.post-content {
  padding: 18px 16px 20px;
  text-align: center;
}

.post-content h3 {
  margin: 0 0 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 20px;
  line-height: 1.55;
}

.post-content h3 a {
  color: #111827;
  text-decoration: none;
  background-image: linear-gradient(90deg, #2563eb, #ef4444);
  background-repeat: no-repeat;
  background-size: 0% 3px;
  background-position: right 100%;
  padding-bottom: 5px;
  transition: color 0.25s ease, background-size 0.25s ease;
}

.post-content h3 a:hover {
  color: #2563eb;
  background-size: 100% 3px;
}

.post-content p {
  color: #667085;
  line-height: 1.8;
  font-size: 14px;
  margin: 0 0 14px;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #8a94a6;
  font-size: 13px;
  font-weight: 500;
}

/* =========================
   Dark Category Section
========================= */

.dark-category-section {
  background: #2b2d31;
  padding: 55px 0 70px;
}

.dark-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.dark-category-head h2 {
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 28px;
  margin: 0;
  position: relative;
  padding-right: 18px;
}

.dark-category-head h2::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 8px;
  height: 22px;
  background: #22b8c9;
  transform: translateY(-50%);
}

.dark-category-head a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.dark-category-head a:hover {
  color: #22b8c9;
}

.dark-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.dark-category-card {
  color: #fff;
  transition: transform 0.3s ease;
}

.dark-category-card:hover {
  transform: translateY(-5px);
}

.dark-category-img {
  position: relative;
  display: block;
  overflow: hidden;
  height: 250px;
  margin-bottom: 18px;
  border-radius: 10px;
}

.dark-category-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.dark-category-card:hover .dark-category-img img {
  transform: scale(1.05);
}

.dark-category-img span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: #22b8c9;
  color: #fff;
  padding: 7px 12px;
  border-radius: 4px;
  font-size: 13px;
}

.dark-category-card h3 {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  font-size: 22px;
  line-height: 1.6;
  font-weight: 800;
}

.dark-category-card h3 a {
  color: #fff;
  text-decoration: none;
}

.dark-category-card h3 a:hover {
  color: #22b8c9;
}

/* =========================
   Multi Category Section
========================= */

.multi-category-section {
  padding: 45px 0 70px;
  background: #fff;
}

.multi-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.multi-category-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.multi-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.multi-category-head h2 {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  font-size: 24px;
  color: #111827;
}

.multi-category-head a {
  color: #ef4444;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.multi-category-list {
  display: flex;
  flex-direction: column;
}

.multi-category-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e5e7eb;
}

.multi-category-item:last-child {
  border-bottom: 0;
}

.multi-category-thumb img {
  width: 78px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.multi-category-info h3 {
  margin: 0 0 6px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.multi-category-info h3 a {
  color: #111827;
  text-decoration: none;
}

.multi-category-info h3 a:hover {
  color: #2563eb;
}

.multi-category-info span {
  color: #64748b;
  font-size: 13px;
}

/* =========================
   Archive Page
========================= */

.custom-archive-page {
  background: #f8fbff;
}

.archive-hero-custom {
  background: linear-gradient(135deg, #eff6ff, #fef2f2);
  padding: 65px 0;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.archive-hero-custom h1 {
  margin: 0 0 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 42px;
  color: #111827;
}

.archive-hero-custom p {
  margin: 0 auto;
  max-width: 760px;
  color: #4b5563;
  font-size: 17px;
  line-height: 1.9;
}

.archive-posts-section {
  padding: 55px 0;
}

.archive-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.archive-post-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.archive-post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.archive-post-thumb {
  display: block;
  height: 230px;
  overflow: hidden;
}

.archive-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.archive-post-card:hover .archive-post-thumb img {
  transform: scale(1.06);
}

.archive-post-content {
  padding: 20px;
  text-align: center;
}

.archive-post-content h2 {
  margin: 0 0 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 21px;
  line-height: 1.55;
}

.archive-post-content h2 a {
  color: #111827;
  text-decoration: none;
  background-image: linear-gradient(90deg, #2563eb, #ef4444);
  background-repeat: no-repeat;
  background-size: 0% 3px;
  background-position: right 100%;
  padding-bottom: 5px;
  transition: color 0.25s ease, background-size 0.25s ease;
}

.archive-post-content h2 a:hover {
  color: #2563eb;
  background-size: 100% 3px;
}

.archive-post-content p {
  color: #667085;
  line-height: 1.8;
  font-size: 14px;
  margin: 0 0 14px;
}

.archive-post-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #8a94a6;
  font-size: 13px;
}

.archive-pagination {
  margin-top: 45px;
  text-align: center;
}

.archive-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  margin: 0 4px;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: background 0.25s ease, color 0.25s ease;
}

.archive-pagination .page-numbers.current,
.archive-pagination .page-numbers:hover {
  background: linear-gradient(135deg, #2563eb, #ef4444);
  color: #fff;
}

/* =========================
   Single Post
========================= */

.single-post-page {
  background: #f8fbff;
}

.single-hero {
  padding: 45px 0 25px;
  text-align: center;
}

.post-title {
  font-family: 'Cairo', sans-serif;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.4;
  margin: 0 0 15px;
  color: #111827;
}

.post-meta-top {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 15px;
  font-weight: 500;
}

.share-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.bottom-share {
  margin-top: 40px;
}

.share-icons a {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.share-icons .fb { background: #1877f2; }
.share-icons .tg { background: #0088cc; }
.share-icons .wa { background: #25d366; }
.share-icons .x  { background: #111827; }

.share-icons a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.single-content {
  padding: 35px 0 55px;
}

.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 35px;
  align-items: start;
}

.post-content-box {
  background: #fff;
  border-radius: 18px;
  padding: 35px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  min-width: 0;
}

.post-content-area {
  font-family: 'Tajawal', sans-serif;
  font-size: 18px;
  line-height: 2.1;
  color: #1f2937;
  overflow-wrap: break-word;
  word-break: break-word;
}

.post-content-area p {
  margin-bottom: 22px;
}

.post-content-area h2,
.post-content-area h3 {
  color: #111827;
  margin: 35px 0 18px;
  line-height: 1.5;
  font-family: 'Cairo', sans-serif;
}

.post-content-area img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 10px auto;
}

.post-content-area table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 25px 0;
  -webkit-overflow-scrolling: touch;
}

.post-content-area th,
.post-content-area td {
  padding: 10px 14px;
  border: 1px solid #ddd;
  text-align: center;
  white-space: nowrap;
}

.post-content-area iframe,
.post-content-area embed,
.post-content-area video {
  max-width: 100%;
}

.table-of-contents {
  background: #f8fbff;
  border: 1px solid #e5e7eb;
  padding: 22px;
  border-radius: 14px;
  margin-bottom: 32px;
}

.table-of-contents h3 {
  margin: 0 0 15px;
  font-family: 'Cairo', sans-serif;
  font-size: 22px;
  color: #111827;
}

.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.table-of-contents li {
  margin-bottom: 12px;
}

.table-of-contents a {
  color: #2563eb;
  text-decoration: none;
  font-size: 16px;
}

.table-of-contents a:hover {
  color: #ef4444;
}

.single-sidebar {
  position: sticky;
  top: 110px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

.single-sidebar h3 {
  margin: 0 0 18px;
  font-family: 'Cairo', sans-serif;
  font-size: 24px;
  color: #111827;
}

.single-sidebar a {
  display: block;
  color: #111827;
  text-decoration: none;
  margin-bottom: 14px;
  line-height: 1.7;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
}

.single-sidebar a:last-child {
  border-bottom: 0;
}

.single-sidebar a:hover {
  color: #2563eb;
}

.related-posts {
  padding: 55px 0 70px;
}

.related-posts h2 {
  font-family: 'Cairo', sans-serif;
  font-size: 28px;
  margin-bottom: 30px;
  color: #111827;
  display: inline-block;
  position: relative;
  padding-bottom: 10px;
}

.related-posts h2::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #ef4444);
  border-radius: 2px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 25px;
}

.related-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.related-card a {
  display: block;
  text-decoration: none;
  color: #111827;
}

.related-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.related-card h3 {
  min-height: 95px;
  padding: 16px;
  margin: 0;
  font-family: 'Cairo', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
  color: #111827;
  transition: color 0.25s ease;
}

.related-card:hover h3 {
  color: #2563eb;
}

/* =========================
   Footer
========================= */

.custom-footer {
  background: #111827;
  color: #e5e7eb;
  padding: 55px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 35px;
}

.footer-about h3,
.footer-links h4,
.footer-social h4 {
  color: #fff;
  margin: 0 0 18px;
  font-family: 'Cairo', sans-serif;
  font-size: 20px;
}

.footer-about p {
  color: #cbd5e1;
  line-height: 1.9;
  font-size: 15px;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-direction: column;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  margin-bottom: 10px;
  font-size: 15px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.footer-links a:hover {
  color: #38bdf8;
  transform: translateX(-4px);
}

.footer-social-icons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-social-icons a {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.footer-social-icons a:hover {
  background: #2563eb;
}

.footer-bottom {
  border-top: 1px solid #1f2937;
  margin-top: 35px;
  padding-top: 18px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* =========================
   Responsive — 1200px
========================= */

@media (max-width: 1200px) {
  .custom-main-menu {
    gap: 2px;
  }

  .custom-main-menu > li > a {
    font-size: 14px;
    padding: 8px 10px;
  }

  .news-grid,
  .trending-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================
   Responsive — Mobile (≤1024px)
   الهيدر يتحول إلى:
   [hamburger] [tools] [space] [logo]
   القائمة تنكشف في سطر منفصل تحتها
========================= */

@media (max-width: 1024px) {

  /* تعطيل sticky على الموبايل لتجنب تراكب العناصر */
  .custom-site-header,
  .custom-site-header.sticky {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    box-shadow: none !important;
  }

  .custom-container {
    width: 94%;
  }

  /*
    Grid row 1: [hamburger] [tools] [gap] [logo]
    Grid row 2: [nav — full width]
    direction:ltr لأننا نتحكم يدوياً في ترتيب grid-column
  */
  .custom-header-row {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "toggle tools . logo"
      "nav    nav   nav  nav";
    grid-template-rows: auto auto;
    min-height: auto;
    gap: 8px;
    padding: 10px 0;
    direction: ltr; /* نتحكم بالترتيب يدوياً */
    align-items: center;
  }

  /* Logo — يمين في RTL = grid-column 4 */
  .custom-logo-box {
    grid-area: logo;
    justify-self: end;
    direction: rtl;
  }

  .custom-logo-box img {
    max-height: 56px;
    max-width: 175px;
  }

  /* Hamburger */
  .mobile-menu-toggle {
    grid-area: toggle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #ef4444);
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    justify-self: start;
  }

  /* Tools */
  .custom-header-tools {
    grid-area: tools;
    justify-self: start;
    direction: rtl;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .search-toggle {
    width: 46px;
    height: 46px;
    font-size: 20px;
  }

  .follow-btn {
    height: 46px;
    padding: 0 14px;
    font-size: 14px;
  }

  /* Search box — fixed full width on mobile */
  .header-search-box {
    position: fixed;
    top: 70px;
    right: 3vw;
    left: 3vw;
    width: auto;
    max-width: none;
  }

  .header-search-box::before {
    display: none;
  }

  /* ── Nav — Mobile ── */
  .custom-main-nav {
    grid-area: nav;
    display: none;
    width: 100%;
    direction: rtl;
  }

  .custom-main-nav.is-open {
    display: block;
  }

  /* Reset desktop flex to vertical list */
  .custom-main-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  }

  /* Top-level items */
  .custom-main-menu > li {
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid #f1f5f9;
  }

  .custom-main-menu > li:last-child {
    border-bottom: 0;
  }

  /* Row: link + toggle button side by side */
  .custom-main-menu > li > a {
    flex: 1;
    font-size: 15px;
    padding: 13px 12px;
    white-space: normal;
  }

  /* Hide desktop underline animation on mobile */
  .custom-main-menu > li > a::before {
    display: none;
  }

  /* Hide desktop chevron (it's inside the <a>) */
  .custom-main-menu > li.menu-item-has-children > a::after {
    display: none;
  }

  /* ── Submenu toggle button — mobile only ── */
  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background: #f8fbff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    color: #374151;
    font-size: 13px;
    margin: 6px 6px 6px 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
  }

  .submenu-toggle:hover {
    background: #eff6ff;
    color: #2563eb;
  }

  /* Rotate icon when submenu is open */
  .menu-item-has-children.submenu-open > .submenu-toggle {
    transform: rotate(180deg);
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
  }

  /* Flex row للـ link + toggle في نفس السطر دائماً */
  .custom-main-menu > li.menu-item-has-children {
    display: flex;
    flex-wrap: wrap;     /* نسمح بـ wrap للـ sub-menu فقط (flex-basis:100%) */
    align-items: center;
    flex-direction: row;
  }

  .custom-main-menu > li.menu-item-has-children > a {
    flex: 1;
    min-width: 0;
    order: 1;
  }

  /* الزر دائماً بجانب الـ link في نفس السطر */
  .custom-main-menu > li.menu-item-has-children > .submenu-toggle {
    order: 2;
    flex-shrink: 0;
  }

  /* ── Sub-menu — Mobile ── */
  .custom-main-menu .sub-menu {
    /* override desktop absolute positioning */
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: 0;
    border-top: 1px solid #f1f5f9;
    border-radius: 0;
    padding: 4px 0 4px 16px;
    background: #f8fbff;
    /* full width في سطر منفصل تحت الـ flex row */
    width: 100%;
    flex-basis: 100%;    /* يجبره على الانتقال لسطر جديد */
    order: 10;           /* دائماً آخر عنصر */
    display: none;       /* JS يتحكم فيه */
  }

  .custom-main-menu .sub-menu a {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 6px;
  }

  /* ── Content responsive ── */
  .main-featured-card {
    grid-template-columns: 1fr;
    direction: rtl;
    gap: 20px;
  }

  .main-featured-content,
  .main-featured-image {
    grid-column: auto;
  }

  .news-grid,
  .trending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .multi-category-grid,
  .dark-category-grid,
  .archive-posts-grid {
    grid-template-columns: 1fr;
  }

  .single-layout {
    grid-template-columns: 1fr;
  }

  .single-sidebar {
    position: static;
    top: auto;
    margin-top: 30px;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================
   Responsive — 768px
========================= */

@media (max-width: 768px) {

  .main-featured-card {
    padding: 16px;
  }

  .main-featured-content h1 {
    font-size: 23px;
  }

  .main-featured-content p {
    font-size: 14px;
  }

  .main-featured-image img {
    height: 210px;
  }

  .section-title {
    font-size: 23px;
    margin-bottom: 22px;
  }

  .post-title {
    font-size: 28px;
    padding: 0 8px;
  }

  .post-content-box {
    padding: 20px;
  }

  .post-content-area {
    font-size: 16px;
  }

  .archive-hero-custom {
    padding: 45px 0;
  }

  .archive-hero-custom h1 {
    font-size: 30px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-social-icons {
    justify-content: center;
  }

  .footer-links a:hover {
    transform: none;
  }
}

/* =========================
   Responsive — 600px
========================= */

@media (max-width: 600px) {
  .custom-container {
    width: 94%;
  }

  .custom-logo-box img {
    max-height: 50px;
    max-width: 155px;
  }

  .search-toggle {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .follow-btn {
    padding: 0 10px;
    font-size: 13px;
    height: 42px;
  }

  .header-search-box {
    top: 64px;
    right: 3vw;
    left: 3vw;
    width: auto;
    padding: 12px;
  }

  .header-search-box form,
  .header-search-box .search-form {
    gap: 8px;
  }

  .header-search-box input[type="search"],
  .header-search-box .search-field {
    height: 46px;
    font-size: 15px;
    padding: 0 12px;
  }

  .header-search-box input[type="submit"],
  .header-search-box button[type="submit"],
  .header-search-box .search-submit {
    width: 48px;
    height: 46px;
    flex-basis: 48px;
  }

  .news-grid,
  .trending-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-thumb,
  .post-thumb img {
    height: 200px;
  }

  .trending-card img {
    height: 180px;
  }

  .dark-category-img {
    height: 200px;
  }

  .post-content h3 {
    font-size: 18px;
  }

  .post-content {
    padding: 14px;
  }

  .multi-category-box {
    padding: 16px;
  }

  .multi-category-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
  }

  .multi-category-thumb img {
    width: 68px;
    height: 58px;
  }

  .single-hero {
    padding: 30px 0 16px;
  }

  .post-title {
    font-size: 24px;
  }

  .post-meta-top {
    gap: 8px;
    font-size: 13px;
  }

  .related-card img {
    height: 190px;
  }

  .related-card h3 {
    font-size: 16px;
    min-height: auto;
  }

  .dark-category-head h2,
  .related-posts h2 {
    font-size: 22px;
  }

  .table-of-contents {
    padding: 15px;
  }

  .table-of-contents a {
    font-size: 15px;
  }

  .load-more-btn {
    min-width: 200px;
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* =========================
   Responsive — 420px
========================= */

@media (max-width: 420px) {
  .custom-header-row {
    gap: 6px;
  }

  .custom-logo-box img {
    max-width: 135px;
  }

  .custom-header-tools {
    gap: 6px;
  }

  .mobile-menu-toggle,
  .search-toggle {
    width: 40px;
    height: 40px;
  }

  .follow-btn {
    padding: 0;
    width: 40px;
    height: 40px;
    font-size: 0; /* hide text */
    border-radius: 8px;
  }

  /* Show a short label via ::after */
  .follow-btn::after {
    content: "تابع";
    font-size: 11px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
  }
}
.custom-site-header {
    border-bottom: 5px solid transparent !important;
    border-image: linear-gradient(90deg, #0D2B52, #1E88FF, #87CEEB) 1 !important;
}




/* Fix desktop ad width */
.arabsky-ad {
  width: 100%;
  max-width: 970px;
  margin: 35px auto;
  text-align: center;
  overflow: hidden;
  border-radius: 14px;
}

.arabsky-ad ins.adsbygoogle {
  display: block !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

/* إعلانات داخل المقال */
.post-content-box .arabsky-ad,
.post-content-area .arabsky-ad {
  max-width: 728px;
}

/* إعلانات الصفحة الرئيسية */
.custom-home-page .arabsky-ad {
  max-width: 970px;
}

/* الموبايل */
@media (max-width: 768px) {
  .arabsky-ad {
    max-width: 100%;
    margin: 25px auto;
    border-radius: 10px;
  }
}


.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.toc-icon {
  font-size: 13px;
}

.toc-body {
  margin-top: 16px;
}

.table-of-contents.toc-closed .toc-body {
  display: none !important;
}

/* =========================
   ArabSkyTech Pro Layer
========================= */

:root {
  --ast-blue: #2563eb;
  --ast-blue-dark: #1d4ed8;
  --ast-red: #ef4444;
  --ast-cyan: #22b8c9;
  --ast-ink: #111827;
  --ast-text: #1f2937;
  --ast-muted: #64748b;
  --ast-border: #e5e7eb;
  --ast-soft: #f8fbff;
  --ast-card: #ffffff;
}

.custom-header-tools .dark-toggle {
  border: 0;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  background: #111827;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.custom-header-tools .dark-toggle:hover {
  background: #374151;
  transform: translateY(-2px);
}

.arabsky-breaking {
  background: #fff;
  border-bottom: 1px solid var(--ast-border);
}

.breaking-inner {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.breaking-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--ast-red), var(--ast-blue));
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  white-space: nowrap;
}

.breaking-list {
  position: relative;
  min-height: 34px;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.breaking-list li {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.breaking-list:not(.is-ready) li:first-child,
.breaking-list li.is-active {
  opacity: 1;
  transform: translateY(0);
}

.breaking-list a {
  color: var(--ast-ink);
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breaking-list a:hover {
  color: var(--ast-blue);
}

.arabsky-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px 0 0;
  color: var(--ast-muted);
  font-size: 14px;
}

.arabsky-breadcrumbs a {
  color: var(--ast-blue);
  text-decoration: none;
  font-weight: 700;
}

.post-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ast-blue), var(--ast-red));
  color: #fff !important;
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  z-index: 2;
}

.post-thumb .post-cat-badge,
.archive-post-thumb .post-cat-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.single-hero-inner .post-cat-badge {
  position: static;
  margin-bottom: 14px;
}

.post-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 160px;
  color: #9ca3af;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(239, 68, 68, 0.08)),
    #f3f4f6;
  font-size: 34px;
}

.main-featured-image .post-thumb-placeholder {
  min-height: 265px;
}

.multi-category-thumb .post-thumb-placeholder {
  width: 78px;
  min-height: 64px;
  border-radius: 8px;
  font-size: 18px;
}

.archive-post-thumb,
.post-thumb {
  position: relative;
}

.post-meta i {
  margin-left: 4px;
  color: var(--ast-blue);
}

.single-hero-inner {
  max-width: 920px;
  margin: 0 auto;
}

.single-hero .post-meta {
  justify-content: center;
  margin-top: 10px;
}

.top-share {
  margin-top: 20px;
}

.single-featured-image {
  max-width: 980px;
  margin: 28px auto 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.14);
}

.single-featured-image img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.sidebar-widget {
  margin-bottom: 28px;
}

.sidebar-widget:last-child {
  margin-bottom: 0;
}

.sidebar-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-widget li {
  border-bottom: 1px solid var(--ast-border);
}

.sidebar-widget li:last-child {
  border-bottom: 0;
}

.sidebar-category-list a {
  display: inline-flex;
  width: auto;
  border: 0;
  margin: 0;
  padding: 10px 0;
}

.single-comments {
  padding: 0 0 45px;
}

.comments-box {
  margin-top: 20px;
}

.comments-area {
  color: var(--ast-text);
}

.comments-title,
.comment-reply-title {
  margin: 0 0 22px;
  font-family: 'Cairo', sans-serif;
  font-size: 24px;
  color: var(--ast-ink);
}

.comment-list {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
}

.comment-list .comment {
  border-bottom: 1px solid var(--ast-border);
  padding: 20px 0;
}

.comment-list .comment:last-child {
  border-bottom: 0;
}

.comment-body {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
}

.comment-author .avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.comment-author .fn {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  color: var(--ast-ink);
}

.comment-metadata,
.comment-awaiting-moderation {
  color: var(--ast-muted);
  font-size: 13px;
}

.comment-content {
  grid-column: 2;
  color: var(--ast-text);
}

.reply {
  grid-column: 2;
}

.reply a {
  color: var(--ast-blue);
  text-decoration: none;
  font-weight: 800;
}

.comment-form {
  display: grid;
  gap: 14px;
}

.comment-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--ast-ink);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--ast-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Tajawal', sans-serif;
}

.comment-form .submit {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ast-blue), var(--ast-red));
  color: #fff;
  padding: 12px 24px;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  cursor: pointer;
}

.page-content-box {
  max-width: 920px;
  margin: 0 auto;
}

.not-found-search {
  max-width: 560px;
  margin: 24px auto;
}

.not-found-search form,
.not-found-search .search-form {
  display: flex;
  gap: 10px;
}

.not-found-search input[type="search"],
.not-found-search .search-field {
  width: 100%;
  height: 50px;
  border: 1px solid var(--ast-border);
  border-radius: 10px;
  padding: 0 14px;
}

.not-found-search input[type="submit"],
.not-found-search .search-submit {
  border: 0;
  border-radius: 10px;
  background: var(--ast-blue);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
}

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

.footer-menu li {
  margin: 0;
  padding: 0;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-widget h4 {
  margin: 0 0 14px;
  color: #fff;
  font-family: 'Cairo', sans-serif;
}

.footer-widget,
.footer-widget p,
.footer-widget a {
  color: #cbd5e1;
}

.back-to-top {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ast-blue), var(--ast-red));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  z-index: 99999;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.arabsky-ad {
  width: min(970px, 92%);
}

.arabsky-ad-empty {
  border: 1px dashed #cbd5e1;
  background: rgba(255, 255, 255, 0.7);
  padding: 18px;
  color: var(--ast-muted);
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
}

.ad-before-header {
  margin-top: 14px;
  margin-bottom: 14px;
}

.ad-after-header {
  margin-top: 22px;
}

.ad-sidebar {
  width: 100%;
  margin-top: 0;
}

.archive-empty {
  text-align: center;
  font-size: 18px;
  color: var(--ast-muted);
}

body.dark-mode {
  color: #e5e7eb;
  background: #0f172a;
}

body.dark-mode .custom-site-header,
body.dark-mode .custom-site-header.sticky,
body.dark-mode .arabsky-breaking,
body.dark-mode .main-featured-card,
body.dark-mode .trending-card,
body.dark-mode .post-card,
body.dark-mode .multi-category-box,
body.dark-mode .archive-post-card,
body.dark-mode .post-content-box,
body.dark-mode .single-sidebar,
body.dark-mode .table-of-contents,
body.dark-mode .custom-main-menu,
body.dark-mode .custom-main-menu .sub-menu,
body.dark-mode .header-search-box,
body.dark-mode .follow-menu {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.22);
  color: #e5e7eb;
}

body.dark-mode .custom-main-menu > li > a,
body.dark-mode .custom-logo-box a,
body.dark-mode .breaking-list a,
body.dark-mode .post-title,
body.dark-mode .post-content h3 a,
body.dark-mode .trending-card h3,
body.dark-mode .multi-category-head h2,
body.dark-mode .multi-category-info h3 a,
body.dark-mode .archive-post-content h2 a,
body.dark-mode .related-card h3,
body.dark-mode .single-sidebar h3,
body.dark-mode .single-sidebar a,
body.dark-mode .table-of-contents h3,
body.dark-mode .post-content-area,
body.dark-mode .post-content-area h2,
body.dark-mode .post-content-area h3 {
  color: #f8fafc;
}

body.dark-mode .main-featured-content p,
body.dark-mode .post-content p,
body.dark-mode .archive-post-content p,
body.dark-mode .post-meta,
body.dark-mode .archive-post-meta,
body.dark-mode .multi-category-info span,
body.dark-mode .arabsky-breadcrumbs {
  color: #cbd5e1;
}

body.dark-mode .archive-hero-custom {
  background: linear-gradient(135deg, #111827, #1f2937);
  border-color: rgba(148, 163, 184, 0.22);
}

body.dark-mode .archive-hero-custom h1,
body.dark-mode .archive-hero-custom p {
  color: #f8fafc;
}

body.dark-mode .comments-title,
body.dark-mode .comment-reply-title,
body.dark-mode .comment-author .fn,
body.dark-mode .comment-form label,
body.dark-mode .comment-content {
  color: #f8fafc;
}

body.dark-mode .comment-form input[type="text"],
body.dark-mode .comment-form input[type="email"],
body.dark-mode .comment-form input[type="url"],
body.dark-mode .comment-form textarea {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.3);
  color: #fff;
}

body.dark-mode .custom-main-menu > li {
  border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .header-search-box input[type="search"],
body.dark-mode .header-search-box .search-field,
body.dark-mode .not-found-search input[type="search"],
body.dark-mode .not-found-search .search-field {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.3);
  color: #fff;
}

body.dark-mode .arabsky-ad-empty {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

/* Dark mode polish: make full pages dark, not only the cards/header. */
body.dark-mode,
body.dark-mode #page,
body.dark-mode .site,
body.dark-mode main,
body.dark-mode .custom-home-page,
body.dark-mode .custom-archive-page,
body.dark-mode .single-post-page,
body.dark-mode .custom-page-view {
  background:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.16), transparent 30%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 46%, #111827 100%) !important;
  color: #e5e7eb;
}

body.dark-mode .home-main-featured,
body.dark-mode .home-trending,
body.dark-mode .home-news-section,
body.dark-mode .multi-category-section,
body.dark-mode .archive-posts-section,
body.dark-mode .single-content,
body.dark-mode .single-comments,
body.dark-mode .related-posts {
  background: transparent !important;
}

body.dark-mode .custom-site-header,
body.dark-mode .custom-site-header.sticky {
  background: rgba(11, 18, 32, 0.96);
  border-bottom-color: rgba(34, 184, 201, 0.75) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

body.dark-mode .main-featured-card,
body.dark-mode .trending-card,
body.dark-mode .post-card,
body.dark-mode .archive-post-card,
body.dark-mode .related-card,
body.dark-mode .multi-category-box,
body.dark-mode .post-content-box,
body.dark-mode .single-sidebar {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

body.dark-mode .main-featured-content h1 a,
body.dark-mode .section-title,
body.dark-mode .dark-category-head h2,
body.dark-mode .related-posts h2 {
  color: #f8fafc;
}

body.dark-mode .section-title {
  border-bottom-color: #38bdf8;
}

body.dark-mode .section-title::after,
body.dark-mode .related-posts h2::after {
  background: linear-gradient(90deg, #38bdf8, #ef4444);
}

body.dark-mode .dark-category-section {
  background: linear-gradient(135deg, #0b1220, #111827);
}

body.dark-mode .custom-main-menu > li > a:hover,
body.dark-mode .custom-main-menu > li.current-menu-item > a,
body.dark-mode .custom-main-menu > li.current-menu-ancestor > a {
  color: #60a5fa;
}

body.dark-mode .post-thumb-placeholder {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(239, 68, 68, 0.14)),
    #111827;
  color: #94a3b8;
}

body.dark-mode .arabsky-breaking {
  background: rgba(15, 23, 42, 0.94);
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .footer-bottom {
  border-top-color: rgba(148, 163, 184, 0.16);
}

@media (max-width: 1024px) {
  .custom-header-tools .dark-toggle {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .breaking-inner {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
  }

  .breaking-label {
    width: max-content;
  }

  .footer-widgets {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .custom-header-tools .dark-toggle {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  .breaking-list a {
    font-size: 14px;
  }

  .arabsky-breadcrumbs {
    padding-top: 14px;
    font-size: 13px;
  }

  .single-featured-image {
    border-radius: 12px;
  }

  .share-icons a {
    width: 38px;
    height: 38px;
  }

  .not-found-search form,
  .not-found-search .search-form {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .custom-header-tools .dark-toggle {
    width: 40px;
    height: 40px;
  }
}

/* =========================
   Homepage Pro Layout
   Palette inspired by the Arab Sky Tech logo
========================= */

:root {
  --ast-blue: #1e88ff;
  --ast-blue-dark: #0d2b52;
  --ast-red: #22b8c9;
  --ast-cyan: #35c9f2;
  --ast-ink: #0b1220;
  --ast-soft: #f4f8ff;
}

.custom-site-header {
  background: #0b1220;
  border-bottom: 5px solid transparent !important;
  border-image: linear-gradient(90deg, #0d2b52, #1e88ff, #35c9f2) 1 !important;
}

.custom-main-menu > li > a,
.custom-logo-box a {
  color: #f8fbff;
}

.custom-main-menu > li > a:hover,
.custom-main-menu > li.current-menu-item > a,
.custom-main-menu > li.current-menu-ancestor > a {
  color: #35c9f2;
}

.search-toggle,
.mobile-menu-toggle,
.read-more-btn,
.load-more-btn,
.follow-btn,
.comment-form .submit,
.back-to-top,
.post-cat-badge {
  background: linear-gradient(135deg, #1e88ff, #35c9f2) !important;
}

.read-more-btn,
.load-more-btn,
.follow-btn {
  box-shadow: 0 10px 24px rgba(30, 136, 255, 0.22);
}

.custom-home-page {
  background: #f4f8ff;
}

.home-main-featured {
  padding: 46px 0 34px;
}

.main-featured-card {
  border-radius: 10px;
  border: 1px solid rgba(13, 43, 82, 0.08);
  box-shadow: 0 18px 48px rgba(13, 43, 82, 0.10);
}

.main-featured-content .post-cat-badge {
  position: static;
  width: max-content;
  margin-bottom: 14px;
}

.home-section-head,
.showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.home-section-head h2,
.showcase-head h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #0d2b52;
}

.home-section-head h2::after,
.showcase-head h2 span {
  content: "";
  display: inline-block;
  width: 10px;
  height: 24px;
  border-radius: 2px;
  background: #22b8c9;
}

.compact-head {
  border-bottom: 1px solid rgba(13, 43, 82, 0.10);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.home-editorial-columns {
  padding: 44px 0;
  background: #fff;
}

.home-columns-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
}

.home-column-block {
  min-width: 0;
}

.home-column-featured {
  margin-bottom: 16px;
}

.home-column-featured-thumb {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  height: 230px;
}

.home-column-featured-thumb img,
.home-column-featured-thumb .post-thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-column-featured h3 {
  margin: 12px 0 0;
  font-family: 'Cairo', sans-serif;
  font-size: 21px;
  line-height: 1.55;
  text-align: center;
}

.home-column-featured h3 a,
.home-column-mini h3 a,
.showcase-card h3 a {
  color: #0b1220;
  text-decoration: none;
}

.home-column-featured h3 a:hover,
.home-column-mini h3 a:hover,
.showcase-card h3 a:hover {
  color: #1e88ff;
}

.home-column-mini {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(13, 43, 82, 0.10);
}

.home-column-mini-thumb {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  height: 70px;
}

.home-column-mini-thumb img,
.home-column-mini-thumb .post-thumb-placeholder {
  width: 100%;
  height: 100%;
  min-height: 70px;
  object-fit: cover;
}

.home-column-mini h3 {
  margin: 0 0 4px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.home-column-mini span {
  color: #64748b;
  font-size: 12px;
}

.home-showcase-section {
  padding: 58px 0 66px;
}

.showcase-dark {
  background: #202228;
  color: #fff;
}

.showcase-light {
  background: #f1f5fb;
}

.showcase-dark .showcase-head h2,
.showcase-dark .showcase-card h3 a {
  color: #fff;
}

.showcase-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.showcase-actions a {
  color: inherit;
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
}

.showcase-controls {
  display: inline-flex;
  gap: 6px;
}

.showcase-controls button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.showcase-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.showcase-grid {
  display: flex;
  direction: ltr;
  gap: 30px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 8px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.showcase-grid::-webkit-scrollbar {
  display: none;
}

.showcase-card {
  direction: rtl;
  flex: 0 0 calc((100% - 90px) / 4);
  min-width: 0;
  scroll-snap-align: start;
}

.showcase-thumb {
  display: block;
  overflow: hidden;
  border-radius: 3px;
  height: 195px;
  background: rgba(15, 23, 42, 0.12);
}

.showcase-thumb img,
.showcase-thumb .post-thumb-placeholder {
  width: 100%;
  height: 100%;
  min-height: 195px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.showcase-card:hover .showcase-thumb img {
  transform: scale(1.04);
}

.showcase-card h3 {
  margin: 13px 0 0;
  font-family: 'Cairo', sans-serif;
  font-size: 19px;
  line-height: 1.55;
  text-align: center;
}

.showcase-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 44px;
}

.showcase-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.55);
}

.showcase-dots span.active {
  width: 15px;
  height: 15px;
  background: #22b8c9;
}

.ad-home-leaderboard,
.ad-home-infeed,
.ad-home-native {
  margin-top: 32px;
  margin-bottom: 32px;
}

body.dark-mode .home-editorial-columns,
body.dark-mode .showcase-light {
  background: transparent !important;
}

body.dark-mode .home-section-head h2,
body.dark-mode .showcase-light .showcase-head h2,
body.dark-mode .home-column-featured h3 a,
body.dark-mode .home-column-mini h3 a,
body.dark-mode .showcase-light .showcase-card h3 a {
  color: #f8fafc;
}

body.dark-mode .home-column-mini {
  border-top-color: rgba(148, 163, 184, 0.18);
}

@media (max-width: 1200px) {
  .showcase-grid {
    gap: 22px;
  }

  .showcase-card {
    flex-basis: calc((100% - 44px) / 3);
  }

  .showcase-thumb {
    height: 170px;
  }
}

@media (max-width: 1024px) {
  .home-columns-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .showcase-card {
    flex-basis: calc((100% - 22px) / 2);
  }

  .home-column-featured-thumb {
    height: 210px;
  }
}

@media (max-width: 700px) {
  .home-columns-grid {
    grid-template-columns: 1fr;
  }

  .showcase-card {
    flex-basis: 86%;
  }

  .home-section-head,
  .showcase-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-section-head h2,
  .showcase-head h2 {
    font-size: 23px;
  }

  .home-column-featured-thumb,
  .showcase-thumb {
    height: 210px;
  }

  .home-showcase-section {
    padding: 42px 0 50px;
  }
}

@media (max-width: 480px) {
  .home-column-mini {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .home-column-mini-thumb {
    height: 62px;
  }
}

/* =========================
   Header + Mobile Width Fixes
========================= */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

#page,
.site,
.custom-home-page,
.custom-archive-page,
.single-post-page {
  max-width: 100%;
  overflow-x: clip;
}

.custom-container {
  width: min(1280px, calc(100% - 32px));
  max-width: 100%;
}

body:not(.dark-mode) .custom-site-header,
body:not(.dark-mode) .custom-site-header.sticky {
  background: #fff !important;
  border-bottom: 5px solid transparent !important;
  border-image: linear-gradient(90deg, #0d2b52, #1e88ff, #35c9f2) 1 !important;
  box-shadow: 0 8px 24px rgba(13, 43, 82, 0.08);
}

body:not(.dark-mode) .custom-main-menu > li > a,
body:not(.dark-mode) .custom-logo-box a {
  color: #0d2b52 !important;
}

body:not(.dark-mode) .custom-main-menu > li > a:hover,
body:not(.dark-mode) .custom-main-menu > li.current-menu-item > a,
body:not(.dark-mode) .custom-main-menu > li.current-menu-ancestor > a {
  color: #1e88ff !important;
}

body:not(.dark-mode) .custom-main-menu .sub-menu a,
body:not(.dark-mode) .follow-menu a {
  color: #0d2b52 !important;
}

body:not(.dark-mode) .custom-main-menu .sub-menu a:hover,
body:not(.dark-mode) .follow-menu a:hover {
  color: #1e88ff !important;
}

body.dark-mode .custom-site-header,
body.dark-mode .custom-site-header.sticky {
  background: rgba(11, 18, 32, 0.96) !important;
}

.custom-header-row,
.custom-header-tools,
.custom-main-nav,
.custom-main-menu,
.home-columns-grid,
.showcase-grid,
.news-grid,
.archive-posts-grid,
.related-grid {
  max-width: 100%;
}

.custom-header-tools,
.custom-main-nav,
.custom-main-menu,
.home-column-block,
.showcase-card,
.post-card,
.archive-post-card {
  min-width: 0;
}

@media (max-width: 1024px) {
  .custom-header-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "toggle tools logo"
      "nav nav nav";
    column-gap: 8px;
  }

  .custom-logo-box img {
    max-width: 150px;
  }

  .custom-header-tools {
    overflow: visible;
  }

  .custom-main-menu {
    width: 100%;
  }

  .header-search-box {
    right: 16px;
    left: 16px;
    width: auto;
  }
}

@media (max-width: 768px) {
  .custom-container {
    width: calc(100% - 24px);
  }

  .follow-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 0;
    border-radius: 8px;
  }

  .follow-btn::after {
    content: "\f1e0";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 16px;
  }

  .follow-menu {
    left: 0;
    right: auto;
    max-width: calc(100vw - 32px);
  }

  .custom-logo-box img {
    max-width: 128px;
  }

  .home-column-featured h3,
  .showcase-card h3 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .custom-container {
    width: calc(100% - 20px);
  }

  .custom-header-row {
    gap: 6px;
  }

  .custom-header-tools {
    gap: 5px;
  }

  .custom-logo-box img {
    max-width: 108px;
  }

  .mobile-menu-toggle,
  .search-toggle,
  .custom-header-tools .dark-toggle,
  .follow-btn {
    width: 38px;
    height: 38px;
  }

  .home-column-mini h3 {
    font-size: 14px;
  }
}

/* =========================
   Mobile Article Fit Fixes
========================= */

.single-post-page,
.single-post-page #primary,
.single-post-page .single-content,
.single-post-page .custom-container,
.single-layout,
.post-content-box,
.post-content-area,
.table-of-contents {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.single-post-page .custom-container {
  overflow-x: visible;
}

.post-content-box {
  overflow: hidden;
}

.post-content-area,
.post-content-area p,
.post-content-area li,
.post-content-area blockquote,
.post-content-area h1,
.post-content-area h2,
.post-content-area h3,
.post-content-area h4,
.post-content-area h5,
.post-content-area h6 {
  overflow-wrap: anywhere;
  word-break: normal;
}

.post-content-area > *,
.post-content-area .wp-block-group,
.post-content-area .wp-block-columns,
.post-content-area .wp-block-column,
.post-content-area .wp-block-cover,
.post-content-area .wp-block-media-text,
.post-content-area figure,
.post-content-area .wp-block-image,
.post-content-area .wp-block-embed,
.post-content-area .wp-block-table {
  max-width: 100% !important;
  box-sizing: border-box;
}

.post-content-area .alignwide,
.post-content-area .alignfull {
  width: 100% !important;
  max-width: 100% !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

.post-content-area img,
.post-content-area figure img,
.post-content-area video,
.post-content-area iframe,
.post-content-area embed,
.post-content-area object {
  max-width: 100% !important;
  height: auto;
}

.post-content-area iframe,
.post-content-area embed,
.post-content-area object {
  width: 100% !important;
}

.post-content-area .wp-block-table,
.post-content-area table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-content-area table {
  border-collapse: collapse;
}

.post-content-area th,
.post-content-area td {
  min-width: 120px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.toc-header {
  gap: 12px;
  flex-wrap: wrap;
}

.toc-toggle {
  max-width: 100%;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .single-post-page .custom-container {
    width: calc(100% - 20px);
  }

  .single-content {
    padding: 22px 0 42px;
  }

  .single-layout {
    display: block;
    width: 100%;
  }

  .post-content-box {
    width: 100%;
    padding: 18px 14px;
    border-radius: 12px;
  }

  .post-content-area {
    font-size: 17px;
    line-height: 2;
    text-align: right;
  }

  .post-content-area h2 {
    font-size: 25px;
    line-height: 1.5;
    margin: 34px 0 14px;
  }

  .post-content-area h3 {
    font-size: 22px;
    line-height: 1.55;
    margin: 28px 0 12px;
  }

  .post-title {
    font-size: 27px;
    line-height: 1.45;
  }

  .table-of-contents {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .table-of-contents h3 {
    font-size: 24px;
  }

  .table-of-contents a {
    font-size: 16px;
    line-height: 1.8;
  }

  .toc-toggle {
    height: 38px;
    padding: 0 12px;
  }

  .single-sidebar {
    width: 100%;
    margin-top: 24px;
  }
}

@media (max-width: 420px) {
  .single-post-page .custom-container {
    width: calc(100% - 16px);
  }

  .post-content-box {
    padding: 16px 12px;
  }

  .post-content-area {
    font-size: 16px;
    line-height: 2;
  }

  .post-content-area h2 {
    font-size: 23px;
  }

  .post-content-area h3 {
    font-size: 20px;
  }

  .post-content-area th,
  .post-content-area td {
    min-width: 105px;
    padding: 9px 10px;
  }
}

/* =========================
   Footer Trim + Live Search
========================= */

.custom-footer {
  padding: 0;
}

.custom-footer .custom-container {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.footer-bottom {
  margin-top: 0;
  border-top: 0;
  padding: 22px 0;
}

.arabsky-live-search {
  position: relative;
}

.header-search-box .arabsky-live-search {
  flex-wrap: wrap;
}

.live-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 100000;
  overflow: hidden;
  border: 1px solid rgba(13, 43, 82, 0.10);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(13, 43, 82, 0.18);
}

.live-search-results[hidden] {
  display: none !important;
}

.live-search-item,
.live-search-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #0d2b52;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
  text-decoration: none;
  border-bottom: 1px solid rgba(13, 43, 82, 0.08);
}

.live-search-item:last-child,
.live-search-status:last-child {
  border-bottom: 0;
}

.live-search-item:hover {
  background: #f4f8ff;
  color: #1e88ff;
}

.live-search-item i {
  flex-shrink: 0;
  color: #35c9f2;
  font-size: 12px;
}

body.dark-mode .live-search-results {
  border-color: rgba(148, 163, 184, 0.20);
  background: #111827;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

body.dark-mode .live-search-item,
body.dark-mode .live-search-status {
  color: #f8fafc;
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

body.dark-mode .live-search-item:hover {
  background: rgba(30, 136, 255, 0.12);
  color: #60a5fa;
}

@media (max-width: 768px) {
  .live-search-results {
    position: static;
    flex: 0 0 100%;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 12px 28px rgba(13, 43, 82, 0.14);
  }

  .live-search-item,
  .live-search-status {
    padding: 11px 12px;
    font-size: 13px;
  }
}