.cugb-gallery-section,
.cugb-gallery-section *{
  box-sizing:border-box;
}

.cugb-gallery-section{
  --cugb-navy:#0f1e4a;
  --cugb-blue:#123b78;
  --cugb-orange:#f5a000;
  --cugb-bg:#f6f9fd;
  --cugb-border:#e5ebf4;
  --cugb-muted:#8090aa;
  --cugb-white:#ffffff;
  width:100%;
  margin:34px 0 42px;
  font-family:Heebo,Arial,sans-serif;
  color:var(--cugb-navy);
}

.cugb-gallery-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:28px;
  margin-bottom:18px;
}

.cugb-gallery-title-wrap{
  display:flex;
  align-items:center;
  min-width:0;
  gap:14px;
}

.cugb-gallery-accent{
  width:5px;
  height:52px;
  flex:0 0 5px;
  border-radius:999px;
  background:var(--cugb-orange);
}

.cugb-gallery-title-wrap h2{
  margin:0;
  color:var(--cugb-navy);
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(30px,3vw,42px);
  font-weight:700;
  line-height:1.05;
  letter-spacing:-.02em;
}

.cugb-gallery-title-wrap p{
  margin:7px 0 0;
  color:var(--cugb-muted);
  font-size:14px;
  line-height:1.55;
}

.cugb-gallery-view-all{
  display:inline-flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
  padding:8px 2px;
  color:var(--cugb-navy);
  text-decoration:none;
  font-size:14px;
  font-weight:700;
  transition:color .2s ease,transform .2s ease;
}

.cugb-gallery-view-arrow{
  color:var(--cugb-orange);
  font-size:23px;
  line-height:1;
  transition:transform .2s ease;
}

.cugb-gallery-view-all:hover{
  color:var(--cugb-blue);
}

.cugb-gallery-view-all:hover .cugb-gallery-view-arrow{
  transform:translateX(4px);
}

.cugb-gallery-card{
  width:100%;
  padding:22px;
  border:1px solid var(--cugb-border);
  border-radius:22px;
  background:rgba(255,255,255,.98);
  box-shadow:
    0 22px 55px rgba(15,30,74,.08),
    0 3px 10px rgba(15,30,74,.04);
}

.cugb-gallery-stage{
  display:grid;
  grid-template-columns:minmax(0,78fr) minmax(150px,22fr);
  gap:16px;
  align-items:stretch;
}

.cugb-gallery-main-wrap{
  min-width:0;
}

.cugb-gallery-main{
  position:relative;
  width:100%;
  aspect-ratio:16 / 9;
  min-height:420px;
  max-height:620px;
  overflow:hidden;
  border-radius:16px;
  background:#edf2f8;
  isolation:isolate;
  touch-action:pan-y;
}

.cugb-gallery-main::after{
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:24%;
  z-index:1;
  pointer-events:none;
  background:linear-gradient(to top,rgba(6,19,48,.24),rgba(6,19,48,0));
}

.cugb-gallery-main img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center;
  opacity:1;
  transform:scale(1);
  user-select:none;
  transition:opacity .34s ease,transform .5s ease;
}

.cugb-gallery-main img.cugb-gallery-is-changing{
  opacity:.16;
  transform:scale(1.012);
}

.cugb-gallery-overlay-nav{
  position:absolute;
  top:50%;
  z-index:3;
  width:48px;
  height:48px;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.96);
  color:var(--cugb-navy);
  box-shadow:0 8px 24px rgba(15,30,74,.20);
  cursor:pointer;
  transform:translateY(-50%);
  transition:transform .2s ease,box-shadow .2s ease,background .2s ease;
}

.cugb-gallery-overlay-nav span{
  display:block;
  margin-top:-3px;
  font-family:Arial,sans-serif;
  font-size:34px;
  line-height:1;
}

.cugb-gallery-overlay-prev{left:18px;}
.cugb-gallery-overlay-next{right:18px;}

.cugb-gallery-overlay-nav:hover{
  background:#fff;
  box-shadow:0 12px 30px rgba(15,30,74,.26);
  transform:translateY(-50%) scale(1.07);
}

.cugb-gallery-overlay-nav:focus-visible,
.cugb-gallery-autoplay:focus-visible,
.cugb-gallery-large-nav:focus-visible,
.cugb-gallery-thumb:focus-visible,
.cugb-gallery-dot:focus-visible,
.cugb-gallery-view-all:focus-visible{
  outline:3px solid rgba(245,160,0,.35);
  outline-offset:3px;
}

.cugb-gallery-counter{
  position:absolute;
  right:24px;
  bottom:20px;
  z-index:3;
  color:#fff;
  font-size:16px;
  font-weight:700;
  letter-spacing:.06em;
  text-shadow:0 2px 7px rgba(0,0,0,.55);
}

.cugb-gallery-thumbs-shell{
  position:relative;
  min-width:0;
  display:flex;
  flex-direction:column;
  height:100%;
}

.cugb-gallery-thumbs{
  height:100%;
  min-height:420px;
  max-height:620px;
  overflow-y:auto;
  overflow-x:hidden;
  display:grid;
  grid-auto-rows:calc((100% - 40px) / 5);
  gap:10px;
  padding:1px 7px 1px 1px;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:var(--cugb-navy) #edf2f7;
}

.cugb-gallery-thumbs::-webkit-scrollbar{
  width:5px;
}

.cugb-gallery-thumbs::-webkit-scrollbar-track{
  border-radius:999px;
  background:#edf2f7;
}

.cugb-gallery-thumbs::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:linear-gradient(var(--cugb-blue),var(--cugb-navy));
}

.cugb-gallery-thumb{
  width:100%;
  height:100%;
  min-height:0;
  padding:4px;
  border:1px solid var(--cugb-border);
  border-radius:13px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 4px 12px rgba(15,30,74,.04);
  cursor:pointer;
  transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;
}

.cugb-gallery-thumb img{
  width:100%;
  height:100%;
  display:block;
  border-radius:9px;
  object-fit:cover;
  object-position:center;
  pointer-events:none;
}

.cugb-gallery-thumb:hover{
  border-color:#c9d4e5;
  box-shadow:0 8px 18px rgba(15,30,74,.11);
  transform:scale(1.018);
}

.cugb-gallery-thumb.cugb-gallery-active{
  border:2px solid var(--cugb-orange);
  padding:3px;
  box-shadow:
    0 0 0 3px rgba(245,160,0,.11),
    0 8px 20px rgba(15,30,74,.10);
}

.cugb-gallery-scroll-indicator{
  display:none;
}

.cugb-gallery-controls{
  display:grid;
  grid-template-columns:minmax(150px,1fr) auto minmax(150px,1fr);
  align-items:center;
  gap:18px;
  margin-top:18px;
}

.cugb-gallery-autoplay-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  justify-self:start;
}

.cugb-gallery-autoplay{
  width:38px;
  height:38px;
  flex:0 0 38px;
  border:1.5px solid #a9b7cb;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  color:var(--cugb-navy);
  cursor:pointer;
  transition:border-color .2s ease,transform .2s ease,box-shadow .2s ease;
}

.cugb-gallery-autoplay:hover{
  border-color:var(--cugb-orange);
  transform:scale(1.05);
  box-shadow:0 6px 16px rgba(15,30,74,.10);
}

.cugb-gallery-autoplay-icon{
  font-size:13px;
  font-weight:800;
  line-height:1;
}

.cugb-gallery-autoplay-label{
  color:var(--cugb-muted);
  font-size:13px;
  font-weight:600;
}

.cugb-gallery-dots{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:7px;
}

.cugb-gallery-dot{
  width:7px;
  height:7px;
  padding:0;
  border:0;
  border-radius:999px;
  background:#c5cfdd;
  cursor:pointer;
  transition:width .22s ease,background .22s ease,transform .22s ease;
}

.cugb-gallery-dot:hover{
  background:#9aaac0;
  transform:scale(1.15);
}

.cugb-gallery-dot.cugb-gallery-active{
  width:22px;
  background:var(--cugb-orange);
}

.cugb-gallery-bottom-nav{
  justify-self:end;
  display:flex;
  align-items:center;
  gap:10px;
}

.cugb-gallery-large-nav{
  width:58px;
  height:58px;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--cugb-navy);
  color:#fff;
  box-shadow:0 8px 20px rgba(15,30,74,.18);
  cursor:pointer;
  font-size:22px;
  transition:background .2s ease,transform .2s ease,box-shadow .2s ease;
}

.cugb-gallery-large-nav:hover{
  background:var(--cugb-blue);
  transform:translateY(-2px) scale(1.04);
  box-shadow:0 12px 25px rgba(15,30,74,.24);
}

@media(max-width:980px){
  .cugb-gallery-card{padding:18px;}
  .cugb-gallery-stage{
    grid-template-columns:minmax(0,80fr) minmax(130px,20fr);
    gap:12px;
  }
  .cugb-gallery-main{
    min-height:360px;
  }
  .cugb-gallery-thumbs{
    min-height:360px;
  }
}

@media(max-width:768px){
  .cugb-gallery-section{
    margin:28px 0 36px;
  }

  .cugb-gallery-header{
    align-items:center;
    gap:16px;
  }

  .cugb-gallery-title-wrap p{
    display:none;
  }

  .cugb-gallery-card{
    padding:14px;
    border-radius:18px;
  }

  .cugb-gallery-stage{
    grid-template-columns:1fr;
    gap:12px;
  }

  .cugb-gallery-main{
    min-height:0;
    max-height:none;
    aspect-ratio:16 / 10;
  }

  .cugb-gallery-thumbs-shell{
    width:100%;
  }

  .cugb-gallery-thumbs{
    width:100%;
    height:auto;
    min-height:0;
    max-height:none;
    display:flex;
    gap:9px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:2px 2px 8px;
    scrollbar-width:none;
    scroll-snap-type:x proximity;
  }

  .cugb-gallery-thumbs::-webkit-scrollbar{
    display:none;
  }

  .cugb-gallery-thumb{
    width:118px;
    height:76px;
    min-width:118px;
    flex:0 0 118px;
    scroll-snap-align:start;
  }

  .cugb-gallery-scroll-indicator{
    display:none;
  }

  .cugb-gallery-controls{
    grid-template-columns:1fr auto;
    grid-template-areas:
      "auto nav"
      "dots dots";
    row-gap:14px;
  }

  .cugb-gallery-autoplay-wrap{grid-area:auto;}
  .cugb-gallery-bottom-nav{grid-area:nav;}
  .cugb-gallery-dots{grid-area:dots;}

  .cugb-gallery-large-nav{
    width:52px;
    height:52px;
  }
}

@media(max-width:480px){
  .cugb-gallery-header{
    align-items:flex-start;
    flex-direction:column;
    margin-bottom:14px;
  }

  .cugb-gallery-title-wrap h2{
    font-size:28px;
  }

  .cugb-gallery-accent{
    height:43px;
  }

  .cugb-gallery-view-all{
    margin-left:19px;
    padding-top:0;
  }

  .cugb-gallery-card{
    padding:10px;
    border-radius:16px;
  }

  .cugb-gallery-main{
    border-radius:13px;
    aspect-ratio:4 / 3;
  }

  .cugb-gallery-overlay-nav{
    width:42px;
    height:42px;
  }

  .cugb-gallery-overlay-prev{left:10px;}
  .cugb-gallery-overlay-next{right:10px;}

  .cugb-gallery-counter{
    right:14px;
    bottom:13px;
    font-size:13px;
  }

  .cugb-gallery-thumb{
    width:104px;
    min-width:104px;
    flex-basis:104px;
    height:68px;
  }

  .cugb-gallery-controls{
    margin-top:14px;
  }

  .cugb-gallery-autoplay-label{
    font-size:12px;
  }

  .cugb-gallery-large-nav{
    width:46px;
    height:46px;
    font-size:19px;
  }
}

@media(prefers-reduced-motion:reduce){
  .cugb-gallery-section *,
  .cugb-gallery-section *::before,
  .cugb-gallery-section *::after{
    scroll-behavior:auto !important;
    animation:none !important;
    transition:none !important;
  }
}
