/* Independent paper notes share a small, accessible fan over the photograph. */
.afhp[data-afhp-id],
.afhp-reopen[data-afhp-for] {
  --afhp-bg: #fff2a8;
  --afhp-paper-rgb: 255 242 168;
  --afhp-paper-alpha: 1;
  --afhp-text: #10232b;
  --afhp-accent: #143f32;
  box-sizing: border-box;
  color: var(--afhp-text);
  font-family: inherit;
  z-index: 1000;
}

.afhp[data-afhp-id][data-afhp-tone="yellow"] {
  --afhp-fold-rgb: 229 209 133;
}

.afhp[data-afhp-id][data-afhp-tone="sky"] {
  --afhp-fold-rgb: 180 213 232;
}

.afhp[data-afhp-id][hidden],
.afhp-reopen[data-afhp-for][hidden] {
  display: none !important;
}

.afhp[data-afhp-id] {
  position: fixed;
  display: flex;
  flex-direction: column;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  width: min(var(--afhp-width, 352px), calc(100vw - 32px));
  max-width: calc(100vw - 16px);
  height: var(--afhp-height, auto);
  max-height: 65vh;
  max-height: 65dvh;
  overflow: hidden;
  padding: 62px 27px 18px;
  background: rgb(var(--afhp-paper-rgb) / var(--afhp-paper-alpha));
  border: 1px solid rgb(16 35 43 / 14%);
  border-radius: 4px;
  box-shadow: 2px 9px 15px rgb(16 35 43 / 16%);
  text-align: left;
  line-height: 1.65;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}

.afhp[data-afhp-id] .afhp-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.afhp[data-afhp-id]::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-top: 22px solid rgb(var(--afhp-fold-rgb, 229 209 133) / var(--afhp-paper-alpha));
  border-right: 22px solid transparent;
  content: "";
  pointer-events: none;
}

.afhp[data-afhp-id][data-afhp-position="top-right"] {
  top: max(28px, env(safe-area-inset-top));
  bottom: auto;
}

body.admin-bar .afhp[data-afhp-id][data-afhp-position="top-right"] {
  top: calc(32px + max(28px, env(safe-area-inset-top)));
}

.afhp[data-afhp-id].is-visible {
  animation: afhp-appear 320ms cubic-bezier(.2, .7, .2, 1) both;
}

.afhp[data-afhp-id].is-positioned,
.afhp[data-afhp-id].is-dragging {
  animation: none;
  transform: none;
}

.afhp[data-afhp-id].is-leaving {
  animation: none;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.afhp[data-afhp-id].is-positioned.is-leaving {
  transform: none;
}

.afhp[data-afhp-id] .afhp-drag-handle {
  position: absolute;
  top: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  height: 44px;
  padding: 0;
  color: var(--afhp-text);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
}

.afhp[data-afhp-id] .afhp-drag-handle {
  left: 7px;
  right: 56px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.afhp[data-afhp-id] .afhp-stack-title {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.afhp[data-afhp-id].is-dragging .afhp-drag-handle {
  cursor: grabbing;
}

.afhp[data-afhp-id] .afhp-close > span {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  pointer-events: none;
}

.afhp[data-afhp-id] .afhp-screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.afhp[data-afhp-id] .afhp-close {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  color: var(--afhp-bg);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: 400 14px/1 sans-serif;
  cursor: pointer;
}

.afhp[data-afhp-id] .afhp-close > span {
  color: var(--afhp-accent);
  background: transparent;
  border: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

.afhp[data-afhp-id] .afhp-close:hover > span {
  transform: rotate(8deg);
}

.afhp[data-afhp-id] .afhp-label {
  margin: 0 0 14px;
  padding: 0;
  color: var(--afhp-accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .06em;
}

.afhp[data-afhp-id] .afhp-title {
  margin: 0 0 14px;
  padding: 0;
  color: var(--afhp-text);
  font-family: inherit;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.045em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.afhp[data-afhp-id] .afhp-body {
  margin: 0 0 19px;
  padding: 0;
  color: var(--afhp-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.afhp[data-afhp-id] .afhp-media {
  width: var(--afhp-image-width, 100%);
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 0;
}

.afhp[data-afhp-id] .afhp-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: var(--afhp-image-height, 180px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 3px;
}

.afhp[data-afhp-id] .afhp-label:empty,
.afhp[data-afhp-id] .afhp-title:empty,
.afhp[data-afhp-id] .afhp-body:empty {
  display: none;
  margin: 0;
}

.afhp[data-afhp-id] .afhp-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 5px 0;
  color: var(--afhp-accent);
  border: 0;
  border-top: 1px solid currentColor;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.afhp[data-afhp-id] .afhp-link span {
  flex: 0 0 auto;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  transition: transform 180ms ease;
}

.afhp[data-afhp-id] .afhp-link:hover span {
  transform: translateX(5px);
}

.afhp[data-afhp-id] .afhp-link:hover {
  color: var(--afhp-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.afhp[data-afhp-id] .afhp-day {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 7px 45px 0 0;
  padding: 0;
  color: var(--afhp-text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

.afhp[data-afhp-id] .afhp-day input {
  appearance: auto;
  -webkit-appearance: checkbox;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--afhp-accent);
  cursor: pointer;
}

.afhp[data-afhp-id] .afhp-dismiss-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  color: var(--afhp-text);
  background: transparent;
  border: 0;
  border-radius: 0 0 4px 0;
  font: 400 18px/1 sans-serif;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.afhp[data-afhp-id].is-dismissing {
  animation: none;
  transform-origin: 50% 0;
  transform: perspective(800px)
    translateY(calc(-1 * var(--afhp-peel-lift, 0px)))
    rotateX(calc(-12deg * var(--afhp-peel-progress, 0)))
    rotateZ(calc(-3deg * var(--afhp-peel-progress, 0)));
  transition: none;
  will-change: transform;
}

.afhp[data-afhp-id].is-dismissing .afhp-dismiss-handle {
  cursor: grabbing;
}

.afhp[data-afhp-id].is-peeling.is-leaving {
  transform-origin: 50% 0;
  animation: afhp-paper-peel 560ms cubic-bezier(.24, .8, .36, 1) both;
  transition: none;
  will-change: transform, opacity;
}

.afhp-reopen[data-afhp-for] {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: calc(max(28px, env(safe-area-inset-bottom)) + var(--afhp-reopen-offset, 0px));
  z-index: 1010;
  max-width: min(300px, calc(100vw - 32px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 44px;
  margin: 0;
  padding: 8px 13px;
  color: var(--afhp-text);
  background: rgb(var(--afhp-paper-rgb) / .72);
  border: 1px solid rgb(16 35 43 / 20%);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgb(16 35 43 / 10%);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: transform 160ms ease;
}

.afhp-reopen[data-afhp-for]:hover {
  transform: translateY(-2px);
}

.afhp[data-afhp-id] .afhp-drag-handle:focus-visible,
.afhp[data-afhp-id] .afhp-dismiss-handle:focus-visible,
.afhp[data-afhp-id] .afhp-link:focus-visible,
.afhp[data-afhp-id] .afhp-day input:focus-visible,
.afhp-reopen[data-afhp-for]:focus-visible {
  outline: 2px solid var(--afhp-text);
  outline-offset: 4px;
}

.afhp[data-afhp-id] .afhp-close:focus-visible {
  outline: 0;
}

.afhp[data-afhp-id] .afhp-close:focus-visible > span {
  outline: 2px solid var(--afhp-text);
  outline-offset: 4px;
}

@keyframes afhp-appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes afhp-paper-peel {
  0% {
    opacity: 1;
    transform: perspective(800px)
      translateY(calc(-1 * var(--afhp-peel-lift, 0px)))
      rotateX(calc(-12deg * var(--afhp-peel-progress, 0)))
      rotateZ(calc(-3deg * var(--afhp-peel-progress, 0)));
  }
  22% {
    opacity: 1;
    transform: perspective(800px)
      translateY(calc(-1 * var(--afhp-peel-lift, 0px) - 10%))
      rotateX(-16deg) rotateZ(-7deg);
  }
  100% {
    opacity: 0;
    transform: perspective(800px)
      translateY(min(60vh, 420px))
      rotateX(35deg) rotateZ(-18deg);
  }
}

@media (max-width: 700px) {
  .afhp[data-afhp-id] {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    padding: 62px 24px 18px;
  }

  .afhp[data-afhp-id][data-afhp-position="top-right"],
  body.admin-bar .afhp[data-afhp-id][data-afhp-position="top-right"] {
    top: auto;
    bottom: max(20px, env(safe-area-inset-bottom));
  }

  .afhp-reopen[data-afhp-for] {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--afhp-reopen-offset, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .afhp[data-afhp-id],
  .afhp[data-afhp-id].is-dismissing,
  .afhp[data-afhp-id].is-peeling.is-leaving,
  .afhp[data-afhp-id] .afhp-close > span,
  .afhp[data-afhp-id] .afhp-link span,
  .afhp-reopen[data-afhp-for] {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
