/* assets/css/gallery-kcg.css (ISOLATED — will not touch nav/footer) */

:root{
  --kcg-ink: rgba(12,14,18,.92);
  --kcg-mutedInk: rgba(12,14,18,.62);

  --kcg-text: rgba(233,238,252,.92);
  --kcg-muted: rgba(233,238,252,.72);

  --kcg-lineDark: rgba(12,14,18,.12);
  --kcg-line: rgba(255,255,255,.12);

  --kcg-glass: rgba(255,255,255,.62);
  --kcg-card: rgba(255,255,255,.86);

  --kcg-shadow: 0 18px 50px rgba(0,0,0,.28);
  --kcg-shadowSoft: 0 12px 30px rgba(0,0,0,.12);

  --kcg-radius: 18px;
  --kcg-gap: 12px;

  --kcg-accent: rgba(43,196,227,1);
  --kcg-accentSoft: rgba(43,196,227,.20);

  --kcg-modalA: rgba(18,20,28,.88);
  --kcg-modalB: rgba(10,12,18,.92);
}

/* ===== Gallery section ===== */
.kcg{
  padding: 20px 14px 28px;
  color: var(--kcg-ink);
  overflow-x: clip;
}

.kcg__head{
  max-width: 980px;
  margin: 0 auto 14px;
}

.kcg__badge{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(43,196,227,.18), rgba(255,255,255,.88));
  border: 1px solid var(--kcg-lineDark);
  color: var(--kcg-ink);
  font-weight: 850;
  letter-spacing: .2px;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

.kcg__title{
  margin: 10px 0 6px;
  font-size: clamp(22px, 4.4vw, 34px);
  line-height: 1.12;
  color: var(--kcg-ink);
  letter-spacing: -.2px;
}

.kcg__sub{
  margin: 0 0 12px;
  color: var(--kcg-mutedInk);
  line-height: 1.45;
}

/* Filters */
.kcg__filters{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border-radius: 16px;
  background: var(--kcg-glass);
  border: 1px solid var(--kcg-lineDark);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

.kcg__filter{
  appearance: none;
  border: 1px solid rgba(12,14,18,.14);
  background: rgba(255,255,255,.78);
  color: rgba(12,14,18,.78);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.kcg__filter:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.92);
}

.kcg__filter[aria-selected="true"]{
  background: linear-gradient(135deg, var(--kcg-accentSoft), rgba(255,255,255,.92));
  border-color: rgba(43,196,227,.55);
  color: rgba(8,10,14,.94);
  box-shadow: 0 10px 18px rgba(43,196,227,.18);
}

/* Grid */
.kcg__grid{
  max-width: 1300px;
  margin: 14px auto 0;
  column-count: 2;
  column-gap: var(--kcg-gap);
}

@media (min-width: 640px){
  .kcg__grid{
    column-count: 3;
  }
}

@media (min-width: 980px){
  .kcg__grid{
    column-count: 4;
  }
}

@media (min-width: 1200px){
  .kcg__grid{
    column-count: 5;
  }
}

/* Card (generated by your JS should use these classes) */
.kcgCard{
  break-inside: avoid;
  margin: 0 0 var(--kcg-gap);
  border-radius: var(--kcg-radius);
  background: var(--kcg-card);
  border: 1px solid rgba(12,14,18,.10);
  box-shadow: var(--kcg-shadowSoft);
  overflow: hidden;
  position: relative;
  transform: translateZ(0);
}

.kcgCard__btn{
  width: 100%;
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.kcgCard__img{
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1080 / 1350;
  object-fit: cover;
  transition: transform .25s ease, filter .25s ease;
}

.kcgCard:hover .kcgCard__img{
  transform: scale(1.03);
  filter: saturate(1.05);
}

.kcgCard__tag{
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 12px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Foot */
.kcg__foot{
  display: flex;
  justify-content: center;
  padding: 14px 0 0;
}

.kcg__more{
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(12,14,18,.14);
  background: rgba(255,255,255,.78);
  color: rgba(12,14,18,.86);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0,0,0,.10);
  transition: transform .18s ease, box-shadow .18s ease;
}

.kcg__more:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
}

/* ===== Modal ===== */
.kcgm{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.kcgm[aria-hidden="false"]{
  display: block;
}

.kcgm__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.kcgm__panel{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(94vw, 980px);
  height: min(92vh, 860px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, var(--kcg-modalA), var(--kcg-modalB));
  box-shadow: var(--kcg-shadow);
  display: flex;
  flex-direction: column;
}

.kcgm__close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  z-index: 20;
}

.kcgm__figure{
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: radial-gradient(1200px 600px at 50% 20%, rgba(255,255,255,.08), rgba(0,0,0,.18));
}

.kcgm__img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  transform-origin: center;
  transition: transform .18s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.kcgm__bar{
  flex: 0 0 auto;
  padding: 12px 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,18,.92);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

@media (min-width: 860px){
  .kcgm__bar{
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.kcgm__metaTitle{
  color: rgba(255,255,255,.92);
  font-weight: 900;
  letter-spacing: .2px;
}

.kcgm__metaSub{
  color: rgba(255,255,255,.68);
  font-size: 13px;
  margin-top: 2px;
  line-height: 1.35;
}

.kcgm__actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.kcgm__cta{
  flex: 0 0 auto;
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,18,.92);
  display: flex;
  justify-content: flex-end;
}

/* ===== Isolated button system for gallery only ===== */
.kcgBtn{
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  font-weight: 900;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.08);
}

.kcgBtn--soft{
  background: rgba(255,255,255,.10);
}

.kcgBtn--primary{
  color: rgba(10,12,18,.96);
  border: 1px solid rgba(255,255,255,.45);
  background:
    radial-gradient(120px 120px at 16% 50%, rgba(255,255,255,.35), transparent 62%),
    linear-gradient(90deg, rgba(43,196,227,1) 0%, rgba(255,45,85,1) 100%);
}

.kcgBtn--wide{
  width: 100%;
  max-width: 340px;
}

.kcgm__chev{
  display: inline-block;
  transform: translateY(-1px);
}

/* Menu (fixed, never clipped) */
.kcgm__menu{
  position: relative;
}

.kcgm__menuPanel{
  display: none;
  min-width: 270px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(12,14,20,.96);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  padding: 8px;
  z-index: 999999;
}

.kcgm__menuPanel[aria-hidden="false"]{
  display: block;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(140px + env(safe-area-inset-bottom));
}

@media (min-width: 860px){
  .kcgm__menuPanel[aria-hidden="false"]{
    bottom: calc(160px + env(safe-area-inset-bottom));
    right: calc(50% - 480px + 16px);
  }
}

.kcgm__menuItem{
  width: 100%;
  text-align: left;
  border: 0;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  margin: 6px 0;
  font-weight: 900;
}

.kcgm__menuItem:hover{
  background: rgba(43,196,227,.16);
}

.kcgm__menuItem--muted{
  background: rgba(255,255,255,.06);
  color: rgba(233,238,252,.78);
}

.kcgm__close,
.kcgm__panel button{
  touch-action: manipulation;
}
