/**
 * TMC Instagram Feed styles.
 *
 * The feed reuses the active theme's gallery classes (.section, .wrap,
 * .mosaic, .tile, .tile__tag, .btn, .eyebrow), so within the tmc-dallas theme
 * almost everything here is inert. Two roles only:
 *
 *   1. Additive bits the theme has no equivalent for (clickable tiles, the
 *      video badge, the empty-state CTA, the horizontal row layout).
 *   2. Low-specificity :where() fallbacks so the feed still looks right if the
 *      theme's CSS is ever absent. :where() keeps specificity at 0, so the
 *      theme's own rules always win when present.
 */

/* ---- Additive: clickable tiles (theme tiles are <figure>) ---- */
.tmc-ig a.tile {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* ---- Additive: video badge ---- */
.tmc-ig__play {
	position: absolute;
	top: 0.7rem;
	right: 0.7rem;
	z-index: 2;
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	color: var(--white, #fbeff4);
	background: rgba(6, 4, 9, 0.55);
	border: 1px solid var(--line, rgba(201, 166, 180, 0.16));
	backdrop-filter: blur(4px);
}
.tmc-ig__play svg {
	width: 15px;
	height: 15px;
	margin-left: 2px;
}

/* ---- Additive: empty-state CTA ---- */
.tmc-ig__cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.1rem;
	padding: 2rem;
	border: 1px solid var(--line, rgba(201, 166, 180, 0.16));
	border-radius: var(--radius, 16px);
	background: var(--panel, rgba(16, 6, 16, 0.62));
}
.tmc-ig__cta p {
	margin: 0;
	color: var(--muted, #c9a6b4);
	font-size: 1.125rem;
}

/* ---- Additive: horizontal row layout ---- */
.tmc-ig--row .tmc-ig__row {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
}
.tmc-ig--row .tile {
	flex: 0 0 clamp(150px, 40vw, 220px);
	aspect-ratio: 1 / 1;
	scroll-snap-align: start;
}

/* ---- Additive: busier feed as a MASONRY wall (full images, no cropping) ----
   The theme renders .tile images with object-fit:cover inside fixed-height grid
   cells, which crops every photo. Here the feed switches to a CSS multi-column
   masonry: each tile sizes to its own image (portrait flyers tall, landscape
   shots wide), so the whole image always shows while the columns stay densely
   packed. Real selectors (specificity >= 0,2,0) override the theme's grid
   .mosaic rules; the .t-feature/.t-wide/.t-tall span classes are simply inert
   here (column layouts can't span columns). */
.tmc-ig .tmc-ig__grid {
	display: block;          /* override the theme's display:grid */
	column-count: 4;
	column-gap: 0.6rem;
}
.tmc-ig .tmc-ig__grid .tile {
	display: block;
	break-inside: avoid;     /* never split a photo across two columns */
	margin: 0 0 0.6rem;      /* vertical gap between stacked tiles */
	height: auto;            /* let the image define the tile height */
	min-height: 120px;       /* reserve space so the masonry can't collapse to 0
	                            before images load (which also lets lazy-loading
	                            fire as tiles scroll into view) */
	background: var(--panel, rgba(16, 6, 16, 0.62)); /* placeholder while loading */
}
.tmc-ig .tmc-ig__grid .tile img {
	display: block;
	height: auto;            /* show the whole image instead of cropping to fill */
	object-fit: contain;
}
@media (max-width: 1100px) {
	.tmc-ig .tmc-ig__grid {
		column-count: 3;
	}
}
@media (max-width: 640px) {
	.tmc-ig .tmc-ig__grid {
		column-count: 2;
		column-gap: 0.5rem;
	}
	.tmc-ig .tmc-ig__grid .tile {
		margin-bottom: 0.5rem;
	}
}

/* ============================================================
   Low-specificity fallbacks (apply only when the theme's own
   gallery CSS is missing). :where() = specificity 0,0,0.
   ============================================================ */
:where(.tmc-ig.section) {
	padding-block: clamp(4.5rem, 3rem + 7vw, 9rem);
	position: relative;
}
:where(.tmc-ig .wrap) {
	width: min(100% - 2.5rem, 1240px);
	margin-inline: auto;
}
:where(.tmc-ig .eyebrow) {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	margin: 0 0 1.5rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--ember, #ff7a3d);
}
:where(.tmc-ig .gallery__head) {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 2rem;
	flex-wrap: wrap;
	margin-bottom: 2rem;
}
:where(.tmc-ig .mosaic) {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 200px;
	gap: 1rem;
}
:where(.tmc-ig .tile) {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius, 16px);
	border: 1px solid var(--line, rgba(201, 166, 180, 0.16));
}
:where(.tmc-ig .tile img) {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
:where(.tmc-ig .t-feature) {
	grid-column: span 2;
	grid-row: span 2;
}
:where(.tmc-ig .t-wide) {
	grid-column: span 2;
}
:where(.tmc-ig .t-tall) {
	grid-row: span 2;
}
:where(.tmc-ig .tile__tag) {
	position: absolute;
	left: 0.85rem;
	bottom: 0.8rem;
	z-index: 2;
	padding: 0.32rem 0.7rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--white, #fbeff4);
	background: rgba(6, 4, 9, 0.6);
	border: 1px solid var(--line, rgba(201, 166, 180, 0.16));
}
:where(.tmc-ig .btn) {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.78rem 1.3rem;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	color: var(--white, #fbeff4);
	border: 1px solid var(--line-strong, rgba(255, 61, 90, 0.3));
}
:where(.tmc-ig .btn svg) {
	width: 17px;
	height: 17px;
}

@media (max-width: 900px) {
	:where(.tmc-ig .mosaic) {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: 160px;
	}
}
@media (max-width: 560px) {
	:where(.tmc-ig .mosaic) {
		grid-template-columns: 1fr;
		grid-auto-rows: 200px;
	}
}
