/* ===========================================
   Merav Keidar – Academic Researcher Site
   Clean, typography-first, Jon Barron style
   =========================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 15px;
  line-height: 1.7;
  color: #333;
  background: #fff;
}

a {
  color: #3a6ea5;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong {
  color: #111;
}

/* ===== Page wrapper ===== */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 52px 28px 64px;
}

/* ===== Header ===== */
header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: center;
  margin-bottom: 44px;
  gap: 36px;
}

.header-photo {
  order: 1;
  flex-shrink: 0;
}

.header-photo img {
  width: 175px;
  height: 175px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(8%);
}

.header-bio {
  flex: 1;
}

.name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 0.9rem;
  color: #777;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: normal;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.bio {
  margin-bottom: 14px;
  font-size: 15px;
  color: #333;
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
}

.contact-line {
  font-size: 14px;
  font-family: 'Source Serif 4', Georgia, serif;
  color: #444;
}

.contact-line a {
  color: #3a6ea5;
}

.sep {
  color: #aaa;
  margin: 0 4px;
}

/* ===== Dividers ===== */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 36px 0;
}

/* ===== Sections ===== */
section {
  margin-bottom: 4px;
}

h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 24px;
}

/* ===== Publication / Project rows ===== */
.entry-row {
  display: flex;
  gap: 22px;
  margin-bottom: 32px;
  align-items: flex-start;
}

.entry-thumb {
  flex-shrink: 0;
  width: 130px;
}

.entry-thumb img {
  width: 130px;
  height: 98px;
  object-fit: cover;
  border: 1px solid #e0e0e0;
  display: block;
}

.thumb-ph {
  width: 130px;
  height: 98px;
  background: #f4f4f4;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-ph svg {
  width: 22px;
  height: 22px;
  color: #bbb;
}

.entry-info {
  flex: 1;
  min-width: 0;
}

.entry-title {
  font-size: 16.5px;
  font-weight: bold;
  color: #111;
  margin-bottom: 4px;
  line-height: 1.4;
}

.entry-title a {
  color: #111;
}

.entry-title a:hover {
  color: #3a6ea5;
  text-decoration: none;
}

.entry-authors {
  font-size: 14px;
  color: #444;
  margin-bottom: 3px;
}

.entry-venue {
  font-size: 14px;
  color: #666;
  font-style: italic;
  margin-bottom: 6px;
}

.entry-desc {
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
  line-height: 1.6;
}

.entry-links {
  font-size: 13px;
  font-family: Arial, Helvetica, sans-serif;
  color: #555;
  margin-bottom: 4px;
}

.entry-links a {
  color: #3a6ea5;
}

.entry-tags {
  font-size: 12px;
  color: #999;
  font-family: Arial, Helvetica, sans-serif;
  margin-top: 3px;
}

/* Row clickable (projects) */
.entry-row.clickable {
  cursor: pointer;
}

.entry-row.clickable:hover .entry-title a {
  color: #3a6ea5;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid #e8e8e8;
  padding-top: 20px;
  font-size: 12px;
  color: #aaa;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.modal-box {
  position: relative;
  background: #fff;
  border: 1px solid #ccc;
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.14);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1.1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 1.1rem;
  padding-right: 2rem;
  line-height: 1.35;
}

.modal-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.modal-gallery img {
  height: 180px;
  width: auto;
  max-width: 300px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
}

.img-placeholder {
  height: 180px;
  width: 260px;
  flex-shrink: 0;
  background: #f7f7f7;
  border: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #bbb;
  font-size: 0.72rem;
  font-family: Arial, sans-serif;
}

.img-placeholder svg {
  width: 24px;
  height: 24px;
  opacity: 0.4;
}

.modal-desc {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin-bottom: 1.1rem;
}

.modal-actions {
  font-size: 14px;
  font-family: Arial, Helvetica, sans-serif;
  color: #555;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.modal-actions a {
  color: #3a6ea5;
}

.modal-actions a:hover {
  text-decoration: underline;
}

.modal-sep {
  color: #bbb;
}

.modal-tags {
  font-size: 12px;
  color: #999;
  font-family: Arial, Helvetica, sans-serif;
  border-top: 1px solid #eee;
  padding-top: 0.85rem;
}

/* ===== Mobile ===== */
@media (max-width: 620px) {
  .page {
    padding: 32px 18px 48px;
  }

  .header-photo img {
    width: 110px;
    height: 110px;
  }

  .name {
    font-size: 1.85rem;
  }

  .entry-thumb {
    display: none;
  }
}
