.overlay--shadow .image-placeholder {
    background: black;
}

.overlay--shadow .image-placeholder img {
    opacity: 0.8;
    will-change: opacity;
}

#gallery,
#image,
#video,
#text,
#quote,
#list {
    margin-bottom: var(--row-gap);
}

#heading {
    margin-bottom: var(--row-gap-small);
}

.footnote-ref {
    top: -7px;
    font-size: 16px;
    z-index: 9;
}

.footnote-ref::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: transparent;
  z-index: -1;
  border-radius: 50%;
}

#image.smaller {
    width: 80%;
}

/* ============================================= */
/* GALLERY */
/* ============================================= */

:root {
    --gallery-gap: 2rem;
    --gallery-medium-width: 50%;
    --gallery-small-width: 9rem;
    --gallery-small-height: 7rem;
}
#gallery {
    display: flex;
    flex-direction: row;
    margin: 0 -6rem var(--row-gap) -6rem;
    justify-content: center;
    gap: var(--main-padding);
}

#gallery.vertical {
    flex-direction: column;
    margin: 0 0 var(--row-gap) 0;
    align-items: center;
}

.gallery--picture {
    width: 50%;
}

.vertical .gallery--picture {
    width: 80%;
}

.gallery--picture img {
    height: 100%;
    object-fit: cover;
}

#gallery + figcaption {
    margin: calc(var(--row-gap) * -1) 0 var(--row-gap) 0 !important;
}

/* Stack direction */
#gallery.horizontal {
    flex-direction: row;
}

/* Horizontal alignment */
#gallery.left {
    justify-content: flex-start;
}
#gallery.center {
    justify-content: center;
}

#gallery.gallerySize-medium > div {
    width: var(--gallery-medium-width);
    height: auto;
}

#gallery.gallerySize-small > div {
    max-width: var(--gallery-small-width);
    max-height: var(--gallery-small-height);
}

/* ============================================= */
/* Page fine-tunes */
/* ============================================= */

[data-template="essay"] #heading {
    margin-bottom: var(--row-gap);
}

#quote:not(:first-child),
#quote:not(:last-child) {
    margin: -2.5rem 0 1rem 3rem;
}

.quote-footer {
    font-style: normal;
}

#essayHead {
    z-index: 8;
}

#footnote-modal {
    position: fixed;
    inset: 0;
    background: rgba(85, 76, 44, 0.2);
    align-items: center;
    justify-content: center;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    background: rgb(255 247 232 / 60%);
    /* background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--essay-color, #fffbec) 15%,
    var(--essay-color, #fffbec) 85%,
    transparent 100%
    ); */
}

#footnote-modal.active {
  opacity: 1;
  pointer-events: auto;
}

#footnote-modal .footnote-modal-content {
  position: fixed;
  top: 50vh;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
  to bottom,
  transparent 0%,
  var(--essay-color, #fffbec) 30%,
  var(--essay-color, #fffbec) 70%,
  transparent 100%
);
  color: var(--c-darker, #222);
  /* box-shadow: 0 8px 32px rgba(0,0,0,0.15); */
  /* overflow: auto; */
  opacity: 0;
  transition: opacity 0.7s;
  padding: 140px 0;
}

#footnote-modal.active .footnote-modal-content {
    opacity: 1;
    transition: opacity 0.7s;
}

.footnote-modal-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--c-darker, #222);
    margin-bottom: 1rem;
    text-align: left;
    grid-column: 5 / span 1;
  }
.footnote-modal-text {
grid-column: 6 / -6;
text-align: center;
}

.footnote-modal-number,
.footnote-modal-text {
font-family: inherit;
font-size: inherit;
line-height: inherit;
font-weight: inherit;
font-style: inherit;
}

.footnote-ref {
cursor: pointer;
}

.footnote-list {
    display: flex;
    flex-direction: column;
    /* gap: .5rem; */
    /* width: calc(100% - 23px); */
    /* padding-right: 8rem; */
    transform: translateX(-19px);
    margin-bottom: 4rem;
}

body[data-template="about"] #gallery {
    grid-column: 9 / -9;
    gap: 1.5rem;
}

body[data-template="about"] #gallery .gallery--picture {
   max-width: 50%;
}

.footnote-list li {
    text-indent: 0;
    padding-left: 20px; /* Adjust for more space */
}

  @media (hover: hover) {
    .footnote-ref:hover {
        opacity: .5;
        transition: opacity 0.2s ease-in-out;
      }
}
