/* ============================================================
   Madis Ligema — madis.ligema.ee personal site
   Clean, self-hosted, no external dependencies
   ============================================================ */

/* Newsreader (SIL Open Font License), self-hosted */
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-ext-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-ext-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-ext-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

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

:root {
  --nav-h: 60px;
  --pad: clamp(1rem, 3vw, 2rem);
  --font-nav: clamp(1.05rem, 1.8vw, 1.4rem);
  --font-body: clamp(0.875rem, 1.2vw, 1rem);
}

html {
  font-size: 16px;
}

body {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  background: #fff;
  color: #111;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s;
}

strong, b {
  font-weight: 500;
}

a:hover {
  opacity: 0.45;
}

/* ── TOP NAV ─────────────────────────────────────────────── */

.nav-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  z-index: 20;
}

.nav-top .site-name {
  font-size: var(--font-nav);
  font-weight: normal;
  letter-spacing: 0.01em;
}

.nav-right {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.nav-top .info-link[aria-current="page"] {
  opacity: 0.45;
}

.nav-top .info-link {
  font-size: var(--font-nav);
  font-weight: normal;
  letter-spacing: 0.01em;
}

/* ── BOTTOM NAV ─────────────────────────────────────────── */

.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  z-index: 20;
}

.nav-bottom .works-link {
  font-size: var(--font-nav);
  font-weight: normal;
  letter-spacing: 0.01em;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-icons a {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.nav-icons svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

/* ── HOME PAGE: SLIDESHOW ────────────────────────────────── */

body.home {
  overflow: hidden;
}

.slideshow {
  position: fixed;
  top: var(--nav-h);
  bottom: var(--nav-h);
  left: 0;
  right: 0;
  background: #fff;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slideshow {
  cursor: pointer;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* ── INFO PAGE ───────────────────────────────────────────── */

body.info-page {
  overflow-y: auto;
}

.info-main {
  margin-top: var(--nav-h);
  padding: 3rem var(--pad) calc(var(--nav-h) + 3rem);
}

.info-columns {
  display: flex;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: flex-start;
  max-width: 1280px;
}

.info-col-text {
  flex: 0 0 56%;
  min-width: 0;
}

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

.info-col-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.info-col-photo figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 0.02em;
}

/* ── INFO TYPOGRAPHY ─────────────────────────────────────── */

.info-col-text p {
  font-size: var(--font-body);
  line-height: 1.7;
  margin-bottom: 1.1em;
  max-width: 64ch;
}

.info-col-text p:last-child {
  margin-bottom: 0;
}

.info-col-text em {
  font-style: italic;
}

.section-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #888;
  margin-top: 2.2rem;
  margin-bottom: 0.7em;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  font-size: var(--font-body);
  line-height: 1.9;
}

.contact-list a::before {
  content: '→ ';
}

.press-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  max-width: 64ch;
}

.press-list li {
  font-size: var(--font-body);
  line-height: 1.6;
}

.press-list a {
  border-bottom: 1px solid #ccc;
}

/* ── WORKS PAGE ─────────────────────────────────────────── */

.works {
  max-width: 1080px;
}

.works > .section-label:first-child {
  margin-top: 0;
}

.works-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.work {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0 clamp(1rem, 3vw, 2.5rem);
  padding: 1.6rem 0;
  border-top: 1px solid #e6e6e3;
}

.work.has-image {
  grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 0.7fr);
}

.work-year {
  font-size: var(--font-body);
  color: #888;
  font-variant-numeric: tabular-nums oldstyle-nums;
  padding-top: 0.2em;
}

.work-body {
  min-width: 0;
  max-width: 60ch;
}

.work-title {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
}

.work-alt {
  font-size: var(--font-body);
  color: #888;
  margin-top: 0.2rem;
}

.work-meta {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #888;
  margin-top: 0.9rem;
}

.work-note {
  font-size: var(--font-body);
  line-height: 1.7;
  margin-top: 0.6rem;
}

.work-status {
  font-size: 0.85rem;
  line-height: 1.6;
  font-style: italic;
  margin-top: 0.6rem;
}

.work-link {
  font-size: 0.85rem;
  margin-top: 0.6rem;
}

.work-link a {
  border-bottom: 1px solid currentColor;
}

.work-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── MOBILE ──────────────────────────────────────────────── */

@media (max-width: 680px) {
  :root {
    --nav-h: 52px;
    --pad: 1rem;
    --font-nav: 1rem;
  }

  .nav-bottom .works-link {
    font-size: 0.8rem;
  }

  .info-columns {
    flex-direction: column;
  }

  .info-col-text,
  .info-col-photo {
    flex: none;
    width: 100%;
  }

  .work,
  .work.has-image {
    grid-template-columns: 1fr;
  }

  .work-year {
    margin-bottom: 0.4rem;
  }

  .work-image {
    margin-top: 1rem;
    max-width: 320px;
  }

  .info-col-photo {
    order: -1;
    max-width: 320px;
  }
}
