/* FFYF watermark — homepage & events page only */

:root,
[data-theme="light"] {
  --ffyf-wm-border: #15803d;
  --ffyf-wm-bg: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.55) 0%, transparent 52%),
    linear-gradient(145deg, #ffffff 0%, #86efac 24%, #22c55e 58%, #15803d 100%);
  --ffyf-wm-text: #ffffff;
  --ffyf-wm-text-shadow: 0 1px 3px rgba(21, 128, 61, 0.8);
  --ffyf-wm-shadow:
    0 10px 32px rgba(21, 128, 61, 0.42),
    0 4px 16px rgba(15, 23, 42, 0.2),
    0 0 0 2px #ffffff,
    0 0 0 4px #15803d;
  --ffyf-wm-shadow-hover:
    0 14px 36px rgba(21, 128, 61, 0.5),
    0 0 28px rgba(34, 197, 94, 0.4),
    0 0 0 2px #ffffff,
    0 0 0 5px #166534;
  --ffyf-wm-focus: #15803d;
}

[data-theme="dark"] {
  --ffyf-wm-border: rgba(255, 255, 255, 0.96);
  --ffyf-wm-bg: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.48) 0%, transparent 52%),
    linear-gradient(145deg, #f0fdf4 0%, #4ade80 26%, #22c55e 58%, #166534 100%);
  --ffyf-wm-text: #ffffff;
  --ffyf-wm-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  --ffyf-wm-shadow:
    0 10px 36px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(34, 197, 94, 0.38),
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 0 4px rgba(74, 222, 128, 0.55);
  --ffyf-wm-shadow-hover:
    0 14px 40px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(74, 222, 128, 0.5),
    0 0 0 2px #ffffff,
    0 0 0 5px rgba(134, 239, 172, 0.65);
  --ffyf-wm-focus: #86efac;
}

.ffyf-watermark {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  min-height: 3.25rem;
  padding: 0.55rem 0.85rem;
  border-radius: 9999px;
  border: 2px solid var(--ffyf-wm-border);
  background: var(--ffyf-wm-bg);
  color: var(--ffyf-wm-text);
  text-shadow: var(--ffyf-wm-text-shadow);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--ffyf-wm-shadow);
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

.ffyf-watermark:hover,
.ffyf-watermark:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--ffyf-wm-shadow-hover);
  outline: none;
}

.ffyf-watermark:focus-visible {
  outline: 2px solid var(--ffyf-wm-focus);
  outline-offset: 3px;
}

.ffyf-watermark--shake {
  animation: ffyfWatermarkShake 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes ffyfWatermarkShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 40%, 60%, 80% { transform: translate3d(3px, 0, 0); }
}

/* Modal */
.ffyf-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ffyf-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.ffyf-modal__panel {
  width: min(100%, 42rem);
  max-height: min(88vh, 720px);
  overflow: auto;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(ellipse 90% 50% at 100% 0%, rgba(220, 38, 38, 0.18) 0%, transparent 55%),
    linear-gradient(160deg, #111827 0%, #05080f 100%);
  color: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.ffyf-modal.is-open .ffyf-modal__panel {
  transform: translateY(0) scale(1);
}

.ffyf-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.35rem 0;
}

.ffyf-modal__eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(248, 113, 113, 0.95);
  margin-bottom: 0.35rem;
}

.ffyf-modal__title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

.ffyf-modal__tagline {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: rgba(248, 113, 113, 0.95);
}

.ffyf-modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.ffyf-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ffyf-modal__body {
  padding: 1.25rem 1.35rem 1.5rem;
}

.ffyf-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 1rem;
}

.ffyf-modal__countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.ffyf-modal__countdown-unit {
  text-align: center;
  padding: 0.55rem 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}

.ffyf-modal__countdown-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
}

.ffyf-modal__countdown-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.ffyf-modal__dress {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  margin-bottom: 1.15rem;
}

.ffyf-modal__dress-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.ffyf-modal__dress-dot--white { background: #fff; }
.ffyf-modal__dress-dot--green { background: #16a34a; }

.ffyf-modal__grid {
  display: grid;
  gap: 1.15rem;
}

@media (min-width: 640px) {
  .ffyf-modal__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ffyf-modal__label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.35rem;
}

.ffyf-modal__text {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.ffyf-modal__topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.ffyf-modal__topic {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
}

.ffyf-modal__topic::before {
  content: "";
  flex-shrink: 0;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.35rem;
  border-radius: 9999px;
  background: #ef4444;
}

.ffyf-modal__scripture {
  margin: 0.85rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(239, 68, 68, 0.55);
  font-style: italic;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.72);
}

.ffyf-modal__scripture-ref {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(248, 113, 113, 0.95);
}

.ffyf-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ffyf-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.ffyf-modal__btn--primary {
  background: #dc2626;
  color: #fff;
}

.ffyf-modal__btn--primary:hover {
  background: #ef4444;
}

.ffyf-modal__btn--secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .ffyf-watermark--shake {
    animation: none;
  }

  .ffyf-modal,
  .ffyf-modal__panel {
    transition: none;
  }
}
