/* ═══════════════════════════════════════════
   Image Card Gallery — Plugin Styles v1.0.3
   Works inside Elementor columns / any container
════════════════════════════════════════════ */

:root {
  --icg-ink:   #0e0e0e;
  --icg-warm:  #e8dfd4;
  --icg-gold:  #c9a84c;
  --icg-muted: #8a8178;
}

/* ── Reset inside plugin scope ── */
.icg-wrap *,
.icg-wrap *::before,
.icg-wrap *::after,
.icg-overlay *,
.icg-overlay *::before,
.icg-overlay *::after {
  box-sizing: border-box;
}

/* ════════════════════════════════
   GRID  —  container-aware layout
════════════════════════════════ */
.icg-wrap {
  display: grid;
  gap: 24px;
  width: 100%;
  margin: 0;
}
.icg-cols-1 { grid-template-columns: 1fr; }
.icg-cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.icg-cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.icg-cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }

/* ════════════════════════════════
   CARD
════════════════════════════════ */
.icg-card {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 20px 60px rgba(0,0,0,.08);
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease;
}
.icg-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08), 0 32px 80px rgba(0,0,0,.14);
}

/* Cover image — aspect-ratio keeps proportional at any width */
.icg-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}
.icg-card__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(.9);
  transition: filter .4s ease, transform .5s cubic-bezier(.22,1,.36,1);
}
.icg-card:hover .icg-card__thumb {
  filter: saturate(1.1);
  transform: scale(1.04);
}
.icg-card__badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--icg-gold);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
  z-index: 1;
}

/* Card body */
.icg-card__body {
  padding: 20px 22px 22px;
  border-top: 1px solid var(--icg-warm);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.icg-card__label {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--icg-gold);
  margin: 0 0 8px;
}
.icg-card__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 600;
  color: var(--icg-ink);
  line-height: 1.25;
  margin: 0 0 10px;
}
.icg-card__desc {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--icg-muted);
  line-height: 1.65;
  margin: 0 0 18px;
  flex: 1;
}
.icg-card__meta {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.icg-card__count {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--icg-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.icg-btn-view {
  width: 100%;
  padding: 11px 16px;
  background: var(--icg-ink);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background .25s ease;
  line-height: 1;
}
.icg-btn-view::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  transform: translateX(-100%);
  transition: transform .4s ease;
}
.icg-btn-view:hover { background: #222; }
.icg-btn-view:hover::after { transform: translateX(100%); }

/* ════════════════════════════════
   OVERLAY
════════════════════════════════ */
.icg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,8,6,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.icg-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ════════════════════════════════
   LIGHTBOX
════════════════════════════════ */
.icg-lightbox {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 960px;
  height: calc(100vh - 32px);
  max-height: 860px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.5);
  transform: translateY(20px) scale(.97);
  transition: transform .38s cubic-bezier(.22,1,.36,1);
}
.icg-overlay.open .icg-lightbox {
  transform: translateY(0) scale(1);
}

.icg-lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--icg-warm);
  flex-shrink: 0;
}
.icg-lb-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--icg-ink);
  margin: 0;
}
.icg-lb-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  color: var(--icg-muted);
  letter-spacing: .06em;
  margin-top: 3px;
}
.icg-lb-close {
  flex-shrink: 0;
  width: 34px; height: 34px;
  background: var(--icg-warm);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .25s;
}
.icg-lb-close:hover { background: #d5cec7; transform: rotate(90deg); }

/* Preview — fills all space between header and thumbnails */
.icg-lb-preview {
  flex: 1 1 0;
  min-height: 0;        /* CRITICAL: lets flex shrink below content */
  position: relative;
  background: #111;
  overflow: hidden;
}
.icg-lb-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;  /* full image always visible, no crop */
  object-position: center;
  display: block;
  transition: opacity .28s ease;
}

.icg-lb-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  pointer-events: none;
}
.icg-nav-btn {
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  pointer-events: all;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transition: background .2s, transform .2s;
}
.icg-nav-btn:hover { background: #fff; transform: scale(1.1); }

.icg-lb-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #fff;
  padding: 32px 18px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  pointer-events: none;
}
.icg-lb-counter {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .05em;
  pointer-events: none;
}

/* Thumbnail strip */
.icg-lb-thumbs {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  background: #f9f6f2;
  border-top: 1px solid var(--icg-warm);
  scrollbar-width: thin;
  scrollbar-color: var(--icg-warm) transparent;
}
.icg-lb-thumbs::-webkit-scrollbar { height: 3px; }
.icg-lb-thumbs::-webkit-scrollbar-thumb { background: var(--icg-warm); border-radius: 3px; }

.icg-lb-thumb {
  flex-shrink: 0;
  width: 68px; height: 52px;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .55;
  transition: opacity .2s, border-color .2s, transform .2s;
}
.icg-lb-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.icg-lb-thumb:hover { opacity: .85; transform: translateY(-2px); }
.icg-lb-thumb.active { border-color: var(--icg-gold); opacity: 1; }

.icg-empty {
  color: var(--icg-muted);
  font-style: italic;
  font-family: 'Outfit', sans-serif;
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 768px) {
  .icg-overlay        { padding: 12px; }
  .icg-lightbox       { height: calc(100dvh - 24px); max-height: none; border-radius: 6px; }
  .icg-lb-header      { padding: 13px 16px; }
  .icg-lb-title       { font-size: 17px; }
  .icg-lb-thumb       { width: 56px; height: 44px; }
  .icg-nav-btn        { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
  .icg-overlay        { padding: 0; align-items: flex-end; }
  .icg-lightbox       { width: 100vw; height: 100dvh; border-radius: 0; max-height: none; }
  .icg-lb-header      { padding: 11px 14px; }
  .icg-lb-title       { font-size: 15px; }
  .icg-lb-subtitle    { font-size: 10px; }
  .icg-lb-close       { width: 30px; height: 30px; }
  .icg-lb-thumbs      { padding: 8px 10px; gap: 5px; }
  .icg-lb-thumb       { width: 50px; height: 40px; }
  .icg-nav-btn        { width: 30px; height: 30px; }
  .icg-lb-caption     { font-size: 11px; padding: 22px 12px 10px; }
  .icg-lb-counter     { font-size: 10px; top: 8px; right: 8px; padding: 3px 8px; }
}
