/* Senan Architects — shared styles */

:root {
  --text: #1a1a1a;
  --muted: #9a9a9a;
  --light: #b5b5b5;
  --line: #d9d9d9;
  --ph: #ececec;
  --ph-text: #a8a8a8;
  --page-width: 980px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-weight: 350;
  color: var(--text);
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 1012px) {
  .wrap { padding: 0; }
}

/* ---------- Header ---------- */

.site-header {
  padding-top: 82px;
  padding-bottom: 88px;
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  gap: 47px;
  flex-wrap: wrap;
}

.logo {
  font-size: 21px;
  letter-spacing: 0.01em;
  font-weight: 350;
  white-space: nowrap;
}
/* the wordmark image is trimmed to the letters, so its bottom edge is the text baseline */
.logo img { display: inline-block; height: 17px; width: auto; max-width: none; vertical-align: -1px; } /* never squeezed; the image has a small clear margin, -1px puts the letters on the baseline */

.nav {
  display: flex;
  gap: 54px;
  flex-wrap: wrap;
  margin-inline-start: auto; /* menu and languages sit at the far end, logo at the start */
}

/* Menu: one colour; pointing underlines, and the current page stays underlined. */
.nav a {
  color: var(--text);
  font-size: 16px;
  font-weight: 350;
}


/* narrow screens: logo and languages on the first line, menu below */
@media (max-width: 900px) {
  .site-header .wrap { align-items: center; row-gap: 18px; column-gap: 16px; }
  .logo { order: 1; }
  .lang { order: 2; }
  .site-header .lang { margin-inline-start: auto; padding: 0; }
  .site-header .lang::before { display: none; }
  .nav { order: 3; flex-basis: 100%; margin-inline-start: 0; row-gap: 8px; }
}

@media (max-width: 720px) {
  .site-header { padding-top: 32px; padding-bottom: 36px; }
  .nav { gap: 22px; }
  .nav a { font-size: 15px; }
}

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

.site-footer {
  padding: 52px 0 60px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.copyright {
  font-size: 13px;
  color: var(--text); /* regular text colour, light weight like the rest of the site */
  width: 470px;
  max-width: 100%;
}

/* Social links as words, at the far end of the footer like the menu above */
.social { display: flex; gap: 30px; margin-inline-start: auto; }
.social a { color: var(--text); font-size: 13px; font-weight: 350; } /* same size and colour as the copyright line */

/* ---------- Image placeholders ---------- */

.ph {
  background: var(--ph);
  color: var(--ph-text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  letter-spacing: .04em;
  padding: 10px;
  width: 100%;
  height: 100%;
}

/* ---------- Home slideshow ---------- */

.slideshow {
  position: relative;
  aspect-ratio: 980 / 660;
  overflow: hidden;
  background: var(--ph);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .9s ease;
}
.slide.is-active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }

.slide-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 22px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.45));
  opacity: 0;
  transition: opacity .3s;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.slideshow:hover .slide-caption,
.slideshow:focus-within .slide-caption { opacity: 1; }
.slide-caption .t { font-size: 17px; font-weight: 400; }
.slide-caption .s { font-size: 15px; }
.slide-caption .count { font-size: 15px; }

.ss-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 64px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s;
  z-index: 2;
}
.ss-btn svg { width: 22px; height: 40px; filter: drop-shadow(0 0 3px rgba(0,0,0,.4)); }
.ss-prev { left: 8px; }
.ss-next { right: 8px; }
.slideshow:hover .ss-btn,
.ss-btn:focus-visible { opacity: 1; }

@media (hover: none) {
  .slide-caption, .ss-btn { opacity: 1; }
}

/* ---------- Projects grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 20px;
}

@media (max-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; } .tile-cap .t { font-size: 15px; } .tile-cap .s { font-size: 15px; } }

/* Each project: the image, then its name and place underneath */
.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: start;
}
.tile-img {
  display: block;
  aspect-ratio: 236 / 195;
  background: var(--ph);
  overflow: hidden;
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.tile:hover .tile-img img, .tile:focus-visible .tile-img img { opacity: .85; }
.tile:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }
.tile-cap { display: flex; flex-direction: column; gap: 2px; }
.tile-cap .t { font-size: 16px; font-weight: 400; color: var(--text); }
.tile-cap .s { font-size: 16px; color: var(--text); }
.tile-cap .s:empty { display: none; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.97);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 60px 70px 30px;
}
.lightbox.open { display: flex; }

.lb-media {
  width: min(1000px, 100%);
  aspect-ratio: 3 / 2;
  max-height: calc(100vh - 170px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-media .ph { font-size: 16px; }

.lb-caption {
  margin-top: 16px;
  text-align: center;
}
.lb-caption .t { font-size: 18px; font-weight: 400; }
.lb-caption .s { font-size: 16px; color: #666; }
.lb-caption .n { font-size: 15px; color: var(--text); }

.lb-btn {
  position: absolute;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #555;
  padding: 10px;
}
.lb-btn:hover { color: #000; }
.lb-btn svg { display: block; }
.lb-close { top: 16px; right: 18px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

@media (max-width: 620px) {
  .lightbox { padding: 60px 16px 20px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
}

/* ---------- About ---------- */

/* Text on one side with room to breathe, the portrait on the other */
.about {
  display: grid;
  grid-template-columns: minmax(0, 580px) minmax(0, 294px);
  justify-content: space-between;
  gap: 60px;
  align-items: start;
}

.about-text p {
  margin: 0 0 1.1em;
  text-align: start;
  font-size: 16px;
  line-height: 1.95;
}
.about-text p:last-child { margin-bottom: 0; }

.portrait { aspect-ratio: 294 / 369; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.pubs { margin-top: 48px; }
/* publications: one line each — year · outlet · title, aligned in columns */
.pubs { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); column-gap: 28px; row-gap: 10px; align-items: baseline; }
.pub { display: contents; }
.pub > * { font-weight: 350; }
.pub-y { color: var(--text); font-variant-numeric: tabular-nums; }
.pub-o { color: var(--text); }
.pub-t { color: var(--text); text-align: left; } /* a Hebrew title still lines up with the column */
html[dir="rtl"] .pub-t { text-align: right; }

@media (max-width: 560px) {
  .pubs { grid-template-columns: max-content minmax(0, 1fr); row-gap: 2px; }
  .pub-t { grid-column: 2; margin-bottom: 12px; }
  .pub-o:empty { display: none; }
}

@media (max-width: 900px) {
  .about { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .portrait { max-width: 294px; grid-row: 1; }
}

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

/* same airy line spacing as the About text */
.contact {
  max-width: 380px;
  font-size: 16px;
  line-height: 1.95;
}
.contact p { margin: 0; }
.contact .intro { margin-top: 1.1em; }
.contact .form { margin-top: 1.6em; line-height: 1.5; }

.form { margin-top: 22px; display: flex; flex-direction: column; gap: 5px; }

.form input,
.form textarea {
  width: 100%;
  border: 1px solid #e3e3e3;
  padding: 7px 6px;
  font: inherit;
  font-weight: 350;
  color: var(--text);
  background: #fff;
  border-radius: 0;
  outline: none;
}
.form input:focus,
.form textarea:focus { border-color: #9a9a9a; }
.form ::placeholder { color: #666; opacity: 1; }
.form textarea { height: 130px; resize: vertical; }

.form .row-end { display: flex; justify-content: flex-end; margin-top: 4px; }

.form button {
  background: #cfcfcf;
  color: #fff;
  border: 0;
  padding: 6px 6px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s;
}
.form button:hover { background: #999; }
.form button:disabled { opacity: .6; cursor: default; }

.form-status { font-size: 15px; min-height: 1.4em; }
.form-status.ok { color: #3a7d44; }
.form-status.err { color: #b3261e; }

.hp { position: absolute; left: -9999px; }

/* ---------- Language switch ---------- */

/* Shows only the other language, styled like the menu. The divider is drawn
   on top (absolutely positioned) so it never shifts the word off the menu's line. */
.lang {
  position: relative;
  line-height: 1;
  /* the divider sits halfway between "contact" and the language:
     47px header gap - 20px = 27px before it, 27px after it */
  margin-inline-start: -20px;
  padding-inline-start: 27px;
}
.lang::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 1px;
  height: 13px;
  background: var(--text);
  transform: translateY(-40%) scaleX(.5); /* centred on the letters; half a pixel wide, a hairline like the letters */
}
.lang a {
  color: var(--text);
  font-size: 16px;
}
.lang a[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Open Sans", sans-serif; }
html:not([lang="ar"]) .lang a[data-lang="en"],
html[lang="ar"] .lang a[data-lang="ar"] { display: none; }

/* ---------- Arabic (right-to-left) ---------- */

/* Open Sans has no Arabic letters: Latin names stay in Open Sans, Arabic falls through to Plex. */
html[lang="ar"] body { font-family: "Open Sans", "IBM Plex Sans Arabic", Helvetica, Arial, sans-serif; }
.logo { direction: ltr; unicode-bidi: isolate; }
html[lang="ar"] .nav a { font-size: 16px; }
html[lang="ar"] .copyright, html[lang="ar"] .social a { font-size: 14px; }
html[lang="ar"] .about-text p { line-height: 2; }

/* Arrows: "next" sits on the left and points left */
html[dir="rtl"] .ss-prev { left: auto; right: 8px; }
html[dir="rtl"] .ss-next { right: auto; left: 8px; }
html[dir="rtl"] .lb-prev { left: auto; right: 12px; }
html[dir="rtl"] .lb-next { right: auto; left: 12px; }
html[dir="rtl"] .lb-close { right: auto; left: 18px; }
html[dir="rtl"] .ss-btn svg, html[dir="rtl"] .lb-prev svg, html[dir="rtl"] .lb-next svg { transform: scaleX(-1); }

/* ---------- Project page ---------- */

.back-link {
  display: inline-block;
  margin-bottom: 26px;
  font-size: 15px;
  color: var(--text);
}

.pj-gallery { position: relative; }
.pj-frame {
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
/* whole photo, never cropped: tall photos sit in the middle */
.pj-frame img { width: 100%; height: 100%; object-fit: contain; }
.pj-frame .ph { cursor: default; }
/* counter with long hairline arrows on either side */
.pj-count { margin-top: 10px; font-size: 15px; color: var(--text); display: flex; justify-content: flex-end; align-items: center; gap: 18px; }
.pj-arrow { border: 0; background: none; padding: 6px 0; color: var(--text); cursor: pointer; display: flex; transition: color .2s, transform .2s; }
.pj-arrow svg { width: 36px; height: 11px; }
.pj-arrow:hover, .pj-arrow:focus-visible { color: var(--text); }
.pj-prev:hover { transform: translateX(-3px); }
.pj-next:hover { transform: translateX(3px); }
html[dir="rtl"] .pj-arrow svg { transform: scaleX(-1); }
html[dir="rtl"] .pj-prev:hover { transform: translateX(3px); }
html[dir="rtl"] .pj-next:hover { transform: translateX(-3px); }

.pj-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 60px;
  margin-top: 34px;
}
.pj-title { font-size: 28px; font-weight: 350; margin: 0 0 22px; line-height: 1.25; }
.pj-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 28px;
  margin: 0;
  font-size: 16px;
}
.pj-details dt { color: var(--text); }
.pj-details dd { margin: 0; }
.pj-text p { margin: 0 0 1.1em; font-size: 16px; line-height: 1.95; }
.pj-text p:last-child { margin-bottom: 0; }
/* bold inside written text: a touch heavier than the text, not the browser's heavy bold */
.pj-text strong, .pj-text b, #about-bio strong, #about-bio b { font-weight: 400; }
.pj-missing { color: var(--text); }

@media (max-width: 760px) {
  .pj-body { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 24px; }
  .pj-title { font-size: 24px; }
}

/* Arabic pages: Latin names (dir="auto") still sit on the right, with the Arabic text */
html[dir="rtl"] .pj-title,
html[dir="rtl"] .pj-details dd,
html[dir="rtl"] .tile-cap span { text-align: right; }

/* Links everywhere: plain text in their own colour, no fade;
   pointing at one underlines it. (For a publication, the title is underlined.) */
.nav a.active,
.nav a:hover, .nav a:focus-visible,
.tile:hover .tile-cap .t, .tile:focus-visible .tile-cap .t,
.lang a:hover, .lang a:focus-visible,
.social a:hover, .social a:focus-visible,
.back-link:hover, .back-link:focus-visible,
.contact a:hover, .contact a:focus-visible,
#about-bio a:hover, #about-bio a:focus-visible,
.pj-text a:hover, .pj-text a:focus-visible,
a.pub:hover .pub-t, a.pub:focus-visible .pub-t {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
/* A file from the library (a PDF): a small raised download arrow right after the words. */
#about-bio a[href^="/media/"][href$=".pdf"]::after, .pj-text a[href^="/media/"][href$=".pdf"]::after {
  content: "";
  display: inline-block;
  width: .68em; height: .68em;
  margin-inline-start: .14em;
  vertical-align: .5em;
  background: currentColor;
  opacity: .75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v17M5.5 13.5 12 20l6.5-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v17M5.5 13.5 12 20l6.5-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

