/* 
=============================================================
|  Tred-Mark Communications | Developed by Javorsky Studio  |
|  Viewing File: ~/public-site/assets/css/pages/gallery.css |
| --- Styling/CSS for `~/public-site/gallery/index.html --- |
============================================================= 
*/

.page-our-work main.portal-shell{
  padding-top: calc(var(--header-offset, 84px) + 32px);
}

.page-our-work .portal-shell::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;

  background:
    radial-gradient(circle at 15% 10%,
      rgba(66,232,255,.18) 0%,
      transparent 35%),

    radial-gradient(circle at 85% 15%,
      rgba(138,84,255,.16) 0%,
      transparent 40%),

    radial-gradient(circle at 50% 40%,
      rgba(47,141,255,.08) 0%,
      transparent 55%),

    linear-gradient(
      180deg,
      rgba(4,8,16,.05) 0%,
      rgba(7,10,18,.35) 45%,
      rgba(7,10,18,.75) 100%
    ),
    url("/assets/media/gallery/gallery-bg.webp");

  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  filter: blur(7.5px);
  transform: scale(1.03);
}

.page-our-work .portal-title{
  margin: 4px 0 10px;
  font-size: clamp(44px, 6vw, 78px);
  line-height:.9;
  letter-spacing:-.055em;
  font-weight:1000;

  background: linear-gradient(
    145deg,
    #4cff91 0%,
    #3493ecc7 35%,
    #143494 70%,
    #3f277e 100%
  );

  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  color:transparent;

  text-shadow:
    0 12px 42px rgba(0,0,0,.48);
}

/* Gallery shell */
.tm-gallery-card{
  position:relative;
  padding: clamp(18px, 2.5vw, 30px);
  border-radius: 22px;
  border:1px solid rgba(125,227,255,.14);
  background:
    linear-gradient(180deg, rgba(7,10,18,.76), rgba(7,10,18,.58)),
    radial-gradient(560px 240px at 8% 0%, rgba(74,163,255,.14), transparent 64%),
    radial-gradient(520px 260px at 100% 14%, rgba(139,92,255,.10), transparent 68%);
  box-shadow:
    0 24px 90px rgba(0,0,0,.50),
    inset 0 1px 0 rgba(255,255,255,.06);
  overflow: visible;
}

.tm-gallery-card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  background:linear-gradient(135deg, rgba(255,255,255,.08), transparent 34%, rgba(125,227,255,.05));
  opacity:.72;
  z-index:0;
}

.tm-gallery-card > *{
  position:relative;
  z-index:1;
}

.tm-filter-tags{
  position:relative;
  z-index:20;
}

.tm-filter-tags .tm-tags-pop{
  z-index:999;
}

/* Toolbar */
.tm-gallery-toolbar{
  display:flex;
  gap: var(--space-4);
  align-items:flex-end;
  justify-content:space-between;
  flex-wrap:wrap;
}

.tm-gallery-count{
  font-family:var(--mono);
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(190,226,255,.72);
}

.tm-gallery-right{
  display:flex;
  gap: var(--space-3);
  align-items:flex-end;
  flex-wrap:wrap;
}

.tm-filter{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.tm-filter-label{
  font-family:var(--mono);
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(170,183,214,.82);
}

.tm-gallery-search{
  min-width:min(460px, 72vw);
  background:rgba(255,255,255,.045);
  border-color:rgba(255,255,255,.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}

.tm-gallery-search:focus{
  border-color:rgba(125,227,255,.55);
  box-shadow:
    0 0 0 3px rgba(74,163,255,.12),
    inset 0 1px 0 rgba(255,255,255,.05);
}

/* Tags dropdown trigger */
.tm-filter-tags{ position:relative; }
.tm-tags-btn{
  display:flex;
  gap:10px;
  align-items:center;
  color:rgba(234,240,255,.88);
}
.tm-caret{
  width:10px;
  height:10px;
  display:inline-block;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform: rotate(45deg);
  margin-top:-2px;
  opacity:.8;
}

/* Tags popover */
.tm-filter-tags .tm-tags-pop[hidden]{
  display:none !important;
}

.tm-filter-tags .tm-tags-pop{
  position:absolute;
  top: calc(100% + 10px);
  right:0;
  left:auto;
  z-index:100;

  width: min(620px, calc(100vw - 48px));
  max-height: none;
  overflow: visible;

  padding:12px;
  border-radius:18px;
  background:#070a12;
  border:1px solid rgba(125,227,255,.18);
  box-shadow:0 24px 80px rgba(0,0,0,.65);
  backdrop-filter:blur(16px);
}

.tm-tags-pop-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:10px;
}

.tm-tags-pop-head strong{
  letter-spacing:-.02em;
}

.tm-tags-close{
  padding:6px 10px;
}

.tm-tags-list{
  overflow:visible;
}

.tm-filter-grid{
  display:grid;
  grid-template-columns:220px 340px;
  gap:12px;
  align-items:start;
}

.tm-filter-col{
  width:100%;
  min-width:0;
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background:rgba(255,255,255,.035);
  overflow:hidden;
}

.tm-filter-col-head{
  padding:10px 12px;
  font-weight:800;
  letter-spacing:.10em;
  text-transform:uppercase;
  font-size:11px;
  color:rgba(220,242,255,.88);
  border-bottom:1px solid rgba(255,255,255,.08);
  background:linear-gradient(90deg, rgba(74,163,255,.13), rgba(139,92,255,.07));
  white-space:nowrap;
}

.tm-filter-col-body{
  padding:10px;
  max-height:340px;
  overflow-y:auto;
  overflow-x:hidden;
}

.tm-filter-empty{
  padding:8px 10px;
  color:rgba(255,255,255,.65);
  font-size:13px;
}

.tm-tag-row{
  display:grid;
  grid-template-columns:16px 1fr;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.035);
  margin-bottom:8px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition:background .12s ease, border-color .12s ease;
}

.tm-tag-row:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(125,227,255,.18);
}

.tm-tag-row input[type="checkbox"]{
  width:16px;
  height:16px;
  accent-color:var(--brand);
}

.tm-tag-row span{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.tm-tags-pop-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding-top:10px;
}

/* Active chips row */
.tm-tags-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding-top:14px;
}
.tm-chip,
.tm-gallery-tags .pill,
.tm-lightbox-tags .pill{
  border:1px solid rgba(125,227,255,.16);
  background:rgba(74,163,255,.07);
  color:rgba(220,242,255,.86);
}
.tm-chip{
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
}
.tm-chip:hover{ background:rgba(74,163,255,.12); }

/* Gallery grid + cards */
.tm-gallery-grid{
  columns:4 260px;
  column-gap:16px;
}
@media (max-width:980px){ .tm-gallery-grid{ columns:3 240px; } }
@media (max-width:720px){ .tm-gallery-grid{ columns:2 220px; } }
@media (max-width:480px){ .tm-gallery-grid{ columns:1 260px; } }

.tm-gallery-item{
  break-inside:avoid;
  margin:0 0 16px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(125,227,255,.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)),
    linear-gradient(135deg, #000000 0%, #101d2b 100%);
  cursor:pointer;
  transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
  display:flex;
  flex-direction:column;
  box-shadow:0 14px 34px rgba(0,0,0,.25);
}
.tm-gallery-item:hover,
.tm-gallery-item:focus-visible{
  transform:translateY(-3px);
  border-color:rgba(125,227,255,.34);
  box-shadow:0 22px 50px rgba(0,0,0,.38), 0 0 0 1px rgba(125,227,255,.06);
  outline:none;
}

.tm-gallery-img{
  width:100%;
  aspect-ratio:16 / 10;
  object-fit:cover;
  display:block;
  background:
    radial-gradient(circle at 18% 12%, rgba(125,227,255,.22), transparent 32%),
    linear-gradient(135deg, #05070d, #122236 58%, #0b1424);
}

.tm-gallery-item.is-missing-img .tm-gallery-img{
  display:block !important;
}

.tm-gallery-meta{
  padding:13px 14px 15px;
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:linear-gradient(180deg, rgba(7,10,18,.18), rgba(7,10,18,.38));
}

.tm-gallery-title{
  font-weight:900;
  line-height:1.08;
  letter-spacing:-.025em;
  color:rgba(255,255,255,.95);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:2.25em;
}

.tm-gallery-sub{
  margin-top:5px;
  font-size:13px;
  line-height:1.35;
  min-height:20px;
  color:rgba(170,183,214,.82);
}

.tm-gallery-tags{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height:34px;
}

/* Placeholders */
.tm-gallery-item.is-placeholder{
  opacity:.62;
  pointer-events:none;
  border-style:dashed;
}
.tm-gallery-item.is-placeholder .tm-gallery-meta{
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02));
}
.tm-ph-text,
.tm-ph-pill{
  color:transparent !important;
  user-select:none;
  border-color:rgba(255,255,255,.08) !important;
  background:linear-gradient(90deg, rgba(255,255,255,.05), rgba(125,227,255,.10), rgba(255,255,255,.05)) !important;
}
.tm-ph-img{
  filter:blur(5px) saturate(.9);
  transform:scale(1.03);
}
.tm-ph-img-fallback{
  min-height:170px;
  background:
    radial-gradient(circle at 20% 18%, rgba(125,227,255,.22), transparent 30%),
    linear-gradient(135deg, #000000 10%, #152331 90%);
}

/* Empty state */
#galleryEmpty{
  border:1px dashed rgba(125,227,255,.18);
  border-radius:16px;
  background:rgba(255,255,255,.035);
  text-align:center;
}

/* Lightbox */
.tm-lightbox{
  position:fixed;
  inset:0;
  z-index:999;
}
.tm-lightbox.is-open .tm-lightbox-card{
  transform:translateY(0) scale(1);
  opacity:1;
}
.tm-lightbox-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.70);
  backdrop-filter:blur(8px);
}
.tm-lightbox-card{
  position:relative;
  width:min(1040px, 94vw);
  max-height:min(86vh, 860px);
  margin:6vh auto 0;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow:hidden;
  border-radius:22px;
  border-color:rgba(125,227,255,.16);
  background:
    linear-gradient(180deg, rgba(7,10,18,.86), rgba(7,10,18,.72)),
    radial-gradient(640px 260px at 10% 0%, rgba(74,163,255,.15), transparent 62%);
  transform:translateY(10px) scale(.99);
  opacity:.98;
  transition:transform .12s ease, opacity .12s ease;
}
.tm-lightbox-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.tm-lightbox-title strong{
  font-size:18px;
  letter-spacing:-.02em;
}
.tm-lightbox-sub{
  font-size:13px;
  margin-top:3px;
}
.tm-lightbox-body{
  display:grid;
  grid-template-columns:44px 1fr 44px;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  min-height:0;
}
.tm-lightbox-media{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:0;
}
.tm-lightbox-media img{
  max-width:100%;
  max-height:56vh;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 18px 50px rgba(0,0,0,.38);
}
.tm-lb-nav{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(125,227,255,.14);
  background:rgba(255,255,255,.06);
  color:inherit;
  font-size:28px;
  cursor:pointer;
}
.tm-lb-nav:disabled{ opacity:.35; cursor:default; }
.tm-lb-nav:hover:not(:disabled){
  background:rgba(125,227,255,.10);
  border-color:rgba(125,227,255,.28);
}
.tm-lightbox-foot{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.tm-lightbox-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

@media (max-width:720px){
  .page-our-work .portal-title{ font-size:clamp(38px, 14vw, 58px); }
  .tm-gallery-card{ padding:16px; border-radius:18px; }
  .tm-gallery-toolbar,
  .tm-gallery-right{ align-items:stretch; }
  .tm-gallery-right,
  .tm-filter,
  .tm-gallery-search,
  .tm-tags-btn,
  #filtersReset{ width:100%; }
  .tm-filter-tags .tm-tags-pop{
    position:fixed;
    left:16px;
    right:16px;
    top:120px;
    width:auto;
    max-width:none;
    overflow:visible;
  }

  .tm-tags-list{
    max-height:55vh;
  }

  .tm-filter-grid{
    grid-template-columns:1fr;
    width:100%;
  }

  .tm-filter-col,
  .tm-filter-grid{
    width:100%;
  }

  .tm-filter-col-body{
    max-height:220px;
  }
  .tm-lightbox-body{ grid-template-columns:36px 1fr 36px; }
  .tm-lb-nav{ width:36px; height:42px; }
}

.page-our-work .tm-gallery-toolbar{
  position: relative;
  z-index: 50;
}

.page-our-work .tm-tags-chips,
.page-our-work .card-divider,
.page-our-work .tm-gallery-grid,
.page-our-work #galleryEmpty{
  position: relative;
  z-index: 1;
}

.page-our-work .tm-filter-tags{
  position: relative;
  z-index: 60;
}

.page-our-work .tm-filter-tags .tm-tags-pop{
  z-index: 9999;
}

/* Prevent gallery/filter reflow from shifting the page/background */
html{
  overflow-y: scroll;
}

.page-our-work .portal-shell::before{
  position: fixed;
  inset: 0;
  transform: none;
}