/* Dr. Asher Shafrir — shared stylesheet (bilingual, RTL-aware via logical properties) */

:root {
  --bg: #f5f6f3;
  --bg-deep: #ecefe9;
  --paper: #ffffff;
  --ink: #17242a;
  --ink-soft: #52666c;
  --teal-900: #0c3733;
  --teal-800: #124a44;
  --teal-700: #1a615a;
  --teal-500: #2a8d80;
  --teal-tint: #e4efec;
  --coral: #cf6a45;
  --coral-soft: #e2895f;
  --gold: #b6913f;
  --line: rgba(12, 55, 51, 0.13);
  --card-bg: #ffffff;
  --shadow: 0 1px 2px rgba(12, 40, 37, 0.06), 0 10px 26px rgba(12, 40, 37, 0.07);
  --radius: 16px;
  --focus: #2f6fb3;
  color-scheme: light;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body { font-family: 'Assistant', 'Inter', -apple-system, sans-serif; }

h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--teal-900);
  margin: 0;
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .display {
  font-family: 'Assistant', 'Fraunces', serif;
  font-weight: 700;
  letter-spacing: normal;
}

a { color: inherit; }
img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
html[dir="rtl"] .eyebrow { letter-spacing: 0.02em; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  background: var(--teal-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  z-index: 100;
  transition: top 0.2s ease;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 246, 243, 0.9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--teal-900);
  white-space: nowrap;
}
html[dir="rtl"] .brand { font-family: 'Assistant', serif; font-weight: 700; }
.brand svg { width: 26px; height: 26px; color: var(--teal-500); flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--teal-900); border-color: var(--coral-soft); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  color: var(--teal-800) !important;
}
.lang-switch:hover { background: var(--teal-tint); }

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: none; border: none; cursor: pointer;
    color: var(--teal-900);
  }
  .site-nav.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 68px; inset-inline: 0;
    background: var(--paper);
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--line);
    gap: 4px;
  }
  .site-nav.open .nav-links a, .site-nav.open .nav-links .lang-switch { padding: 12px 4px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-800) 55%, var(--teal-700) 100%);
  color: #f4f8f6;
  padding: 72px 0 88px;
}
.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-photo { order: -1; margin: 0 auto; }
}
.hero-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bfe0d6;
  margin-bottom: 18px;
}
html[dir="rtl"] .hero-eyebrow { letter-spacing: 0.02em; }
.hero h1 {
  color: #fbfaf5;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.1;
  font-weight: 500;
}
html[dir="rtl"] .hero h1 { font-weight: 700; }
.hero-role {
  margin-top: 14px;
  font-size: 18px;
  color: #d7ece5;
  font-family: 'Fraunces', serif;
  font-style: italic;
  line-height: 1.6;
}
html[dir="rtl"] .hero-role { font-family: 'Assistant', serif; font-style: normal; font-weight: 600; }
.hero-sub {
  margin-top: 20px;
  max-width: 52ch;
  font-size: 16.5px;
  color: #cfe3dc;
}
@media (max-width: 860px) { .hero-sub { margin-inline: auto; } }
.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
@media (max-width: 860px) { .hero-actions { justify-content: center; } }

.hero-photo-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 50px rgba(4, 20, 18, 0.35);
  background: rgba(255,255,255,0.06);
}
.hero-photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #bfe0d6;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: 'Inter', sans-serif;
}
html[dir="rtl"] .btn { font-family: 'Assistant', 'Inter', sans-serif; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: #fbfaf5;
  color: var(--teal-900);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.btn-primary:hover { background: #fff; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fbfaf5;
  border-color: rgba(251, 250, 245, 0.5);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.btn-solid {
  background: var(--coral);
  color: #fff9f5;
}
.btn-solid:hover { background: var(--coral-soft); }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { max-width: 760px; margin: 0 auto 48px; }
.section-head.center { text-align: center; }
.section-head h2 { font-size: clamp(26px, 4vw, 36px); margin-top: 12px; }
.section-head p { color: var(--ink-soft); margin-top: 14px; font-size: 17px; }

.lede {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.lede strong { color: var(--teal-900); font-weight: 600; }

/* ---------- Timeline (About page) ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 40px;
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 28px;
}
html[dir="rtl"] .timeline { border-inline-start: none; border-inline-end: 2px solid var(--line); padding-inline-start: 0; padding-inline-end: 28px; }
.timeline-item { position: relative; padding-bottom: 30px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  inset-inline-start: -34px;
  top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--teal-500);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--teal-500);
}
html[dir="rtl"] .timeline-item::before { inset-inline-start: auto; inset-inline-end: -34px; }
.timeline-item .when { font-size: 13px; font-weight: 600; color: var(--teal-700); letter-spacing: 0.04em; }
.timeline-item h3 { font-size: 18px; margin-top: 4px; }
.timeline-item p { color: var(--ink-soft); margin-top: 6px; font-size: 15.5px; }

/* Two-column info grid (teaching / mentoring / honors) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 20px;
}
@media (max-width: 700px) { .info-grid { grid-template-columns: 1fr; } }
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.info-card h3 { font-size: 17px; margin-bottom: 10px; }
.info-card ul { margin: 0; padding: 0; list-style: none; }
.info-card li {
  position: relative;
  padding-inline-start: 20px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 15px;
}
html[dir="rtl"] .info-card li { padding-inline-start: 0; padding-inline-end: 20px; }
.info-card li::before {
  content: "\2022";
  position: absolute;
  inset-inline-start: 0;
  color: var(--coral);
}
html[dir="rtl"] .info-card li::before { inset-inline-start: auto; inset-inline-end: 0; }

/* ---------- Cards grid (GI conditions) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--teal-500), var(--teal-800));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 23px; height: 23px; color: #f4f8f6; }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 15.5px; }
.card p + p { margin-top: 10px; }

.disclaimer {
  margin-top: 44px;
  background: var(--teal-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 14.5px;
  color: var(--teal-900);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.disclaimer svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--teal-700); margin-top: 2px; }

/* ---------- Academia / publications ---------- */
.pub-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--ink-soft);
}
.pub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--coral);
  color: #fff9f5;
}
.pub-list { display: flex; flex-direction: column; gap: 18px; }
.pub-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  border-inline-start: 4px solid transparent;
}
.pub-card.gi { border-inline-start-color: var(--coral); background: linear-gradient(180deg, #fffaf6, var(--card-bg) 70px); }
.pub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.pub-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 17px; color: var(--teal-900); line-height: 1.4; }
html[dir="rtl"] .pub-title { font-family: 'Assistant', serif; }
.pub-meta { font-size: 13.5px; color: var(--ink-soft); margin-top: 6px; }
.pub-summary { margin-top: 12px; color: var(--ink-soft); font-size: 15px; }
.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--teal-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.pub-link:hover { border-color: var(--teal-700); }
.pub-link svg { width: 14px; height: 14px; }

/* ---------- Contact ---------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 860px) { .contact-wrap { grid-template-columns: 1fr; gap: 40px; } }
.contact-copy h2 { font-size: clamp(26px, 4vw, 34px); margin-top: 12px; }
.contact-copy p { color: var(--ink-soft); margin-top: 16px; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink-soft); }
.contact-list svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 2px; color: var(--coral); }

form.contact-form {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: 14px; color: var(--teal-900); margin-bottom: 8px; }
.field .hint { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 111, 179, 0.18);
}
.field textarea { min-height: 130px; resize: vertical; }
.hp-field { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  display: none;
}
.form-status.show { display: block; }
.form-status.ok { background: #e4f3ec; color: #1a5c3a; border: 1px solid #b9dfc9; }
.form-status.err { background: #fbe7e2; color: #8a2f18; border: 1px solid #f0c2b3; }

.form-note { font-size: 13px; color: var(--ink-soft); margin-top: 14px; line-height: 1.6; }

/* ---------- Footer ---------- */
footer { background: var(--teal-900); color: #cfe3dc; padding: 52px 0 32px; text-align: center; }
.footer-mark { display: flex; align-items: center; justify-content: center; gap: 10px; color: #fbfaf5; font-family: 'Fraunces', serif; font-size: 16px; }
html[dir="rtl"] .footer-mark { font-family: 'Assistant', serif; font-weight: 700; }
.footer-mark svg { width: 20px; height: 20px; color: var(--coral-soft); }
footer .tagline { margin-top: 10px; font-size: 13px; color: #a9c7bd; }
footer .fine { margin-top: 24px; font-size: 12.5px; color: #7fa093; }

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1613;
    --bg-deep: #101c18;
    --paper: #12201c;
    --ink: #eaf2ee;
    --ink-soft: #a9c0b8;
    --teal-900: #eef6f2;
    --teal-tint: #16332c;
    --card-bg: #12201c;
    --line: rgba(238, 246, 242, 0.12);
    --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 10px 26px rgba(0,0,0,0.4);
    --focus: #7cb2ec;
    color-scheme: dark;
  }
  .site-nav { background: rgba(13, 22, 19, 0.88); }
  .field input, .field textarea { background: #0e1a16; color: var(--ink); }
  .pub-card.gi { background: linear-gradient(180deg, #17241f, var(--card-bg) 70px); }
}
