/*
Theme Name: Rehab Zanaty Academic
Theme URI: https://rehabzanaty.com
Author: Rehab Zanaty Website Project
Description: Academic RTL WordPress theme based on approved version nine. Existing scientific page designs included for staged migration; WordPress posts remain editable in dashboard.
Version: 3.0.8
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: rehabzanaty
*/
body{direction:rtl} .rehab-posts{direction:rtl;max-width:900px;margin:4rem auto;padding:0 1.5rem;font-family:Tahoma,Arial,sans-serif;line-height:1.9}.rehab-posts a{color:#145b9d}.rehab-posts h1{color:#0d2956}

/* V6: Keep Gutenberg page content inside a readable RTL column. */
body.page .rehab-posts, body.single .rehab-posts {
  width: min(100%, 960px);
  max-width: 960px;
  margin: 3rem auto;
  padding: 0 24px;
  box-sizing: border-box;
  min-width: 0;
  direction: rtl;
}
body.page .rehab-posts article, body.single .rehab-posts article,
body.page .rehab-posts .entry-content, body.single .rehab-posts .entry-content {
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
}
body.page .rehab-posts p, body.single .rehab-posts p,
body.page .rehab-posts .wp-block-paragraph, body.single .rehab-posts .wp-block-paragraph {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  white-space: normal !important; overflow-wrap: normal !important; word-break: normal !important; hyphens: none !important;
  text-align: right; line-height: 1.95; box-sizing: border-box;
}
body.page .rehab-posts img, body.single .rehab-posts img { max-width: 100%; height: auto; }
@media (max-width: 680px) {
  body.page .rehab-posts, body.single .rehab-posts { margin: 1.75rem auto; padding: 0 16px; }
}

/* V7: Keep Arabic words intact at line endings. */
body.page .rehab-posts p, body.single .rehab-posts p { overflow-wrap: normal !important; word-wrap: normal !important; word-break: normal !important; hyphens: none !important; }

/* V8: WordPress prose is constrained without breaking Arabic words. */
body.page .rehab-posts, body.single .rehab-posts {
  display:block; width:100%; max-width:960px; overflow:visible;
}
body.page .rehab-posts article, body.single .rehab-posts article {min-width:0;max-width:100%;}
body.page .rehab-posts article > p, body.single .rehab-posts article > p,
body.page .rehab-posts .wp-block-paragraph, body.single .rehab-posts .wp-block-paragraph {
  width:auto; max-width:100%; white-space:normal !important;
  word-break:normal !important; overflow-wrap:normal !important;
  text-align:right; line-height:1.95;
}


/* V9: Match the approved home-page Arabic typography on WordPress content. */
@font-face {
 font-family:"Rehab Naskh";
 src:url("assets/fonts/NotoNaskhArabic-Regular.ttf") format("truetype");
 font-weight:400; font-style:normal; font-display:swap;
}
@font-face {
 font-family:"Rehab Amiri";
 src:url("assets/fonts/Amiri-Regular.ttf") format("truetype");
 font-weight:400; font-style:normal; font-display:swap;
}
body.page .rehab-posts, body.single .rehab-posts,
body.blog .rehab-posts, body.archive .rehab-posts {
 font-family:"Rehab Naskh", "Noto Naskh Arabic", serif;
 font-size:20px;
 line-height:1.95;
 color:#142940;
}
.rehab-posts h1, .rehab-posts h2 {
 font-family:"Rehab Amiri", "Amiri", "Rehab Naskh", serif;
 font-weight:400;
 color:#0d2956;
 line-height:1.6;
}
.rehab-posts h1 {font-size:clamp(32px,4vw,43px);}
.rehab-posts h2 {font-size:clamp(27px,3vw,34px);}
.rehab-posts h3, .rehab-posts h4 {
 font-family:"Rehab Naskh", "Noto Naskh Arabic",serif;
 color:#0d2956;
 line-height:1.65;
}
.rehab-posts p, .rehab-posts li {font-size:1em;line-height:1.95;word-break:normal;overflow-wrap:normal;}
.rehab-posts ul, .rehab-posts ol {padding-right:1.6em;padding-left:0;}
.rehab-posts a {color:#145b9d;}
@media(max-width:680px){body.page .rehab-posts,body.single .rehab-posts{font-size:18px;}}

/* V11: clear home navigation for regular WordPress pages; legacy pages keep their own header. */
.rehab-return-nav{max-width:960px;width:calc(100% - 36px);margin:24px auto 0;direction:rtl;text-align:right;font-family:"Noto Naskh Arabic",serif;}
.rehab-return-nav a{display:inline-block;color:#143b70;text-decoration:none;font-size:1.1rem;font-weight:700;padding:6px 0;}
.rehab-return-nav a:hover,.rehab-return-nav a:focus{text-decoration:underline;}

/* V29: article directory filters (published posts only) */
.rz-articles-directory{background:#fbfaf7;min-height:60vh;padding:35px 18px 75px;font-family:"Noto Naskh Arabic",serif;line-height:1.8}
.rz-articles-shell{max-width:1110px;margin:auto}
.rz-articles-back a{color:#145b9d}.rz-articles-kicker{color:#a47b36;margin:20px 0 0}
.rz-articles-directory h1{font:normal 42px/1.5 "Amiri",serif;color:#0d2956;margin:0}
.rz-articles-lead{color:#59697a;font-size:18px}
.rz-article-filters{display:grid;grid-template-columns:2fr 1fr 1fr auto;align-items:end;gap:12px;background:#fff;border:1px solid #e9e0cf;border-radius:15px;padding:18px;margin:25px 0}
.rz-article-filters label{font-size:16px;color:#19395e;display:flex;flex-direction:column;gap:5px}
.rz-article-filters input,.rz-article-filters select{width:100%;min-width:0;border:1px solid #bfc9d4;border-radius:8px;padding:9px 12px;background:#fff;color:#182e48;font:inherit}
.rz-article-filters button{background:#0d2956;color:#fff;border:0;border-radius:8px;padding:9px 18px;font:inherit;cursor:pointer}
.rz-directory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.rz-directory-card{background:#fff;border:1px solid #e6e1d7;border-radius:15px;padding:18px;display:flex;flex-direction:column;gap:9px;min-width:0}
.rz-directory-card h2{font:normal 26px/1.6 "Amiri",serif;color:#0d2956;margin:0}
.rz-directory-card p{margin:0;color:#576b7e}
.rz-directory-card img{width:100%;height:190px;object-fit:cover;border-radius:8px}
.rz-directory-card>a:last-child{color:#145b9d;margin-top:auto}.rz-directory-meta{font-size:14px!important;color:#987a4b!important}
.rz-articles-empty{border:1px solid #eadfca;background:#fff;border-radius:12px;padding:28px;color:#526276}
@media(max-width:850px){.rz-article-filters{grid-template-columns:1fr 1fr}.rz-directory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.rz-article-filters,.rz-directory-grid{grid-template-columns:1fr}}

/* V30: A stable, editorial byline under each post title; never use the admin username. */
body.single-post .rehab-posts .rz-article-byline {
  margin: -0.35rem 0 1.65rem;
  text-align: right;
  color: #657387;
  font-family: "Rehab Naskh", "Noto Naskh Arabic", serif;
  font-size: 17px;
  line-height: 1.8;
}
body.single-post .rehab-posts .rz-article-byline-name { color: #355170; }
@media (max-width: 680px) {
  body.single-post .rehab-posts .rz-article-byline { font-size: 16px; margin-bottom: 1.15rem; }
}
