/* Year archives (ex-archive.php); every rule is scoped to body.ex-archive. Blocks get no vertical margins here: the gaps
   between them come from the content flow rules in ex-site.css (> * + *). */

/* Photo galleries: masonry columns like Elementor Pro's gallery (4 / 2 / 1 columns, 10 px gaps), thumbnails open in
   the core lightbox. Core's gallery is a flex row of equal cells; these rules turn it into CSS columns. */
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry {
	display: block;
	column-count: 4;
	column-gap: 10px;
}
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.columns-2 { column-count: 2; }
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.columns-3 { column-count: 3; }
@media (max-width: 1024px) { .ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry { column-count: 2; } }
@media (max-width: 767px) { .ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry { column-count: 1; } }
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry figure.wp-block-image:not(#individual-image) {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	break-inside: avoid;
}
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry figure.wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
}
/* With ex-archive.js: a grid of 1 px rows, filled like Elementor (row by row, each photo under the shortest column). */
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.ex-masonry-js {
	--ex-masonry-gap: 10px;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 1px;
	grid-auto-flow: row dense;
	column-gap: var(--ex-masonry-gap);
	row-gap: 0;
}
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.ex-masonry-js.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.ex-masonry-js.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1024px) { .ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.ex-masonry-js { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.ex-masonry-js { grid-template-columns: minmax(0, 1fr); } }
.ex-archive .ex-content .wp-block-gallery.has-nested-images.ex-masonry.ex-masonry-js figure.wp-block-image:not(#individual-image) {
	align-self: start;
	margin: 0;
}

/* Video pairs (IAG Live): two to a row, one on phones. */
.ex-archive .ex-content .ex-row-videos {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px 40px;
}
.ex-archive .ex-content .ex-row-videos > * { margin: 0; }
@media (max-width: 767px) { .ex-archive .ex-content .ex-row-videos { grid-template-columns: minmax(0, 1fr); } }

/* Side-by-side rows (exhibitors, nominees): logo/photo column and text column. */
.ex-archive .ex-content .wp-block-columns { gap: var(--ex-s-4); }
.ex-archive .ex-content .wp-block-column > :last-child { margin-bottom: 0; }
.ex-archive .ex-content .wp-block-column .wp-block-image img { height: auto; max-width: 100%; }

/* Framed rows (2025 Exhibition's exhibitors): a thin white frame around logo and text, as on live. */
.ex-archive .ex-content .wp-block-columns.ex-box {
	padding: var(--ex-s-2);
	border: 1px solid #fff;
}

/* Dividers between sections: a thin light rule, as Elementor's divider widget. */
.ex-archive .ex-content .wp-block-separator {
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 0.4;
}

/* Sponsor "Click here" buttons inside cards. */
.ex-archive .ex-content .wp-block-button__link {
	padding: 12px 24px;
	border-radius: 3px;
	color: #fff;
	font-size: 15px;
	line-height: 1;
}

/* Grey cards: live mixes grey (#a7a7a7) panels in with the dark-blue ones (judges, sponsors); they keep their colour. */
.ex-archive .ex-content .ex-card.ex-card-grey { background: #a7a7a7; }
/* A card row that Elementor padded with empty cells (one sponsor tier per row, a centred sponsor) keeps the card in
   the same column while the grid is three across. */
@media (min-width: 1025px) {
	.ex-archive .ex-content .ex-cards > .ex-card-col-2 { grid-column-start: 2; }
	.ex-archive .ex-content .ex-cards > .ex-card-col-3 { grid-column-start: 3; }
}

/* Popups reproduced from Elementor (ex-archive.js): hidden until opened, then a box over the page in the same look as
   the sponsor lightbox elsewhere on the site (iag-content's .cmg-lb: navy box, round corners, lilac Close). */
.ex-archive .ex-content .ex-popup { display: none; }
.ex-archive .ex-content .ex-popup.is-open,
.ex-archive .ex-content .ex-popup:target {
	display: block;
	position: fixed;
	z-index: 100001;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(640px, calc(100vw - 2 * var(--ex-s-4)));
	max-height: 90vh;
	overflow-y: auto;
	margin: 0;
	padding: 40px 32px 24px;
	border-radius: 15px;
	background: #1a1c4b;
	color: #fff;
	font-size: 15px;
	line-height: 1.7;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	scrollbar-width: thin;
	scrollbar-color: var(--ex-link) #1a1c4b;
}
.ex-archive .ex-content .ex-popup:target { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.7); }
.ex-archive .ex-content .ex-popup:focus { outline: none; }
.ex-archive .ex-content .ex-popup > * { max-width: none; margin: 0 0 12px; }
.ex-archive .ex-content .ex-popup h2 { margin: 0 0 4px; font-family: var(--ex-body); font-size: 26px; font-weight: 700; line-height: 1.2; text-transform: none; text-align: left; }
.ex-archive .ex-content .ex-popup .wp-block-separator { margin: var(--ex-s-2) 0 var(--ex-s-3); }
.ex-archive .ex-content .ex-popup .wp-block-image img { display: block; max-width: 260px; width: 100%; height: auto; margin: 0 auto; padding: 8px; border-radius: 5px; background: #fff; }
.ex-archive .ex-content .ex-popup .wp-block-image { margin-bottom: 24px; }
.ex-archive .ex-content .ex-popup a:not(.wp-block-button__link) { color: var(--ex-link); text-decoration: underline; }
.ex-archive .ex-content .ex-popup .wp-block-embed { margin: var(--ex-s-3) 0; padding-block: 0; }
.ex-archive .ex-content .ex-popup .wp-block-buttons { margin: 20px 0 0; }
.ex-archive .ex-content .ex-popup .ex-popup-close .wp-block-button__link { padding: 10px 36px; border-radius: 6px; color: #000; font-size: 14px; font-weight: 600; }
.ex-popup-scrim { display: none; position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, 0.7); }
.ex-popup-scrim.is-open { display: block; }
.ex-popup-lock, .ex-popup-lock body { overflow: hidden; }

/* Tables pasted into HTML blocks (2025 Exhibition's schedule) scroll inside themselves on phones instead of widening
   the page. */
@media (max-width: 767px) { .ex-archive .ex-content .wp-block-html table, .ex-archive .ex-content > table { display: block; max-width: 100%; overflow-x: auto; } }
