/* Guy Hetzroni — personal academic website
   One stylesheet for every page. Colours are set once below. */

:root {
  --ink: #26303b;          /* main text */
  --muted: #66717d;        /* dates, captions */
  --blue: #2c5a85;         /* links, accents */
  --blue-dark: #1f4466;
  --blue-soft: #edf2f7;    /* light blue panels */
  --line: #e1e5ea;         /* borders */
  --bg: #f7f8fa;           /* page background */
  --surface: #ffffff;      /* content background */
  --max: 860px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.4rem 1rem 0;
}

.site-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.site-title:hover { color: var(--ink); text-decoration: none; }

.site-subtitle {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

nav ul {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.6rem;
  font-size: 0.92rem;
}

nav a {
  display: inline-block;
  padding: 0.55rem 0 0.6rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--blue); text-decoration: none; }
nav a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* "בעברית" sits at the right end of the ribbon */
nav .nav-hebrew { margin-left: auto; }
nav .nav-hebrew a { font-weight: 600; color: var(--blue); }
.flag {
  display: inline-block;
  width: 1.15em;
  height: auto;
  margin-left: 0.35em;
  vertical-align: -0.12em;
  border: 1px solid var(--line);
}

/* ---------- Main content ---------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem 1rem 3.5rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: normal;
  line-height: 1.3;
  color: var(--ink);
}
h1 { font-size: 2rem; margin: 0 0 0.3rem; }
h2 {
  font-size: 1.45rem;
  margin: 2.8rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 1.15rem; margin: 2rem 0 0.6rem; }

/* Anchored headings stop below the top edge when scrolled to */
[id] { scroll-margin-top: 1.25rem; }

.lead {
  font-size: 1.08rem;
  color: var(--muted);
}

/* ---------- Home page ---------- */

.banner {
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center 45%;
}

.intro {
  display: grid;
  grid-template-columns: 1fr 270px;   /* text left, portrait right */
  gap: 2.25rem;
  align-items: start;
}

.portrait {
  order: 2;                         /* portrait sits right of the text on wide screens */
  width: 270px;
  height: 320px;
  object-fit: cover;
  object-position: 45% 30%;
  border-radius: 16px;
  margin-top: -4.5rem;            /* overlaps the banner slightly */
  border: 5px solid var(--surface);
  box-shadow: 0 2px 10px rgba(30, 50, 70, 0.12);
  background: var(--surface);
}

.position {
  color: var(--blue);
  font-size: 1.02rem;
  margin: 0 0 1rem;
}

.lang-toggle {
  float: right;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}
.lang-toggle a, .lang-toggle span { padding: 0 0.15rem; }
.lang-toggle .current { color: var(--ink); font-weight: 600; }

.research-theme {
  border-left: 3px solid var(--blue);
  padding: 0.1rem 0 0.1rem 1.1rem;
  margin: 1.8rem 0;
}
.research-theme h3 { margin-top: 0; }

.note {
  background: var(--blue-soft);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 2.25rem 0 0;
}
.note h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.note p { margin: 0.3rem 0; }

/* ---------- Contact page ---------- */

/* Photo spans from the top of the "Contact" heading to the last line of text */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 420px;   /* details left, campus photo right */
  gap: 2rem;
  align-items: stretch;
}
.contact-grid > div > :last-child { margin-bottom: 0; }

/* The text column sets the height; the photo fills its cell without affecting it */
.contact-photo-cell { position: relative; }

.contact-photo {
  position: absolute;
  top: 0.6rem;            /* level with the top of the letters in "Contact" */
  bottom: 0.45rem;        /* level with the baseline of the last line of text */
  left: 0;
  width: 100%;
  height: calc(100% - 1.05rem);
  object-fit: cover;
  object-position: center top;   /* keep the sky above the tower; trim the slope below */
  border-radius: 16px;
  border: 5px solid var(--surface);
  box-shadow: 0 2px 10px rgba(30, 50, 70, 0.12);
  box-sizing: border-box;
}

/* ---------- Lists of publications, talks ---------- */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entries li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.entries li:last-child { border-bottom: none; }

.entries .title { font-weight: 600; }
.entries .venue { font-style: italic; }
.entries .me { font-weight: 600; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.links a {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.6rem;
  border: 1px solid #c9d6e3;
  border-radius: 999px;
  background: var(--surface);
}
.links a:hover { background: var(--blue-soft); text-decoration: none; }
/* Official (publisher) link is filled to stand out from preprints */
.links a.official {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.links a.official:hover { background: var(--blue-dark); }

.dated li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
}
.dated .date {
  color: var(--muted);
  font-size: 0.88rem;
  padding-top: 0.12rem;
}

.section-links {
  font-size: 0.9rem;
  color: var(--muted);
}
.section-links a { margin-right: 0.9rem; }

/* ---------- CV tables ---------- */

.cv {
  width: 100%;
  border-collapse: collapse;
}
.cv td {
  vertical-align: top;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.cv tr:last-child td { border-bottom: none; }
.cv td:first-child {
  width: 7.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  padding-right: 1rem;
}

/* ---------- Hebrew page ---------- */

.rtl {
  direction: rtl;
  text-align: right;
  font-family: "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
}
.rtl h1, .rtl h2, .rtl h3 { font-family: inherit; font-weight: 600; }
.rtl .lang-toggle { float: left; }
/* Hebrew page: portrait on the right of the text, no banner to overlap */
.rtl .intro { grid-template-columns: 270px 1fr; }
.rtl .portrait { order: 0; margin-top: 0.4rem; }
.rtl .research-theme {
  border-left: none;
  border-right: 3px solid var(--blue);
  padding: 0.1rem 1.1rem 0.1rem 0;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem 1rem;
}
footer p { margin: 0.2rem 0; }

/* ---------- Phones ---------- */

@media (max-width: 640px) {
  html { font-size: 16px; }
  .sub-sep { display: none; }            /* subtitle: "University of Haifa" on its own line */
  .sub-place { display: block; }
  nav ul { gap: 0 1.1rem; }
  nav .nav-hebrew { margin-left: 0; }
  .banner { height: 130px; }
  .intro, .rtl .intro { grid-template-columns: 1fr; gap: 1rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .contact-photo { position: static; height: auto; aspect-ratio: 4 / 3; margin-top: 1rem; }
  .portrait { order: 0; width: 160px; height: 190px; margin-top: -4rem; }
  .dated li { grid-template-columns: 1fr; gap: 0; }
  .cv td:first-child { width: 5.5rem; white-space: normal; }
  h1 { font-size: 1.7rem; }
}
