.sp-widget {
  --stfm-primary: #1d417b;
  --stfm-secondary: #ef8d2b;
  --stfm-tertiary: #0096d2;
  --sp-bg-cool: #e6f0f8;
  --sp-bg-cream: #fbfdff;
  --sp-bg-warm: #fdf6ea;
  --sp-text-dark: #1d2b4a;
  --sp-text-muted: #6d7a96;
  --stfm-heading-font: "Montserrat", sans-serif;
  --stfm-body-font: "Open Sans", sans-serif;
  --sp-gap: 2.25rem;
  --sp-edge-inset: clamp(2.25rem, 4.5vw, 5.5rem);
  --sp-track-pad-x: 0rem;
  --sp-visible: 5;
  --sp-card-ratio: 3 / 4;
  --sp-card-radius: 14px;
  position: relative;
  width: 100%;
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(140deg, #f4f9fd 0%, #fbfdff 52%, #fff8ef 100%);
  border-top: 1px solid rgba(29, 65, 123, 0.08);
  border-bottom: 1px solid rgba(29, 65, 123, 0.08);
  color: var(--sp-text-dark);
  font-family: var(--stfm-body-font);
  overflow: hidden;
}

.sp-widget *,
.sp-widget *::before,
.sp-widget *::after {
  box-sizing: border-box;
}

.sp-widget::before,
.sp-widget::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(78px);
  pointer-events: none;
  z-index: 0;
}

.sp-widget::before {
  width: 420px;
  height: 420px;
  top: -140px;
  left: 5%;
  background: var(--stfm-tertiary);
  opacity: 0.08;
}

.sp-widget::after {
  width: 520px;
  height: 520px;
  right: 10%;
  bottom: -220px;
  background: var(--stfm-secondary);
  opacity: 0.075;
}

.sp-widget > .container,
.sp-viewport,
.sp-pagination {
  position: relative;
  z-index: 1;
}

.sp-viewport {
  width: 100%;
  padding: 0 var(--sp-edge-inset);
}

.sp-track {
  display: flex;
  gap: var(--sp-gap);
  margin: 0;
  padding: 1.25rem var(--sp-track-pad-x) 1.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.sp-track::-webkit-scrollbar {
  display: none;
}

.sp-card-wrap {
  --tilt: 0deg;
  flex: 0 0 calc((100% - (var(--sp-track-pad-x) * 2) - (var(--sp-gap) * (var(--sp-visible) - 1))) / var(--sp-visible));
  position: relative;
  margin: 0;
  padding: 0.5rem 0 0.75rem;
  list-style: none;
  scroll-snap-align: start;
}

.sp-card-wrap:nth-child(4n+1) { --tilt: -1.8deg; }
.sp-card-wrap:nth-child(4n+2) { --tilt: 1.5deg; }
.sp-card-wrap:nth-child(4n+3) { --tilt: -0.9deg; }
.sp-card-wrap:nth-child(4n+4) { --tilt: 2.2deg; }

.sp-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--sp-card-ratio);
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: none;
  border-radius: var(--sp-card-radius);
  box-shadow: 0 2px 4px rgba(29, 43, 74, 0.05), 0 14px 30px rgba(29, 43, 74, 0.08);
  cursor: pointer;
  transform: rotate(var(--tilt));
  transform-origin: center 55%;
  transition: transform 0.75s cubic-bezier(.22, .61, .36, 1), box-shadow 0.6s ease;
}

.sp-card:focus-visible {
  outline: 2px solid var(--stfm-secondary);
  outline-offset: 4px;
}

.sp-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.8s cubic-bezier(.2, .9, .3, 1.15);
}

.sp-card:hover {
  box-shadow: 0 4px 8px rgba(29, 43, 74, 0.07), 0 20px 42px rgba(29, 65, 123, 0.16);
  transform: rotate(0deg) translateY(-6px);
}

.sp-card:hover img {
  transform: scale(1.05);
}

.sp-card-num {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--stfm-primary);
  color: #ffffff;
  font-family: var(--stfm-heading-font);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(29, 65, 123, 0.4);
}

.sp-card-chip {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  background: #ffffff;
  color: var(--stfm-primary);
  font-family: var(--stfm-heading-font);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(29, 43, 74, 0.18);
}

.sp-card-chip i {
  color: var(--stfm-secondary);
  font-size: 0.7rem;
}

.sp-card-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 2rem 1.1rem 1rem;
  color: #ffffff;
  background: linear-gradient(to top, rgba(12, 22, 44, 0.92) 0%, rgba(12, 22, 44, 0.68) 45%, rgba(12, 22, 44, 0) 100%);
  pointer-events: none;
}

.sp-card-date {
  margin-bottom: 0.4rem;
  color: var(--stfm-secondary);
  font-family: var(--stfm-heading-font);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sp-card-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #ffffff;
  font-family: var(--stfm-heading-font);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sp-arrow {
  position: absolute;
  top: calc(50% - 1.25rem);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: #ffffff;
  background: var(--stfm-primary);
  border: none;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(29, 65, 123, 0.35), 0 2px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.22s ease, transform 0.28s cubic-bezier(.2, .9, .3, 1.3), box-shadow 0.22s ease, opacity 0.22s ease;
}

.sp-arrow-prev { left: max(0.5rem, calc(var(--sp-edge-inset) - 1.5rem)); }
.sp-arrow-next { right: max(0.5rem, calc(var(--sp-edge-inset) - 1.5rem)); }

.sp-arrow:hover {
  background: var(--stfm-secondary);
  box-shadow: 0 12px 28px rgba(239, 141, 43, 0.42), 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%) scale(1.1) rotate(var(--sp-rotate, 0));
}

.sp-arrow-prev:hover { --sp-rotate: -6deg; }
.sp-arrow-next:hover { --sp-rotate: 6deg; }
.sp-arrow:active { transform: translateY(-50%) scale(0.97); }

.sp-arrow.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

.sp-pagination {
  display: flex;
  position: relative;
  z-index: 2;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem var(--sp-edge-inset) 0;
}

.sp-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgba(29, 65, 123, 0.18);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease, transform 0.25s cubic-bezier(.2, .9, .3, 1.3);
}

.sp-dot:hover {
  background: rgba(29, 65, 123, 0.4);
}

.sp-dot.is-active {
  width: 38px;
  background: var(--stfm-secondary);
  border-radius: 999px;
}

.sp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  opacity: 0;
  background: radial-gradient(ellipse at 15% 10%, rgba(0, 150, 210, 0.18), transparent 50%), radial-gradient(ellipse at 85% 90%, rgba(239, 141, 43, 0.14), transparent 50%), linear-gradient(160deg, #0f244a 0%, #081a3a 100%);
  transition: opacity 0.3s ease;
}

.sp-lightbox.is-open {
  display: flex;
  opacity: 1;
}

body.sp-lb-locked {
  overflow: hidden;
}

.sp-lb-stage {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 4rem 6rem 1.5rem;
}

.sp-lb-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  padding: 0.9rem;
  object-fit: contain;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(0, 150, 210, 0.2);
  animation: sp-lb-zoom 0.4s cubic-bezier(.2, .9, .3, 1.25);
}

@keyframes sp-lb-zoom {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.sp-lb-bar {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(0, 100ch) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
  padding: 1.75rem 6rem 2rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: sp-lb-slide 0.5s cubic-bezier(.2, .9, .3, 1.15);
}

@keyframes sp-lb-slide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.sp-lb-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-self: start;
  min-width: 130px;
  padding-right: 2.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.sp-lb-num {
  color: var(--stfm-secondary);
  font-family: var(--stfm-heading-font);
  font-size: 3rem;
  font-weight: 900;
  line-height: 0.9;
}

.sp-lb-counter {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--stfm-heading-font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sp-lb-meta {
  min-width: 0;
  justify-self: center;
  text-align: center;
}

.sp-lb-date {
  margin-bottom: 0.45rem;
  color: var(--stfm-tertiary);
  font-family: var(--stfm-heading-font);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sp-lb-title {
  margin: 0 0 0.5rem;
  color: #ffffff;
  font-family: var(--stfm-heading-font);
  font-size: clamp(1.2rem, 1.6vw, 1.6rem);
  font-weight: 900;
  line-height: 1.12;
}

.sp-lb-notes {
  display: -webkit-box;
  max-width: 100ch;
  margin: 0 auto;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.sp-lb-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 1rem;
}

.sp-lb-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.4rem;
  color: #ffffff;
  background: var(--stfm-secondary);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(239, 141, 43, 0.45);
  font-family: var(--stfm-heading-font);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.sp-lb-pdf:hover {
  color: #ffffff;
  background: var(--stfm-tertiary);
  box-shadow: 0 10px 26px rgba(0, 150, 210, 0.5);
  transform: translateY(-2px);
}

.sp-lb-close,
.sp-lb-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 50%;
  cursor: pointer;
}

.sp-lb-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 3;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1.15rem;
  transition: background 0.2s ease, transform 0.3s ease, border-color 0.2s ease;
}

.sp-lb-close:hover {
  background: var(--stfm-secondary);
  border-color: var(--stfm-secondary);
  transform: rotate(90deg);
}

.sp-lb-nav {
  position: absolute;
  top: 40%;
  z-index: 3;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  transform: translateY(-50%);
  transition: background 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.sp-lb-nav:hover {
  background: var(--stfm-secondary);
  border-color: var(--stfm-secondary);
  transform: translateY(-50%) scale(1.1);
}

.sp-lb-nav-prev { left: 1.5rem; }
.sp-lb-nav-next { right: 1.5rem; }

@media (max-width: 1199px) {
  .sp-widget {
    --sp-visible: 4;
    --sp-edge-inset: clamp(1.75rem, 4vw, 3rem);
  }
  .sp-lb-stage { padding: 3rem 4rem 1rem; }
  .sp-lb-bar { gap: 1.5rem; padding: 1.5rem 4rem 1.75rem; }
  .sp-lb-id { min-width: 110px; padding-right: 1.75rem; }
  .sp-lb-num { font-size: 2.5rem; }
}

@media (max-width: 900px) {
  .sp-widget {
    --sp-visible: 2;
    --sp-edge-inset: clamp(1.25rem, 4vw, 2rem);
    --sp-gap: 1rem;
  }

  .sp-lb-stage { padding: 3.5rem 1.5rem 1rem; }
  .sp-lb-bar {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem 1.5rem;
  }
  .sp-lb-id { grid-row: 1; min-width: 0; padding-right: 1.25rem; }
  .sp-lb-meta { grid-row: 1; }
  .sp-lb-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .sp-lb-num { font-size: 2rem; }
  .sp-lb-title { font-size: 1.1rem; }
  .sp-lb-notes {
    font-size: 0.8rem;
    -webkit-line-clamp: 4;
  }
  .sp-lb-nav { width: 44px; height: 44px; }
  .sp-lb-nav-prev { left: 0.5rem; }
  .sp-lb-nav-next { right: 0.5rem; }
}

@media (max-width: 1100px) and (orientation: landscape) and (max-height: 575px) {
  .sp-lightbox.is-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .sp-lb-stage {
    min-height: 0;
    padding: 1.25rem 3.75rem;
  }

  .sp-lb-image {
    max-width: 100%;
    max-height: calc(100vh - 2.5rem);
    padding: 0.65rem;
  }

  .sp-lb-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    min-width: 0;
    padding: 2.25rem 3.25rem 2rem 1.25rem;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0) 100%);
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sp-lb-id {
    flex-direction: row;
    align-items: baseline;
    gap: 0.65rem;
    min-width: 0;
    padding-right: 0;
    border-right: none;
    text-align: left;
  }

  .sp-lb-num {
    font-size: 2.5rem;
  }

  .sp-lb-counter {
    margin-top: 0;
  }

  .sp-lb-date {
    margin-bottom: 0.35rem;
  }

  .sp-lb-meta {
    justify-self: auto;
    text-align: left;
  }

  .sp-lb-title {
    margin-bottom: 0.45rem;
    font-size: 1.25rem;
  }

  .sp-lb-notes {
    max-width: 48ch;
    margin: 0;
    font-size: 0.8rem;
    -webkit-line-clamp: 5;
  }

  .sp-lb-actions {
    width: 100%;
  }

  .sp-lb-pdf {
    padding: 0.75rem 1.1rem;
    font-size: 0.66rem;
  }

  .sp-lb-close {
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
  }

  .sp-lb-nav {
    top: 50%;
    width: 46px;
    height: 46px;
  }

  .sp-lb-nav-prev {
    left: 0.8rem;
  }

  .sp-lb-nav-next {
    right: 0.8rem;
  }
}

@media (min-width: 700px) and (max-width: 900px) and (orientation: portrait) {
  .sp-widget {
    --sp-visible: 2.5;
    --sp-card-ratio: 4 / 5;
  }

  .sp-track {
    padding-top: 1rem;
    padding-bottom: 1.25rem;
  }

  .sp-card-overlay {
    padding: 1.7rem 1rem 0.9rem;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  .sp-widget {
    --sp-visible: 1;
    --sp-edge-inset: 1rem;
    --sp-gap: 0.85rem;
  }

  .sp-arrow {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 500px) {
  .sp-widget {
    --sp-visible: 1;
  }
}
