/* ═══════════════════════════════════════════════════════════
   style_ar.css – mkadmi.tn – Version Arabe
   Palette : vert émeraude foncé • or • blanc • gris clair
   Direction : RTL
═══════════════════════════════════════════════════════════ */

:root {
  --bord:     #0D5C4A;   /* vert émeraude foncé */
  --bord-mid: #1A7A62;
  --bord-lt:  #2E9E80;
  --gold:     #C8860A;
  --gold-lt:  #E8A820;
  --white:    #FFFFFF;
  --bg:       #FAFAFA;
  --bg-strip: #EEF6F3;
  --text:     #1A1E1C;
  --muted:    #5A7068;
  --line:     #C8DDD8;
  --link:     #0D5C4A;
  --nav-h:    80px;
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 9pt;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
}
a { color: var(--link); text-decoration: underline; font-weight: bold; }
a:hover { color: var(--bord-mid); }
p { text-align: justify; margin-bottom: .6em; }

/* ── Page wrapper ─────────────────────────────────────── */
.site-wrap {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--white);
  box-shadow: 0 0 40px rgba(13,92,74,.1);
}

/* ═══════════════════════════════════════════════════════
   TOP BAR
═══════════════════════════════════════════════════════ */
.topbar {
  background: var(--bord);
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;  /* nav first=RIGHT, logo last=LEFT in RTL */
  padding: 0 20px;
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
}
.topbar-logo .logo-svg,
.logo-horizontal .logo-svg {
  width: auto;
  height: 65px;
  max-height: 65px;
  flex-shrink: 0;
}
.logo-horizontal {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-horizontal img,
.logo-horizontal .logo-svg {
  width: auto;
  height: 65px;
}

/* Navigation */
.topnav { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.topnav a {
  color: #D0EDE6;
  text-decoration: none;
  font-size: 8pt;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 3px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.topnav a:hover,
.topnav a.active {
  background: var(--gold);
  color: var(--bord);
}

/* Hamburger */
.nav-toggle { display: none; cursor: pointer; background: none; border: none; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--white); margin: 5px 0;
  transition: .3s;
}

/* Liens langues */
.lang-links {
  position: absolute;
  top: 0; left: 0;
  display: flex; gap: 0;
  z-index: 200;
}
.lang-link {
  background: var(--gold);
  color: var(--bord) !important;
  font-size: 7.5pt;
  font-weight: bold !important;
  padding: 3px 10px;
  text-decoration: none !important;
  transition: background .15s;
}
.lang-link:first-child { border-bottom-right-radius: 5px; }
.lang-link:last-child  { border-bottom-left-radius: 5px; margin-right: 2px; }
.lang-link:hover { background: var(--gold-lt) !important; color: var(--bord) !important; }

/* ═══════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════ */
.page-banner {
  background: linear-gradient(135deg, var(--bord) 60%, var(--bord-mid) 100%);
  border-bottom: 3px solid var(--gold);
  padding: 18px 28px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-direction: row-reverse;
}
.page-banner h1 {
  color: var(--white);
  font-size: 14pt;
  font-weight: bold;
  margin: 0;
}
.page-banner .banner-icon { font-size: 22pt; flex-shrink: 0; }
.page-banner .banner-sub  { color: #C0E8DF; font-size: 8.5pt; margin-top: 3px; }

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════ */
.page-body { padding: 0 28px 40px; }

.sec-head {
  background: var(--bord);
  color: var(--white);
  font-size: 10.5pt;
  font-weight: bold;
  padding: 6px 14px;
  margin: 26px -28px 14px;
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  letter-spacing: .3px;
}
.sub-head {
  color: var(--bord-mid);
  font-size: 9.5pt;
  font-weight: bold;
  border-bottom: 2px solid var(--bord-mid);
  padding-bottom: 3px;
  margin: 16px 0 8px;
}

/* ── Lists ── */
.cv-list { list-style: none; padding: 0; margin: 6px 0 12px; }
.cv-list li {
  padding: 3px 18px 3px 0;
  position: relative;
  font-size: 9pt;
  line-height: 1.55;
  text-align: justify;
}
.cv-list li::before {
  content: "◂";
  color: var(--bord-lt);
  position: absolute; right: 0; top: 3px;
  font-size: 8pt;
}

/* ── Entry ── */
.entry { display: flex; gap: 16px; margin-bottom: 10px; flex-direction: row-reverse; }
.entry-date {
  flex: 0 0 110px;
  font-weight: bold; color: var(--bord-mid);
  font-size: 8.5pt; padding-top: 1px; text-align: left;
}
.entry-body { flex: 1; }
.entry-body strong { font-size: 9pt; }
.entry-body .inst { font-style: italic; color: var(--muted); font-size: 8.5pt; display: block; margin-top: 1px; }
.entry-body .det  { font-size: 8.5pt; display: block; margin-top: 2px; }

/* ── Tables ── */
.cv-table {
  width: 100%; border-collapse: collapse;
  font-size: 8.5pt; margin-bottom: 14px;
}
.cv-table thead tr { background: var(--bord); color: var(--white); }
.cv-table thead th { padding: 5px 8px; text-align: right; font-weight: bold; }
.cv-table tbody tr:nth-child(even) { background: var(--bg-strip); }
.cv-table tbody td { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.4; text-align: right; }
.cv-table .num { text-align: center; width: 30px; color: var(--bord-mid); font-weight: bold; }
.cv-table .yr  { white-space: nowrap; color: var(--bord-mid); font-weight: bold; }

/* ── Info box ── */
.info-box {
  background: var(--bg-strip);
  border-right: 4px solid var(--bord-mid);
  border-left: none;
  padding: 8px 12px;
  font-size: 8.5pt;
  margin-bottom: 14px;
  line-height: 1.6;
}
.info-box strong { color: var(--bord); }
hr.divider { border: none; border-top: 1px solid var(--line); margin: 8px 0; }

/* ═══════════════════════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════════════════════ */
.home-hero {
  background: linear-gradient(135deg, var(--bord) 55%, var(--bord-mid));
  border-bottom: 4px solid var(--gold);
  padding: 28px 28px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-direction: row-reverse;
}
.hero-photo img {
  width: 155px; height: 178px;
  object-fit: cover; object-position: center top;
  border: 3px solid var(--gold);
  border-radius: 6px;
  display: block;
}
.hero-info { flex: 1; }
.hero-info h1 { font-size: 20pt; font-weight: bold; color: var(--white); margin: 0 0 5px; }
.hero-info .hero-title { color: var(--gold-lt); font-size: 9.5pt; font-style: italic; margin-bottom: 10px; }
.hero-info .hero-contact { font-size: 8.5pt; color: #C8E8E0; line-height: 1.8; }
.hero-info .hero-contact a { color: #C8E8E0; font-weight: normal; }
.hero-info .hero-contact a:hover { color: var(--gold-lt); }

/* Profiles strip */
.profiles-strip {
  background: var(--bg-strip);
  border-bottom: 2px solid var(--line);
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 4px;
  padding: 8px 16px;
}
.profiles-strip a {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 7.5pt; font-weight: bold; color: var(--bord);
  text-decoration: none;
  padding: 4px 12px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--white);
  transition: .15s;
}
.profiles-strip a .ps { font-size: 7pt; font-weight: normal; color: var(--muted); }
.profiles-strip a:hover { background: var(--bord); color: var(--white); border-color: var(--bord); }
.profiles-strip a:hover .ps { color: var(--gold-lt); }

/* ── Page layout sidebar ── */
.page-layout { display: flex; align-items: flex-start; flex-direction: row-reverse; }
.sidebar {
  width: 175px; flex-shrink: 0;
  background: var(--bg-strip);
  border-left: 2px solid var(--line);
  border-right: none;
  padding: 14px 10px;
  min-height: 700px;
}
.sb-section { margin-bottom: 18px; }
.sb-title {
  font-size: 7pt; font-weight: bold; color: var(--bord);
  text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px; margin-bottom: 8px;
}
.sb-nav { list-style: none; padding: 0; margin: 0; }
.sb-nav li { margin-bottom: 2px; }
.sb-nav a {
  display: flex; align-items: center; gap: 7px;
  font-size: 8.5pt; font-weight: bold; color: var(--bord);
  text-decoration: none; padding: 5px 7px;
  border-radius: 4px; transition: background .15s, color .15s;
  flex-direction: row-reverse;
}
.sb-nav a:hover, .sb-nav a.active { background: var(--bord); color: var(--white); }
.sb-nav .ico { font-size: 12pt; flex-shrink: 0; }

.uni-list { display: flex; flex-direction: column; gap: 7px; }
.uni-list a {
  display: flex; align-items: center; gap: 7px;
  text-decoration: none; font-size: 7.5pt; color: var(--muted);
  font-weight: normal; padding-bottom: 6px;
  border-bottom: 1px dotted var(--line); transition: color .15s;
  flex-direction: row-reverse;
}
.uni-list a:last-child { border-bottom: none; }
.uni-list a:hover { color: var(--bord); }
.uni-badge {
  width: 28px; height: 28px; border-radius: 4px;
  flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 11pt; color: #fff;
}
.u-squ{background:#006B3F;}.u-isd{background:#003A6E;}.u-p8{background:#C00000;}
.u-ecp{background:#0055A4;}.u-enssib{background:#8B0000;}

.social-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.social-wrap a {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bord); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 11pt; text-decoration: none;
  transition: background .15s, transform .15s; font-weight: normal;
}
.social-wrap a:hover { background: var(--gold); color: var(--bord); transform: scale(1.1); }

.main-content { flex: 1; padding: 18px 22px; min-width: 0; }
.main-sec {
  font-size: 10pt; font-weight: bold; color: var(--bord);
  border-bottom: 2px solid var(--bord);
  padding-bottom: 4px; margin: 0 0 12px;
}

/* Conf grid */
.conf-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-bottom: 22px; }
.conf-box {
  background: var(--bord); border-radius: 5px;
  padding: 9px 11px; display: flex; gap: 8px;
  align-items: center; transition: background .15s;
  flex-direction: row-reverse;
}
.conf-box:hover { background: var(--bord-mid); }
.conf-badge {
  background: var(--gold); color: var(--bord);
  font-weight: bold; font-size: 7.5pt;
  padding: 3px 6px; border-radius: 3px;
  white-space: nowrap; flex-shrink: 0;
}
.conf-name { font-weight: bold; font-size: 8pt; color: #fff; }
.conf-desc { font-size: 7pt; color: #C8E8E0; }

/* Book rows */
.book-row {
  display: flex; gap: 13px; padding: 13px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start; flex-direction: row-reverse;
}
.book-row:last-child { border-bottom: none; }
.book-cover {
  width: 76px; flex-shrink: 0;
  background: var(--bg-strip);
  border: 1px solid var(--line);
  border-top: 4px solid var(--bord);
  border-radius: 3px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px; font-size: 7pt; color: var(--muted);
  text-align: center; min-height: 95px;
}
.book-cover .cov-ico { font-size: 22pt; display: block; margin-bottom: 4px; }
.book-body { flex: 1; }
.btitle { font-weight: bold; font-size: 9.5pt; color: var(--bord); line-height: 1.35; margin-bottom: 4px; }
.bmeta  { font-size: 8pt; color: var(--muted); margin-bottom: 5px; }
.bdesc  { font-size: 8.5pt; color: var(--text); text-align: justify; line-height: 1.5; }
.blinks { margin-top: 6px; font-size: 8pt; }
.blinks a { margin-left: 10px; }

/* ═══════════════════════════════════════════════════════
   PUBLICATIONS
═══════════════════════════════════════════════════════ */
.pub-item {
  padding: 5px 20px 5px 0;
  position: relative;
  font-size: 8pt; line-height: 1.5;
  border-bottom: 1px dotted var(--line);
  text-align: justify;
}
.pub-item::before {
  content: "◂";
  color: var(--bord-lt);
  position: absolute; right: 0; top: 5px; font-size: 8pt;
}
.pub-item .pub-num { font-weight: bold; color: var(--bord-mid); margin-left: 4px; }
.pub-item .pub-lang {
  display: inline-block; font-size: 7pt; font-weight: bold;
  background: var(--bord); color: var(--white);
  padding: 1px 5px; border-radius: 2px; margin-left: 4px; vertical-align: middle;
}
.pub-item em { color: var(--bord-mid); }

/* Scopus badge */
.scopus-badge {
  display: inline-block; background-color: #e87722;
  color: #fff !important; font-size: 6.8pt; font-weight: bold;
  padding: 1px 6px; border-radius: 3px; margin-left: 5px;
  vertical-align: middle; text-decoration: none !important;
}
.scopus-badge:hover { background-color: #c45f00 !important; }

.pub-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px;
  justify-content: flex-end;
}
.pub-tabs a {
  font-size: 8pt; font-weight: bold; color: var(--bord);
  text-decoration: none; padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--bord); background: var(--white); transition: .15s;
}
.pub-tabs a:hover, .pub-tabs a.active { background: var(--bord); color: var(--white); }

/* ═══════════════════════════════════════════════════════
   RESEARCH
═══════════════════════════════════════════════════════ */
.research-axis {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin: 10px 0 14px;
}
.axis-card { background: var(--bg-strip); border-top: 3px solid var(--bord); border-radius: 4px; padding: 12px; }
.axis-card .axis-icon { font-size: 18pt; margin-bottom: 6px; }
.axis-card .axis-title { font-weight: bold; color: var(--bord); font-size: 9pt; margin-bottom: 4px; }
.axis-card .axis-desc { font-size: 8pt; color: var(--muted); line-height: 1.4; }

.links-cols {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px; margin: 8px 0 14px;
}
.links-cols a {
  display: block; font-size: 8.5pt; padding: 4px 8px;
  background: var(--white); border: 1px solid var(--line);
  border-right: 3px solid var(--bord-lt); border-left: none;
  border-radius: 3px; text-decoration: none; color: var(--link);
  transition: .15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.links-cols a:hover { background: var(--bg-strip); border-right-color: var(--bord); }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bord);
  border-top: 3px solid var(--gold);
  color: #A0CCB8;
  font-size: 8pt; text-align: center;
  padding: 14px 20px; line-height: 1.7;
}
.site-footer a { color: var(--gold-lt); font-weight: normal; }
.site-footer a:hover { color: var(--white); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE MOBILE
═══════════════════════════════════════════════════════ */
@media (max-width: 680px) {
  :root { --nav-h: 60px; }
  .topbar { position: relative; padding: 0 12px; }
  .topbar-logo .logo-svg, .logo-horizontal .logo-svg { height: 46px !important; width: auto !important; }
  .nav-toggle { display: block; }
  .topnav {
    display: none; flex-direction: column;
    position: absolute; top: var(--nav-h); right: 0; left: 0;
    background: var(--bord); padding: 6px 0; z-index: 99;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    border-top: 2px solid var(--gold);
  }
  .topnav.open { display: flex; }
  .topnav a { border-radius: 0; padding: 11px 20px; width: 100%; font-size: 9pt; text-align: right; }
  .lang-links { top: 4px; left: 52px; }
  .home-hero { flex-direction: column; align-items: center; text-align: center; padding: 16px 14px; gap: 12px; }
  .hero-photo img { width: 100px; height: 115px; }
  .hero-info h1 { font-size: 14pt; }
  .page-layout { flex-direction: column; }
  .sidebar { width: 100%; border-left: none; border-bottom: 2px solid var(--line); min-height: auto; padding: 10px 14px; }
  .conf-grid { grid-template-columns: 1fr; gap: 7px; }
  .book-row { flex-direction: column; gap: 8px; }
  .book-cover { width: 100%; flex-direction: row; min-height: auto; padding: 6px 10px; gap: 10px; justify-content: flex-start; }
  .cv-table { display: block; overflow-x: auto; }
  .entry { flex-direction: column; gap: 2px; }
  .page-body { padding: 0 14px 28px; }
  .sec-head { margin: 20px -14px 12px; }
  .research-axis, .links-cols { grid-template-columns: 1fr; }
  .pub-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .pub-tabs a { flex-shrink: 0; }
}

@media print {
  .topbar, .site-footer { display: none; }
  .site-wrap { box-shadow: none; }
  .page-body { padding: 0; }
}
