/* --- Cromarty Live Gallery: layout & styles (updated overlay + controls) --- */
.cromarty-gallery {
  --gap: 16px;
  --radius: 12px;
  --cap-font: 1rem; /* slightly larger for overlay text */
  --control-font: 1rem; /* controls match page font */
  --transition-time: 1.6s;
}

/* Controls row: increase sizes so inputs/buttons match font */
.cromarty-gallery .cg-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 6px 0 10px;
}

/* Make selects, inputs, buttons and labels larger and friendlier */
.cromarty-gallery .cg-controls select,
.cromarty-gallery .cg-controls input[type="search"],
.cromarty-gallery .cg-controls input[type="text"],
.cromarty-gallery .cg-controls input[type="checkbox"],
.cromarty-gallery .cg-controls button,
.cromarty-gallery .cg-controls label {
  font-size: var(--control-font);
  line-height: 1.2;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: #111;
}

/* Make checkbox label spacing nicer */
.cromarty-gallery .cg-controls .cg-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
}

/* The grid */
.cromarty-gallery #cg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  align-items: start;
}

/* Card basics */
.cromarty-gallery .cg-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f0f0f;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transition: opacity var(--transition-time) ease, transform var(--transition-time) ease;
  will-change: opacity, transform;
}

/* Thumb area (image) */
.cromarty-gallery .cg-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: block;
}
.cromarty-gallery .cg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* Overlay meta (sits on image) */
.cromarty-gallery .cg-meta-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.18) 45%, transparent 100%);
  color: #fff;
  pointer-events: none; /* don't block clicks on the link */
}
.cromarty-gallery .cg-meta-overlay .cg-line {
  font-size: 1.02rem; /* slightly larger */
  font-weight: 600;
  text-shadow:
    0 1px 1px rgba(0,0,0,0.8),
    0 2px 6px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ensure the link covers thumb so clicking anywhere opens it */
.cromarty-gallery .cg-thumb .cg-link {
  position: absolute;
  inset: 0;
  display: block;
}

/* Remove the old separate meta area (if present) */
.cromarty-gallery .cg-meta { display: none; }

/* Hidden/in/out transitions */
.cromarty-gallery .cg-card.cg-out { opacity: 0; transform: scale(.985); }
.cromarty-gallery .cg-card.cg-in { opacity: 1; transform: none; }

/* Responsive card sizing */
@media (min-width: 900px) {
  .cromarty-gallery #cg-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
@media (min-width: 1200px) {
  .cromarty-gallery #cg-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
}

/* Small visual polish */
.cromarty-gallery .cg-card { background: #111; border-radius: 10px; }