:root {
  --gan-brown-deep: #70594d;
  --gan-brown: #8a7060;
  --gan-taupe: #8e806a;
  --gan-sand: #c3b091;
  --gan-cream: #ffe6bc;
  --gan-ink: #332822;
}

body.post-type-archive-gan_sergi {
  margin: 0;
  overflow-x: clip;
  background: var(--gan-brown-deep);
}

body.post-type-archive-gan_sergi .site-content > .ast-container,
body.post-type-archive-gan_sergi .ast-container,
body.post-type-archive-gan_sergi #primary {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.post-type-archive-gan_sergi .ast-archive-description,
body.post-type-archive-gan_sergi .ast-primary-header-bar,
body.post-type-archive-gan_sergi .entry-header {
  display: none !important;
}

.gan-exhibitions-page {
  width: 100%;
  background: var(--gan-brown-deep);
  color: var(--gan-cream);
}

.gan-exhibitions-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 80;
  background: transparent !important;
}

.gan-logo-text {
  color: var(--gan-cream);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  letter-spacing: .14em;
}

.gan-exhibitions-intro {
  min-height: 34vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(120px, 12vw, 180px) clamp(24px, 5vw, 88px) clamp(48px, 5vw, 76px);
  background: var(--gan-brown-deep);
}

.gan-exhibitions-kicker,
.gan-exhibition-label {
  margin: 0 0 16px;
  color: var(--gan-cream);
  font-size: clamp(.68rem, .75vw, .82rem);
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.gan-exhibitions-intro h1 {
  margin: 0;
  color: var(--gan-cream);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(3.8rem, 7vw, 7.4rem);
  font-weight: 400;
  line-height: .82;
  letter-spacing: -.045em;
}

.gan-exhibitions-intro > p:last-child {
  width: min(560px, 100%);
  margin: 22px 0 0;
  color: rgba(255, 230, 188, .82);
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.75;
}

.gan-exhibition-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(310px, 32%) minmax(0, 68%);
  height: clamp(300px, 23.5vw, 360px);
  min-height: 300px;
  color: var(--gan-cream);
  background: var(--gan-brown);
  text-decoration: none !important;
  overflow: hidden;
}

.gan-exhibition-row:nth-child(even) { background: var(--gan-taupe); }
.gan-exhibition-row.is-reverse { grid-template-columns: minmax(0, 68%) minmax(310px, 32%); }
.gan-exhibition-row.is-reverse .gan-exhibition-copy { order: 2; }
.gan-exhibition-row.is-reverse .gan-exhibition-images { order: 1; }

.gan-exhibition-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 3.4vw, 54px);
}

.gan-exhibition-copy h2 {
  max-width: 12ch;
  margin: 0;
  color: var(--gan-cream);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 3.35vw, 4.5rem);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.035em;
}

.gan-exhibition-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 17px 0 0;
  color: rgba(255, 230, 188, .9);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.6;
  text-transform: uppercase;
}

.gan-exhibition-description {
  max-width: 40ch;
  display: -webkit-box;
  margin: 13px 0 0;
  overflow: hidden;
  color: rgba(255, 230, 188, .78);
  font-size: clamp(.78rem, .82vw, .92rem);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gan-exhibition-download,
.gan-exhibition-unavailable {
  width: max-content;
  margin-top: 18px;
  padding-bottom: 5px;
  border-bottom: 1px solid currentColor;
  color: var(--gan-cream);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gan-exhibition-download span {
  display: inline-block;
  margin-left: 8px;
  transition: transform .35s ease;
}

.gan-exhibition-unavailable { opacity: .56; }

.gan-exhibition-images {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  min-height: 100%;
  background: var(--gan-sand);
}

.gan-exhibition-images.count-1 { grid-template-columns: 1fr; }
.gan-exhibition-images.count-2 { grid-template-columns: 1.08fr .92fr; }
.gan-exhibition-images.count-3 { grid-template-columns: 1.1fr .9fr 1fr; }

.gan-exhibition-images figure {
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.gan-exhibition-images img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1), filter .8s ease;
}

.gan-exhibition-images figure:nth-child(2) img { object-position: 56% center; }
.gan-exhibition-images figure:nth-child(3) img { object-position: 44% center; }

.gan-exhibition-row.has-pdf:hover .gan-exhibition-images img { transform: scale(1.025); }
.gan-exhibition-row.has-pdf:hover .gan-exhibition-download span { transform: translateY(4px); }

.gan-exhibition-placeholder {
  display: grid;
  place-items: center;
  min-height: 100%;
  background: linear-gradient(135deg, var(--gan-sand), var(--gan-taupe));
  color: rgba(255, 230, 188, .8);
  letter-spacing: .24em;
}

.gan-exhibitions-empty {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(70px, 10vw, 150px) clamp(24px, 8vw, 150px);
  background: var(--gan-brown);
}

.gan-exhibitions-empty h2 {
  max-width: 760px;
  margin: 0;
  color: var(--gan-cream);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.6rem, 5vw, 5.8rem);
  font-weight: 400;
  line-height: 1;
}

.gan-exhibitions-empty a {
  width: max-content;
  margin-top: 34px;
  color: var(--gan-cream);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.gan-reveal {
  opacity: 0;
  transform: translate3d(-48px, 28px, 0);
  transition: opacity 1s ease, transform 1.15s cubic-bezier(.2,.7,.2,1);
}

.gan-reveal.is-reverse { transform: translate3d(48px, 28px, 0); }
.gan-reveal.is-visible { opacity: 1; transform: translate3d(0, 0, 0); }

/* Keep Astra's transparent archive header legible on the brown intro. */
body.post-type-archive-gan_sergi #masthead .site-logo-img img,
body.post-type-archive-gan_sergi #masthead img.custom-logo {
  opacity: 1 !important;
  filter: brightness(0) saturate(100%) invert(93%) sepia(25%) saturate(633%) hue-rotate(333deg) brightness(109%) contrast(102%) drop-shadow(0 1px 8px rgba(51, 40, 34, .14)) !important;
}

body.post-type-archive-gan_sergi #masthead .menu-toggle,
body.post-type-archive-gan_sergi #masthead .main-header-menu-toggle {
  color: var(--gan-cream) !important;
  background: transparent !important;
  opacity: 1 !important;
}

body.post-type-archive-gan_sergi #masthead .menu-toggle:hover,
body.post-type-archive-gan_sergi #masthead .menu-toggle:focus-visible {
  color: #fff5e5 !important;
}

body.post-type-archive-gan_sergi #masthead .menu-toggle svg,
body.post-type-archive-gan_sergi #masthead .main-header-menu-toggle svg {
  fill: currentColor !important;
  filter: drop-shadow(0 1px 7px rgba(51, 40, 34, .16));
}

/* Custom Galeri AN header used by the archive template. */
body.post-type-archive-gan_sergi .gan-exhibitions-header .hks-site-logo img {
  opacity: 1 !important;
  filter: brightness(0) invert(1) drop-shadow(0 1px 8px rgba(51, 40, 34, .14)) !important;
}

body.post-type-archive-gan_sergi .gan-exhibitions-header .hks-menu-toggle span {
  background-color: #fffaf2 !important;
  opacity: 1 !important;
  box-shadow: 0 1px 7px rgba(51, 40, 34, .16);
}

body.post-type-archive-gan_sergi .gan-exhibitions-header .hks-menu-toggle:hover span,
body.post-type-archive-gan_sergi .gan-exhibitions-header .hks-menu-toggle:focus-visible span {
  background-color: #ffffff !important;
}

/* One consistent gallery-style header strip across all custom pages. */
body .hks-site-header,
body .hks-about-header {
  position: sticky !important;
  inset: auto !important;
  top: 0 !important;
  z-index: 10000 !important;
  width: 100% !important;
  height: 94px !important;
  min-height: 94px !important;
  padding: 0 clamp(28px, 4.1vw, 78px) !important;
  background: #70594d !important;
  box-shadow: 0 1px 0 rgba(255, 250, 242, .09) !important;
}

body.admin-bar .hks-site-header,
body.admin-bar .hks-about-header {
  top: 32px !important;
}

body .hks-site-header .hks-site-logo img,
body .hks-about-header .hks-site-logo img {
  width: auto !important;
  height: 66px !important;
  max-height: 66px !important;
  opacity: 1 !important;
  filter: brightness(0) invert(1) drop-shadow(0 1px 7px rgba(51, 40, 34, .12)) !important;
}

body .hks-site-header .hks-menu-toggle,
body .hks-about-header .hks-menu-toggle {
  color: #fffaf2 !important;
  background: transparent !important;
  opacity: 1 !important;
}

body .hks-site-header .hks-menu-toggle span,
body .hks-about-header .hks-menu-toggle span {
  background-color: #fffaf2 !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

body .hks-site-header .hks-menu-toggle:hover span,
body .hks-site-header .hks-menu-toggle:focus-visible span,
body .hks-about-header .hks-menu-toggle:hover span,
body .hks-about-header .hks-menu-toggle:focus-visible span {
  background-color: #ffffff !important;
}

/* Win against the page-specific inline styles used by Home and About. */
html body .hks-portfolyo > .hks-site-header,
html body.page-id-14 .hks-about-page > .hks-about-header,
html body.post-type-archive-gan_sergi .gan-exhibitions-page > .gan-exhibitions-header {
  position: sticky !important;
  inset: auto !important;
  top: 0 !important;
  width: 100% !important;
  height: 94px !important;
  min-height: 94px !important;
  background: #70594d !important;
}

html body.admin-bar .hks-portfolyo > .hks-site-header,
html body.admin-bar.page-id-14 .hks-about-page > .hks-about-header,
html body.admin-bar.post-type-archive-gan_sergi .gan-exhibitions-page > .gan-exhibitions-header {
  top: 32px !important;
}

html body .hks-portfolyo .hks-site-header .hks-menu-toggle > span,
html body.page-id-14 .hks-about-page .hks-about-header .hks-menu-toggle > span,
html body.post-type-archive-gan_sergi .gan-exhibitions-page .gan-exhibitions-header .hks-menu-toggle > span {
  background-color: #fffaf2 !important;
}

body.post-type-archive-gan_sergi .gan-exhibitions-intro {
  padding-top: clamp(58px, 7vw, 96px);
}

@media (max-width: 900px) {
  .gan-exhibition-row,
  .gan-exhibition-row.is-reverse {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .gan-exhibition-row .gan-exhibition-copy,
  .gan-exhibition-row.is-reverse .gan-exhibition-copy { order: 1; }

  .gan-exhibition-row .gan-exhibition-images,
  .gan-exhibition-row.is-reverse .gan-exhibition-images {
    order: 2;
    min-height: clamp(330px, 70vw, 620px);
  }

  .gan-exhibition-copy { min-height: 320px; }
}

@media (max-width: 620px) {
  body .hks-site-header,
  body .hks-about-header {
    height: 76px !important;
    min-height: 76px !important;
    padding-inline: 22px !important;
  }

  body.admin-bar .hks-site-header,
  body.admin-bar .hks-about-header { top: 46px !important; }

  html body .hks-portfolyo > .hks-site-header,
  html body.page-id-14 .hks-about-page > .hks-about-header,
  html body.post-type-archive-gan_sergi .gan-exhibitions-page > .gan-exhibitions-header {
    height: 76px !important;
    min-height: 76px !important;
  }

  body .hks-site-header .hks-site-logo img,
  body .hks-about-header .hks-site-logo img {
    height: 56px !important;
    max-height: 56px !important;
  }

  html body.admin-bar .hks-portfolyo > .hks-site-header,
  html body.admin-bar.page-id-14 .hks-about-page > .hks-about-header,
  html body.admin-bar.post-type-archive-gan_sergi .gan-exhibitions-page > .gan-exhibitions-header {
    top: 46px !important;
  }

  .gan-exhibitions-intro { min-height: 32vh; padding: 54px 22px 44px; }
  .gan-exhibitions-intro h1 { font-size: clamp(3.5rem, 18vw, 5.4rem); }
  .gan-exhibition-copy { min-height: 300px; padding: 42px 24px; }
  .gan-exhibition-copy h2 { font-size: clamp(2.6rem, 12vw, 4rem); }
  .gan-exhibition-description { -webkit-line-clamp: 3; }

  .gan-exhibition-images,
  .gan-exhibition-images.count-2,
  .gan-exhibition-images.count-3 {
    grid-template-columns: 1.1fr .9fr;
    grid-template-rows: 1.08fr .92fr;
  }

  .gan-exhibition-images.count-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .gan-exhibition-images.count-3 figure:first-child { grid-row: 1 / span 2; }
  .gan-exhibition-images.count-4 figure:first-child { grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
  .gan-reveal { opacity: 1; transform: none; transition: none; }
  .gan-exhibition-images img,
  .gan-exhibition-download span { transition: none; }
}
