
/* ========================================
   Art portfolio page
   ======================================== */
/* Change the background colour just for the art page */   
body {
  background-color: #e8e0d4;
}

.art-page {
  padding: 64px 0 100px;
}

.art-page-header {
  max-width: 720px;
  margin-bottom: 48px;
}

.art-page-header h1 {
  margin: 0 0 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.art-page-header > p:last-child {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.art-page-header .eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Sidebar and gallery */

.art-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  gap: 40px;
}

.art-sidebar {
  position: sticky;
  top: 32px;
}

.art-categories {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.art-category {
  display: block;
  width: 100%;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.art-category:hover {
  color: var(--ink);
  background: rgb(22 22 22 / 4%);
}

.art-category.is-active {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}

.art-category:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.art-gallery-section {
  min-width: 0;
}

.art-gallery-count {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

/*
  Each image gets a calculated grid-row span from art.js.
  The small implicit row height lets images of different
  proportions fit together without cropping.
*/

.art-gallery {
  --gallery-row-height: 8px;
  --gallery-gap: 16px;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: var(--gallery-row-height);
  gap: var(--gallery-gap);
  align-items: start;
}

.art-tile {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--paper-alt);
  cursor: zoom-in;
}

.art-tile-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: inherit;
}

.art-tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 220ms ease;
}

.art-tile:hover img {
  transform: scale(1.025);
}

.art-tile-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.art-empty-message {
  padding: 32px 0;
  color: var(--muted);
}

/* ========================================
   Lightbox
   ======================================== */

.art-lightbox[hidden] {
  display: none;
}

.art-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgb(15 15 15 / 94%);
  color: var(--white);
}

.art-lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

.art-lightbox-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 96px);
  max-height: calc(100vh - 128px);
  object-fit: contain;
}

/*
  The image has no forced width or height. It therefore
  displays at its intrinsic size when it fits, and shrinks
  only when necessary to fit the viewport.
*/

.art-lightbox-figure figcaption {
  max-width: min(700px, 100%);
  color: rgb(255 255 255 / 75%);
  font-size: 0.9rem;
  text-align: center;
}

.art-lightbox-close,
.art-lightbox-arrow {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 50%;
  background: rgb(0 0 0 / 25%);
  color: white;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.art-lightbox-close:hover,
.art-lightbox-arrow:hover {
  border-color: rgb(255 255 255 / 70%);
  background: rgb(255 255 255 / 15%);
}

.art-lightbox-close {
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
}

.art-lightbox-arrow {
  top: 50%;
  width: 48px;
  height: 48px;
  font-size: 2.4rem;
  line-height: 1;
  transform: translateY(-50%);
}

.art-lightbox-previous {
  left: 18px;
}

.art-lightbox-next {
  right: 18px;
}

.art-lightbox-counter {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  margin: 0;
  color: rgb(255 255 255 / 65%);
  font-size: 0.8rem;
  text-align: center;
}

.art-lightbox button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

body.art-lightbox-open {
  overflow: hidden;
}

/* ========================================
   Responsive layout
   ======================================== */

@media (max-width: 1100px) {
  .art-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .art-page {
    padding: 44px 0 72px;
  }

  .art-page-header {
    margin-bottom: 32px;
  }

  .art-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .art-sidebar {
    position: static;
    min-width: 0;
  }

  .art-categories {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scrollbar-width: thin;
  }

  .art-category {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .art-gallery-count {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .art-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    --gallery-gap: 10px;
  }

  .art-lightbox {
    padding: 24px;
  }

  .art-lightbox-figure img {
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 100px);
  }

  .art-lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .art-lightbox-arrow {
    top: auto;
    bottom: 12px;
    width: 42px;
    height: 42px;
    transform: none;
  }

  .art-lightbox-previous {
    left: 16px;
  }

  .art-lightbox-next {
    right: 16px;
  }

  .art-lightbox-counter {
    bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .art-category,
  .art-tile img,
  .art-lightbox-close,
  .art-lightbox-arrow {
    transition: none;
  }

  .art-tile:hover img {
    transform: none;
  }
}

/* Respect the site's existing animation preference. */

.animations-off .art-category,
.animations-off .art-tile img,
.animations-off .art-lightbox-close,
.animations-off .art-lightbox-arrow {
  transition: none;
}

.animations-off .art-tile:hover img {
  transform: none;
}
