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

/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --bg:            #f4e6e1;
  --white:         #ffffff;
  --text:          #1a1a1a;
  --terracotta:    #7a2e19;
  --hover-bg:      rgba(180, 85, 55, 0.18);

  --size-large:    clamp(26px, 3.7vw, 40px);
  --size-body:     clamp(9px, 1.5vw, 16px);
}

/* ─── Base ───────────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: var(--size-body);
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}

.semibold   { font-weight: 600; }
.terracotta { color: var(--terracotta); }

/* ─── Links ──────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
  transition: background-color 0.12s ease;
}

a:hover {
  background-color: var(--hover-bg);
}

/* ─── Header ─────────────────────────────────────────── */
header {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vw, 40px);
  margin: clamp(16px, 3.5vw, 50px) clamp(16px, 3.5vw, 50px) 0;
  min-height: clamp(80px, 10vw, 170px);
  position: relative;
}

.site-title {
  font-size: var(--size-large);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: uppercase;
  text-align: center;
}

/* ─── Header nav ─────────────────────────────────────── */
.header-nav {
  position: absolute;
  top: clamp(16px, 2.5vw, 28px);
  left: clamp(16px, 2.5vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--size-body);
}

.header-nav a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  font-weight: 400;
}

.header-nav a:hover {
  background-color: var(--hover-bg);
}

.header-nav a.nav-active {
  font-weight: 600;
  text-decoration: none;
  pointer-events: none;
}

.logo {
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 12px;
  height: calc(100% - 24px);
  width: auto;
}

/* ─── Main ───────────────────────────────────────────── */
main {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px) clamp(32px, 11vw, 150px) clamp(60px, 8vw, 96px);
}

/* ─── Date row ───────────────────────────────────────── */
.date-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: clamp(20px, 3vw, 32px);
  color: var(--terracotta);
}

.date-primary {
  font-size: var(--size-large);
  line-height: 1.1;
}

.date-late {
  font-size: var(--size-body);
  line-height: 1.1;
}

/* ─── Venue ──────────────────────────────────────────── */
.venue-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: clamp(20px, 3vw, 40px);
}

.venue-link {
  display: block;
  font-size: var(--size-large);
  line-height: 1.2;
  color: var(--text);
  flex: 1;
}

.logo-mobile {
  display: none;
}

/* ─── Description ────────────────────────────────────── */
.description-block {
  margin-bottom: clamp(20px, 3vw, 40px);
}

.curator-line {
  font-size: var(--size-body);
  margin-bottom: clamp(10px, 1.5vw, 16px);
}

.body-text {
  font-size: var(--size-body);
  line-height: 1.55;
}

/* ─── Artists ────────────────────────────────────────── */
.artists-block {
  margin-top: clamp(20px, 3vw, 40px);
}

.featuring-label {
  font-size: var(--size-body);
  margin-bottom: clamp(10px, 1.5vw, 16px);
}

.artists-list {
  font-size: var(--size-large);
  line-height: 1.35;
}

/* ─── Page nav (below header) ────────────────────────── */
.page-nav {
  display: flex;
  gap: 16px;
  padding: clamp(12px, 2vw, 20px) clamp(16px, 3.5vw, 50px) 0;
  font-size: var(--size-body);
}

.page-nav a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  font-weight: 400;
}

.page-nav a:hover {
  background-color: var(--hover-bg);
}

.page-nav a.nav-active {
  font-weight: 600;
  text-decoration: none;
  pointer-events: none;
}

/* ─── Gallery main override ──────────────────────────── */
main.gallery-main {
  max-width: none;
  margin: 0;
  padding: clamp(20px, 3vw, 40px) clamp(16px, 3.5vw, 50px) clamp(60px, 8vw, 96px);
}

/* ─── Gallery grid ───────────────────────────────────── */
.gallery-grid {
  columns: 3;
  column-gap: clamp(10px, 1.5vw, 20px);
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: clamp(10px, 1.5vw, 20px);
  background: var(--white);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-caption {
  height: 70px;
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  background: var(--white);
}

.gallery-caption .artist-name {
  font-size: clamp(8px, 0.85vw, 10px);
  font-weight: 600;
  display: block;
  line-height: 1.5;
}

.gallery-caption .artwork-title {
  font-size: clamp(8px, 0.85vw, 10px);
  font-weight: 400;
  display: block;
  line-height: 1.5;
}

/* ─── Responsive tweaks ──────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
  header {
    margin: 24px 24px 0;
    min-height: 100px;
  }

  main {
    padding: 32px 40px 64px;
  }

  .date-row {
    flex-wrap: wrap;
    gap: 4px 16px;
  }

  .gallery-grid {
    columns: 2;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --size-large: 24px;
    --size-body:  14px;
  }

  header {
    margin: 16px 16px 0;
    padding: 20px 20px 16px;
    min-height: unset;
    flex-direction: column;
    gap: 12px;
  }

  .header-nav {
    position: static;
    flex-direction: row;
    gap: 16px;
  }

  .logo {
    top: 8px;
    bottom: 8px;
    right: 8px;
    height: calc(100% - 16px);
  }

  main {
    padding: 24px 20px 56px;
  }

  .date-row {
    flex-direction: column;
    gap: 4px;
  }

  .venue-link {
    width: 100%;
  }

  .logo {
    display: none;
  }

  .logo-mobile {
    display: block;
    height: 105px;
    width: auto;
    flex-shrink: 0;
    margin-left: 12px;
    margin-top: -20px;
    align-self: center;
  }

  .venue-link .semibold {
    display: block;
    line-height: 1;
  }

  .venue-address {
    font-size: var(--size-body);
  }

  .gallery-grid {
    columns: 1;
  }
}