/* ==========================================================================
   SevaPopup.css - liquid "Seva First Challenge" header button + two popups
   (gallery of documents  ->  enlarged viewer). Load AFTER DefaultPolish.css.
   To remove the feature: delete the <link> to this file, SevaPopup.js and the
   #sevaModal / #sevaViewer markup at the end of Default.aspx.
   ========================================================================== */

:root {
  --sv-navy: #0d2b5e;
  --sv-navy-deep: #06183a;
  --sv-gold: #e8c547;
  --sv-gold-deep: #a8842a;
  --sv-red: #c0281f;
  --sv-red-deep: #8f1d17;
  --sv-ease: cubic-bezier(.22, 1, .36, 1);
  /* soft pastel palette for the popups */
  --sv-ink: #34445f;
  --sv-ink-soft: #6b7a93;
  --sv-line: #dde5f2;
  --sv-gold-soft: #e6d097;
  --sv-accent: #7f9bd0;
}

/* ======================= 1. THE LIQUID HEADER BUTTON ======================= */
.seva-action-row .seva-liquid-btn {
  position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
  appearance: none; -webkit-appearance: none; font-family: inherit;
  background: linear-gradient(135deg, #d12e24 0%, #a81f18 100%) !important;
  border: 1.5px solid var(--sv-gold) !important;
  border-radius: 999px !important;
  padding: 8px 18px 8px 12px !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(179, 38, 30, .38), inset 0 1px 0 rgba(255, 255, 255, .28) !important;
  transition: transform .35s var(--sv-ease), box-shadow .35s var(--sv-ease);
  -webkit-tap-highlight-color: transparent;
}
.seva-action-row .seva-liquid-btn:hover { background: linear-gradient(135deg, #d12e24 0%, #a81f18 100%) !important; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(179, 38, 30, .5), 0 0 0 4px rgba(232, 197, 71, .22), inset 0 1px 0 rgba(255, 255, 255, .3) !important; }
.seva-action-row .seva-liquid-btn:active { transform: translateY(0) scale(.97); }
.seva-liquid-btn:focus-visible { outline: 2px solid var(--sv-gold); outline-offset: 3px; }

/* the liquid: two big rounded squares rotating inside the pill; they rise on hover */
.seva-liquid-btn .slb-liquid { position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; overflow: hidden; }
.seva-liquid-btn .slb-liquid i {
  position: absolute; left: -35%; width: 170%; aspect-ratio: 1; top: 68%;
  border-radius: 43%;
  background: rgba(232, 197, 71, .55);
  animation: slbSpin 7s linear infinite;
  transition: top .8s var(--sv-ease);
}
.seva-liquid-btn .slb-liquid i:nth-child(2) { background: rgba(255, 255, 255, .22); border-radius: 40%; animation-duration: 11s; animation-direction: reverse; top: 74%; }
.seva-liquid-btn:hover .slb-liquid i:nth-child(1) { top: -30%; background: rgba(232, 197, 71, .9); }
.seva-liquid-btn:hover .slb-liquid i:nth-child(2) { top: -22%; }
.seva-liquid-btn .slb-main, .seva-liquid-btn .slb-eyebrow { transition: color .4s; }
.seva-liquid-btn:hover .slb-main { color: var(--sv-navy-deep); }
.seva-liquid-btn:hover .slb-eyebrow { color: #7a1510; }
.seva-liquid-btn:hover .slb-ico { background: var(--sv-navy-deep); border-color: var(--sv-navy-deep); }
@keyframes slbSpin { to { transform: rotate(360deg); } }

/* gloss sweep + soft attention pulse */
.seva-liquid-btn::before {
  content: ''; position: absolute; z-index: 0; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: slbShine 3.6s ease-in-out infinite; pointer-events: none;
}
@keyframes slbShine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.seva-liquid-btn::after {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; z-index: -2; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(232, 197, 71, .6); animation: slbPulse 2.4s ease-out infinite;
}
@keyframes slbPulse { 0% { box-shadow: 0 0 0 0 rgba(232, 197, 71, .55); } 70%, 100% { box-shadow: 0 0 0 12px rgba(232, 197, 71, 0); } }

.seva-liquid-btn .slb-ico { position: relative; z-index: 2; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); color: var(--sv-gold); font-size: .72rem; flex: none; }
.seva-liquid-btn .slb-ico i { animation: slbGlow 1.6s ease-in-out infinite; }
@keyframes slbGlow { 50% { text-shadow: 0 0 10px #fff; transform: scale(1.18); } }
.seva-liquid-btn .slb-label { position: relative; z-index: 2; display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.05; text-align: left; }
.seva-liquid-btn .slb-eyebrow { font-size: .46rem; font-weight: 700; letter-spacing: 1.6px; color: var(--sv-gold); text-transform: uppercase; }
.seva-liquid-btn .slb-main { font-size: .78rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.seva-liquid-btn .slb-new { position: relative; z-index: 2; margin-left: 2px; font-size: .5rem; font-weight: 800; letter-spacing: 1px; padding: 2px 6px; border-radius: 99px; background: var(--sv-gold); color: var(--sv-navy-deep); animation: slbBlink 1.2s ease-in-out infinite; }
@keyframes slbBlink { 50% { opacity: .45; } }

/* click ripple (JS) */
.slb-rip { position: absolute; z-index: 1; pointer-events: none; border-radius: 50%; background: rgba(255, 255, 255, .55); transform: scale(0); animation: slbRip .75s var(--sv-ease) forwards; }
@keyframes slbRip { to { transform: scale(1); opacity: 0; } }

/* ======================= 2. SHARED POPUP SHELL (soft pastel theme) ======================= */
html.sv-lock, html.sv-lock body { overflow: hidden !important; }

.sv-modal {
  position: fixed; inset: 0; z-index: 100010; display: grid; place-items: center;
  padding: 18px; visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.sv-modal.sv-open { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .4s ease; }
#svViewer { z-index: 100020; }

.sv-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(1100px 650px at 12% 8%, rgba(244, 201, 196, .55), transparent 60%),
              radial-gradient(1000px 700px at 92% 92%, rgba(243, 226, 179, .55), transparent 60%),
              rgba(214, 224, 242, .78);
  -webkit-backdrop-filter: blur(8px) saturate(1.05); backdrop-filter: blur(8px) saturate(1.05);
}

.sv-panel {
  position: relative; width: min(1120px, 100%); max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px);
  display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  border-radius: 28px; color: var(--sv-ink);
  background: linear-gradient(160deg, #fffdf9 0%, #f4f7fd 55%, #ebf1fa 100%);
  border: 1px solid rgba(201, 178, 112, .45);
  box-shadow: 0 30px 70px -24px rgba(60, 80, 125, .35), 0 0 0 1px rgba(255, 255, 255, .8) inset;
  transform: translateY(40px) scale(.94); opacity: 0;
  transition: transform .65s var(--sv-ease), opacity .45s ease;
}
.sv-open > .sv-panel { transform: none; opacity: 1; }

/* drifting pastel blobs behind the content */
.sv-aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sv-aurora b { position: absolute; width: 420px; height: 420px; filter: blur(70px); opacity: .5; border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%; animation: svDrift 14s ease-in-out infinite alternate; }
.sv-aurora b:nth-child(1) { background: #f6d3cf; left: -120px; top: -140px; }
.sv-aurora b:nth-child(2) { background: #f6e8bd; right: -140px; bottom: -160px; animation-delay: -5s; opacity: .55; }
.sv-aurora b:nth-child(3) { background: #c6d8f3; left: 40%; top: 35%; width: 320px; height: 320px; animation-delay: -9s; opacity: .45; }
@keyframes svDrift { 0% { transform: translate(0, 0) rotate(0) scale(1); } 100% { transform: translate(60px, 40px) rotate(60deg) scale(1.2); } }

/* liquid close button (used in both popups) */
.sv-close {
  position: absolute; top: 16px; right: 16px; z-index: 5; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; overflow: hidden; isolation: isolate;
  border: 1.5px solid var(--sv-gold-soft); color: var(--sv-gold-deep); font-size: 1.05rem; padding: 0;
  background: linear-gradient(135deg, #ffffff, #f6efdc);
  box-shadow: 0 6px 16px rgba(60, 80, 125, .18);
  transition: transform .5s var(--sv-ease), color .3s;
}
.sv-close i { position: relative; z-index: 2; transition: transform .5s var(--sv-ease); }
.sv-close .slb-liquid { position: absolute; inset: 0; z-index: 0; border-radius: 50%; overflow: hidden; pointer-events: none; }
.sv-close .slb-liquid i { position: absolute; left: -40%; width: 180%; aspect-ratio: 1; top: 130%; border-radius: 42%; background: var(--sv-gold-soft); animation: slbSpin 6s linear infinite; transition: top .7s var(--sv-ease); }
.sv-close:hover { color: #4a3a10; transform: scale(1.08); }
.sv-close:hover .slb-liquid i { top: -25%; }
.sv-close:hover > i { transform: rotate(180deg); }
.sv-close:focus-visible { outline: 2px solid var(--sv-accent); outline-offset: 3px; }

/* ======================= 3. GALLERY POPUP ======================= */
.sv-head { padding: 30px 84px 6px 34px; }
.sv-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .68rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--sv-gold-deep); }
.sv-eyebrow::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--sv-gold-soft); box-shadow: 0 0 0 0 rgba(216, 188, 122, .7); animation: slbPulse 2s ease-out infinite; }
.sv-title { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: clamp(1.7rem, 3.6vw, 2.7rem); line-height: 1.1; margin: 8px 0 6px; background: linear-gradient(100deg, #27406e 30%, #b8932f 60%, #27406e 90%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: svTitle 7s linear infinite; }
@keyframes svTitle { to { background-position: -200% 0; } }
.sv-sub { margin: 0; color: var(--sv-ink-soft); font-size: .92rem; line-height: 1.55; max-width: 62ch; }

.sv-body { padding: 18px 34px 8px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; padding-bottom: 14px; }

.sv-card {
  position: relative; display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; cursor: pointer;
  padding: 10px 10px 14px; border-radius: 20px; overflow: hidden; isolation: isolate;
  background: rgba(255, 255, 255, .78); border: 1px solid var(--sv-line);
  box-shadow: 0 8px 22px -14px rgba(60, 80, 125, .3);
  opacity: 0; transform: translateY(30px);
  transition: transform .5s var(--sv-ease), border-color .3s, box-shadow .4s, background .3s;
}
.sv-open .sv-card { animation: svCardIn .8s var(--sv-ease) forwards; }
.sv-open .sv-card:nth-child(1) { animation-delay: .18s; } .sv-open .sv-card:nth-child(2) { animation-delay: .3s; } .sv-open .sv-card:nth-child(3) { animation-delay: .42s; } .sv-open .sv-card:nth-child(4) { animation-delay: .54s; }
@keyframes svCardIn { to { opacity: 1; transform: none; } }
.sv-card:hover, .sv-card:focus-visible { transform: translateY(-6px); border-color: var(--sv-gold-soft); background: #fff; box-shadow: 0 22px 40px -18px rgba(60, 80, 125, .35), 0 0 26px rgba(216, 188, 122, .22); outline: none; }

.sv-frame { position: relative; aspect-ratio: 4 / 3; border-radius: 13px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--sv-line); }
.sv-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform 1s var(--sv-ease); }
.sv-card:hover .sv-frame img { transform: scale(1.07); }
.sv-frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 82%, rgba(120, 140, 180, .14)); pointer-events: none; }
.sv-zoom { position: absolute; z-index: 2; right: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sv-gold-soft); color: #4a3a10; font-size: .85rem; transform: scale(.4) rotate(-90deg); opacity: 0; transition: transform .5s var(--sv-ease), opacity .3s; box-shadow: 0 6px 14px rgba(60, 80, 125, .25); }
.sv-card:hover .sv-zoom, .sv-card:focus-visible .sv-zoom { transform: none; opacity: 1; }
.sv-num { position: absolute; z-index: 2; left: 10px; top: 10px; font-size: .62rem; font-weight: 800; letter-spacing: 1.5px; padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, .92); color: var(--sv-gold-deep); border: 1px solid rgba(201, 178, 112, .55); }

.sv-meta { padding: 14px 8px 0; display: flex; flex-direction: column; gap: 4px; }
.sv-tag { font-size: .6rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--sv-gold-deep); }
.sv-name { font-size: 1.02rem; font-weight: 700; line-height: 1.3; color: var(--sv-navy); }
.sv-date { font-size: .78rem; color: var(--sv-ink-soft); }
.sv-view { margin-top: 10px; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; position: relative; overflow: hidden; isolation: isolate; padding: 8px 16px; border-radius: 99px; font-size: .72rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #5a4512; background: #f4e7bd; transition: color .3s, box-shadow .4s; }
.sv-view .slb-liquid { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; }
.sv-view .slb-liquid i { position: absolute; left: -40%; width: 180%; aspect-ratio: 1; top: 130%; border-radius: 42%; background: #fff9e6; animation: slbSpin 6s linear infinite; transition: top .7s var(--sv-ease); }
.sv-card:hover .sv-view .slb-liquid i, .sv-card:focus-visible .sv-view .slb-liquid i { top: -35%; }
.sv-card:hover .sv-view { box-shadow: 0 0 20px rgba(216, 188, 122, .5); }

.sv-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 14px 34px 24px; border-top: 1px solid var(--sv-line); margin-top: 6px; }
.sv-foot p { margin: 0; font-size: .8rem; color: var(--sv-ink-soft); }
.sv-foot strong { color: var(--sv-gold-deep); }

/* shared liquid action pill (footer + viewer toolbar) */
.sv-pill { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 99px; border: 1.5px solid var(--sv-gold-soft); font: inherit; font-size: .74rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; text-decoration: none; cursor: pointer; color: #34507f; background: rgba(255, 255, 255, .8); transition: color .35s, transform .35s var(--sv-ease), box-shadow .4s; }
.sv-pill .slb-liquid { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; }
.sv-pill .slb-liquid i { position: absolute; left: -40%; width: 180%; aspect-ratio: 1; top: 130%; border-radius: 42%; background: #f4e7bd; animation: slbSpin 6s linear infinite; transition: top .7s var(--sv-ease); }
.sv-pill:hover { color: #4a3a10; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(216, 188, 122, .35); }
.sv-pill:hover .slb-liquid i { top: -30%; }
.sv-pill:focus-visible { outline: 2px solid var(--sv-accent); outline-offset: 3px; }
.sv-pill.sv-solid { background: linear-gradient(135deg, #e3ecfa, #cfdef4); color: #27406e; }
.sv-pill[disabled] { opacity: .4; pointer-events: none; }

/* ======================= 4. VIEWER (ENLARGED) POPUP ======================= */
.sv-viewer-panel { width: min(1000px, 100%); height: calc(100vh - 36px); height: calc(100dvh - 36px); background: linear-gradient(160deg, #fdfcf9, #eef3fb); }
.sv-vhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 76px 14px 22px; border-bottom: 1px solid var(--sv-line); }
.sv-vtitle { flex: 1 1 220px; min-width: 0; }
.sv-vtitle small { display: block; font-size: .6rem; letter-spacing: 2.5px; text-transform: uppercase; color: var(--sv-gold-deep); font-weight: 700; }
.sv-vtitle h3 { margin: 2px 0 0; font-size: 1.05rem; font-weight: 700; line-height: 1.25; color: var(--sv-navy); }
.sv-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-tools .sv-pill { padding: 8px 14px; font-size: .68rem; }

.sv-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; place-items: start center; padding: 22px; background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .9), transparent 65%), #e9eff8; }
.sv-sheet { margin: auto; background: #fff; border-radius: 6px; box-shadow: 0 22px 44px -18px rgba(60, 80, 125, .4), 0 0 0 1px var(--sv-line); max-width: 100%; transition: opacity .35s ease, transform .5s var(--sv-ease); }
.sv-sheet img { display: block; width: 100%; height: auto; max-height: none; border-radius: 6px; }
.sv-sheet img + img { margin-top: 14px; box-shadow: 0 0 0 1px var(--sv-line); }
.sv-stage.sv-fit .sv-sheet { width: auto; }
.sv-stage.sv-fit .sv-sheet img { width: auto; max-width: 100%; max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px); }
/* Zoom = pages fill the frame width (readable size); scroll through them, scrollbar hidden */
.sv-stage.sv-wide { scrollbar-width: none; -ms-overflow-style: none; padding: 12px 12px 46px; }
.sv-stage.sv-wide::-webkit-scrollbar { display: none; }
.sv-stage.sv-wide .sv-sheet { width: min(920px, 100%); max-width: none; margin: 0 auto; }
.sv-stage.sv-wide .sv-sheet img { width: 100%; height: auto; max-height: none; }
.sv-viewer-panel { transition: width .45s var(--sv-ease), height .45s var(--sv-ease); }
#svViewer.sv-zoomed .sv-viewer-panel { width: 100%; height: calc(100vh - 20px); height: calc(100dvh - 20px); }
#svViewer.sv-zoomed .sv-modal, #svViewer.sv-zoomed { padding: 10px; }
.sv-sheet.sv-swap { opacity: 0; transform: scale(.97); }

.sv-nav { position: absolute; z-index: 4; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; border: 1.5px solid var(--sv-gold-soft); background: rgba(255, 255, 255, .92); color: var(--sv-gold-deep); box-shadow: 0 6px 16px rgba(60, 80, 125, .18); display: grid; place-items: center; cursor: pointer; transition: transform .4s var(--sv-ease), background .3s, color .3s; }
.sv-nav:hover { background: var(--sv-gold-soft); color: #4a3a10; transform: scale(1.1); }
.sv-nav:focus-visible { outline: 2px solid var(--sv-accent); outline-offset: 3px; }
.sv-prev { left: 14px; } .sv-next { right: 14px; }
.sv-count { position: absolute; z-index: 4; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: .7rem; font-weight: 700; letter-spacing: 2px; padding: 5px 14px; border-radius: 99px; background: rgba(255, 255, 255, .94); border: 1px solid rgba(201, 178, 112, .55); color: var(--sv-gold-deep); pointer-events: none; }

/* ======================= 5. RESPONSIVE ======================= */
@media (max-width: 880px) {
  .sv-grid { grid-template-columns: 1fr; gap: 16px; }
  .sv-frame { aspect-ratio: 16 / 10; }
}
@media (max-width: 575.98px) {
  .sv-modal { padding: 8px; }
  .sv-panel { border-radius: 22px; max-height: calc(100dvh - 16px); }
  .sv-head { padding: 22px 64px 4px 20px; }
  .sv-body { padding: 14px 16px 6px; }
  .sv-foot { padding: 12px 16px 18px; }
  .sv-close { top: 12px; right: 12px; width: 42px; height: 42px; }
  .sv-viewer-panel { height: calc(100dvh - 16px); }
  .sv-vhead { padding: 12px 62px 10px 14px; gap: 8px; }
  .sv-stage { padding: 12px; }
  .sv-nav { width: 40px; height: 40px; margin-top: -20px; }
  .sv-prev { left: 6px; } .sv-next { right: 6px; }
  .seva-liquid-btn .slb-main { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) {
  .seva-liquid-btn::before, .seva-liquid-btn::after, .slb-liquid i, .sv-aurora b, .sv-title, .sv-eyebrow::before, .seva-liquid-btn .slb-ico i, .seva-liquid-btn .slb-new { animation: none !important; }
  .sv-open .sv-card { animation-duration: .01s !important; }
  .sv-panel, .sv-card, .sv-sheet { transition-duration: .01s !important; }
}
