/* ===========================================================
   TESPAM Kurumsal — main stylesheet
   Uses CSS logical properties throughout so the Arabic (RTL)
   rendering mirrors correctly without a separate stylesheet.
   =========================================================== */

:root {
  --teal: #0f6e6b;
  --teal-dark: #0a4a48;
  --navy: #16283f;
  --ink: #1b2430;
  --paper: #ffffff;
  --paper-soft: #f5f7f8;
  --line: #e3e8ea;
  --red: #b3242c;
  --gold: #c99a3e;

  --academic: #2f5fa8;
  --administrative: #d1791f;
  --commercial: #6b7280;
  --civil: #2f8a4e;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 34, 33, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 34, 33, 0.14);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-width: 0;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, "Noto Sans Arabic", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
}

html[dir="rtl"] body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; cursor: pointer; }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-block-end: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand img { height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; color: var(--navy); letter-spacing: 0.02em; }
.brand-text span { font-size: 0.72rem; color: var(--teal); text-transform: uppercase; letter-spacing: 0.12em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--paper-soft);
  color: var(--teal-dark);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 14px;
  margin-inline-start: 6px;
}
.lang-switch a {
  padding: 6px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 6px;
  color: #6b7688;
  text-transform: uppercase;
}
.lang-switch a.active {
  background: var(--teal);
  color: #fff;
}

.nav-toggle {
  display: none;
  border: none;
  background: none;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

.nav-flex {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------------------------------------------------------- hero */

.hero {
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(15, 110, 107, 0.10), transparent),
    linear-gradient(180deg, #f7faf9 0%, #ffffff 100%);
  padding-block: 72px 60px;
  border-block-end: 1px solid var(--line);
}
.hero-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(179, 36, 44, 0.08);
  padding: 5px 14px;
  border-radius: 999px;
  margin-block-end: 18px;
}
.hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  color: var(--navy);
  font-weight: 800;
  max-width: 820px;
  margin-block-end: 18px;
}
.hero .lead {
  font-size: 1.12rem;
  color: #46525f;
  max-width: 720px;
  margin-block-end: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.96rem;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 20px rgba(15, 110, 107, 0.28); }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); }
.btn-outline { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-gold { background: var(--gold); color: #2a1e05; box-shadow: 0 8px 20px rgba(201, 154, 62, 0.3); }
.btn-gold:hover { transform: translateY(-1px); }

/* ---------------------------------------------------------- stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-block: 40px;
}
.stat { text-align: center; }
.stat-num { font-size: 2.1rem; font-weight: 800; color: var(--teal-dark); }
.stat-lbl { font-size: 0.88rem; color: #5a6672; margin-block-start: 4px; }

/* ---------------------------------------------------------- sections generic */

section.block { padding-block: 64px; }
.block-alt { background: var(--paper-soft); }
.eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--teal);
  margin-block-end: 10px;
}
.section-heading {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--navy);
  font-weight: 800;
  margin-block-end: 14px;
}
.section-lead { color: #4b5763; max-width: 760px; font-size: 1.03rem; margin-block-end: 40px; }

/* ---------------------------------------------------------- pillars */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.pillar-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
}
.pillar-badge {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  margin-block-end: 18px;
}
.pillar-card.academic .pillar-badge { background: var(--academic); }
.pillar-card.commercial .pillar-badge { background: var(--commercial); }
.pillar-card.civil .pillar-badge { background: var(--civil); }
.pillar-card h3 { font-size: 1.2rem; color: var(--navy); margin-block-end: 10px; }
.pillar-card p { color: #565f6a; font-size: 0.98rem; }

/* ---------------------------------------------------------- ecosystem / logo grid */

.logo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.logo-tile {
  aspect-ratio: 1.3 / 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.logo-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.logo-tile img { max-height: 100%; max-width: 100%; object-fit: contain; }

/* ---------------------------------------------------------- CTA band */

.cta-band {
  background: linear-gradient(120deg, var(--teal-dark), var(--navy));
  color: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 { font-size: 1.5rem; margin-block-end: 8px; }
.cta-band p { color: rgba(255,255,255,0.82); max-width: 560px; }
.cta-band .btn-outline { border-color: #fff; color: #fff; }
.cta-band .btn-outline:hover { background: #fff; color: var(--navy); }

/* ---------------------------------------------------------- about page */

.prose { max-width: 800px; }
.prose p { color: #414c57; margin-block-end: 16px; font-size: 1.02rem; }
.prose h2 { font-size: 1.05rem; color: var(--navy); margin-block: 30px 10px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.legend-strip {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-block: 24px;
}
.legend-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: #414c57;
  background: var(--paper-soft);
  padding: 8px 14px;
  border-radius: 999px;
}
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.legend-dot.academic { background: var(--academic); }
.legend-dot.administrative { background: var(--administrative); }
.legend-dot.commercial { background: var(--commercial); }
.legend-dot.civil { background: var(--civil); }

.doc-callout {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-block-start: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.doc-callout h3 { color: var(--navy); font-size: 1.08rem; margin-block-end: 6px; }
.doc-callout p { color: #56616c; font-size: 0.95rem; max-width: 480px; }

/* ---------------------------------------------------------- org chart page */

.orgchart-frame {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: auto;
}
.orgchart-frame img { border-radius: 6px; margin-inline: auto; }

/* ---------------------------------------------------------- team page */

.team-toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-block-end: 34px;
}
.team-search {
  flex: 1 1 260px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.98rem;
  background: var(--paper-soft);
}
.team-search:focus { outline: 2px solid var(--teal); background: #fff; }
.team-filter {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  font-size: 0.94rem;
  max-width: 260px;
}

.team-section { margin-block-end: 46px; }
.team-section-title {
  font-size: 1.15rem;
  color: var(--navy);
  font-weight: 800;
  margin-block-end: 18px;
  padding-inline-start: 14px;
  border-inline-start: 4px solid var(--teal);
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.team-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  transition: box-shadow 0.15s, transform 0.15s;
}
.team-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.team-avatar {
  width: 74px; height: 74px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; color: #fff;
  overflow: hidden;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-name { font-size: 0.95rem; font-weight: 700; color: var(--navy); margin-block-end: 4px; }
.team-title { font-size: 0.82rem; color: #667180; line-height: 1.4; }
.team-note {
  margin-block-start: 30px;
  font-size: 0.88rem;
  color: #7a8390;
  background: var(--paper-soft);
  border-radius: 10px;
  padding: 16px 18px;
}
#team-no-results { display: none; text-align: center; padding-block: 40px; color: #7a8390; }

/* ---------------------------------------------------------- contact page */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}
.contact-cards { display: flex; flex-direction: column; gap: 14px; }
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.contact-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(15, 110, 107, 0.1);
  color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.contact-card h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: #8891a0; margin-block-end: 4px; }
.contact-card a, .contact-card p { font-size: 1rem; color: var(--navy); font-weight: 600; }
.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; }
.form-note {
  margin-block-start: 20px;
  background: var(--paper-soft);
  border-radius: 12px;
  padding: 20px 22px;
}
.form-note h4 { color: var(--navy); margin-block-end: 8px; }
.form-note p { color: #56616c; font-size: 0.94rem; }

/* ---------------------------------------------------------- footer */

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  padding-block: 50px 26px;
  margin-block-start: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
  margin-block-end: 34px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; margin-block-end: 14px; }
.footer-brand img { height: 38px; }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.site-footer p { font-size: 0.92rem; color: rgba(255,255,255,0.65); max-width: 340px; }
.site-footer h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-block-end: 14px; }
.site-footer ul li { margin-block-end: 9px; }
.site-footer a { color: rgba(255,255,255,0.72); font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-block-start: 1px solid rgba(255,255,255,0.14);
  padding-block-start: 20px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------------------------------------------------- admin panel */

.admin-body { background: var(--paper-soft); min-height: 100vh; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  padding: 26px 18px;
}
.admin-sidebar .brand { color: #fff; margin-block-end: 30px; }
.admin-sidebar .brand-text strong { color: #fff; }
.admin-nav a {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.78);
  font-size: 0.94rem;
  margin-block-end: 4px;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.1); color: #fff; }
.admin-main { flex: 1; padding: 30px 34px; min-width: 0; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-block-end: 26px; flex-wrap: wrap; gap: 12px;
}
.admin-topbar h1 { font-size: 1.4rem; color: var(--navy); }
.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-block-end: 22px;
  box-shadow: var(--shadow);
}
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.admin-stat { text-align: center; padding: 18px; }
.admin-stat .num { font-size: 1.8rem; font-weight: 800; color: var(--teal-dark); }
.admin-stat .lbl { font-size: 0.85rem; color: #6b7688; }

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--teal-dark));
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card img { height: 56px; margin: 0 auto 18px; }
.login-card h1 { font-size: 1.2rem; color: var(--navy); margin-block-end: 24px; }

.form-field { margin-block-end: 18px; text-align: start; }
.form-field label { display: block; font-size: 0.86rem; font-weight: 700; color: #414c57; margin-block-end: 6px; }
.form-field input[type=text],
.form-field input[type=password],
.form-field input[type=email],
.form-field input[type=tel],
.form-field input[type=file],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fbfcfc;
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: 2px solid var(--teal);
  background: #fff;
}
.form-actions { display: flex; gap: 10px; margin-block-start: 22px; flex-wrap: wrap; }
.field-hint { font-size: 0.8rem; color: #8891a0; margin-block-start: 4px; }

.alert {
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-block-end: 18px;
}
.alert-error { background: #fdecec; color: #8a1c22; border: 1px solid #f3c6c8; }
.alert-success { background: #e8f6ee; color: #1e6b3c; border: 1px solid #bfe6cc; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.admin-table th, table.admin-table td {
  padding: 11px 12px;
  text-align: start;
  border-block-end: 1px solid var(--line);
}
table.admin-table th { color: #6b7688; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.admin-table .mini-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.72rem; font-weight: 700; overflow: hidden; vertical-align: middle;
}
table.admin-table .mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.row-actions { display: flex; gap: 8px; }
.row-actions a, .row-actions button {
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.row-actions .danger { color: #b3242c; border-color: #f3c6c8; }

.pagination { display: flex; gap: 6px; margin-block-start: 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
}
.pagination a.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.current-photo { display: flex; align-items: center; gap: 14px; margin-block-end: 14px; }
.current-photo .team-avatar { width: 60px; height: 60px; margin: 0; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .pillars-grid { grid-template-columns: 1fr; }
  .two-col, .contact-grid { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-flex {
    display: none;
    position: fixed;
    inset-inline: 0;
    inset-block-start: 70px;
    background: #fff;
    border-block-end: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 20px 22px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  }
  .nav-flex.open { display: flex; }
  .main-nav { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { padding: 12px 14px; }
  .lang-switch { border-inline-start: none; padding-inline-start: 0; margin-inline-start: 0; margin-block-start: 10px; justify-content: center; }
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-band { flex-direction: column; text-align: center; }
  .doc-callout { flex-direction: column; text-align: center; }
}

html[dir="rtl"] .nav-flex.open { align-items: stretch; }

/* ---------------------------------------------------------- offices (contact page) */
.office-hq-title { font-size: 1.15rem; color: var(--navy); margin-block-end: 16px; }
.offices-heading { margin-block: 56px 22px; }
.offices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-block-end: 30px; }
.office-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; box-shadow: var(--shadow); border-block-start: 3px solid var(--teal); }
.office-card h3 { font-size: 1rem; color: var(--navy); margin-block-end: 8px; }
.office-addr { color: #4b5763; font-size: 0.92rem; margin-block-end: 10px; }
.office-meta li { display: flex; gap: 8px; font-size: 0.88rem; margin-block-end: 4px; flex-wrap: wrap; }
.office-meta li span { color: #8891a0; min-width: 62px; }
.office-meta a { color: var(--teal-dark); font-weight: 600; overflow-wrap: break-word; min-width: 0; }
.office-meta b { font-weight: 600; color: var(--navy); }
.site-footer ul li strong { color: #fff; font-size: 0.92rem; }
