/* Basic structure */
*{box-sizing:border-box}
:root{
  --article-frame:980px;
  --content-pad:clamp(16px,3vw,32px);
  --hf-space:clamp(28px,4vw,64px);
  --frame-border:#e7eef5;
  --frame-radius:16px;
  --divider:#e9eef3;

  /* lists */
  --rtl-list-indent:2.1rem;
  --rtl-nested-indent:1.6rem;

  /* cattrail/byline colors */
  --cat-link:#3166d6;
  --cat-link-hover:#0c4a6e;
  --cat-label:#0c4a6e;
  --cat-sep:#0c4a6e;
  --by-author:#3166d6;
  --by-author-hover:#1e40af;
  --by-author-underline:#cbd5e1;
  --by-author-underline-hov:#94a3b8;

  /* author box */
  --author-bg:#f9fbfd;
  --author-border:#eef2f6;
  --author-name:#0f172a;
  --author-name-h:#1e40af;
  --author-bio:#475569;

  /* internal links in article */
  --internal-link:#3166d6;
  --internal-link-hover:#0c4a6e;
  --internal-link-visited:#4c51bf;
}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica,Arial,sans-serif;line-height:1.6;color:#0f172a;background:#fff}
a{color:inherit}
.container{max-width:1200px;margin:0 auto;padding:0 16px}

/* Header/Footer */
.site-header,.site-footer{background:#fff;border-block:1px solid var(--divider)}
.site-header .container,.site-footer .container{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-block:12px}
.site-title{font-weight:800;text-decoration:none}
.menu{list-style:none;margin:0;padding:0;display:flex;gap:16px}

/* Content wrapper */
.site-content{padding-block:var(--hf-space)}

/* Single Article */
.naf-single{max-width:var(--article-frame);margin-inline:auto;padding:var(--content-pad);background:#fff;border:1px solid var(--frame-border);border-radius:var(--frame-radius);box-shadow:0 8px 22px rgba(0,0,0,.05)}
.naf-single__header{text-align:right}
.entry-title{font-size:clamp(28px,4.5vw,44px);line-height:1.25;margin:0 0 8px}
.naf-subtitle{font-size:clamp(18px,2.2vw,22px);font-weight:500;color:#4b5563;margin:.35rem 0 .25rem;text-align:right}

/* Category trail */
html[dir="rtl"] .naf-single__header .naf-cattrail{display:block;width:100%;direction:rtl;text-align:right;margin:.35rem 0 1rem}
html[dir="rtl"] .naf-single__header .naf-cattrail .lab,
html[dir="rtl"] .naf-single__header .naf-cattrail .sep,
html[dir="rtl"] .naf-single__header .naf-cattrail .cat{display:inline}
.naf-single__header .naf-cattrail .lab{color:var(--cat-label)}
.naf-single__header .naf-cattrail .cat{color:var(--cat-link);text-decoration:none;font-weight:700}
.naf-single__header .naf-cattrail .cat:hover{color:var(--cat-link-hover)}
.naf-single__header .naf-cattrail .sep{color:var(--cat-sep)}

/* Byline */
.naf-byline{margin:.35rem 0 1.25rem;font-size:14.5px;color:#6b7280;text-align:right}
.naf-byline .sep{opacity:.6;margin:0 .35em}
.naf-byline .by-author{color:var(--by-author);text-decoration:none;border-bottom:1px dashed var(--by-author-underline)}
.naf-byline .by-author:hover{color:var(--by-author-hover);border-color:var(--by-author-underline-hov)}
.naf-single__header .naf-cattrail a:focus-visible,.naf-byline .by-author:focus-visible{outline:2px solid currentColor;outline-offset:2px}

/* Featured image */
.naf-featured{margin:0 0 clamp(14px,2.2vw,22px);border-radius:12px;overflow:hidden}
.naf-featured img{width:100%;height:auto;display:block}

/* Article content */
.naf-single__content{direction:rtl;text-align:right}
.naf-single__content img{max-width:100%;height:auto;display:block;border-radius:12px}
.naf-single__content figure{margin:18px 0}
.naf-single__content :is(h2,h3,h4,h5){margin:1.4em 0 .55em}
.naf-single__content :is(p,ul,ol,blockquote){margin:0 0 1.1em}
.naf-single__content ul{padding-right:1.3em;padding-left:0}

/* RTL lists fine-tuning */
html[dir="rtl"] body.single .entry-content>ul,
html[dir="rtl"] body.single .entry-content>ol,
html[dir="rtl"] body.single .naf-single__content>ul,
html[dir="rtl"] body.single .naf-single__content>ol{
  list-style-position:outside!important;
  padding-inline-start:var(--rtl-list-indent)!important;
  padding-right:var(--rtl-list-indent)!important;
  padding-left:0!important;margin-inline-start:0!important;margin-right:0!important;text-indent:0!important
}
html[dir="rtl"] body.single .entry-content li,
html[dir="rtl"] body.single .naf-single__content li{padding-right:.2rem!important}
html[dir="rtl"] body.single .entry-content li>ul,
html[dir="rtl"] body.single .entry-content li>ol,
html[dir="rtl"] body.single .naf-single__content li>ul,
html[dir="rtl"] body.single .naf-single__content li>ol{
  list-style-position:outside!important;
  padding-inline-start:var(--rtl-nested-indent)!important;
  padding-right:var(--rtl-nested-indent)!important;
  padding-left:0!important;margin-inline-start:0!important
}
html[dir="rtl"] body.single .entry-content li::marker,
html[dir="rtl"] body.single .naf-single__content li::marker{font-size:.95em}

/* Tags pills */
.tags-pills-wrap{margin-top:16px}
.tags-pills{display:flex;flex-wrap:wrap;gap:8px}
.tags-pills .pill{display:inline-flex;align-items:center;gap:.35em;padding:.4em .8em;border-radius:999px;background:#f5f7fa;border:1px solid #e7ecf2;font-size:.92rem;text-decoration:none}
.tags-pills .pill .hash{opacity:.6}

/* Author box */
.author-box{display:flex;gap:16px;align-items:flex-start;padding:16px;margin-top:22px;background:var(--author-bg);border:1px solid var(--author-border);border-radius:12px}
.author-box .author-avatar img{border-radius:50%}
.author-box .author-name{margin:0 0 6px;font-weight:700;color:var(--author-name)}
.author-box .author-name a{color:inherit;text-decoration:none}
.author-box .author-name a:hover{color:var(--author-name-h)}
.author-box .author-bio{margin:0;color:var(--author-bio);line-height:1.8}

/* Picks */
.naf-picks{margin:28px 0}
.naf-picks__title{text-align:right;font-weight:800;margin:0 0 12px}
.naf-picks__grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.naf-pick{border:1px solid #e5e7eb;border-radius:12px;background:#fff;overflow:hidden;transition:transform .15s,box-shadow .15s}
.naf-pick:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(0,0,0,.06)}
.naf-pick__thumb{height:220px;background:#f3f4f6;overflow:hidden}
.naf-pick__thumb img{width:100%;height:100%;object-fit:cover}
.naf-pick__title{margin:10px 12px 14px;font-weight:700;text-align:right}
@media (max-width:700px){.naf-picks__grid{grid-template-columns:1fr}.naf-pick__thumb{height:200px}}

/* Loop */
.loop-container{max-width:980px;margin:0 auto;padding:0 16px}
.loop-item{padding:16px;border-bottom:1px solid #f1f5f9}
.loop-title{margin:0 0 8px}

/* Internal links in article */
.naf-single__content a[href^="/"],
.naf-single__content a[href^="#"],
.naf-single__content a[href*="://nafithatak.com"],
.naf-single__content a[href*="://www.nafithatak.com"]{
  color:var(--internal-link)!important;text-decoration:none!important;border-bottom:none!important
}
.naf-single__content a[href^="/"]:hover,
.naf-single__content a[href^="#"]:hover,
.naf-single__content a[href*="://nafithatak.com"]:hover,
.naf-single__content a[href*="://www.nafithatak.com"]:hover{color:var(--internal-link-hover)!important}
.naf-single__content a[href^="/"]:visited,
.naf-single__content a[href^="#"]:visited,
.naf-single__content a[href*="://nafithatak.com"]:visited,
.naf-single__content a[href*="://www.nafithatak.com"]:visited{color:var(--internal-link-visited)!important}
.naf-single__content a.wp-block-button__link,
.naf-single__content a[class*="btn"],.naf-single__content a.button{color:inherit!important}
.naf-single__content a[href^="http"]:not([href*="nafithatak.com"]){text-decoration:underline;text-underline-offset:3px}
.naf-single__content a[href^="http"]:not([href*="nafithatak.com"]):hover{text-decoration:underline}
.naf-single__content a:focus-visible{outline:2px dashed currentColor;outline-offset:2px}

/* Hide old author box (if exists) */
.persmind-author-box{display:none!important}

/* Author card extras */
.naf-author-area{max-width:980px;margin:28px auto 0;padding:0 16px}
.naf-author-sep{height:1px;border:none;background:#e5e7eb;margin:12px 0 22px}
.naf-author-card{text-align:center;background:transparent;padding:0}
.naf-author-avatar .avatar{width:96px;height:96px;border-radius:50%;display:block;margin:0 auto 12px;box-shadow:0 0 0 4px #fff,0 0 0 3px #e6edf5;object-fit:cover}
.naf-author-name{margin:0 0 10px;font-weight:800;font-size:22px;color:#0f172a}
.naf-author-bio{max-width:820px;margin:0 auto 12px;color:#334155;line-height:1.95;font-size:16px}
.naf-author-bio p{margin:0 0 .7em}
.naf-author-count{margin-top:4px;font-size:14px;color:#64748b;font-weight:700}
.naf-author-count .num{color:#0f172a;font-weight:800;margin-inline:4px}
@media (max-width:640px){
  .naf-author-area{padding-inline:12px}
  .naf-author-avatar .avatar{width:84px;height:84px}
  .naf-author-name{font-size:18px}
  .naf-author-bio{font-size:15px;line-height:1.9}
}
@media (min-width:641px) and (max-width:1024px){
  .naf-author-avatar .avatar{width:90px;height:90px}
  .naf-author-name{font-size:20px}
}
.naf-author-card a{text-decoration:none}

/* Footer */
.site-footer{background:#f6f6f6;margin-top:2rem;font-size:15px;color:#222}
.footer-container{max-width:1200px;margin:0 auto;padding:20px 16px}
.footer-menu{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;align-items:center;gap:10px}
.footer-menu li{border:none}
.footer-menu a{text-decoration:none;font-weight:500;color:#0a58ca;transition:color .2s ease}
.footer-menu a:hover{text-decoration:underline;color:#083a86}
.footer-copy{text-align:center;font-size:14px;opacity:.9;padding:12px;border-top:1px solid #ddd;background:#eceff3}
@media (min-width:768px){
  .footer-menu{flex-direction:row;justify-content:center;gap:20px}
  .footer-copy{background:transparent;border-top:1px solid #ddd;margin-top:10px}
}

/* Remove gap after header on home */
html,body{margin:0!important}
.site-header{margin-bottom:0!important;padding-bottom:0!important;border-bottom:0!important}
.site-content,.content-area,.site-main,main{margin-top:0!important;padding-top:0!important}
body.home main>*:first-child{margin-top:0!important;padding-top:0!important}
body.home main>.ast-container:first-child,
body.home main>.container:first-child,
body.home main>section:first-child,
body.home main>div:first-child{margin-top:0!important;padding-top:0!important}
body.home .hero,body.home .home-hero,body.home .front-hero,body.home .masthead{margin-top:0!important;padding-top:0!important}
body.home .site-header+*{margin-top:0!important;padding-top:0!important}

/* Menus coloring on home */
nav.site-nav .menu.menu--primary>li>a,
.site-nav__panel .menu.menu--primary>li>a{color:var(--nav-link-color)!important}
nav.site-nav .menu.menu--primary>li.current-menu-item>a,
nav.site-nav .menu.menu--primary>li.current_page_item>a,
nav.site-nav .menu.menu--primary>li.is-active>a{color:var(--nav-link-active)!important}
.home nav.site-nav a[href*="#categories"],
.home .site-nav__panel a[href*="#categories"]{color:var(--nav-link-color)!important}
.home nav.site-nav a[href*="#categories"]:visited,
.home .site-nav__panel a[href*="#categories"]:visited{color:var(--nav-link-color)!important}
.home nav.site-nav li.is-active>a[href*="#categories"],
.home .site-nav__panel li.is-active>a[href*="#categories"]{color:var(--nav-link-active)!important}
nav.site-nav .menu.menu--primary>li>a:hover,
.site-nav__panel .menu.menu--primary>li>a:hover{color:var(--nav-link-hover)!important}

.home #primary-menu>li.is-active>a[href*="#categories"],
.home #primary-menu-mobile>li.is-active>a[href*="#categories"]{color:var(--nav-link-active)!important}

/* Blocks */
blockquote{border-right:4px solid #4958df;padding:1em;margin:1.5em 0;background-color:#f9f9f9;font-style:italic;color:#333}
h1{font-size:28px;margin:20px 0;font-weight:bold}

/* Pages content */
.page:not(.home) .entry-content{max-width:850px;margin-inline:auto;padding-inline:20px;line-height:1.9}
@media (max-width:768px){.page:not(.home) .entry-content{padding-inline:16px}}
.page .entry-content a{overflow-wrap:anywhere;word-break:break-word}
.page .entry-content pre{white-space:pre-wrap;word-wrap:break-word}
html[dir="rtl"] .page .entry-content ul{padding-right:1.25rem;padding-left:0;margin-right:0}
@media (max-width:768px){
  body.page-id-2469 .entry-content{padding-inline:16px;line-height:1.85}
}
body.page-id-2469 .entry-content a{overflow-wrap:anywhere;word-break:break-word}
html[dir="rtl"] body.page-id-2469 .entry-content ul{padding-right:1.25rem;padding-left:0;margin-right:0}

/* Picks: remove underlines inside */
.single .naf-picks .naf-pick__link,
.single .naf-picks .naf-pick__link:link,
.single .naf-picks .naf-pick__link:visited,
.single .naf-picks .naf-pick__link:hover,
.single .naf-picks .naf-pick__link:active,
.single .naf-picks .naf-pick__title,
.single .naf-picks .naf-pick__title a,
.single .naf-picks h4 a{text-decoration:none!important;text-decoration-line:none!important;border-bottom:0!important;box-shadow:none!important}
.single .naf-picks .naf-pick__link:hover .naf-pick__title{color:#1e40af}

/* ========================= */
/* Share box (ALL FIXES)     */
/* ========================= */
body.single .naf-share-box{margin:22px 0 10px;text-align:center;direction:rtl}
body.single .naf-share-box .naf-share-head{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:12px}
body.single .naf-share-box .naf-share-title{margin:0;font-weight:800;color:#0f172a;font-size:clamp(18px,2.4vw,22px)}
/* إصلاح كروم: لا تسمح لقواعد عامة مثل svg{width:100%} بتكبير الأيقونة */
body.single .naf-share-box .naf-share-head .naf-share-icon{
  width:28px!important;height:28px!important;
  max-width:28px!important;max-height:28px!important;
  display:inline-block!important;flex:0 0 28px!important;fill:#0f172a
}
/* منع أي max-width عام داخل الصندوق */
body.single .naf-share-box svg{max-width:none}

/* صف الأزرار */
body.single .naf-share-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:14px}

/* زر كبسولي + خط أبيض للنص */
body.single .btn-share{--bg:#111827;--badge:22px;--ico:16px;display:inline-flex;align-items:center;gap:.75em;padding:.6em 1.1em;border-radius:999px;background:var(--bg);color:#fff!important;text-decoration:none;font-weight:700;line-height:1;box-shadow:0 6px 14px rgba(0,0,0,.1);transition:transform .12s ease,filter .12s ease}
body.single .btn-share:hover{transform:translateY(-1px);filter:brightness(.97)}
body.single .btn-share .badge{width:var(--badge);height:var(--badge);border-radius:50%;background:rgba(255,255,255,.16);display:inline-grid;place-items:center}
/* تأكيد مقاس الأيقونة داخل الشارة ضد أي قواعد عامة */
body.single .btn-share .badge svg{width:var(--ico)!important;height:var(--ico)!important;display:block;max-width:none!important}
body.single .btn-share .badge svg *,body.single .btn-share .badge svg path,body.single .btn-share .badge svg polygon,body.single .btn-share .badge svg rect,body.single .btn-share .badge svg circle,body.single .btn-share .badge svg line{fill:#fff!important;stroke:#fff!important}

/* ألوان الهوية */
body.single .btn-telegram{--bg:#0d5579}
body.single .btn-facebook{--bg:#1877F2}
body.single .btn-linkedin{--bg:#0A66C2}
/* واتساب بتدرّج رسمي */
body.single .btn-whatsapp{background:linear-gradient(135deg,#25D366 0%,#128C7E 100%)!important;box-shadow:0 8px 16px rgba(18,140,126,.25);color:#fff!important}
body.single .btn-whatsapp .badge{background:transparent!important;box-shadow:none!important}
body.single .btn-whatsapp .badge svg,body.single .btn-whatsapp .badge svg *,body.single .btn-whatsapp .badge svg path{fill:#fff!important;stroke:#fff!important;filter:drop-shadow(0 0 .5px rgba(0,0,0,.1))}

/* موحّدة افتراضيًا – تكبير بسيط لأيقونة واتساب كي تتوازن بصريًا */
body.single .btn-share{--ico:16px;--badge:22px}
body.single .btn-whatsapp{--ico:18px}

@media (max-width:480px){
  body.single .btn-share{padding:.55em 1em;font-size:.95rem}
  body.single .naf-share-actions{gap:10px}
}

/* ======================= */
/*  FIX: H1 spacing (single)  */
/* ======================= */
html[dir="rtl"] body.single #primary .naf-single.naf-single .naf-single__header.naf-single__header h1.entry-title.entry-title,
html[dir="rtl"] body.single .naf-single.naf-single .naf-single__header.naf-single__header h1.entry-title.entry-title{
  display:block!important;width:100%!important;box-sizing:border-box!important;
  margin-top:0!important;margin-bottom:10px!important;
  font-family:Roboto,system-ui,-apple-system,"Segoe UI",Helvetica,Arial,sans-serif!important;
  font-weight:800!important;font-size:clamp(28px,4.5vw,44px)!important;line-height:1.25!important;color:#0f172a!important
}
html[dir="rtl"] body.single #primary .naf-single__header.naf-single__header .pm-subtitle-below,
html[dir="rtl"] body.single .naf-single__header.naf-single__header .pm-subtitle-below{
  display:block!important;margin-top:8px!important
}
html[dir="rtl"] body.single #primary .naf-single__header,
html[dir="rtl"] body.single .naf-single__header{text-align:right!important}
/* ===== تنسيق الجداول داخل المقالات ===== */
.single-post .entry-content table,
.page .entry-content table,
.naf-single__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  display: table;
  border: 1px solid #d1d5db; /* لون الإطار العام */
  border-radius: 8px;
  overflow: hidden;
}

.single-post .entry-content th,
.single-post .entry-content td,
.page .entry-content th,
.page .entry-content td,
.naf-single__content th,
.naf-single__content td {
  border: 1px solid #d1d5db;
  padding: 10px 14px;
  text-align: center;
  vertical-align: middle;
}

.single-post .entry-content th {
  background-color: #f8fafc;
  font-weight: 700;
  color: #0f172a;
}

.single-post .entry-content tr:nth-child(even) {
  background-color: #f9fafb;
}
