/* ============================================================
   MODAL OVERLAY — class-based open/close (v4.0.0)
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,20,35,.75); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all .3s var(--ease); padding: 20px; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal { background: var(--wh); border-radius: 16px; width: 100%; max-width: 780px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(30,58,82,.45); transform: translateY(20px); transition: transform .35s var(--ease); position: relative; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-head { background: var(--pb); padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2; border-radius: 16px 16px 0 0; }
.modal-head h2,
.modal-head h3 { font-family: var(--ft); font-size: 1.4rem; text-transform: uppercase; letter-spacing: .5px; color: var(--wh); margin: 0; }
.modal-close { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15); border: none; color: var(--wh); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.modal-close:hover { background: rgba(255,255,255,.3); }
.modal-body { padding: 28px; font-family: var(--fb); font-size: .9rem; color: var(--ch); line-height: 1.75; }
.modal-body p { margin: 0 0 14px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body ul, .modal-body ol { margin: 0 0 14px 1.3em; padding: 0; }
.modal-body li { margin-bottom: 7px; }
.modal-body li:last-child { margin-bottom: 0; }
.modal-body strong, .modal-body b { font-weight: 700; color: var(--pb); }
.modal-body a:not(.btn) { color: var(--pb); text-decoration: underline; text-underline-offset: 2px; }
.modal-body a:not(.btn):hover { color: var(--db); }
.modal-body h2, .modal-body h3, .modal-body h4 { font-family: var(--ft); text-transform: uppercase; letter-spacing: .3px; color: var(--pb); margin: 20px 0 10px; line-height: 1; }
.modal-body h2 { font-size: 1.4rem; }
.modal-body h3 { font-size: 1.15rem; }
.modal-body h4 { font-size: 1rem; }

/* ============================================================
   CHURCHSUITE EVENT MODAL
   ============================================================ */
.cs-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.cs-modal[aria-hidden="false"] { display: flex; }
.cs-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}
.cs-modal__wrap {
  position: relative;
  width: 90vw;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
}
.cs-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}
.cs-modal__close:hover { background: rgba(0,0,0,0.6); }
.cs-modal__img {
  width: 100%;
  height: 220px;
  background-size: cover;
  background-position: center;
  border-radius: 12px 12px 0 0;
}
.cs-modal__body { padding: 24px 28px 28px; }
.cs-modal__date {
  font-family: var(--fb);
  font-size: 0.85rem;
  color: var(--sb);
  margin: 0 0 4px;
}
.cs-modal__title {
  font-family: var(--ft);
  font-size: 1.6rem;
  text-transform: uppercase;
  color: var(--db);
  margin: 0 0 12px;
  line-height: 1.15;
}
.cs-modal__meta {
  font-family: var(--fb);
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 16px;
}
.cs-modal__desc {
  font-family: var(--fb);
  font-size: 0.9rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 20px;
}
.cs-modal__desc p { margin: 0 0 8px; }
.cs-modal__btn {
  display: inline-block;
  font-family: var(--fb);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--pb);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
}
.cs-modal__btn:hover { background: var(--db); }

@media (max-width: 600px) {
  .cs-modal__wrap { width: 95vw; max-height: 90vh; }
  .cs-modal__img { height: 160px; }
  .cs-modal__body { padding: 16px 20px 20px; }
  .cs-modal__title { font-size: 1.3rem; }
}

/* ============================================================
   VIDEO MODAL
   ============================================================ */
.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.video-modal[aria-hidden="false"] { display: flex; }
.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}
.video-modal__wrap {
  position: relative;
  width: 90vw;
  max-width: 960px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
}
.video-modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.video-modal__close:hover { opacity: 0.7; }
.video-modal__frame {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}
.video-modal__frame iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

/* Booking embed modal */
.booking-embed iframe {
  width: 100%;
  border: none;
  min-height: 400px;
}

/* Large modal variant (Gift Aid, full-page embeds) */
.modal--lg { max-width: 900px; }

/* Modal empty state */
.modal-empty {
  padding: 48px 24px; text-align: center;
  font-family: var(--fb); font-size: .9rem; color: var(--sb); line-height: 1.7;
}
.modal-empty a { color: var(--pb); font-weight: 700; text-decoration: none; }
.modal-empty a:hover { text-decoration: underline; }

/* ── Modal responsive ── */
@media (max-width: 768px) {
  .modal { border-radius: 10px; }
}
@media (max-width: 480px) {
  .modal { border-radius: 10px; }
}

/* ============================================================
   GLOBAL YOUTUBE MODAL — intercepts YouTube links site-wide
   ============================================================ */
.cove-yt-modal { display: none; position: fixed; inset: 0; z-index: 10000; align-items: center; justify-content: center; }
.cove-yt-modal[aria-hidden="false"] { display: flex; }
.cove-yt-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.88); cursor: pointer; }
.cove-yt-modal__wrap { position: relative; width: 92vw; max-width: 1040px; z-index: 1; animation: coveYtFade .25s ease; }
@keyframes coveYtFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.cove-yt-modal__close { position: absolute; top: -44px; right: 0; background: none; border: none; color: #fff; font-size: 2rem; line-height: 1; padding: 4px 8px; cursor: pointer; opacity: .85; transition: opacity .2s; }
.cove-yt-modal__close:hover { opacity: 1; }
.cove-yt-modal__frame { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 18px 56px rgba(30,58,82,.55); background: #000; }
.cove-yt-modal__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 600px) {
  .cove-yt-modal__wrap { width: 96vw; }
  .cove-yt-modal__close { top: -38px; font-size: 1.7rem; }
}
