@font-face {
  font-family: "TheBasics Corporate";
  src: url("../assets/fonts/TheBasics_Corporate-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Sentient;
  src: url("../assets/fonts/Sentient-Light.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Romema Spitzer";
  src: url("../assets/fonts/RomemaSpitzer-Thin.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Al Bayan";
  src: url("../assets/fonts/AlBayan.ttc") format("collection");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #7f4c00;
  --yellow: #ffff80;
  --paper: #ffffff;
  --ui: "TheBasics Corporate", "Segoe UI", sans-serif;
  --sentient: Sentient, "Times New Roman", serif;
  --hebrew: "Romema Spitzer", "TheBasics Corporate", sans-serif;
  --arabic: "Al Bayan", "TheBasics Corporate", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; max-width: 100%; overflow-x: clip; }

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--ui);
  font-size: 18px;
  line-height: 22px;
}

body.home { background: var(--yellow); }

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

button, input { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

.filters { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: white;
  padding: 0.4rem 0.7rem;
}

.skip-link:focus { top: 0.5rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  direction: ltr;
}

body.home .site-header {
  width: 100%;
  background: var(--yellow);
}

.header-start {
  min-height: 32px;
  display: flex;
  align-items: center;
  flex: 1;
}

.icon-button {
  min-width: 28px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button svg,
.search-toggle {
  width: 22px;
  height: 22px;
  display: block;
}

.back-button svg { width: 26px; height: 26px; }

.lang-switch { display: flex; align-items: center; gap: 14px; direction: ltr; }

.lang-switch button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] { border-color: var(--ink); }

.search-field {
  width: min(220px, 46vw);
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  padding: 4px 0;
  outline: none;
}

main { width: min(100%, 480px); margin: 0 auto; }

body.home main { width: 100%; }

.site-footer {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  font-size: 12px;
  line-height: 16px;
}

body.home .site-footer { width: 100%; }

.title-block {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--ink);
  padding: 16px 20px;
  direction: ltr;
}

.title-lockup {
  display: grid;
  max-width: 100%;
}

.title-en {
  margin: 0;
  line-height: 0;
}

.title-logo {
  width: min(332px, calc(100vw - 40px));
  height: auto;
  margin: 0 auto;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  width: 0;
  min-width: 100%;
  margin-top: 4px;
}

.title-ar {
  margin: 0;
  font-family: var(--arabic);
  font-size: min(40px, calc((100vw - 40px) / 8.4));
  line-height: 1.1;
}

.title-he {
  margin: 0;
  font-family: var(--hebrew);
  font-weight: 200;
  font-size: min(39px, calc((100vw - 40px) / 8.6));
  line-height: 1;
  text-align: right;
}

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

.card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--ink);
  min-width: 0;
}

.card-main {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

.filters { position: absolute; width: 0; height: 0; }

.card-photo {
  flex: none;
  width: clamp(88px, 28vw, 140px);
  aspect-ratio: 140 / 96;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: url("#ink-gradient-map");
}

.names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.names p {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-family: var(--ui);
  text-align: start;
  overflow-wrap: anywhere;
}

[dir="rtl"] .arrow { transform: scaleX(-1); }

.arrow { flex: none; }

.empty {
  padding: 28px 20px;
  margin: 0;
}

.artist-name {
  margin: 0;
  border-bottom: 1px solid var(--ink);
  padding: 16px 20px 14px;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 200;
}

.artist-name.en { font-family: var(--sentient); }
.artist-name.he { font-family: var(--hebrew); }
.artist-name.ar { font-family: var(--arabic); }

.portrait-wrap, .bio, .identity { border-bottom: 1px solid var(--ink); }

.portrait-wrap { padding: 20px; }

.portrait-wrap img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: #f3e7c4;
}

.bio, .identity { padding: 16px 20px; }

.bio p, .born, .school-copy p { margin: 0; }

.identity { display: flex; flex-direction: column; gap: 15px; }

.school {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 30px;
  align-items: baseline;
}

.school + .school { margin-top: 10px; }

.school p { margin: 0; line-height: 22px; }

.year { grid-column: 1; grid-row: 1; }

.school-name {
  grid-column: 2;
  grid-row: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.school-dept { grid-column: 2; grid-row: 2; }

.body-text { padding: 40px 20px; }

.body-text p { margin: 0 0 20px; line-height: 24px; }

.body-text p:last-of-type { margin-bottom: 0; }

.further-reading {
  display: block;
  width: fit-content;
  margin-top: 28px;
  margin-inline-start: 0;
  margin-inline-end: auto;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.25;
}

.gallery {
  position: relative;
  direction: ltr;
  margin: 0;
  border-bottom: 1px solid var(--ink);
  padding: 20px 0 28px;
}

.gallery-viewport {
  margin-inline: 25px;
  overflow: hidden;
  touch-action: pan-y;
  background: var(--paper);
}

.gallery-track {
  display: flex;
  align-items: center;
  height: 100%;
  will-change: transform;
}

.gallery-track img {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  direction: ltr;
}

.gallery-nav.prev { left: 2px; }
.gallery-nav.next { right: 2px; }

.gallery-nav svg { width: 22px; height: 22px; display: block; }

.artist-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  direction: ltr;
}

.gallery + .artist-pager { border-top: 0; }

.pager-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 16px 20px;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 18px;
  line-height: 1.2;
}

.pager-link.previous { justify-content: flex-start; }

.pager-link.next { justify-content: flex-end; text-align: end; }

.pager-link span { min-width: 0; }

.pager-link svg { width: 22px; height: 22px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .gallery-track,
  main { transition: none !important; }
}

@media (min-width: 720px) {
  .card-photo { width: 168px; }
  .portrait-wrap img { height: 320px; }
}
