/* Florian Luca memorial popup. Kept separate from the site's general theme. */
.fm-open {
  overflow: hidden;
}

.fm-overlay,
.fm-overlay * {
  box-sizing: border-box;
}

.fm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(255, 255, 255, 0.88);
}

.fm-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
  width: min(1180px, 94vw);
  height: min(800px, 86vh);
  min-height: 470px;
  overflow: hidden;
  color: #0a0a0a;
  background: #fff;
  border: 3px solid #000;
  border-radius: 0;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
}

.fm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 2px solid #000;
  border-radius: 0;
  color: #000;
  background: #fff;
  font: 400 30px/1 Arial, sans-serif;
  cursor: pointer;
}

.fm-close:hover,
.fm-close:focus-visible {
  color: #fff;
  background: #000;
  outline: none;
}

.fm-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 84px 0 32px;
  border-right: 2px solid #000;
  background: #fff;
}

.fm-tab {
  width: 100%;
  margin: 0;
  padding: 18px 22px;
  border: 0;
  border-top: 1px solid #000;
  border-radius: 0;
  color: #000;
  background: #fff;
  font: 600 0.88rem/1.35 Arial, sans-serif;
  letter-spacing: 0.035em;
  text-align: left;
  cursor: pointer;
}

.fm-tab:last-child {
  border-bottom: 1px solid #000;
}

.fm-tab:hover,
.fm-tab:focus-visible,
.fm-tab[aria-selected="true"] {
  color: #fff;
  background: #000;
  outline: none;
}

.fm-content {
  min-width: 0;
  overflow-y: auto;
  padding: clamp(70px, 8vw, 104px) clamp(28px, 6vw, 88px) 64px;
  scrollbar-color: #000 #fff;
}

.fm-content[aria-busy="true"] {
  opacity: 0.55;
}

.fm-panel {
  max-width: 780px;
  margin: 0 auto;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.16rem);
  line-height: 1.75;
}

.fm-panel > :first-child {
  margin-top: 0;
}

.fm-panel h1,
.fm-panel h2,
.fm-panel h3 {
  color: #000;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.15;
}

.fm-panel h1 {
  margin: 34px 0 24px;
  font-size: clamp(2rem, 1.45rem + 2vw, 3.6rem);
  letter-spacing: -0.025em;
}

.fm-panel p {
  margin: 0 0 1.2em;
}

.fm-panel a {
  color: #000;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.fm-panel img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
  filter: grayscale(100%);
}

.fm-panel--team > p:first-of-type img,
.fm-panel--team > img:first-child {
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  object-position: center 35%;
  border-bottom: 3px solid #000;
}

.fm-panel--team > p:first-of-type:has(img) {
  margin-bottom: 0;
}

.fm-panel--family > p:first-of-type:has(img) {
  float: right;
  width: min(48%, 360px);
  margin: 0 0 30px 42px;
}

.fm-panel--family > p:first-of-type img,
.fm-panel--family > img:first-child {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border: 2px solid #000;
  filter: none;
}

.fm-error {
  padding-left: 18px;
  border-left: 3px solid #000;
  font-family: Arial, sans-serif;
}

@media (max-width: 720px) {
  .fm-overlay {
    padding: 8px;
  }

  .fm-dialog {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: calc(100dvh - 16px);
    min-height: 0;
  }

  .fm-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 56px 0 0;
    border-right: 0;
    border-bottom: 2px solid #000;
  }

  .fm-tab {
    display: grid;
    min-height: 62px;
    padding: 10px 8px;
    place-items: center;
    border-top: 1px solid #000;
    border-right: 1px solid #000;
    font-size: 0.7rem;
    text-align: center;
  }

  .fm-tab:last-child {
    border-right: 0;
    border-bottom: 0;
  }

  .fm-close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
  }

  .fm-content {
    padding: 38px 24px 48px;
  }

  .fm-panel--family > p:first-of-type:has(img) {
    float: none;
    width: 100%;
    margin: 0 0 28px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .fm-overlay {
    animation: fm-fade-in 180ms ease-out;
  }

  .fm-dialog {
    animation: fm-rise-in 240ms ease-out;
  }
}

@keyframes fm-fade-in {
  from { opacity: 0; }
}

@keyframes fm-rise-in {
  from { transform: translateY(10px); }
}
