.opportunities-section{
  padding:26px 0 30px;
}

.opportunities-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:34px;
}

.opportunity-card{
  background:#ffffff;
  cursor:pointer;
  overflow:hidden;
  box-shadow:0 18px 45px rgba(0,0,0,.10);
  transition:transform .35s ease, box-shadow .35s ease;
}

.opportunity-card:hover{
  transform:translateY(-8px);
  box-shadow:0 28px 60px rgba(0,0,0,.16);
}

.opportunity-card__image{
  width:100%;
  aspect-ratio:4 / 5;
  overflow:hidden;
  background:#ddd;
}

.opportunity-card__image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .5s ease;
}

.opportunity-card:hover .opportunity-card__image img{
  transform:scale(1.03);
}

.opportunity-card__content{
  padding:28px;
}

.opportunity-card__label{
  margin:0 0 14px;
  font-size:12px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:rgba(0,0,0,.55);
}

.opportunity-card__title{
  margin:0;
  font-size:15px;
  line-height:1.15;
  font-weight:700;
  color:#111;
}

.opportunity-card__text{
  margin:18px 0 0;
  font-size:14px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#111;
}

/* MODALE */

.opportunity-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  padding:30px 110px;
  box-sizing:border-box;
  background:rgba(0,0,0,.88);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  visibility:hidden;
  transition:opacity .3s ease, visibility .3s ease;
}

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

/*
  Desktop:
  immagine e contatore nella colonna principale;
  miniature verticali nella colonna destra.
*/

.opportunity-modal__gallery{
  width:min(82vw, 1200px);
  max-height:calc(100vh - 60px);
  display:grid;
  grid-template-columns:minmax(0, 1fr) 76px;
  grid-template-rows:minmax(0, 1fr) auto;
  column-gap:20px;
  row-gap:12px;
  align-items:center;
}

.opportunity-modal__content{
  grid-column:1;
  grid-row:1;
  width:100%;
  height:min(78vh, 720px);
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.opportunity-modal__content img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:block;
  box-shadow:0 30px 80px rgba(0,0,0,.45);
}

.opportunity-modal__counter{
  grid-column:1;
  grid-row:2;
  justify-self:center;
  min-width:72px;
  padding:7px 13px;
  background:rgba(255,255,255,.96);
  color:#111111;
  font-size:13px;
  font-weight:600;
  letter-spacing:.08em;
  text-align:center;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.opportunity-modal__thumbnails{
  grid-column:2;
  grid-row:1 / span 2;
  align-self:center;
  width:76px;
  max-height:min(78vh, 720px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:4px 6px;
  box-sizing:border-box;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-width:thin;
  scroll-behavior:smooth;
}

.opportunity-modal__thumbnail{
  width:64px;
  height:64px;
  padding:0;
  border:2px solid transparent;
  background:transparent;
  opacity:.55;
  cursor:pointer;
  flex:0 0 64px;
  overflow:hidden;
  transition:
    opacity .2s ease,
    border-color .2s ease,
    transform .2s ease;
}

.opportunity-modal__thumbnail img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.opportunity-modal__thumbnail:hover{
  opacity:.85;
  transform:translateX(-2px);
}

.opportunity-modal__thumbnail.is-active{
  opacity:1;
  border-color:#ffffff;
  transform:translateX(-2px);
}

.opportunity-modal__close{
  position:absolute;
  top:28px;
  right:34px;
  width:46px;
  height:46px;
  border:0;
  background:#ffffff;
  color:#111;
  font-size:34px;
  line-height:1;
  cursor:pointer;
  z-index:3;
}

.opportunity-modal__arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:52px;
  height:52px;
  border:0;
  background:#ffffff;
  color:#111;
  font-size:30px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:3;
}

.opportunity-modal__arrow--prev{
  left:34px;
}

.opportunity-modal__arrow--next{
  right:34px;
}

body.modal-open{
  overflow:hidden;
}

/* ZOOM */

.zoomable-image{
  cursor:zoom-in;
  transition:transform .15s ease;
  transform-origin:center center;
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
  touch-action:none;
  will-change:transform;
}

.zoomable-image.is-touching{
  transition:none;
}

.zoomable-image.is-zoomed{
  cursor:grab;
}

.zoomable-image.is-dragging{
  cursor:grabbing;
  transition:none;
}

/* TABLET */

@media (max-width:980px){
  .opportunities-grid{
    grid-template-columns:repeat(2, 1fr);
  }

  .opportunity-modal{
    padding-left:85px;
    padding-right:85px;
  }

  .opportunity-modal__gallery{
    width:100%;
    grid-template-columns:minmax(0, 1fr) 68px;
    column-gap:14px;
  }

  .opportunity-modal__thumbnails{
    width:68px;
  }

  .opportunity-modal__thumbnail{
    width:56px;
    height:56px;
    flex-basis:56px;
  }
}

/* MOBILE */

@media (max-width:768px){
  .opportunities-section{
    padding:30px 0;
  }

  .opportunities-grid{
    grid-template-columns:1fr;
    gap:28px;
    margin-top:10px;
  }

  .opportunity-card__content{
    padding:24px;
  }

  .opportunity-modal{
    padding:0;
  }

  /*
    Su mobile torna il layout originale:
    immagine, contatore e miniature orizzontali.
  */

  .opportunity-modal__gallery{
    width:92vw;
    max-height:none;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
  }

  .opportunity-modal__content{
    width:100%;
    height:68vh;
    min-height:0;
  }

  .opportunity-modal__counter{
    min-width:72px;
    padding:6px 11px;
    font-size:12px;
  }

  .opportunity-modal__thumbnails{
    width:100%;
    max-height:none;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    padding:4px 2px 6px;
    box-sizing:border-box;
    overflow-x:auto;
    overflow-y:hidden;
  }

  .opportunity-modal__thumbnail{
    width:52px;
    height:52px;
    flex:0 0 52px;
  }

  .opportunity-modal__thumbnail:hover,
  .opportunity-modal__thumbnail.is-active{
    transform:translateY(-2px);
  }

  .opportunity-modal__close{
    top:18px;
    right:18px;
    width:42px;
    height:42px;
    font-size:30px;
  }

  .opportunity-modal__arrow{
    display:none;
  }

  .opportunity-modal__arrow--prev{
    left:16px;
  }

  .opportunity-modal__arrow--next{
    right:16px;
  }
}