/*! EduRise teacher profile v4 — magazine / portfolio */
:root {
  --bg: #f4f8fb;
  --bg-elev: #ffffff;
  --bg-muted: #e8f1f7;
  --ink: #0b1b2b;
  --muted: #5b7388;
  --line: rgba(11, 27, 43, 0.1);
  --teal: #0d9488;
  --cyan: #1ec8e0;
  --amber: #f0a202;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 12px 32px rgba(7, 19, 31, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Outfit", var(--font);
  --nav-h: 64px;
  --sticky-auth: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #07131f;
  --bg-elev: #0c1c2e;
  --bg-muted: #122437;
  --ink: #eef8fb;
  --muted: #8aa0b4;
  --line: rgba(238, 248, 251, 0.12);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
html[lang="ar"] body.tp-body,
html[dir="rtl"] body.tp-body {
  --display: "Cairo", "Outfit", var(--font);
  --font: "Cairo", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.tp-body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 12% -10%, rgba(13, 148, 136, 0.09), transparent 55%),
    radial-gradient(900px 420px at 92% 8%, rgba(240, 162, 2, 0.07), transparent 50%),
    var(--bg);
  line-height: 1.5;
  padding-bottom: calc(var(--sticky-auth) + var(--safe-b));
}
body.tp-guest { --sticky-auth: 68px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.d-none { display: none !important; }
.wrap { width: min(1120px, calc(100% - 1.5rem)); margin-inline: auto; }

.tp-page { padding-bottom: 2rem; }

.tp-banner {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.22);
  color: #0f766e;
  font-weight: 600;
  font-size: 0.9rem;
}
[data-theme="dark"] .tp-banner { color: #99f6e4; }
.tp-banner a {
  text-decoration: none;
  background: var(--teal);
  color: #fff !important;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.84rem;
}

/* Magazine grid: ~40% portrait column / ~60% content */
.tp-layout {
  margin-top: 1.15rem;
  display: grid;
  gap: 1.15rem;
  align-items: start;
}
@media (min-width: 900px) {
  .tp-layout {
    grid-template-columns: minmax(280px, 0.4fr) minmax(0, 0.6fr);
    gap: 1.35rem;
  }
}

.tp-aside { min-width: 0; }
@media (min-width: 900px) {
  .tp-aside { position: sticky; top: calc(var(--nav-h) + 0.75rem); }
}

.tp-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* Dominant square portrait */
.tp-photo {
  margin: 0;
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #0d9488;
  overflow: hidden;
}
.tp-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.tp-photo img.is-broken { display: none; }

.tp-photo__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.5rem, 18vw, 6.5rem);
  letter-spacing: -0.04em;
  color: #fff;
  background: linear-gradient(145deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
  user-select: none;
}

/* Broken real photo → teal initials via data-initials */
.tp-photo:has(img.is-broken)::after,
.tp-photo:not(:has(img[src])):not(.tp-photo--initials)::after {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.5rem, 18vw, 6.5rem);
  letter-spacing: -0.04em;
  color: #fff;
  background: linear-gradient(145deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
  pointer-events: none;
}

.tp-identity {
  padding: 1.05rem 1.1rem 1.2rem;
  display: grid;
  gap: 0.75rem;
}

.tp-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  line-height: 1.15;
}
.tp-subject {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--teal);
}
.tp-rating { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
}
.tp-chip--amber {
  background: rgba(240, 162, 2, 0.16);
  border-color: rgba(240, 162, 2, 0.35);
  color: #92400e;
}
[data-theme="dark"] .tp-chip--amber { color: #fde68a; }
.tp-chip small { opacity: 0.75; font-weight: 600; }

.tp-socials { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tp-socials a {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.tp-socials a:hover { background: rgba(13, 148, 136, 0.14); color: var(--teal); }

.tp-aside-heading {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.tp-edu__body {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--line);
}
.tp-edu__body strong { font-size: 0.92rem; }
.tp-edu__body span { font-size: 0.82rem; color: var(--muted); }

.tp-skills { display: grid; gap: 0.55rem; }
.tp-skill__row {
  display: flex; justify-content: space-between;
  font-size: 0.84rem; margin-bottom: 0.22rem;
}
.tp-skill__row span:last-child { color: var(--muted); }
.tp-bar {
  height: 7px; border-radius: 999px; background: var(--bg-muted); overflow: hidden;
}
.tp-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
}

.tp-main {
  min-width: 0;
  display: grid;
  gap: 1.15rem;
}

.tp-about {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.25rem 1.3rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .tp-about {
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 1.25rem;
  }
}
.tp-about h2 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tp-bio {
  margin: 0 0 0.9rem;
  color: var(--ink);
  font-size: 0.98rem;
  max-width: 58ch;
}
.tp-bio--muted { color: var(--muted); }

.tp-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.tp-contact__label {
  display: inline-block;
  min-width: 4.5rem;
  color: var(--muted);
  font-weight: 600;
  margin-inline-end: 0.35rem;
}
.tp-contact a { color: var(--teal); font-weight: 700; text-decoration: none; }
.tp-lock {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.tp-kpis {
  display: grid;
  gap: 0.55rem;
  min-width: 11.5rem;
}
.tp-kpi {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: var(--bg-muted);
  border: 1px solid var(--line);
}
.tp-kpi strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}
.tp-kpi span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

/* Courses */
.tp-courses {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.15rem 1.35rem;
}
.tp-courses__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tp-courses__head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
}
.tp-courses__head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.tp-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 560px) { .tp-grid { grid-template-columns: 1fr 1fr; } }

.tp-course {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  content-visibility: auto;
  contain-intrinsic-size: 280px;
}
.tp-course:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tp-course__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--bg-muted);
  position: relative;
  overflow: hidden;
}
.tp-course__media img { width: 100%; height: 100%; object-fit: cover; }
.tp-badge {
  position: absolute; top: 0.55rem;
  font-size: 0.7rem; font-weight: 800;
  padding: 0.18rem 0.5rem; border-radius: 999px; z-index: 2;
}
.tp-badge--level { inset-inline-start: 0.55rem; background: rgba(13,148,136,.92); color: #fff; }
.tp-badge--grade { inset-inline-end: 0.55rem; background: var(--amber); color: #3b2a05; }
.tp-course__body { display: block; padding: 0.85rem 0.9rem 1rem; text-decoration: none; color: inherit; }
.tp-course__meta { display: flex; gap: 0.5rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.25rem; }
.tp-stars { color: #b45309; font-weight: 700; }
.tp-course__title {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tp-course__desc { margin: 0 0 0.65rem; color: var(--muted); font-size: 0.84rem; }
.tp-course__foot {
  display: flex; justify-content: space-between; gap: 0.5rem;
  font-size: 0.78rem; color: var(--muted);
}
.tp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  background: var(--bg-muted);
  border-radius: 14px;
}

.tp-pager { margin-top: 1.1rem; display: flex; justify-content: center; }
.tp-pager .pagination { display: flex; gap: 0.35rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.tp-pager .page-link {
  display: inline-flex; min-width: 2.1rem; height: 2.1rem;
  align-items: center; justify-content: center;
  padding: 0 0.55rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.86rem;
}
.tp-pager .page-item.active .page-link,
.tp-pager .page-item.active > span {
  background: var(--teal); border-color: var(--teal); color: #fff;
  display: inline-flex; min-width: 2.1rem; height: 2.1rem;
  align-items: center; justify-content: center;
  padding: 0 0.55rem; border-radius: 10px; font-weight: 700;
}
.tp-pager .page-item.disabled .page-link { opacity: 0.45; pointer-events: none; }

.course-fav-btn {
  position: absolute; top: 0.5rem; inset-inline-end: 0.5rem; z-index: 4;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.92); color: #94a3b8;
}
.course-fav-btn.is-favorited { color: #e74c3c; }
.course-fav-btn svg { width: 16px; height: 16px; }

.tp-footer {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
  justify-content: space-between;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.88rem;
}
.tp-footer p { margin: 0; }
.tp-footer a { color: var(--teal); font-weight: 700; text-decoration: none; }

.tp-reveal { opacity: 0; transform: translateY(12px); transition: opacity .45s ease, transform .45s ease; }
.tp-reveal.is-in { opacity: 1; transform: none; }

.landing-sticky-auth {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  padding: 0.65rem 0.85rem calc(0.65rem + var(--safe-b));
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.landing-sticky-auth__btn {
  text-align: center; text-decoration: none; font-weight: 800; padding: 0.75rem; border-radius: 12px;
}
.landing-sticky-auth__btn--login { background: var(--bg-muted); color: var(--ink); }
.landing-sticky-auth__btn--join { background: var(--amber); color: #3b2a05; }

@media (max-width: 899px) {
  .tp-aside { position: static; }
}
