/* Ko-fi embed panel — shared by index + standalone articles */
:root {
  --kofi-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.kofi-sheet-open {
  overflow: hidden;
  touch-action: none;
}

.kofi-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1024;
  background: rgba(2, 10, 8, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--kofi-ease);
}

.kofi-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.kofi-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1025;
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 720px);
  height: min(78vh, 720px);
  background: linear-gradient(180deg, rgba(10, 28, 22, 0.98) 0%, rgba(4, 12, 9, 0.99) 45%);
  border: 1px solid rgba(61, 214, 232, 0.12);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -24px 64px rgba(0, 0, 0, 0.55);
  transform: translateY(105%);
  transition: transform 0.4s var(--kofi-ease);
  -webkit-overflow-scrolling: touch;
}

.kofi-sheet.open {
  transform: translateY(0);
}

.kofi-sheet-bar {
  width: 36px;
  height: 4px;
  margin: 0.45rem auto 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.kofi-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem clamp(1rem, 4vw, 1.5rem) 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.kofi-sheet-head-text {
  min-width: 0;
}

.kofi-sheet-title {
  display: block;
  font-family: var(--serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.2;
}

.kofi-sheet-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

.kofi-sheet-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.kofi-sheet-linkout {
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(61, 214, 232, 0.55);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.kofi-sheet-linkout:hover {
  color: rgba(61, 214, 232, 0.88);
}

.kofi-sheet-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.42);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.kofi-sheet-close:hover {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
}

.kofi-sheet-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0.65rem 0.5rem;
  /* AR shell only: Ko-fi’s own purple/teal/etc. inside the iframe are unchanged (cross-origin). */
  background: linear-gradient(
    180deg,
    rgba(6, 22, 18, 0.45) 0%,
    rgba(4, 14, 11, 0.82) 38%,
    rgba(3, 11, 9, 0.94) 100%
  );
  border-radius: 0 0 14px 14px;
}

.kofi-sheet-frame {
  flex: 1;
  width: 100%;
  min-height: 280px;
  border: 0;
  border-radius: 0 0 12px 12px;
  background: rgba(0, 0, 0, 0.18);
  /* Do not filter the iframe: any filter shifts Ko-fi’s brand colours. Inner page background
     can only be changed from Ko-fi’s side, not from this stylesheet. */
}

@media (min-width: 721px) {
  .kofi-sheet {
    left: 50%;
    right: auto;
    width: min(440px, 96vw);
    transform: translateX(-50%) translateY(105%);
    bottom: 0;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }

  .kofi-sheet.open {
    transform: translateX(-50%) translateY(0);
  }

  .kofi-sheet-body {
    padding: 0 0.65rem 0.65rem;
  }
}
