/**
 * Image arrangement element (inc/widgets/class-image-arrangement.php).
 * The PHP writes each device's geometry to custom properties (--d-* desktop, --t-* tablet, --m-* phone);
 * these rules apply them at Elementor's breakpoints (phone ≤767px, tablet ≤1024px).
 *   grid:  --x-cols (grid-template-columns), --x-dir (rtl = mirrored), --x-disp (flex = justified rows)
 *   item:  --x-c / --x-r (column / row span), --x-ar (slot shape; slots without one stretch to the row),
 *          --x-grow (0 for shaped slots: they keep their shape when a title makes the row taller),
 *          --x-w (justified rows: the item's width), --x-order (stacked: the mirrored desktop reading order)
 * The gutter is the --gc-gap-images token (20px, the old grid's gutter).
 */

.gc-ia { position: relative; }
.gc-ia__group-link { display: block; color: inherit; text-decoration: none; }

.gc-ia__grid {
	display: grid;
	gap: var(--gc-gap-images, 20px);
	grid-auto-flow: row dense;
	flex-wrap: wrap;
}
.gc-ia__item { position: relative; display: flex; flex-direction: column; min-width: 0; direction: ltr; }
.gc-ia__media { position: relative; display: block; flex: 1 1 auto; min-height: 0; overflow: hidden; line-height: 0; }
.gc-ia .gc-ia__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
/* Titles (the home page tiles): 10px below the image, as the old grid's column padding gave. */
.gc-ia__title { flex: none; }
.gc-ia__item > .gc-ia__title, .gc-ia > .gc-ia__title { margin-top: 10px; }
.gc-ia-legacy-grid .gc-ia > .gc-ia__title, .gc-ia-legacy-row .gc-ia > .gc-ia__title { margin-top: 0; }
.gc-ia__title :is(h1, h2, h3, h4, h5, h6, p) { margin-bottom: 0; }

@media (min-width: 1025px) {
	.gc-ia__grid { display: var(--d-disp, grid); grid-template-columns: var(--d-cols, minmax(0, 1fr)); direction: var(--d-dir, ltr); }
	.gc-ia__item { grid-column: var(--d-c, auto); grid-row: var(--d-r, auto); width: var(--d-w, auto); order: var(--d-order, 0); }
	.gc-ia__media { aspect-ratio: var(--d-ar, auto); flex-grow: var(--d-grow, 1); }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.gc-ia__grid { display: var(--t-disp, grid); grid-template-columns: var(--t-cols, minmax(0, 1fr)); direction: var(--t-dir, ltr); }
	.gc-ia__item { grid-column: var(--t-c, auto); grid-row: var(--t-r, auto); width: var(--t-w, auto); order: var(--t-order, 0); }
	.gc-ia__media { aspect-ratio: var(--t-ar, auto); flex-grow: var(--t-grow, 1); }
}
@media (max-width: 767px) {
	.gc-ia__grid { display: var(--m-disp, grid); grid-template-columns: var(--m-cols, minmax(0, 1fr)); direction: var(--m-dir, ltr); }
	.gc-ia__item { grid-column: var(--m-c, auto); grid-row: var(--m-r, auto); width: var(--m-w, auto); order: var(--m-order, 0); }
	.gc-ia__media { aspect-ratio: var(--m-ar, auto); flex-grow: var(--m-grow, 1); }
	.gc-ia__item--hide-m { display: none; }
}

/* Carousel (Owl, as the old theme's image carousel): every image at its own shape, the height follows it. */
.gc-ia__slide, .gc-ia__slide-media { display: block; }
.gc-ia__slide .img-width-caption { position: relative; display: block; }
.gc-ia .gc-ia__slide .gc-ia__img { position: static; height: auto; }
.elementor-editor-active .gc-ia__carousel:not(.owl-loaded) { display: grid; gap: var(--gc-gap-images, 20px); }

/* Arrangements migrated from the old grid keep its spacing: rows had 1rem margins (inner rows and linked blocks
   none), columns 10px padding. */
.e-con .elementor-widget.gc-ia-legacy-row, .elementor-widget.elementor-widget.gc-ia-legacy-row { margin-block: 1rem; }
.gc-ia-legacy-row .gc-ia__grid, .gc-ia-legacy-grid .gc-ia__grid { padding-block: 10px; }
.gc-ia-legacy-carousel-gap .gc-ia__grid { padding-bottom: calc(10px + 1rem); } /* row that held a one-image carousel */

.gc-ia--empty { padding: 2em; text-align: center; outline: 1px dashed currentColor; }

/* Photo credit badge: the media box sets line-height 0 (no gap under images); give the badge its own, so it keeps the
   theme's pill size (27 Nov 2026). Light variant for dark photos (the old site took white from the surrounding section). */
.gc-ia__media .img-caption { line-height: 1.5; }
.img-caption.img-caption--light { color: var(--gc-color-white); }
