.adsense-wrap {
  max-width: 900px;
  margin: 32px 0;
}

:root {
  --bg: #FFFFFF;
  --surface: #F5F4F1;
  --surface2: #EBEBEB;
  --text: #0F0F0F;
  --muted: #888888;
  --accent: #CC2B09;
  --border: #DEDEDE;
  --border-dark: #0F0F0F;
  --green: #1A7530;
  --nav-h: 52px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F0F;
    --surface: #1A1A1A;
    --surface2: #252525;
    --text: #EFEFEF;
    --border: #2A2A2A;
    --border-dark: #EFEFEF;
    --muted: #777777;
    --accent: #FF4D28;
  }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── READING PROGRESS BAR ─── */
#readingProgress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--border-dark);
}

.logo {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  height: var(--nav-h);
  margin-left: auto;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  transition: color 0.15s, background 0.15s;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  letter-spacing: 0.5px;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--surface);
}

.lang-switcher {
  display: flex;
  height: var(--nav-h);
  border-left: 1px solid var(--border-dark);
}
.lang-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 0 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.5px;
}
.lang-btn:last-child { border-right: none; }
.lang-btn:hover, .lang-btn.active { background: var(--text); color: var(--bg); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0 16px;
  background: none;
  border: none;
  border-left: 1px solid var(--border-dark);
  height: var(--nav-h);
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── BLOG HERO ─── */
.blog-hero {
  padding: calc(var(--nav-h) + 64px) 48px 56px;
  border-bottom: 1px solid var(--border-dark);
}
.blog-hero h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 700;
  letter-spacing: -3px;
  line-height: 0.95;
  margin-bottom: 24px;
}
.blog-hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.blog-hero p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 32px;
  max-width: 480px;
}

/* ─── SEARCH ─── */
.blog-search-wrap {
  position: relative;
  max-width: 400px;
}
.blog-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-dark);
  padding: 12px 20px 12px 44px;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  letter-spacing: 0.3px;
}
.blog-search::placeholder { color: var(--muted); }
.blog-search:focus { border-color: var(--accent); }
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
}

/* ─── CATEGORY FILTERS ─── */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border-dark);
  overflow-x: auto;
}
.filter-btn {
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
.filter-btn:hover { background: var(--surface); color: var(--text); }
.filter-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ─── BLOG GRID ─── */
.blog-grid {
  max-width: 100%;
  margin: 0;
  padding: 0 48px 80px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-left: 1px solid var(--border-dark);
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  max-width: 1200px;
}

.blog-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
  border-bottom: 1px solid var(--border-dark);
}
.blog-card.featured .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}
.blog-card.featured .card-visual {
  background: var(--surface);
  height: 100%;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 72px;
  font-weight: 700;
  color: var(--border);
  letter-spacing: -4px;
  border-left: 1px solid var(--border-dark);
  order: 1;
}
.blog-card.featured h2 { font-size: 24px; }

.blog-card {
  background: var(--bg);
  border: none;
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  padding: 36px 32px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  position: relative;
  cursor: pointer;
}
.blog-card:nth-child(even) { border-right: none; }
.blog-card::before { display: none; }
.blog-card:hover { background: var(--surface); }

.post-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  font-family: 'IBM Plex Mono', monospace;
}

.blog-card h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.blog-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 11px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.3px;
}
.read-time { display: flex; align-items: center; gap: 4px; }
.read-more {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.5px;
}

.no-results { text-align: center; padding: 80px 24px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 14px; }
.no-results.hidden { display: none; }

/* ─── SINGLE POST ─── */
.post-container {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 48px 80px;
  display: none;
}
.post-container.active { display: block; }
.blog-list-section.hidden { display: none; }

.post-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.back-btn:hover { border-color: var(--border-dark); color: var(--text); background: var(--surface); }

.post-share { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  transition: all 0.15s;
}
.share-btn:hover { background: var(--text); border-color: var(--text); color: var(--bg); }

.post-category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-family: 'IBM Plex Mono', monospace;
}

.post-container h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.post-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.3px;
}
.dot { opacity: 0.4; }

.post-divider { border: none; border-top: 1px solid var(--border-dark); margin: 24px 0 40px; }

.post-container h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 48px 0 16px;
  color: var(--text);
}
.post-container h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
}
.post-container p {
  color: #444;
  font-size: 16px;
  line-height: 1.85;
  margin-bottom: 20px;
}
.post-container ul, .post-container ol {
  color: #444;
  font-size: 16px;
  line-height: 1.85;
  margin: 16px 0 20px 24px;
}
.post-container li { margin-bottom: 8px; }
.post-container strong { color: var(--text); font-weight: 600; }
.post-container a { color: var(--accent); text-decoration: none; }
.post-container a:hover { text-decoration: underline; }

/* ─── GUEST CTA ─── */
.guest-cta-box {
  margin-top: 56px;
  background: var(--text);
  padding: 40px;
  text-align: left;
}
.guest-cta-title {
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--bg) !important;
  margin-bottom: 10px !important;
  letter-spacing: -0.5px !important;
  line-height: 1.3 !important;
}
.guest-cta-sub {
  color: rgba(255,255,255,0.55) !important;
  font-size: 14px !important;
  margin-bottom: 24px !important;
}
.guest-cta-link {
  display: inline-block !important;
  background: var(--accent) !important;
  color: #fff !important;
  text-decoration: none !important;
  padding: 11px 24px !important;
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  transition: background 0.15s !important;
}
.guest-cta-link:hover { background: #FF5533 !important; text-decoration: none !important; }

/* ─── RELATED POSTS ─── */
.related-posts {
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--border-dark);
}
.related-posts h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--border-dark);
}
.related-card {
  background: var(--bg);
  border-right: 1px solid var(--border-dark);
  padding: 24px 28px;
  cursor: pointer;
  transition: background 0.15s;
}
.related-card:last-child { border-right: none; }
.related-card:hover { background: var(--surface); }
.related-card .post-tag { font-size: 10px; margin-bottom: 10px; }
.related-card h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ─── FOOTER ─── */
footer {
  padding: 22px 48px;
  border-top: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
}
.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.footer-link:hover { color: var(--text); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-dark); }

/* ─── COOKIE BANNER ─── */
#cookieBanner {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  background: var(--text);
  color: rgba(255,255,255,0.65);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 680px;
  width: calc(100% - 48px);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  flex-wrap: wrap;
  border: 1px solid var(--border-dark);
}
#cookieBanner p { flex: 1; min-width: 200px; margin: 0; }
#cookieBanner a { color: var(--accent); text-decoration: none; }
#cookieBanner a:hover { text-decoration: underline; }
.cookie-btns { display: flex; gap: 0; flex-shrink: 0; }
.cookie-accept {
  background: var(--accent); color: #fff; border: none;
  padding: 8px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700; font-size: 11px;
  cursor: pointer; transition: background 0.2s;
  letter-spacing: 1px; text-transform: uppercase;
}
.cookie-accept:hover { background: #FF5533; }
.cookie-decline {
  background: transparent; color: rgba(255,255,255,0.45);
  border: none; border-left: 1px solid rgba(255,255,255,0.15);
  padding: 8px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; cursor: pointer; transition: color 0.2s;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.cookie-decline:hover { color: rgba(255,255,255,0.75); }
#cookieBanner.cookie-hidden { display: none !important; }

/* ─── RTL (Arabic) ─── */
[dir="rtl"] body {
  font-family: 'Cairo', 'IBM Plex Sans', sans-serif;
}
[dir="rtl"] nav {
  padding: 0 32px 0 0;
}
[dir="rtl"] .nav-links {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .nav-links a {
  border-left: none;
  border-right: 1px solid var(--border);
  font-family: 'Cairo', 'IBM Plex Mono', monospace;
}
[dir="rtl"] .lang-switcher {
  border-left: none;
  border-right: 1px solid var(--border-dark);
}
[dir="rtl"] .lang-btn {
  border-right: none;
  border-left: 1px solid var(--border);
}
[dir="rtl"] .lang-btn:last-child {
  border-left: none;
}
[dir="rtl"] .hamburger {
  border-left: none;
  border-right: 1px solid var(--border-dark);
}
[dir="rtl"] .search-icon {
  left: auto;
  right: 14px;
}
[dir="rtl"] .blog-search {
  padding: 12px 44px 12px 20px;
}
[dir="rtl"] .read-more {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .post-container ul,
[dir="rtl"] .post-container ol {
  margin: 16px 24px 20px 0;
}
[dir="rtl"] .blog-card.featured .card-visual {
  border-left: none;
  border-right: 1px solid var(--border-dark);
}
[dir="rtl"] .related-card {
  border-right: none;
  border-left: 1px solid var(--border-dark);
}
[dir="rtl"] .related-card:last-child {
  border-left: none;
}
[dir="rtl"] .guest-cta-box {
  text-align: right;
}
[dir="rtl"] .blog-card h2,
[dir="rtl"] .blog-hero h1,
[dir="rtl"] .post-container h1,
[dir="rtl"] .post-container h2,
[dir="rtl"] .post-container h3,
[dir="rtl"] .related-card h4,
[dir="rtl"] .filter-btn,
[dir="rtl"] .back-btn,
[dir="rtl"] .post-category-badge,
[dir="rtl"] .post-info-bar,
[dir="rtl"] .post-meta,
[dir="rtl"] .related-posts h3 {
  font-family: 'Cairo', 'IBM Plex Mono', monospace;
}

/* ─── NEWSLETTER BOX ─── */
.newsletter-box {
  margin: 40px 0 0;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border-dark);
}
.newsletter-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.newsletter-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.newsletter-btn {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 12px 24px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  transition: opacity 0.15s;
}
.newsletter-btn:hover { opacity: 0.8; }
[dir="rtl"] .newsletter-box { text-align: right; }
[dir="rtl"] .newsletter-title, [dir="rtl"] .newsletter-sub { font-family: 'Cairo', 'IBM Plex Sans', sans-serif; }

/* ─── LOAD MORE BUTTON ─── */
.load-more-btn {
  display: block;
  margin: 32px auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px 40px;
  background: none;
  color: var(--text);
  border: 1px solid var(--border-dark);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.load-more-btn:hover { background: var(--text); color: var(--bg); }

/* ─── MOBILE ─── */
@media (max-width: 768px) {
  nav { padding: 0 0 0 20px; }
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    height: auto;
    border-bottom: 2px solid var(--border-dark);
    z-index: 99;
    margin-left: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    padding: 16px 24px;
    font-size: 13px;
    height: auto;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .lang-switcher { display: none; }

  .blog-hero { padding: calc(var(--nav-h) + 32px) 24px 40px; }
  .blog-filters { }
  .blog-grid {
    grid-template-columns: 1fr;
    padding: 0 24px 60px;
  }
  .blog-card.featured { grid-column: 1; grid-template-columns: 1fr; }
  .blog-card.featured .card-body { padding: 32px 24px; }
  .blog-card.featured .card-visual { display: none; }
  .blog-card:nth-child(even) { border-right: 1px solid var(--border-dark); }
  .blog-card { border-right: none; }
  .post-container { padding: calc(var(--nav-h) + 24px) 24px 60px; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card { border-right: none; border-bottom: 1px solid var(--border-dark); }
  .related-card:last-child { border-bottom: none; }
  footer { flex-direction: column; gap: 10px; text-align: center; }
  .post-top-bar { flex-direction: column; align-items: flex-start; }

  [dir="rtl"] nav { padding: 0 20px 0 0; }
  [dir="rtl"] .blog-card { border-left: none; border-right: none; }
  [dir="rtl"] .blog-card:nth-child(even) { border-left: 1px solid var(--border-dark); border-right: none; }
  [dir="rtl"] .related-card { border-left: none; border-right: none; border-bottom: 1px solid var(--border-dark); }
  [dir="rtl"] .related-card:last-child { border-bottom: none; }
  [dir="rtl"] .search-icon { left: auto; right: 14px; }
  [dir="rtl"] .blog-search { padding: 12px 44px 12px 20px; }
  [dir="rtl"] footer { text-align: center; }
}
