/* Gallery page styles. */
.gallery-grid {
  display: grid;
  gap: 24px;
}

.art-card {
  min-width: 0;
}

.art-card-button {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.art-card-button:hover .art-card-image,
.art-card-button:focus-visible .art-card-image {
  box-shadow: 0 20px 55px rgba(150, 42, 108, 0.22);
}

.art-card-image {
  display: block;
  width: 100%;
  height: 300px;
  min-height: 300px;
  object-fit: cover;
  border: 12px solid #fff;
  box-shadow: var(--shadow-soft);
}

.art-card-body {
  display: block;
  padding: 15px 0 0;
}

.art-card-title {
  display: block;
  color: var(--black);
  font-family: var(--font-display);
  font-size: 1.58rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.art-card-meta {
  display: block;
  margin-top: 5px;
  color: var(--accent);
  font-size: 0.68rem;
  line-height: 1.3;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  padding: 16px;
  overflow: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 1200px);
  margin: auto;
  background: #fff;
  border: 1px solid var(--black);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--black);
  border-radius: 50%;
  background: #fff;
  color: var(--black);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.modal-close svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.modal-close:hover,
.modal-close:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.modal-art {
  min-height: 420px;
  background-position: center;
  background-size: cover;
}

.modal-art.has-image {
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: contain;
}

.modal-art.has-image::before,
.modal-art.has-image::after {
  content: none;
}

.modal-content {
  padding: 28px;
}

.modal-content h2 {
  color: var(--accent);
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.modal-nav-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--black);
  border-radius: 50%;
  background: #fff;
  color: var(--black);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.modal-nav-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-nav-button:hover,
.modal-nav-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* Gallery exhibition layout */
.gallery-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 5.5vw, 72px) 0 clamp(34px, 4.5vw, 58px);
  background: #fff;
}

.gallery-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--border);
  pointer-events: none;
}

.gallery-hero-simple {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.gallery-hero-simple h1 {
  position: relative;
  max-width: none;
  font-size: clamp(4.2rem, 10vw, 8.4rem);
  line-height: 0.78;
  letter-spacing: -0.075em;
}

.gallery-hero-simple h1::after {
  content: "";
  position: absolute;
  top: 10%;
  right: -0.42em;
  width: 0.22em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0.13em 0.15em 0 var(--sage);
}

.gallery-section {
  padding: clamp(28px, 4vw, 50px) 0 clamp(84px, 11vw, 150px);
  background: #fcfbfa;
}

.gallery-grid {
  gap: 48px;
}

.art-card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(.2,.7,.2,1);
}

.art-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.art-card-button {
  position: relative;
  overflow: hidden;
  background: transparent;
}

.art-card-button:focus {
  outline: none;
}

.art-card-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 0;
}

.art-card-image {
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 5;
  border: 0;
  box-shadow: none;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1), filter 300ms ease;
}

.art-card-button:hover .art-card-image,
.art-card-button:focus-visible .art-card-image {
  box-shadow: none;
  filter: saturate(1.05);
  transform: scale(1.025);
}

.art-card-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  align-items: baseline;
  padding: 17px 0 0;
  background: #fcfbfa;
}

.art-card-title {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.art-card-meta {
  grid-column: 1 / -1;
  max-width: 42ch;
  color: #75536a;
  font-size: 0.61rem;
}

.modal {
  overflow: hidden;
  padding: 0;
}

.modal-backdrop {
  background: rgba(20, 15, 18, 0.82);
}

.modal-dialog {
  width: 100%;
  height: 100svh;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 0;
  background: #fff;
}

.modal-visual {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.modal-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background-position: center;
  background-size: cover;
}

.modal-art.has-image {
  background-color: #fff;
  background-size: contain;
  filter: drop-shadow(0 12px 28px rgba(20, 12, 17, 0.12));
}

.modal-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 42px;
  height: 42px;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(20, 15, 18, 0.45);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  pointer-events: none;
}

.modal-nav-button {
  width: 46px;
  height: 46px;
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(20, 15, 18, 0.52);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.modal-count {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(20, 15, 18, 0.62);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.modal-close:focus,
.modal-nav-button:focus {
  outline: none;
}

.modal-close:focus-visible,
.modal-nav-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.modal-content {
  max-height: 43svh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 24px max(24px, env(safe-area-inset-bottom));
}

.modal-content .eyebrow {
  margin-bottom: 8px;
}

.modal-content h2 {
  margin-bottom: 7px;
  font-size: clamp(2rem, 9vw, 3.1rem);
}

.modal-meta {
  margin-bottom: 10px;
  font-size: 0.59rem;
  line-height: 1.45;
  white-space: pre-line;
}

.modal-content > p:last-child {
  font-size: 0.88rem;
  line-height: 1.55;
}

