@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&display=swap');

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

:root {
  --font: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --text: #222;
  --link: #222;
  --link-hover: #888;
  --sidebar-width: 180px;
  --sidebar-left: 50px;
  --sidebar-top: 50px;
}

html, body {
  height: 100%;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6em;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

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

#header {
  position: fixed;
  top: var(--sidebar-top);
  left: var(--sidebar-left);
  width: var(--sidebar-width);
  z-index: 100;
}

.site-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25em;
  margin-bottom: 2em;
}

.site-title a {
  color: var(--text);
}

nav ul {
  list-style: none;
}

nav ul li {
  margin-bottom: 0.6em;
}

nav ul li a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.6em;
}

nav ul li a:hover {
  color: var(--link-hover);
}

nav ul li.active a {
  color: var(--text);
  font-weight: 700;
}

#secondary-nav {
  margin-top: 1.5em;
}

#secondary-nav ul li a {
  font-weight: 400;
  font-size: 13px;
}

/* ---- Page layout ---- */

#page {
  margin-left: calc(var(--sidebar-left) + var(--sidebar-width) + 50px);
  padding: 50px 50px 80px 0;
  max-width: 960px;
}

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

.hero-image {
  margin-bottom: 2em;
}

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

.image-caption {
  font-size: 12px;
  color: #666;
  margin-top: 0.6em;
  line-height: 1.4em;
}

.about-text {
  max-width: 640px;
  margin-bottom: 2.5em;
}

.about-text h1 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.8em;
}

.about-text p {
  font-size: 14px;
  line-height: 1.7em;
  color: #333;
}

hr.divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2em 0;
  max-width: 640px;
}

.exhibitions {
  max-width: 640px;
}

.exhibitions h1 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.8em;
}

.exhibitions p {
  font-size: 14px;
  line-height: 1.7em;
  color: #333;
  margin-bottom: 0.8em;
}

.exhibitions strong {
  font-weight: 600;
}

.exhibitions em {
  font-style: italic;
}

/* ---- Art / Gallery page ---- */

.gallery-grid {
  columns: 3;
  column-gap: 6px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 6px;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.7s ease-out;
}

.gallery-item.visible {
  opacity: 1;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.2s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-item:hover img {
  opacity: 0.82;
}

/* ---- Image viewer ---- */

#viewer {
  display: none;
  flex-direction: column;
  min-height: calc(100vh - 100px);
}

#viewer.open {
  display: flex;
}

#gallery.hidden {
  display: none;
}

#viewer-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#viewer-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#viewer-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

#viewer-controls {
  position: fixed;
  top: 20px;
  right: 70px;
  display: flex;
  align-items: center;
  gap: 0.2em;
  z-index: 2;
}

#viewer-controls button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 26px;
  font-weight: 300;
  color: var(--text);
  padding: 4px 6px;
  line-height: 1;
  opacity: 0.45;
}

#viewer-controls button:hover {
  opacity: 1;
}

#viewer-close {
  margin-left: 0.4em;
}

/* ---- Mobile ---- */

/* nav-group is transparent to desktop flex layout */
#nav-group {
  display: contents;
}

@media (max-width: 800px) {
  #header {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6em;
    border-bottom: 1px solid #eee;
  }

  /* Single-line title on mobile */
  .site-title br { display: none; }
  .site-title { margin-bottom: 0; font-size: 17px; }

  /* Both navs in one row */
  #nav-group {
    display: flex;
    align-items: baseline;
    gap: 1.5em;
  }

  nav ul {
    display: flex;
    gap: 1em;
  }

  #secondary-nav {
    margin-top: 0;
  }

  /* Hide header while viewer is open */
  body.viewer-open #header {
    display: none;
  }

  #page {
    margin-left: 0;
    padding: 20px;
  }

  .gallery-grid {
    columns: 2;
    column-gap: 4px;
  }

  .gallery-item {
    margin-bottom: 4px;
  }

  #viewer-controls {
    top: auto;
    bottom: 24px;
    right: 20px;
  }
}
