/* ═══════════════════════════════════════
   Creative Portfolio Popup — Frontend CSS
   Uses CSS custom properties from plugin settings
═══════════════════════════════════════ */

body.ct-noscroll { overflow: hidden !important; }

/* ── Wrapper ── */
.ct-wrap { font-family: var(--font, 'Poppins', sans-serif); color: #222; }

/* ── Filter Tabs ── */
.ct-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  padding: 22px 16px 0;
  border-bottom: 1px solid #e2e2e2;
  background: #fff;
  margin-bottom: 0;
}
.ct-tab {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  padding: 10px 0;
  position: relative;
  letter-spacing: .5px;
  text-transform: uppercase;
  transition: color .2s;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.ct-tab::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ccc;
  display: inline-block;
  transition: background .2s;
}
.ct-tab.on { color: var(--a, #c0392b); }
.ct-tab.on::before { background: var(--a, #c0392b); }
.ct-tab.on::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2.5px;
  background: var(--a, #c0392b);
  border-radius: 2px 2px 0 0;
}

/* ── Grid ── */
.ct-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: var(--gap, 22px);
  padding: 26px 0 50px;
}

/* ── Card ── */
.ct-card {
  background: #fff;
  border-radius: var(--r, 6px);
  overflow: hidden;
  box-shadow: var(--sh, 0 2px 10px rgba(0,0,0,.08));
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  position: relative;
}
.ct-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,.13); }

/* Card thumbnail */
.ct-ct {
  width: 100%;
  height: 210px;
  overflow: hidden;
  position: relative;
  background: #eef0f4;
}
.ct-cimg {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .38s;
}
.ct-card:hover .ct-cimg { transform: scale(1.05); }
.ct-cph {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  background: #f0f4f8;
}

/* Hover overlay */
.ct-ov {
  position: absolute; inset: 0;
  background: var(--ov, rgba(26,26,26,.82));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity .22s;
}
.ct-card:hover .ct-ov { opacity: 1; }

.ct-ob {
  width: 170px;
  padding: 10px 0;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .3px;
  transition: .18s;
  border: none;
}
.ct-qv { background: var(--a, #c0392b); color: #fff; }
.ct-qv:hover { filter: brightness(.85); }
.ct-md { background: transparent; color: var(--a, #c0392b); border: 2px solid var(--a, #c0392b); }
.ct-md:hover { background: var(--a, #c0392b); color: #fff; }

/* Card body */
.ct-cb { padding: 14px 16px 17px; }
.ct-ctt { font-size: var(--tfs, 15px); font-weight: 700; color: #1a1a1a; margin-bottom: 5px; line-height: 1.3; }
.ct-cde {
  font-size: var(--dfs, 12px); color: #777; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ct-ctg {
  display: inline-block; margin-top: 9px;
  font-size: var(--tgs, 11px); font-weight: 600;
  color: var(--a, #c0392b);
  background: rgba(var(--ar, 192,57,43), .1);
  border-radius: 3px; padding: 3px 9px;
  text-transform: uppercase; letter-spacing: .4px;
}

/* ═══════════════════════════════════════
   POPUP
═══════════════════════════════════════ */
.ct-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.ct-overlay.open { display: flex; animation: ctFade .18s ease; }
@keyframes ctFade { from{opacity:0} to{opacity:1} }

.ct-popup {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: var(--pw, 860px);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  animation: ctPop .22s ease;
  box-shadow: 0 24px 72px rgba(0,0,0,.45);
  font-family: var(--font);
}
@keyframes ctPop { from{transform:translateY(22px);opacity:0} to{transform:translateY(0);opacity:1} }
.ct-popup::-webkit-scrollbar { width: 4px; }
.ct-popup::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Close button */
.ct-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: #222; color: #fff;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s; z-index: 10; line-height: 1;
}
.ct-close:hover { background: var(--a, #c0392b); }

/* Popup header */
.ct-ph {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 22px 15px; border-bottom: 1px solid #eee;
  gap: 14px; flex-wrap: wrap;
}
.ct-ptitle { font-size: var(--pts, 18px); font-weight: 700; color: var(--a, #c0392b); margin-bottom: 4px; line-height: 1.2; }
.ct-psub { font-size: 12.5px; color: #555; }

/* Share block */
.ct-slabel { font-size: 12px; font-weight: 700; color: #222; margin-bottom: 9px; font-style: italic; text-align: right; }
.ct-sicons { display: flex; gap: 7px; justify-content: flex-end; }
.ct-si {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f0f0f0; color: #555;
  transition: .16s; text-decoration: none;
}
.ct-si:hover { background: var(--a, #c0392b); color: #fff; }

/* Gallery area */
.ct-gallery { padding: 16px 22px 12px; }

/* Hero image — tall, scrollable */
.ct-hero {
  width: 100%;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  background: #f5f5f5;
  margin-bottom: 10px;
  line-height: 0;
  max-height: 440px;
  overflow-y: auto;
}
.ct-hero::-webkit-scrollbar { width: 4px; }
.ct-hero::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.ct-himg { width: 100%; display: block; }
.ct-himg.ct-swap { animation: ctSwap .2s ease; }
@keyframes ctSwap { from{opacity:.2;transform:scale(.98)} to{opacity:1;transform:scale(1)} }

.ct-hph {
  width: 100%; height: 240px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; background: #f5f5f5;
}

/* Gallery grid — 2-col */
.ct-ggrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ct-gi {
  position: relative; border-radius: 5px; overflow: hidden;
  cursor: pointer; border: 2px solid #e0e0e0;
  transition: border-color .16s, transform .16s, box-shadow .16s;
  background: #f0f4f8; line-height: 0; aspect-ratio: 16/9;
}
.ct-gi img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-gi:hover:not(.on) { border-color: #bbb; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ct-gi.on { border-color: var(--a, #c0392b); box-shadow: 0 0 0 3px rgba(var(--ar, 192,57,43),.15); }
.ct-gi.on::after { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--a, #c0392b); }

/* Popup footer */
.ct-pfoot {
  padding: 14px 22px 18px;
  display: flex; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid #f0f0f0;
}
.ct-pbtn {
  padding: 10px 24px; border-radius: 4px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; border: 2px solid var(--a, #c0392b); transition: .16s;
  text-decoration: none; display: inline-block;
}
.ct-pv { background: var(--a, #c0392b); color: #fff; }
.ct-pv:hover { filter: brightness(.85); color: #fff; }
.ct-ps { background: transparent; color: var(--a, #c0392b); }
.ct-ps:hover { background: var(--a, #c0392b); color: #fff; }

.ct-credit { padding: 8px 22px 14px; font-size: 11px; color: #bbb; text-align: right; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .ct-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 540px) {
  .ct-grid { grid-template-columns: 1fr !important; gap: 14px; }
  .ct-tabs { gap: 12px; }
  .ct-ph { flex-direction: column; }
  .ct-slabel, .ct-sicons { text-align: left; justify-content: flex-start; }
  .ct-ggrid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .ct-popup { border-radius: 6px; }
}
