/*
Theme Name: tt5-cimegs-child
Template: twentytwentyfive
Version: 1.1.0 (mobile-first clean)
*/

/* ========= Root & Tokens ========= */
:root{
  --tt5c-max: 1100px;
  --tt5c-gap: 1rem;
  --tt5c-muted: #6b7280;
  --tt5c-border: #e5e7eb;
  --tt5c-brand: #0f172a;
}

/* ========= Generic layout ========= */
*{box-sizing:border-box}
img{max-width:100%;height:auto;display:block}
.container{max-width:var(--tt5c-max);margin:0 auto;padding:1rem}
.muted{color:var(--tt5c-muted)}

/* ========= Header (classic) ========= */
.tt5c-header{position:sticky;top:0;z-index:10;background:#fff;border-bottom:1px solid var(--tt5c-border)}
.nav-wrap{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.6rem 1rem}
.brand{font-weight:700;text-decoration:none;color:var(--tt5c-brand)}
.menu{list-style:none;display:flex;gap:.75rem;margin:0;padding:0;flex-wrap:wrap}
.menu a{text-decoration:none;color:#111}
.menu a:hover{text-decoration:underline}

/* ========= Page title / sections ========= */
.page-header{margin:1rem 0 1.25rem}
.page-title,.site-title{margin:0 0 .25rem}

/* ========= Buttons ========= */
.tt5c-btn{
  border:1px solid var(--tt5c-border);
  background:#fff;color:#111;
  padding:.6rem .9rem;border-radius:.7rem;
  text-decoration:none;display:inline-flex;align-items:center;justify-content:center;
  font-weight:600;cursor:pointer;transition:transform .18s ease,background .18s ease,box-shadow .18s
}
.tt5c-btn:hover{background:#f3f4f6;transform:translateY(-1px)}
.tt5c-btn--light{background:#f9fafb}
.tt5c-btn--red{background:#e11d48;border-color:#e11d48;color:#fff}
.tt5c-btn--red:hover{background:#be123c}
.tt5c-btn--navy{background:#0f172a;border-color:#0f172a;color:#fff}
.tt5c-btn--navy:hover{background:#111827}

/* ========= Search bar ========= */
.tt5c-search{display:flex;gap:.5rem;margin:1rem 0 1.25rem}
.tt5c-search input[type="search"]{flex:1;padding:.65rem .8rem;border:1px solid var(--tt5c-border);border-radius:.6rem}

/* ========= Cards / Grid ========= */
.tt5c-grid{display:grid;grid-template-columns:1fr;gap:var(--tt5c-gap)}
@media (min-width: 520px){ .tt5c-grid{grid-template-columns:repeat(2,1fr)} }
@media (min-width: 900px){ .tt5c-grid{grid-template-columns:repeat(3,1fr)} }

.tt5c-card{border:1px solid var(--tt5c-border);border-radius:.8rem;overflow:hidden;background:#fff;display:flex;flex-direction:column}
.tt5c-thumb{display:block;overflow:hidden}
.tt5c-thumb-img,.tt5c-featured-img{width:100%;height:auto;object-fit:cover;display:block}
.tt5c-card-body{padding:.9rem}
.tt5c-card-title{margin:.2rem 0 .4rem;font-size:1.06rem}
.tt5c-meta{font-size:.86rem;color:var(--tt5c-muted);margin-bottom:.45rem}
.tt5c-excerpt{margin:0 0 .5rem;color:#333}

/* Tags */
.tt5c-tags a{display:inline-block;font-size:.78rem;margin:.15rem .35rem .15rem 0;color:#0369a1;text-decoration:none}
.tt5c-tags a:hover{text-decoration:underline}

/* Pagination */
.tt5c-pagination{display:flex;gap:.35rem;justify-content:center;margin:1.2rem 0}
.tt5c-pagination a,.tt5c-pagination span{padding:.45rem .6rem;border:1px solid var(--tt5c-border);border-radius:.5rem}

/* ========= Single Post ========= */
.tt5c-single-title{margin:.25rem 0 .35rem;font-size:1.75rem;line-height:1.2}
.tt5c-single-header,
.tt5c-featured,
.tt5c-content{max-width:820px;margin:0 auto}
.tt5c-featured{margin:.75rem auto 1.25rem}
.tt5c-featured-img{border-radius:.6rem;max-height:520px;object-fit:cover}
.tt5c-article-tools{display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0}
.tt5c-citation{margin:1.5rem 0 .75rem}
.tt5c-apa{background:#f8fafc;border:1px solid var(--tt5c-border);padding:.75rem;border-radius:.5rem;overflow:auto}

/* Gutenberg images inside content */
.tt5c-content .wp-block-image,
.tt5c-content figure.wp-block-image{max-width:720px;margin:1rem auto}
.tt5c-content .wp-block-image img,
.tt5c-content img.size-full,
.tt5c-content img.size-large{width:100%;height:auto;max-width:720px;display:block}
.tt5c-content .wp-block-image.alignleft,
.tt5c-content .wp-block-image.alignright{max-width:360px}
.tt5c-content .wp-block-image.alignleft{margin-right:1rem}
.tt5c-content .wp-block-image.alignright{margin-left:1rem}
.tt5c-content .alignwide,
.tt5c-content .alignfull,
.tt5c-content .wp-block-image.alignwide,
.tt5c-content .wp-block-image.alignfull{width:100%!important;max-width:720px!important;margin-left:auto!important;margin-right:auto!important;overflow:hidden}

/* ========= Author Page ========= */
.tt5c-author-meta{display:flex;gap:18px;align-items:flex-start;margin-bottom:16px}
@media (max-width: 600px){ .tt5c-author-meta{flex-direction:column} }

/* ========= Forms ========= */
.tt5c-input{width:100%;padding:.6rem .7rem;border:1px solid var(--tt5c-border);border-radius:.6rem}
.tt5c-form label{display:block;font-weight:500;color:#111}

/* ========= Footer ========= */
.tt5c-footer{border-top:1px solid var(--tt5c-border);margin-top:2rem;background:#fff}
.footer-inner{display:flex;align-items:center;justify-content:center;gap:1rem;padding:1rem 0}

/* ========= Hero (front page) ========= */
/* Wrapper (full-width bars optional) */
.tt5c-hero-wrap{width:100%;background:#0b1425}
.tt5c-hero{display:grid;grid-template-columns:1fr;min-height:60vh;width:100%}
.tt5c-hero-left{min-height:36vh;background-size:cover;background-position:center;position:relative}
.tt5c-hero-left:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(11,20,37,.55) 0%,rgba(11,20,37,0) 60%)}
.tt5c-hero-right{
  background:#162236;color:#fff;display:flex;flex-direction:column;justify-content:center;
  align-items:center;text-align:center;padding:1.5rem 1rem
}
.tt5c-hero-badge{width:96px;height:96px;border-radius:999px;object-fit:cover;margin-bottom:1rem;border:3px solid rgba(255,255,255,.15);box-shadow:0 8px 20px rgba(0,0,0,.22)}
.tt5c-hero-title{color:#fff;margin:.2rem 0 .45rem;font-size:2rem;line-height:1.12;font-weight:800}
.tt5c-hero-sub{color:#cfe0f5;margin:0 0 1rem;font-size:1.03rem;max-width:48ch}
.tt5c-hero-ctas{display:flex;gap:.6rem;flex-wrap:wrap;justify-content:center}

/* Larger screens */
@media (min-width: 768px){
  .container{padding:1.25rem}
  .tt5c-hero{grid-template-columns:56% 44%;min-height:72vh}
  .tt5c-hero-right{padding:2rem 1.75rem}
  .tt5c-hero-badge{width:108px;height:108px}
  .tt5c-hero-title{font-size:2.4rem}
}
@media (min-width: 1024px){
  .tt5c-hero-title{font-size:2.8rem}
}

/* ===== Header base ===== */
.tt5c-header{
  position: sticky; top:0; z-index:100;
  backdrop-filter: saturate(1.2) blur(6px);
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid var(--tt5c-border);
}
.nav-wrap{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.5rem 0}

/* Brand */
.brand{display:flex;align-items:center;gap:.6rem;text-decoration:none}
.brand-img img{width:40px;height:40px;display:block}
.brand-name{font-weight:800;color:var(--tt5c-brand);letter-spacing:.2px}

/* Desktop menu */
.primary-nav{display:none}
@media (min-width: 900px){ .primary-nav{display:block} }

.menu{list-style:none;margin:0;padding:0;display:flex;gap:1.1rem;align-items:center}
.menu a{
  position:relative;text-decoration:none;color:#111;font-weight:600;padding:.35rem 0;display:inline-block
}
/* Underline reveal effect */
.menu a:after{
  content:""; position:absolute; left:0; right:0; bottom:-4px; height:2px;
  background: linear-gradient(90deg, #0f172a, #1e3a8a);
  transform:scaleX(0); transform-origin:left; transition:transform .22s ease;
  border-radius:2px;
}
.menu a:hover:after, .menu .current-menu-item > a:after{ transform:scaleX(1) }

/* Dropdown (one level) */
.menu li{position:relative}
.menu li .sub-menu{
  position:absolute; left:0; top:calc(100% + 10px);
  background:#fff; border:1px solid var(--tt5c-border); border-radius:.7rem;
  padding:.4rem; min-width:180px; box-shadow:0 14px 26px rgba(0,0,0,.1);
  opacity:0; transform: translateY(-6px) scale(.98);
  pointer-events:none; transition:opacity .18s ease, transform .18s ease;
}
.menu li:hover > .sub-menu{ opacity:1; transform: translateY(0) scale(1); pointer-events:auto }
.sub-menu li{display:block}
.sub-menu a{display:block;padding:.45rem .6rem;border-radius:.5rem}
.sub-menu a:hover{background:#f3f4f6}

/* Mobile button */
.nav-toggle{display:flex;flex-direction:column;gap:4px;background:transparent;border:0;cursor:pointer}
.nav-toggle .bar{width:24px;height:2px;background:#111;border-radius:2px;transition:transform .18s ease,opacity .18s}
@media (min-width: 900px){ .nav-toggle{display:none} }

/* Mobile drawer */
.mobile-drawer{
  display:block; background:#0f172a; color:#fff;
  max-height:0; overflow:hidden; transition:max-height .28s ease;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.menu--mobile{flex-direction:column; align-items:flex-start; gap:0; padding: .3rem 1rem 1rem}
.menu--mobile a{color:#fff; padding:.7rem 0}
.menu--mobile .sub-menu{position:static; opacity:1; transform:none; border:0; box-shadow:none; background:transparent; padding:0}
.menu--mobile .sub-menu a{padding:.45rem 0 .45rem 1rem; opacity:.9}

/* Mobile drawer opened */
.mobile-drawer.is-open{ max-height: 70vh }

/* Active (X) icon animation */
.nav-toggle[aria-expanded="true"] .bar:nth-child(1){ transform: translateY(6px) rotate(45deg) }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2){ opacity:0 }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3){ transform: translateY(-6px) rotate(-45deg) }

/* Hide TT5 block header so only our classic header shows */
.wp-site-blocks > header,
.wp-block-template-part[aria-label="Header"] {
  display: none !important;
}

/* ===== Articles directory ===== */
.articles-hero .page-title{
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  margin: 0 0 .25rem;
}
.articles-hero .intro{
  margin: 0 0 1rem;
  font-size: 1.02rem;
}
.articles-search input[type="search"]{
  border-radius: 999px;
  padding: .8rem 1rem;
}
.articles-search .tt5c-btn{
  border-radius: 999px;
  padding: .8rem 1.1rem;
}

/* Grid */
.articles-grid{ display:grid; gap: 1rem; }
@media (min-width: 680px){ .articles-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px){ .articles-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); } }

/* Card */
.articles-card{
  background:#fff; border:1px solid var(--tt5c-border); border-radius: 1rem; overflow:hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.articles-card:hover{ transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.08); }

/* Thumb: ثابت 16:9 */
.articles-thumb{ display:block; position:relative; overflow:hidden; }
.articles-thumb img{
  width:100%; height:100%; aspect-ratio: 16 / 9; object-fit:cover;
  transform: scale(1.001); transition: transform .35s ease;
}
.articles-card:hover .articles-thumb img{ transform: scale(1.05); }

/* Body */
.articles-body{ padding: .9rem 1rem 1rem; }
.articles-title{ margin:.1rem 0 .35rem; font-size:1.08rem; line-height:1.25; }
.articles-title a{ color:#0b1320; text-decoration:none; }
.articles-title a:hover{ text-decoration:underline; }
.articles-meta{ font-size:.86rem; color:var(--tt5c-muted); margin-bottom:.45rem; }
.articles-excerpt{ margin:0; color:#333; font-size:.98rem; }

/* ===== Single: meta & tools ===== */
.tt5c-meta{ font-size:.9rem; color:var(--tt5c-muted); margin:.25rem 0 .5rem; }
.tt5c-article-tools{ display:flex; flex-wrap:wrap; gap:.5rem .6rem; align-items:center; }

/* Share pills */
.tt5c-share { display:flex; gap:.4rem; margin-left:auto; }
.tt5c-share__btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:999px; text-decoration:none; color:#fff; font-weight:700;
  border:1px solid transparent; transition:transform .18s ease, filter .18s ease;
}
.tt5c-share__btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.tt5c-share__btn.x  { background:#111827; }
.tt5c-share__btn.in { background:#0a66c2; }
.tt5c-share__btn.fb { background:#1877f2; }

/* Single footer buttons */
.tt5c-single-footer .tt5c-single-nav{ display:flex; gap:.5rem; flex-wrap:wrap; margin-top:.75rem; }

/* Author box */
.tt5c-author-box{
  display:flex; gap:14px; align-items:flex-start;
  border:1px solid var(--tt5c-border); border-radius:.8rem; background:#fff;
  padding: .9rem 1rem; margin: 1.25rem auto 0; max-width:820px;
}
.tt5c-author-box__img{ width:64px; height:64px; border-radius:999px; object-fit:cover; }
.tt5c-author-box__name{ margin:.1rem 0 .15rem; font-size:1.05rem; }
.tt5c-author-box__role{ font-size:.9rem; margin-bottom:.25rem; }
.tt5c-author-box__bio{ margin:.2rem 0 0; color:#333; }

/* Prev/Next */
.tt5c-prevnext{
  display:flex; justify-content:space-between; gap:.75rem; margin:1rem auto 0; max-width:820px;
}
.tt5c-prevnext a{ color:#0b1320; text-decoration:none; }
.tt5c-prevnext a:hover{ text-decoration:underline; }

@media (max-width:600px){
  .tt5c-author-box{ flex-direction:column; align-items:flex-start; }
}

/* === Single: ضبط الصورة المميّزة وعرض المقال === */
.tt5c-single-header,
.tt5c-featured,
.tt5c-content,
.tt5c-single-footer,
.tt5c-author-box,
.tt5c-prevnext,
.tt5c-article-tools { 
  max-width: 820px; 
  margin-left: auto; 
  margin-right: auto; 
}

/* الصورة المميزة: لا تتمدّد أكثر من عرض المقال */
.tt5c-featured { margin: .75rem auto 1.1rem; }
.tt5c-featured-img{
  display:block; width:100%; height:auto;
  max-height: 460px;           /* قلّلها لو حاب (مثلاً 380px) */
  object-fit: cover; 
  border-radius: .6rem;
}

/* شريط الأدوات أسفل الصورة */
.tt5c-article-tools{
  display:flex; flex-wrap:wrap; gap:.5rem .6rem; align-items:center;
  padding: 0 1rem;
}

/* أزرار المشاركة كأيقونات واضحة */
.tt5c-share{ display:flex; gap:.4rem; margin-left:auto; }
.tt5c-share__btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:999px; text-decoration:none;
  border:1px solid transparent; transition:transform .18s ease, filter .18s ease;
}
.tt5c-share__btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.tt5c-share__btn svg{ width:18px; height:18px; fill:#fff; display:block; }
.tt5c-share__btn--x  { background:#111827; }
.tt5c-share__btn--in { background:#0a66c2; }
.tt5c-share__btn--fb { background:#1877f2; }

/* زر الاقتباس */
#tt5c-copy-apa{ white-space:nowrap; }


/* Clamp helpers */
.line-clamp-2{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.line-clamp-3{ display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }

/* ========== Typography – clean & readable ========== */
html { font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, "Noto Sans Arabic", "Helvetica Neue", sans-serif;
  color:#0b1320; line-height:1.65;
}
h1,h2,h3 { line-height:1.25; letter-spacing:.1px; }
h1 { font-size: clamp(1.7rem, 2.5vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-top:1.1rem; }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.25rem); margin-top:.9rem; }
.tt5c-content p { margin: .75rem 0; }
.tt5c-content blockquote {
  margin: 1rem 0; padding: .75rem 1rem;
  background:#f8fafc; border-left:4px solid #cbd5e1; border-radius:.5rem;
}

/* ========== Buttons – distinct look ========== */
.tt5c-btn{
  border:1px solid transparent; border-radius:.8rem; padding:.7rem 1rem;
  font-weight:700; letter-spacing:.2px; display:inline-flex; align-items:center; gap:.45rem;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}
.tt5c-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.09); }

/* Primary (navy) & Accent (rose) & Ghost */
.tt5c-btn--primary {
  background: linear-gradient(135deg,#1b2a43 0%,#0f172a 100%); color:#fff; border-color:#0f172a;
}
.tt5c-btn--primary:hover { filter: brightness(1.05); }

.tt5c-btn--accent {
  background: linear-gradient(135deg,#ef395c 0%,#d90f3b 100%); color:#fff; border-color:#cf2044;
}
.tt5c-btn--accent:hover { filter: brightness(.98); }

.tt5c-btn--ghost {
  background:#ffffff; color:#0f172a; border-color:#e5e7eb;
}
.tt5c-btn--ghost:hover { background:#f3f4f6; }

/* Small icon inside buttons */
.tt5c-btn svg { width:18px; height:18px; fill:currentColor; }

/* ========== Single: featured image & tools layout ========== */
.tt5c-single-header,
.tt5c-featured,
.tt5c-content,
.tt5c-single-footer,
.tt5c-author-box,
.tt5c-prevnext,
.tt5c-article-tools { max-width:820px; margin-left:auto; margin-right:auto; }

.tt5c-featured { margin: .7rem auto 1rem; }
.tt5c-featured-img { width:100%; height:auto; max-height:420px; object-fit:cover; border-radius:.7rem; }

/* Tools row (PDF + APA + Share) */
.tt5c-article-tools { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; padding:0 0.2rem; }

/* Share icons */
.tt5c-share { display:flex; gap:.4rem; margin-left:auto; }
.tt5c-share__btn {
  width:36px; height:36px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center;
  border:0; box-shadow:0 8px 18px rgba(0,0,0,.08);
  transition: transform .16s ease, filter .16s ease;
}
.tt5c-share__btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.tt5c-share__btn svg { width:18px; height:18px; fill:#fff; }
.tt5c-share__btn--x  { background:#111827; }
.tt5c-share__btn--in { background:#0a66c2; }
.tt5c-share__btn--fb { background:#1877f2; }

/* ========== Author box – subtle separation ========== */
.tt5c-author-box{
  display:flex; gap:14px; align-items:flex-start;
  border:1px solid #e6ebf2; background: #f7fafc; /* لون خفيف مميِّز */
  border-radius: 12px; padding: 1rem 1.1rem; margin: 1.2rem auto 0;
}
.tt5c-author-box__img{ width:70px; height:70px; border-radius:999px; object-fit:cover; box-shadow:0 4px 12px rgba(0,0,0,.06); }
.tt5c-author-box__name{ margin:.1rem 0 .15rem; font-size:1.06rem; }
.tt5c-author-box__role{ font-size:.92rem; color:#64748b; margin-bottom:.25rem; }
.tt5c-author-box__bio{ margin:.2rem 0 0; color:#222; }

/* ========== Prev/Next – compact pills ========== */
.tt5c-prevnext{
  display:flex; justify-content:space-between; gap:.6rem; margin:1rem auto 0;
}
.tt5c-prevnext a{
  display:inline-flex; align-items:center; gap:.35rem;
  background:#f3f6fb; color:#0b1320; border:1px solid #e6ebf2; border-radius:999px;
  padding:.45rem .75rem; text-decoration:none; font-weight:600;
}
.tt5c-prevnext a:hover{ background:#eaf0f9; }

/* ========== Footer copyright ========== */
.tt5c-footer .footer-inner{
  justify-content:center; padding: .9rem 0;
}
.tt5c-footer .footer-inner > div{
  font-size:.88rem; color:#6b7280;
}

/* ========== Micro tweaks on small screens ========== */
@media (max-width: 520px){
  .tt5c-featured-img{ max-height: 360px; }
  .tt5c-share{ margin-left:0; }
}
/* 1) حواف داخلية على الموبايل لكل مقاطع صفحة المقال */
.tt5c-single-header,
.tt5c-featured,
.tt5c-content,
.tt5c-single-footer,
.tt5c-author-box,
.tt5c-prevnext,
.tt5c-article-tools{
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;   /* ← يبعد النص عن حافة الشاشة */
  padding-right: 1rem;  /* ← يبعد النص عن حافة الشاشة */
  box-sizing: border-box;
}

/* عند الشاشات الأوسع لا نحتاج padding جانبي */
@media (min-width: 860px){
  .tt5c-single-header,
  .tt5c-featured,
  .tt5c-content,
  .tt5c-single-footer,
  .tt5c-author-box,
  .tt5c-prevnext,
  .tt5c-article-tools{
    padding-left: 0;
    padding-right: 0;
  }
}

/* 2) حجم نص المحتوى (أصغر على الموبايل، مريح على الديسكتوب) */
.tt5c-content{ font-size: 1rem; line-height: 1.7; }
@media (min-width: 900px){
  .tt5c-content{ font-size: 1.06rem; }
}

/* 3) ضبط الصورة المميزة كي لا تكبر زائد */
.tt5c-featured{ margin: .7rem auto 1rem; }
.tt5c-featured-img{
  width:100%; height:auto; max-height: 400px; object-fit: cover; border-radius: .7rem;
}
/* إن أردت نسبة ثابتة 16:9 أضف السطر التالي: */
/* .tt5c-featured-img{ aspect-ratio: 16/9; } */

/* 4) أزرار المشاركة تبقى ضمن السطر */
.tt5c-article-tools{ display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; }

/* 5) تنسيق أزرار السابق/التالي كي لا تخرج عن الإطار وتقص العنوان الطويل */
.tt5c-prevnext{
  display:flex; gap:.6rem; justify-content:space-between;
  margin: 1rem auto 0;
}
.tt5c-prevnext .prev, .tt5c-prevnext .next{ flex: 1 1 0; }  /* عمودين متساويين */
.tt5c-prevnext a{
  display:block;
  max-width: 100%;
  background:#f3f6fb;
  color:#0b1320;
  border:1px solid #e6ebf2;
  border-radius:.7rem;
  padding:.5rem .65rem;
  text-decoration:none;
  font-weight:600;
  line-height:1.35;
  white-space: nowrap;         /* سطر واحد */
  overflow: hidden;            /* قص الزيادة */
  text-overflow: ellipsis;     /* … */
}
.tt5c-prevnext a:hover{ background:#eaf0f9; }

/* 6) صندوق الكاتب يبقى مميَّز وبداخل الحواف */
.tt5c-author-box{
  border:1px solid #e6ebf2; background:#f7fafc;
  border-radius:12px; padding:1rem 1.1rem;
}
/* ==== Fix: prev/next link overflowing on mobile ==== */
.tt5c-prevnext{
  max-width: 820px;
  margin: 1rem auto 0;
  padding: 0 1rem;              /* يحافظ على الحواف الداخلية */
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  gap: .6rem;
  overflow: hidden;             /* يمنع أي امتداد أفقي */
}

@media (min-width: 860px){
  .tt5c-prevnext{ padding: 0; } /* على الديسكتوب نلغي الحواف الجانبية */
}

.tt5c-prevnext .prev,
.tt5c-prevnext .next{
  flex: 1 1 0;
  min-width: 0;                 /* أهم سطر: اسمح للعناصر أن تنكمش داخل flex */
}

.tt5c-prevnext a{
  display: block;
  min-width: 0;                 /* مهم أيضاً للرابط نفسه */
  max-width: 100%;
  background: #f3f6fb;
  color: #0b1320;
  border: 1px solid #e6ebf2;
  border-radius: 999px;
  padding: .55rem .75rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;

  white-space: nowrap;          /* سطر واحد فقط */
  overflow: hidden;             /* قصّ الزائد */
  text-overflow: ellipsis;      /* … في النهاية */
}

.tt5c-prevnext a:hover{ background:#eaf0f9; }


/* فقرات واضحة ومريحة للقراءة */
.tt5c-content {
  font-size: 1rem;
  line-height: 1.75;
}
.tt5c-content p { 
  margin: 0 0 1.05rem; 
}
.tt5c-content p:empty { display:none; }

/* مسافات قبل العناوين داخل المقال */
.tt5c-content h2, .tt5c-content h3, .tt5c-content h4 {
  margin-top: 1.4rem;
  margin-bottom: .6rem;
}

/* القوائم */
.tt5c-content ul, .tt5c-content ol {
  margin: 0 0 1.1rem 1.25rem; /* فراغ سفلي وهوامش يسار */
  padding: 0;
}
.tt5c-content li { margin: .35rem 0; }

/* اقتباسات */
.tt5c-content blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  background: #f8fafc;
  border-left: 4px solid #cbd5e1;
  border-radius: .5rem;
}

/* صور داخل النص تبقى داخل عرض المحتوى */
.tt5c-content img { max-width:100%; height:auto; display:block; }

/* ===== Article Card (around the content) ===== */
.tt5c-article-card{
  max-width: 800px;
  margin: 0 auto 1rem;
  background:#fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  border-radius: 12px;
  padding: 20px;
  box-sizing: border-box;
}

/* Title centered */
.tt5c-article-title{
  color:#0f3c60;
  text-align:center;
  margin:.25rem 0 1rem;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height:1.2;
}

/* Inline author strip */
.tt5c-inline-author{
  display:flex; align-items:center; gap:15px; margin: 14px 0 18px;
}
.tt5c-inline-author img{
  width:60px; height:60px; border-radius:50%; object-fit:cover;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.tt5c-inline-author .name{ margin:0; font-weight:700; color:#0f3c60; }
.tt5c-inline-author .name a{ color:inherit; text-decoration:none; }
.tt5c-inline-author .name a:hover{ text-decoration:underline; }
.tt5c-inline-author .role{ margin:.1rem 0 0; color:#667085; font-size:.92rem; }

/* Prose typography */
.tt5c-prose{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, "Noto Sans Arabic", "Helvetica Neue", sans-serif;
  color:#333; line-height:1.7; font-size:1rem;
}
.tt5c-prose p{ margin:0 0 1.05rem; text-align:justify; text-justify:inter-word; hyphens:auto; -webkit-hyphens:auto; }
.tt5c-prose h2, .tt5c-prose h3, .tt5c-prose h4{ margin:1.4rem 0 .6rem; color:#0f3c60; line-height:1.3; }
.tt5c-prose ul, .tt5c-prose ol{ margin:0 0 1.1rem 1.25rem; padding:0; }
.tt5c-prose li{ margin:.35rem 0; text-align:justify; text-justify:inter-word; }
.tt5c-prose blockquote{
  margin:1rem 0; padding:.75rem 1rem; background:#f8fafc;
  border-left:4px solid #cbd5e1; border-radius:.5rem;
}
.tt5c-prose img{ max-width:100%; height:auto; display:block; border-radius:.4rem; }

/* Back-to-author button center */
.tt5c-back-author{ text-align:center; margin-top: 32px; }
.tt5c-back-author .tt5c-btn{ border-radius:30px; padding:.6rem 1.2rem; }

/* Mobile gutters so text never hits screen edges */
@media (max-width: 860px){
  .tt5c-article-card{ margin-left: 1rem; margin-right: 1rem; }
}
/* ===== About Page ===== */
.about-hero{
  text-align:center;
  padding-top: 1rem;
  padding-bottom: .5rem;
}
.about-badge{
  width:84px; height:84px; border-radius:999px; object-fit:cover;
  border:3px solid rgba(0,0,0,.06); box-shadow:0 6px 16px rgba(0,0,0,.08);
  margin: 0 auto .6rem;
}
.about-title{
  margin:.2rem 0 .2rem;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  color:#0f3c60; line-height:1.2;
}
.about-tag{
  margin:0 0 .4rem; color:#64748b; font-weight:600;
}

/* Card intro */
.about-card{
  max-width: 840px; margin: 0 auto 1rem;
  background:#fff; border:1px solid #e6ebf2; border-radius:12px;
  box-shadow:0 6px 16px rgba(0,0,0,.05);
  padding: 18px 18px;
}
.about-prose{
  font-size:1rem; line-height:1.75; color:#333;
  text-align:justify; text-justify:inter-word; hyphens:auto; -webkit-hyphens:auto;
}

/* Tiles */
.about-grid{
  display:grid; gap: .9rem; margin-top:.6rem;
}
.about-tile{
  background:#fff; border:1px solid #e6ebf2; border-radius:12px;
  padding: 14px 16px; box-shadow:0 4px 12px rgba(0,0,0,.04);
}
.about-tile h2{
  margin:.1rem 0 .4rem; font-size:1.2rem; color:#0f3c60;
}
.about-tile p{ margin:0; color:#1f2937; line-height:1.7; }

/* CTAs */
.about-ctas{
  display:flex; gap:.6rem; flex-wrap:wrap; justify-content:center;
  margin: 1rem auto 0;
}

/* Wider screens */
@media (min-width: 900px){
  .about-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .about-card{ padding: 22px 24px; }
}


/* ===== Minimal bottom bar footer ===== */
.tt5c-simple-footer{
  background:#0b1320;               /* شريط داكن */
  color:#cbd5e1;
  border-top:1px solid rgba(255,255,255,.08);
}
.tt5c-simple-footer .container{
  padding:.8rem 1rem;
  text-align:center;
  font-size:.92rem;
  line-height:1.6;
}

/* إخفاء فوتر القالب البلوكي إن وُجد */
.wp-site-blocks > footer,
.wp-block-template-part[aria-label="Footer"]{ display:none !important; }

/* ===== Rotating Ticker (Home) ===== */
.tt5c-ticker{
  position: sticky; top: 0; z-index: 8;  /* يبقى أسفل الهيدر إذا كان الهيدر sticky */
  background:#0f172a; color:#e5e7eb; border-bottom:1px solid rgba(255,255,255,.08);
}
.admin-bar .tt5c-ticker{ top: 32px; } /* يراعي شريط المشرف إن كان ظاهرًا */

.tt5c-ticker__inner{
  display:flex; align-items:center; gap:.6rem;
  padding:.45rem 1rem; min-height:42px;
}

.tt5c-ticker__label{
  display:inline-block; font-weight:700; font-size:.82rem; letter-spacing:.02em;
  background:#e11d48; color:#fff; border-radius:999px;
  padding:.28rem .6rem; flex:0 0 auto;
}

.tt5c-ticker__viewport{
  position:relative; overflow:hidden; flex:1 1 auto; min-height:1.2em;
  display:flex; align-items:center;
}

.tt5c-ticker__item{
  position:absolute; left:0; right:0;
  white-space:nowrap; text-overflow:ellipsis; overflow:hidden;
  opacity:0; transform: translateY(8px); transition: opacity .28s ease, transform .28s ease;
  color:#cfe0f5; text-decoration:none; font-weight:600;
}
.tt5c-ticker__item:hover{ text-decoration:underline; }
.tt5c-ticker__item.show{ opacity:1; transform: translateY(0); }

/* Alerts */
.tt5c-alert{ border-radius:.6rem; padding:.75rem 1rem; margin:.75rem 0; }
.tt5c-alert--ok{ background:#ecfdf5; color:#065f46; border:1px solid #a7f3d0; }
.tt5c-alert--warn{ background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }

/* Form rows */
.tt5c-form{ margin-top:.25rem; }
.tt5c-form-row{ margin:.6rem 0; }
.tt5c-form label{ display:block; font-weight:600; margin-bottom:.25rem; color:#111827; }
.tt5c-input{ width:100%; padding:.65rem .75rem; border:1px solid var(--tt5c-border,#e5e7eb); border-radius:.6rem; }
.tt5c-input:focus{ outline:none; border-color:#0f172a; box-shadow:0 0 0 .15rem rgba(15,23,42,.08); }

/* ===== Apply as Writer – layout ===== */
.tt5c-apply{ padding: 1rem 0 1.25rem; }
.tt5c-apply-head .page-title{ margin-bottom:.25rem; }
.tt5c-apply-card{ padding:1rem; }

.tt5c-card{
  background:#fff;
  border:1px solid var(--tt5c-border,#e5e7eb);
  border-radius:1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

/* Grid for the 4 small fields */
.tt5c-grid-4{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:.75rem;
}
@media (max-width: 1100px){ .tt5c-grid-4{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .tt5c-grid-4{ grid-template-columns: 1fr; } }

/* Form elements */
.tt5c-form{ margin-top:.25rem; }
.tt5c-form-row{ margin:.7rem 0; }
.tt5c-form label{ display:block; font-weight:600; margin-bottom:.3rem; color:#0f172a; }
.tt5c-input{
  width:100%; padding:.75rem .85rem;
  border:1px solid var(--tt5c-border,#e5e7eb);
  border-radius:.7rem; background:#fff;
  transition:border-color .2s, box-shadow .2s;
}
.tt5c-input:focus{
  outline:none;
  border-color:#0f172a;
  box-shadow:0 0 0 .15rem rgba(15,23,42,.08);
}
.tt5c-input::placeholder{ color:#9aa3ad; }

/* File input subtle style */
.tt5c-file{ padding:.55rem .6rem; }

/* Honeypot */
.tt5c-form .hp{ display:none !important; }

/* Consent row */
.tt5c-consent{ display:flex; align-items:center; gap:.5rem; }
.tt5c-consent input{ transform: translateY(1px); }

/* Actions */
.tt5c-form-actions{
  margin-top:.6rem;
  display:flex; gap:.6rem; flex-wrap:wrap;
}

/* Buttons (inherit your existing) */
.tt5c-btn{
  border:1px solid var(--tt5c-border,#e5e7eb);
  background:#fff; color:#111;
  padding:.7rem 1.05rem; border-radius:.8rem; text-decoration:none; display:inline-block; font-weight:600;
}
.tt5c-btn--navy{ background:#0f172a; border-color:#0f172a; color:#fff; }
.tt5c-btn--navy:hover{ background:#111827; }
.tt5c-btn--white:hover{ background:#f3f4f6; }

.required{ color:#e11d48; margin-left:.15rem; }

/* Alerts (if not already added) */
.tt5c-alert{ border-radius:.7rem; padding:.8rem 1rem; margin:.75rem 0; }
.tt5c-alert--ok{ background:#ecfdf5; color:#065f46; border:1px solid #a7f3d0; }
.tt5c-alert--warn{ background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }

/* ألغِ أي حدود افتراضية قد يضيفها الثيم تحت الهيدر */
.tt5c-header,
header.wp-block-template-part,
.site-header,
header[role="banner"]{
  border-bottom: 0 !important;
  box-shadow: none !important;
}

/* الفاصل تحت الهيدر */
.site-divider{
  height: 14px;                     /* سماكة المساحة */
  background:
    linear-gradient(                 /* "شعرة" متدرجة أنيقة في الأعلى */
      to bottom,
      rgba(0,0,0,0.12),
      rgba(0,0,0,0.12)
    ) top / 100% 1px no-repeat,
    linear-gradient(                 /* تلاشي خفيف أسفل الخط */
      to bottom,
      rgba(0,0,0,0.08),
      rgba(0,0,0,0)
    );
  margin-bottom: clamp(12px, 2.5vh, 28px);  /* مسافة بين الهيدر والمحتوى */
  pointer-events: none;
}

/* حاوية الهيدر (تأكيد المحاذاة والحواف الداخلية) */
.tt5c-header .nav-wrap.container{
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(16px,4vw,32px);
}


/* طبّق فقط داخل أرشيف الكاتب */
body.author .posts-grid img.wp-post-image,
body.author .post-card img.wp-post-image,
body.author .hentry img.wp-post-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;         /* لبعض الثيمات يُفضّل ضبطه لاحقًا */
  object-fit: cover;
  display: block;
}

/* لو كانت هناك حاوية للصورة */
body.author .post-card .post-thumbnail,
body.author .post-card .thumb,
body.author .hentry .post-thumbnail {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
}


/* تصغير وتوحيد أزرار/الحبوب داخل صفحة المقال فقط */
body.single-post .tt5c-back-author .tt5c-btn,
body.single-post .tt5c-single-footer .tt5c-btn,
body.single-post .tt5c-prevnext a {
  font-size: clamp(12px, 1vw, 14px);   /* كان كبيرًا؛ الآن 12–14px */
  line-height: 1.1;
  padding: 8px 12px;                   /* حواف أهدأ */
  border-radius: 9999px;               /* شكل pill */
  font-weight: 500;
}

/* جعل روابط السابق/التالي تظهر كـ pill متناسق أيضًا */
body.single-post .tt5c-prevnext a {
  display: inline-block;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  text-decoration: none;
  white-space: nowrap;                 /* لا تكسر العنوان الطويل */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;             /* نقاط عند الطول الزائد */
}

/* مسافات متسقة بين الحبوب */
body.single-post .tt5c-single-footer .tt5c-single-nav,
body.single-post .tt5c-prevnext {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

/* زرّ "Back to Author Page" نفس الأسلوب */
body.single-post .tt5c-back-author {
  margin: 18px 0 8px;
}
body.single-post .tt5c-back-author .tt5c-btn {
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
}
