/*
Theme Name: Anjizha Blog
Theme URI: https://anjizha.com
Author: Anjizha
Description: قالب مدونة انجزها بنفس هوية الموقع: ألوان انجزها، خط IBM Plex Sans Arabic، زر واتساب، وروابط صفحات الخدمات.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: anjizha-blog
*/

:root {
  --green: #40a75f;
  --green-dark: #296c3d;
  --green-soft: #e8f5ec;
  --navy: #0c0f20;
  --navy-2: #1d2136;
  --ink: #181c32;
  --text: #3f4254;
  --muted: #7e8299;
  --line: #e1e3ea;
  --bg: #f4f6f8;
  --card: #ffffff;
  --radius: 22px;
  --wa: #25d366;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  direction: rtl;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green); }
img { max-width: 100%; height: auto; display: block; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Header (white, like a news blog) ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 84px;
}
.site-logo img { height: 46px; width: auto; }
.main-nav { flex: 1; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: 16.5px; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--green-dark); }
.main-nav .current-menu-item a { color: var(--green-dark); border-bottom-color: var(--green); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: #fff;
}
.icon-btn:hover { background: var(--green-dark); color: #fff; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Latest articles ticker ---------- */
.ticker { padding: 18px 0 0; }
.ticker-inner {
  display: flex; align-items: stretch;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.ticker-label {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  background: var(--green); color: #fff; font-weight: 700; font-size: 17px; padding: 0 20px;
}
.ticker-label i { width: 9px; height: 9px; border-radius: 50%; background: #fff; display: inline-block; animation: anj-blink 1.6s infinite; }
.ticker-track { flex: 1; overflow: hidden; min-width: 0; }
.ticker-move { display: flex; width: max-content; animation: anj-ticker 60s linear infinite; }
.ticker:hover .ticker-move, .ticker.is-paused .ticker-move { animation-play-state: paused; }
.ticker-item { display: flex; flex-direction: column; padding: 9px 22px; border-inline-start: 1px solid var(--line); line-height: 1.45; white-space: nowrap; }
.ticker-item strong { color: var(--ink); font-size: 15.5px; }
.ticker-item small { color: var(--green-dark); font-size: 13px; font-weight: 600; }
.ticker-item:hover strong { color: var(--green-dark); }
.ticker-pause { flex: none; width: 52px; border: 0; background: var(--navy); color: #fff; cursor: pointer; }
.ticker-pause svg { width: 18px; height: 18px; }
.ticker.is-paused .ticker-pause { background: var(--green); }
@keyframes anj-ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }
@keyframes anj-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-move { animation: none; }
  .ticker-track { overflow-x: auto; }
}

/* ---------- Featured slider ---------- */
.slider {
  position: relative; margin-top: 24px;
  background: #fff; border-radius: 28px; padding: 30px;
  box-shadow: 0 18px 40px rgba(12, 15, 32, .06);
}
.slide { display: flex; gap: 36px; align-items: center; }
.slide[hidden] { display: none; }
.slide-thumb { flex: 1.15; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; background: var(--navy); }
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slide-thumb .thumb-placeholder img { height: 70px; width: auto; object-fit: contain; }
.slide-body { flex: 1; padding-inline-end: 30px; }
.slide-body h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.5; margin: 14px 0 10px; }
.slide-body h2 a { color: var(--ink); }
.slide-body h2 a:hover { color: var(--green-dark); }
.slide-body .excerpt { color: var(--muted); font-size: 17px; margin: 0 0 16px; }
.read-more { display: inline-flex; gap: 8px; font-weight: 700; color: var(--ink); margin-bottom: 20px; }
.read-more:hover { color: var(--green-dark); }
.meta .author { color: var(--ink); font-weight: 700; }
.meta .author img { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); padding: 6px; object-fit: contain; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--ink); box-shadow: 0 6px 18px rgba(12, 15, 32, .14);
  display: flex; align-items: center; justify-content: center;
}
.slider-arrow:hover { background: var(--green); color: #fff; }
.slider-arrow svg { width: 22px; height: 22px; }
.slider-arrow.prev { right: -18px; }
.slider-arrow.next { left: -18px; }
.slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.slider-dots button { width: 10px; height: 10px; border-radius: 999px; border: 0; padding: 0; background: var(--line); cursor: pointer; transition: width .2s; }
.slider-dots button.is-active { width: 28px; background: var(--green); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  border: 2px solid transparent;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-outline { border-color: var(--green); color: var(--green-dark); background: #fff; }
.btn svg { width: 20px; height: 20px; flex: none; }
.menu-toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px; }
.menu-toggle svg { width: 30px; height: 30px; }

/* ---------- Blog hero ---------- */
.blog-hero { padding: 56px 0 26px; }
.blog-hero.is-compact { padding: 44px 0 10px; }
.blog-hero.is-compact h1 { font-size: clamp(26px, 3.4vw, 34px); }
.blog-hero h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 46px); line-height: 1.3; color: var(--ink); }
.blog-hero h1 span { color: var(--green); }
.blog-hero p { margin: 0; max-width: 640px; font-size: 18px; color: var(--muted); }
.search-box {
  margin-top: 26px;
  display: flex;
  max-width: 560px;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(12, 15, 32, .06);
}
.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  padding: 8px 14px;
  min-width: 0;
}
.search-box button { border: 0; cursor: pointer; font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--line);
}
.chip:hover, .chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Post cards ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 18px 0 40px;
}
.post-card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(12, 15, 32, .05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(12, 15, 32, .08); }
.post-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .thumb, .slide-thumb { position: relative; display: block; }
.post-card .thumb video, .slide-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(64, 167, 95, .92); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}
.play-badge svg { width: 30px; height: 30px; margin-inline-end: -4px; }
.post-card:hover .play-badge, .slide-thumb:hover .play-badge { transform: translate(-50%, -50%) scale(1.08); }
.slide-thumb .play-badge { width: 80px; height: 80px; }
.post-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.badge {
  align-self: flex-start;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
}
.post-card h2 { font-size: 20px; line-height: 1.55; margin: 12px 0 8px; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--green-dark); }
.post-card .excerpt { color: var(--muted); font-size: 15.5px; line-height: 1.8; margin: 0 0 16px; flex: 1; }
.meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 16px; height: 16px; }

/* Featured (first) post */
.post-card.is-featured { grid-column: 1 / -1; flex-direction: row; }
.post-card.is-featured .thumb { flex: 1.2; aspect-ratio: auto; min-height: 340px; }
.post-card.is-featured .body { flex: 1; padding: 36px; justify-content: center; }
.post-card.is-featured h2 { font-size: 28px; }

/* Placeholder image when a post has no featured image */
.thumb-placeholder {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 20% 20%, rgba(64, 167, 95, .35), transparent 55%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 20px;
  text-align: center;
}
.post-card .thumb .thumb-placeholder img { height: 44px; width: auto; object-fit: contain; opacity: .95; }
.post-card.is-featured .thumb .thumb-placeholder img { height: 64px; }
.thumb-placeholder span { font-weight: 700; font-size: 18px; color: #d9f2e1; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; padding-bottom: 60px; }
.pagination .page-numbers {
  min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: #fff; color: var(--ink); font-weight: 700; padding: 0 12px;
}
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--green); color: #fff; }

/* ---------- Single post ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 15px; padding-top: 34px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green-dark); }
.article-head { padding: 18px 0 26px; max-width: 860px; }
.article-head h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.4; color: var(--ink); margin: 14px 0 14px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: start; padding-bottom: 50px; }
.article {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}
.article .cover { aspect-ratio: 16 / 8; background: var(--navy); }
.article .cover img { width: 100%; height: 100%; object-fit: cover; }
.entry { padding: 34px 40px 40px; color: var(--text); }
.entry > *:first-child { margin-top: 0; }
.entry h2 {
  font-size: 26px; line-height: 1.5; color: var(--ink);
  margin: 38px 0 14px; padding-inline-start: 14px;
  border-inline-start: 5px solid var(--green);
}
.entry h3 { font-size: 21px; color: var(--ink); margin: 28px 0 10px; }
.entry p { margin: 0 0 18px; }
.entry ul, .entry ol { padding-inline-start: 24px; margin: 0 0 20px; }
.entry li { margin-bottom: 8px; }
.entry ul li::marker { color: var(--green); }
.entry ol li::marker { color: var(--green-dark); font-weight: 700; }
.entry blockquote {
  margin: 24px 0; padding: 18px 22px; background: var(--green-soft);
  border-radius: 16px; border-inline-start: 5px solid var(--green); color: var(--ink);
}
.entry blockquote p:last-child { margin: 0; }
.entry table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15.5px; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 14px; text-align: start; }
.entry th { background: var(--navy); color: #fff; }
.entry tr:nth-child(even) td { background: #f7f8fa; }
.entry img { border-radius: 16px; margin: 10px 0 20px; }
.entry a { text-decoration: underline; text-underline-offset: 4px; }

.toc { background: #f7f8fa; border-radius: 16px; padding: 18px 22px; margin: 0 0 28px; }
.toc strong { display: block; color: var(--ink); margin-bottom: 6px; }
.toc ol { margin: 0; padding-inline-start: 20px; }
.toc a { text-decoration: none; }

/* Sidebar CTA */
.sidebar { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 20px; }
.cta-card {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 26px;
  background-image: radial-gradient(circle at 85% 10%, rgba(64, 167, 95, .35), transparent 50%);
}
.cta-card h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.5; color: #fff; }
.cta-card p { margin: 0 0 20px; color: #c9cbd6; font-size: 15.5px; line-height: 1.8; }
.cta-card .btn { width: 100%; justify-content: center; }
.cta-card .btn + .btn { margin-top: 10px; }
.cta-card .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.side-box { background: var(--card); border-radius: var(--radius); padding: 22px 24px; }
.side-box h4 { margin: 0 0 10px; color: var(--ink); font-size: 17px; }
.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li { border-top: 1px solid var(--line); }
.side-box li:first-child { border-top: 0; }
.side-box li a { display: block; padding: 9px 0; color: var(--text); font-size: 15.5px; }
.side-box li a:hover { color: var(--green-dark); }

/* Bottom CTA inside article */
.inline-cta {
  margin: 34px 40px 40px;
  border-radius: 18px;
  background: var(--green);
  color: #fff;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.inline-cta h3 { margin: 0; font-size: 21px; line-height: 1.5; color: #fff; }
.inline-cta p { margin: 4px 0 0; color: #e7f6ec; font-size: 15.5px; }
.inline-cta .btn { background: #fff; color: var(--green-dark); }
.inline-cta-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.inline-cta-wa { color: #fff; font-size: 14.5px; text-decoration: underline; opacity: .9; }
.inline-cta-wa:hover { color: #fff; opacity: 1; }

.related { padding: 10px 0 60px; }
.related > h2 { color: var(--ink); font-size: 26px; margin: 0 0 6px; }
.related .posts-grid { padding-top: 12px; }

/* ---------- Page / 404 ---------- */
.simple-page { padding: 50px 0 70px; }
.simple-page .article { max-width: 880px; margin-inline: auto; }
.simple-page h1 { color: var(--ink); }
.empty { background: #fff; border-radius: var(--radius); padding: 40px; text-align: center; margin-bottom: 60px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #c9cbd6;
  border-radius: 40px 40px 0 0;
  padding: 54px 0 26px;
}
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 36px; }
.footer-grid h4 { color: var(--green); font-size: 18px; margin: 0 0 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.footer-grid li { margin-bottom: 8px; break-inside: avoid; }
.footer-grid a { color: #e6e7ee; font-size: 15px; }
.footer-grid a:hover { color: var(--green); }
.footer-about img { height: 52px; width: auto; margin-bottom: 14px; }
.footer-about p { margin: 0; font-size: 15px; line-height: 1.9; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 36px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
}

/* ---------- WhatsApp floating button ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--wa);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.whatsapp-float svg { width: 30px; height: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .site-header .container { min-height: 70px; justify-content: space-between; }
  .site-logo img { height: 38px; }
  .menu-toggle { display: block; }
  .header-cta { padding: 8px 12px; font-size: 14px; gap: 6px; border-radius: 12px; }
  .header-cta svg { width: 16px; height: 16px; }
  .site-header .container { gap: 12px; }
  .header-actions { margin-inline-start: auto; }
  .icon-btn { width: 40px; height: 40px; }
  .ticker-label { font-size: 15px; padding: 0 12px; }
  .ticker-pause { width: 42px; }
  .slider { padding: 16px; border-radius: 22px; }
  .slide { flex-direction: column; gap: 16px; align-items: stretch; }
  .slide-thumb { flex: none; }
  .slide-body { padding: 0 6px 4px; }
  .slider-arrow { top: 28%; width: 40px; height: 40px; }
  .slider-arrow.prev { right: 4px; }
  .slider-arrow.next { left: 4px; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 30px rgba(12, 15, 32, .1);
    border-radius: 18px;
    padding: 14px 20px;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 6px; }
  .posts-grid { grid-template-columns: 1fr; gap: 18px; }
  .post-card.is-featured { flex-direction: column; }
  .post-card.is-featured .thumb { aspect-ratio: 16 / 9; min-height: 0; }
  .post-card.is-featured .body { padding: 20px 22px 22px; }
  .post-card.is-featured h2 { font-size: 22px; }
  .entry { padding: 24px 20px 28px; }
  .entry h2 { font-size: 22px; }
  .inline-cta { margin: 0 20px 28px; padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; }
  .whatsapp-float { width: 54px; height: 54px; bottom: 16px; right: 16px; }
}
