/* SRM OY - Palvelut Modal Gallery */

.srmoy-clickable{
  cursor:pointer;
  position:relative;
  transition:transform .25s ease, box-shadow .25s ease;
}
.srmoy-clickable:hover{ transform:translateY(-4px); }
.srmoy-clickable:focus-visible{
  outline:3px solid #f0a500;
  outline-offset:4px;
  border-radius:6px;
}

.srmoy-modal{
  position:fixed;
  inset:0;
  z-index:999999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(9,12,18,.88);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  opacity:0;
  visibility:hidden;
  transition:opacity .28s ease, visibility .28s ease;
  box-sizing:border-box;
}
.srmoy-modal *,
.srmoy-modal *::before,
.srmoy-modal *::after{ box-sizing:border-box; }

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

.srmoy-modal__dialog{
  position:relative;
  width:100%;
  max-width:1040px;
  transform:scale(.96);
  transition:transform .28s cubic-bezier(.2,.8,.3,1);
}
.srmoy-modal.is-open .srmoy-modal__dialog{ transform:scale(1); }

.srmoy-modal__title{
  margin:0 0 12px;
  padding:0 60px;
  color:#fff;
  font-size:20px;
  line-height:1.3;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  text-align:center;
}

.srmoy-modal__stage{
  position:relative;
  width:100%;
  aspect-ratio:16 / 10;
  max-height:calc(100vh - 190px);
  background:#0d1117;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 24px 60px rgba(0,0,0,.55);
}
/* Fallback selaimille ilman aspect-ratio-tukea */
@supports not (aspect-ratio: 16 / 10){
  .srmoy-modal__stage{ height:min(62vh, 620px); }
}

.srmoy-modal__slide{
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  width:100%;
  height:100%;
  object-fit:contain;
  opacity:0;
  transition:opacity .45s ease;
  margin:0;
  display:block;
  max-width:100%;
}
.srmoy-modal__slide.is-active{ opacity:1; }

.srmoy-modal__spinner{
  position:absolute;
  z-index:2;
  top:50%; left:50%;
  width:38px; height:38px;
  margin:-19px 0 0 -19px;
  border:3px solid rgba(255,255,255,.25);
  border-top-color:#fff;
  border-radius:50%;
  animation:srmoy-spin .8s linear infinite;
  pointer-events:none;
}
.srmoy-modal__stage.is-loaded .srmoy-modal__spinner{ display:none; }
@keyframes srmoy-spin{ to{ transform:rotate(360deg); } }

.srmoy-modal__nav{
  position:absolute;
  z-index:3;
  top:50%;
  transform:translateY(-50%);
  width:46px;
  height:46px;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:0;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .2s ease;
  padding:0;
}
.srmoy-modal__nav:hover{ background:rgba(255,255,255,.32); }
.srmoy-modal__nav svg{ width:20px; height:20px; }
.srmoy-modal__nav--prev{ left:14px; }
.srmoy-modal__nav--next{ right:14px; }

.srmoy-modal__close{
  position:absolute;
  z-index:5;
  top:16px;
  right:16px;
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.14);
  color:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  transition:background .2s ease, transform .2s ease;
}
.srmoy-modal__close:hover{ background:rgba(255,255,255,.32); transform:rotate(90deg); }
.srmoy-modal__close svg{ width:18px; height:18px; }

.srmoy-modal__bar{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  margin-top:16px;
}
.srmoy-modal__dots{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
}
.srmoy-modal__dot{
  width:9px; height:9px;
  padding:0;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.32);
  cursor:pointer;
  transition:background .2s ease, transform .2s ease;
}
.srmoy-modal__dot.is-active{ background:#f0a500; transform:scale(1.35); }

.srmoy-modal__count{
  color:rgba(255,255,255,.7);
  font-size:13px;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

@media (max-width:640px){
  .srmoy-modal{ padding:16px; }
  .srmoy-modal__title{ font-size:16px; }
  .srmoy-modal__stage{ aspect-ratio:4 / 3; border-radius:10px; max-height:calc(100vh - 170px); }
  .srmoy-modal__close{ top:10px; right:10px; width:38px; height:38px; }
  .srmoy-modal__nav{ width:38px; height:38px; }
  .srmoy-modal__nav--prev{ left:8px; }
  .srmoy-modal__nav--next{ right:8px; }
}

@media (prefers-reduced-motion:reduce){
  .srmoy-modal,
  .srmoy-modal__dialog,
  .srmoy-modal__slide,
  .srmoy-clickable{ transition:none !important; }
  .srmoy-modal__spinner{ animation:none; }
}
