/* 3kta - site.css
   Desktop: project pages = title + text/video on the left, images on the right (two columns).
   Phones (<= 800px): everything stacks in one column. */

:root {
  --pad: clamp(20px, 7vw, 130px);
  --max: 1200px;
  --gap: clamp(2rem, 4vw, 3.5rem);
  --accent: #0cf;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
}

a { color: #000; text-decoration: underline; }
a:hover, a:active { color: var(--accent); }

img { max-width: 100%; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- header ---------- */
/* the header stays at the top of the window while the page scrolls */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  padding-top: 20px;
  padding-bottom: 1rem;
}
.site-header .logo { display: inline-block; line-height: 0; }
.site-header .logo img { display: block; width: 80px; height: auto; }

.site-nav {
  margin-top: 1.4rem;
  font-family: 'IBM Plex Sans', Arial, sans-serif;
  font-size: 1rem;
}
.site-nav a {
  display: inline-block;
  margin-right: 2.2rem;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- main ---------- */
main { padding-top: 2.5rem; padding-bottom: 4rem; }

/* ---------- project pages: content flows in TWO columns ---------- */
/* one container: title, text, video and images run down the first column and
   continue in the second, so both columns end at about the same height */
.project .flow {
  column-count: 2;
  column-gap: var(--gap);
}
.project .flow > * { margin-top: 0; }
/* title and year sit above both columns; the two columns then start on the same line below them */
.project .flow > h1,
.project .flow > .meta { column-span: all; }
.project h1 { break-after: avoid; }
.project p { orphans: 3; widows: 3; }
.project img,
.project .video,
.project iframe,
.project table,
.project ul { break-inside: avoid; }

.project h1 {
  margin: 0;
  font-weight: 300;
  font-style: italic;          /* the project title is italic */
  font-size: 1.6rem;
  line-height: 1.3;
}
.project .meta {
  margin: 0 0 1.6rem;
  font-weight: 300;
  font-style: normal;          /* place and date are upright */
  font-size: 1.6rem;
  line-height: 1.3;
}

.project p { margin: 0 0 1em; }

.project img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 1rem;
}
.project iframe { max-width: 100%; border: 0; }

.video {
  position: relative;
  height: 0;
  padding-top: var(--ratio, 56.25%);
  margin: 0 0 1.2rem;
  background: #000;
}
.video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

.project table { max-width: 100%; border-collapse: collapse; }
.project ul { padding-left: 1.2rem; }

/* texts page */
.publication { margin: 0 0 2.4rem; max-width: 46rem; }
.publication h2 { font-size: 1.2rem; font-weight: 500; margin: 0 0 .4rem; }
.publication-meta { font-size: .9rem; margin-bottom: .8rem; }


/* texts page (list): year in the left column, entry in the right column */
.texts-heading { margin: 0 0 1.4rem; font-weight: 300; font-size: 1.6rem; line-height: 1.3; }
.texts-list { list-style: none; margin: 0; padding: 0; }
.text-item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  column-gap: var(--gap);
  padding: 1.1rem 0 1.2rem;
  border-top: 1px solid #ddd;
}
.text-year { font-weight: 300; font-size: 1.2rem; line-height: 1.4; }
.text-title { margin: 0; font-weight: 500; font-size: 1.1rem; line-height: 1.35; }
.text-title-pt { margin: .15rem 0 0; font-style: italic; font-size: 1rem; line-height: 1.35; }
.text-sub { margin: .15rem 0 0; font-size: .95rem; line-height: 1.4; }
.text-meta { margin: .45rem 0 0; font-size: .9rem; line-height: 1.45; }
.text-links { margin: .55rem 0 0; font-family: 'IBM Plex Sans', Arial, sans-serif; font-size: .9rem; }
.text-links a { margin-right: .25rem; }


/* texts page (list): year in the left column, entry in the right column */
.texts-heading { margin: 0 0 1.4rem; font-weight: 300; font-size: 1.6rem; line-height: 1.3; }
.texts-list { list-style: none; margin: 0; padding: 0; }
.text-item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  column-gap: var(--gap);
  padding: 1.1rem 0 1.2rem;
  border-top: 1px solid #ddd;
}
.text-year { font-weight: 300; font-size: 1.2rem; line-height: 1.4; }
.text-title { margin: 0; font-weight: 500; font-size: 1.1rem; line-height: 1.35; }
.text-title-pt { margin: .15rem 0 0; font-style: italic; font-size: 1rem; line-height: 1.35; }
.text-sub { margin: .15rem 0 0; font-size: .95rem; line-height: 1.4; }
.text-meta { margin: .45rem 0 0; font-size: .9rem; line-height: 1.45; }
.text-links { margin: .55rem 0 0; font-family: 'IBM Plex Sans', Arial, sans-serif; font-size: .9rem; }
.text-links a { margin-right: .25rem; }

/* ---------- index: project grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.8rem 1.4rem;
}
.card { display: block; text-decoration: none; font-size: .95rem; line-height: 1.35; }
.card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;      /* every thumbnail the same size... */
  object-fit: cover;        /* ...cropped to fill, never stretched */
  object-position: center;
  background: #eee;
}
.card-title { display: block; margin-top: .55rem; }
.card-year { display: block; }

/* project names always stay black: never blue, and never purple/blue once visited */
.card,
.card:link,
.card:visited,
.card:hover,
.card:active,
.card:focus {
  color: #000;
}
.card:hover .card-title { text-decoration: underline; }   /* hover feedback without colour */

/* ---------- phones / narrow windows: ONE column ---------- */
@media (max-width: 800px) {
  .text-item { grid-template-columns: minmax(0, 1fr); row-gap: .3rem; }
  .text-year:empty { display: none; }
  .project .flow { column-count: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.4rem 1rem; }
  .site-nav { font-size: .85rem; white-space: nowrap; }
  .site-nav a { margin-right: 1rem; }
  .site-header { padding-top: 10px; padding-bottom: .5rem; }
  .site-header .logo img { width: 56px; }
  .site-nav { margin-top: .7rem; }
}

/* very small phones */
@media (max-width: 340px) {
  .site-nav { font-size: .78rem; }
  .site-nav a { margin-right: .75rem; }
}
