/* =====================================================================
   Dream Cleen v2 - homepage "Our Work" gallery (tabs + photo/video lightbox)
   ---------------------------------------------------------------------
   Markup is generated by D:\websites\tools\dc-home-gallery\build.js.
   Square tiles with rounded corners (same 16px radius as the service
   thumbnails), every photo/video masked to a square whatever its shape.
   Max TWO rows per tab: 6 per row on desktop, 4 on tablet, 3 on phones.
   Edit the values marked <<<.
   ===================================================================== */
.dc-hg { padding: 90px 10px 70px; }   /* <<< space above / below the gallery */
.dc-hg__inner { max-width: 1140px; margin: 0 auto; }
@media (max-width: 767.98px) { .dc-hg { padding: 60px 10px 50px; } }

/* heading - same style as "See the Difference - Before & After" */
.dc-hg__title {
  margin: 0 0 26px;
  text-align: center;
  font-family: "Radio Canada", sans-serif;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.2;
  color: #000;
}
.dc-hg__title span { color: #111C52; }
@media (max-width: 767.98px) { .dc-hg__title { font-size: 30px; margin-bottom: 20px; } }

/* ---------- tabs: always ONE row; swipe it, or use the navy arrows that appear when it overflows ---------- */
.dc-hg__tabbar { position: relative; margin: 0 0 22px; }
.dc-hg__tabs {
  position: relative;                 /* offsetLeft of each tab is measured from here */
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0;
  padding: 4px 2px;                   /* room for the focus ring */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.dc-hg__tabs::-webkit-scrollbar { display: none; }
/* centred when they all fit; when they don't, the row starts at the first tab */
.dc-hg__tab:first-child { margin-left: auto; }
.dc-hg__tab:last-child { margin-right: auto; }
.dc-hg__tabbar.is-overflow .dc-hg__tabs { padding-left: 4px; padding-right: 4px; }

/* soft white fade at whichever edge has more tabs hidden behind it */
.dc-hg__tabbar::before,
.dc-hg__tabbar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 64px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.dc-hg__tabbar::before { left: 0; background: linear-gradient(90deg, #fff 45%, rgba(255, 255, 255, 0)); }
.dc-hg__tabbar::after { right: 0; background: linear-gradient(270deg, #fff 45%, rgba(255, 255, 255, 0)); }
.dc-hg__tabbar.has-prev::before, .dc-hg__tabbar.has-next::after { opacity: 1; }

.dc-hg__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;                        /* <<< arrow size */
  height: 36px;
  margin-top: -18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #111C52;                /* <<< navy */
  color: #fff;
  box-shadow: 0 4px 12px rgba(17, 28, 82, .3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(.8);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.dc-hg__arrow--prev { left: 0; }
.dc-hg__arrow--next { right: 0; }
.dc-hg__arrow.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease, visibility 0s, background .2s ease; }
.dc-hg__arrow:hover { background: #1b2a73; }
.dc-hg__arrow:active { transform: scale(.92); }
.dc-hg__arrow:focus-visible { outline: 3px solid #61CE70; outline-offset: 2px; }
.dc-hg__arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.dc-hg__tab {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 10px 20px;
  border: 1.5px solid #111C52;        /* <<< navy */
  border-radius: 999px;
  background: #fff;
  color: #111C52;
  font-family: "Anek Latin", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
.dc-hg__tab:hover { background: #111C52; color: #fff; }   /* <<< hover: navy with white text */
.dc-hg__tab:active { transform: scale(.97); }
.dc-hg__tab.is-active { background: #111C52; color: #fff; }
.dc-hg__tab:focus-visible { outline: 3px solid #61CE70; outline-offset: 2px; }

/* ---------- grid ---------- */
.dc-hg__grid {
  --dc-hg-cols: 6;                    /* <<< tiles per row (desktop) */
  display: grid;
  grid-template-columns: repeat(var(--dc-hg-cols), 1fr);
  gap: 14px;                          /* <<< gap between tiles */
}
@media (max-width: 1024px) { .dc-hg__grid { --dc-hg-cols: 4; gap: 12px; } }
@media (max-width: 767.98px) { .dc-hg__grid { --dc-hg-cols: 3; gap: 8px; } .dc-hg__tab { padding: 8px 14px; font-size: 15px; } }

.dc-hg__item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;                /* square mask whatever the photo's shape */
  overflow: hidden;
  border-radius: 16px;                /* <<< matches the service thumbnails */
  background: #e9ecf4;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  animation: dc-hg-in .35s ease both;
}
.dc-hg__item[hidden] { display: none; }
.dc-hg__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
@keyframes dc-hg-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* hover: navy tint + eye (photos) / play (videos) */
.dc-hg__over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 28, 82, .58);  /* <<< navy tint */
  opacity: 0;
  transition: opacity .3s ease;
}
.dc-hg__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .9);
  transform: scale(.7);
  transition: transform .3s ease;
}
.dc-hg__icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dc-hg__item--video .dc-hg__icon svg { fill: #fff; stroke: none; margin-left: 3px; }
.dc-hg__item:hover .dc-hg__over, .dc-hg__item:focus-visible .dc-hg__over { opacity: 1; }
.dc-hg__item:hover .dc-hg__icon, .dc-hg__item:focus-visible .dc-hg__icon { transform: scale(1); }
.dc-hg__item:hover img, .dc-hg__item:focus-visible img { transform: scale(1.06); }
.dc-hg__item:focus-visible { outline: 3px solid #61CE70; outline-offset: 2px; }

/* small permanent play badge so videos stand out before hovering */
.dc-hg__badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(17, 28, 82, .85);
  transition: opacity .2s ease;
}
.dc-hg__badge svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
.dc-hg__item:hover .dc-hg__badge { opacity: 0; }

/* "+N more" on the last tile when a tab has more than two rows of items */
.dc-hg__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 28, 82, .62);
  color: #fff;
  font-family: "Anek Latin", sans-serif;
  font-size: 26px;
  font-weight: 600;
  pointer-events: none;
}
.dc-hg__item.has-more .dc-hg__over,
.dc-hg__item.has-more .dc-hg__badge { display: none; }

/* ---------- lightbox ---------- */
html.dc-hlb-open { overflow: hidden; }
.dc-hlb {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: rgba(6, 10, 30, .985);  /* <<< lightbox backdrop */
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.dc-hlb.is-open { opacity: 1; visibility: visible; }
.dc-hlb__top { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.dc-hlb__count { font-size: 15px; letter-spacing: .06em; color: rgba(255, 255, 255, .8); }
/* the outgoing and incoming items sit in the SAME grid cell and cross-fade,
   so nothing shifts sideways or jumps when one replaces the other */
.dc-hlb__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: 0 72px;
}
.dc-hlb__media {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  background: #000;
  opacity: 0;
  transform: translate3d(var(--dc-shift, 0), 0, 0);
  transition: opacity .45s cubic-bezier(.4, 0, .2, 1), transform .45s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity, transform;
}
.dc-hlb__media.is-out { pointer-events: none; }
img.dc-hlb__media { object-fit: contain; background: transparent; }
.dc-hlb__media.is-in { opacity: 1; transform: none; }
.dc-hlb__caption { flex: 0 0 auto; margin: 14px 18px 0; text-align: center; font-size: 17px; line-height: 1.4; }
.dc-hlb__thumbs { flex: 0 0 auto; display: flex; justify-content: flex-start; gap: 10px; padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px)); overflow-x: auto; scrollbar-width: none; }
.dc-hlb__thumbs::-webkit-scrollbar { display: none; }
/* centred when they fit, scrollable from the first one when they don't (justify-content:center would cut off the first thumbs) */
/* divider between one service's thumbnails and the next */
.dc-hlb__sep { flex: 0 0 auto; align-self: center; width: 2px; height: 34px; margin: 0 8px; border-radius: 2px; background: rgba(255, 255, 255, .28); }
.dc-hlb__thumb:first-child { margin-left: auto; }
.dc-hlb__thumb:last-child { margin-right: auto; }
.dc-hlb__thumb { position: relative; flex: 0 0 auto; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; overflow: hidden; opacity: .5; cursor: pointer; transition: opacity .2s ease, border-color .2s ease; }
.dc-hlb__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-hlb__thumb:hover { opacity: .85; }
.dc-hlb__thumb.is-active { opacity: 1; border-color: #61CE70; }
.dc-hlb__thumb--video::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -7px 0 0 -4px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.dc-hlb__btn { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; transition: background .2s ease; }
.dc-hlb__btn:hover { background: rgba(255, 255, 255, .25); }
.dc-hlb__btn:focus-visible { outline: 2px solid #61CE70; outline-offset: 2px; }
.dc-hlb__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dc-hlb__prev, .dc-hlb__next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.dc-hlb__prev { left: 14px; }
.dc-hlb__next { right: 14px; }
.dc-hlb__spinner { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; z-index: 1; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: dc-hlb-spin .8s linear infinite; opacity: 0; transition: opacity .2s ease; }
.dc-hlb.is-loading .dc-hlb__spinner { opacity: 1; }
@keyframes dc-hlb-spin { to { transform: rotate(360deg); } }
@media (max-width: 767.98px) {
  .dc-hlb__stage { padding: 0 8px; }
  .dc-hlb__prev, .dc-hlb__next { top: auto; bottom: 8px; transform: none; width: 42px; height: 42px; background: rgba(0, 0, 0, .45); }
  .dc-hlb__thumb { width: 52px; height: 52px; }
  .dc-hlb__caption { font-size: 15px; }
  html.dc-hlb-open .dc-fab { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-hg__item, .dc-hg__item img, .dc-hg__over, .dc-hg__icon, .dc-hlb, .dc-hlb__media { animation: none; transition: none; }
}
