/* ITW Legacy Content – old galleries, images, videos and grids on the new theme */
.itw-legacy-gallery {
	display: grid;
	grid-template-columns: repeat(var(--itw-cols, 3), minmax(0, 1fr));
	gap: var(--itw-gap, 4px);
	margin: 1.75em 0;
}
.itw-legacy-gallery__item { margin: 0; }
.itw-legacy-gallery__item a { display: block; }
.itw-legacy-gallery__item img {
	display: block; width: 100%; height: auto;
	aspect-ratio: var(--itw-ratio, 4 / 3); object-fit: cover; border-radius: 3px;
}
.itw-legacy-gallery__caption {
	grid-column: 1 / -1; margin: 6px 0 0;
	font-family: var(--wp--preset--font-family--sans, sans-serif); font-size: 0.875rem; color: var(--wp--preset--color--muted, #665F55);
}
@media (max-width: 600px) {
	.itw-legacy-gallery { grid-template-columns: repeat(min(var(--itw-cols, 3), 2), minmax(0, 1fr)); }
}
.itw-legacy-image { margin: 1.75em 0; }
.itw-legacy-image img { display: block; width: 100%; height: auto; border-radius: 3px; }
.itw-legacy-image figcaption { font-family: var(--wp--preset--font-family--sans, sans-serif); font-size: 0.875rem; color: var(--wp--preset--color--muted, #665F55); margin-top: 8px; }
.itw-legacy-video { margin: 1.75em 0; }
.itw-legacy-video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 3px; }
.itw-legacy-banner {
	margin: 2.5em 0; padding: clamp(48px, 10vw, 120px) 24px; border-radius: 4px;
	background-size: cover; background-position: center; color: #fff; text-align: center; position: relative; overflow: hidden;
}
.itw-legacy-banner::before { content: ""; position: absolute; inset: 0; background: rgba(28, 24, 20, 0.45); }
.itw-legacy-banner__inner { position: relative; }
.itw-legacy-banner :is(h1, h2, h3, h4, a) { color: #fff; }
.itw-legacy-button { margin: 1em 0; }
.itw-legacy-posts {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
	gap: 32px 24px; margin: 2em 0; text-align: left;
}
.itw-legacy-posts__card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.itw-legacy-posts__img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--wp--preset--color--sand, #E7E1D6); }
.itw-legacy-posts__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.itw-legacy-posts__date { font-family: var(--wp--preset--font-family--sans, sans-serif); font-size: 0.8125rem; color: var(--wp--preset--color--muted, #665F55); }
.itw-legacy-posts__title { font-family: var(--wp--preset--font-family--display, serif); font-size: 1.375rem; line-height: 1.2; }
.itw-legacy-posts__card:hover .itw-legacy-posts__title { color: var(--wp--preset--color--accent, #6F604A); }

/* Photo viewer */
.itw-lb { position: fixed; inset: 0; z-index: 100000; background: rgba(20, 17, 14, 0.94); display: flex; align-items: center; justify-content: center; }
.itw-lb[hidden] { display: none; }
.itw-lb img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.itw-lb button {
	position: absolute; background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; border-radius: 999px;
	width: 48px; height: 48px; font-size: 24px; line-height: 48px; cursor: pointer;
}
.itw-lb button:hover, .itw-lb button:focus-visible { background: rgba(255, 255, 255, 0.28); outline: 2px solid #fff; outline-offset: 2px; }
.itw-lb__close { top: 16px; right: 16px; }
.itw-lb__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.itw-lb__next { right: 16px; top: 50%; transform: translateY(-50%); }
.itw-lb__count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #ddd; font: 600 14px/1 sans-serif; }

.itw-legacy-missing { margin: 1em 0; padding: 10px 14px; border: 1.5px dashed #b32d2e; border-radius: 4px; background: #fdf3f2; color: #8a2424; font: 600 0.8125rem/1.45 var(--wp--preset--font-family--sans, sans-serif); }
