/* Shared styles for all category pages */

/* Breadcrumb styling */
.breadcrumb-container {
	padding-left: 2vw;
	padding-right: 2vw;
	padding-top: 1.35vw;
	padding-bottom: 1vw;
	margin-left: -2vw;
	margin-right: -2vw;
	margin-top: 0;
	border-bottom: solid .4vw rgba(0, 0, 0, 1);
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
}

.breadcrumb-container:hover {
	background-color: #000;
}

.breadcrumb-container:hover .breadcrumb,
.breadcrumb-container:hover .breadcrumb a {
	color: #FFF;
}

.breadcrumb {
	font-family: "Unica-77-Bold", Helvetica, sans-serif;
	font-size: 4.25vw;
	letter-spacing: -.03em;
	line-height: .8em;
	color: rgba(0,0,0,1);
}

.breadcrumb a {
	color: rgba(0,0,0,1);
	text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb-container:hover .breadcrumb a:hover {
	color: #FFF;
}

/* Fix heading bottom padding to match main page */
.heading-2, .heading-3, .heading-4 {
	padding-bottom: .65vw;
	cursor: default;
	pointer-events: none;
}

.heading-2:hover, .heading-3:hover, .heading-4:hover {
	opacity: .95;
}

.heading-3 {
	padding-bottom: 1.3vw;
}

/* Ensure sticky behavior works on category pages */
.heading-wrapper-sticky {
	position: sticky;
	top: 0;
	z-index: 100;
}

.heading-wrapper-2 {
	position: sticky;
	top: 0;
	z-index: 100;
}

/* Ensure images container has background for sticky to work */
.images {
	background-color: #f5f3f2;
	padding-bottom: 0;
}

/* Remove link ability from SKU tags on category pages */
.update, .update-2, .update-3, .update-4 {
	cursor: default;
	pointer-events: none;
}

/* 3-column masonry grid - portraits span 2 rows */
/* Use percentage columns with vw rows - both scale naturally with viewport */
/* Column width = 33.333%, row height = 23.33vw (matches landscape 10/7 ratio) */
#grid.grid-three-column {
	display: grid !important;
	grid-template-columns: 33.333% 33.333% 33.334% !important; /* Percentage columns add to 100% */
	grid-auto-rows: 23.33vw !important; /* vw units scale naturally with viewport */
	gap: 0 !important;
	padding: 0 !important;
	width: 100% !important; /* Fill parent container */
	max-width: 100% !important; /* Don't exceed parent */
	min-width: 0 !important; /* Allow shrinking */
	grid-auto-flow: row !important; /* Sequential flow - no repositioning */
	box-sizing: border-box !important;
	border-top: none !important;
	border-bottom: none !important;
	counter-reset: grid;
	overflow: hidden !important; /* Prevent any overflow */
	margin: 0 !important;
}

#grid.grid-three-column .item,
#grid.grid-three-column .item-2 {
	background-position: center center !important;
	background-repeat: no-repeat !important;
	background-size: cover !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important; /* Fill grid cell */
	min-width: 0 !important; /* Allow shrinking */
	min-height: 0 !important; /* Allow shrinking */
	box-sizing: border-box !important;
	background-color: #f5f3f2 !important; /* Match page background to prevent white edges */
	border-radius: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	cursor: pointer;
	-webkit-user-drag: none;
	user-select: none;
}

/* Landscape images - 1 column × 1 row - grid controls dimensions */
#grid.grid-three-column .item {
	grid-column: span 1 !important;
	grid-row: span 1 !important;
	/* No aspect-ratio - let grid control dimensions to prevent overflow */
}

/* Portrait images - 1 column × 2 rows - grid controls dimensions */
#grid.grid-three-column .item-2 {
	grid-column: span 1 !important;
	grid-row: span 2 !important;
	/* No aspect-ratio - let grid control dimensions to prevent overflow */
}

/* Override nth-child selectors from time-life.css - keep landscape wider */
#grid.grid-three-column .item:nth-child(3n),
#grid.grid-three-column .item:nth-child(3n - 1) {
	aspect-ratio: 10 / 7 !important; /* Wider landscape */
	grid-column: span 1 !important;
	grid-row: span 1 !important;
}

/* Mobile adjustments */
@media only screen and (max-width: 768px) {
	html, body {
		touch-action: manipulation;
	}

	.breadcrumb-container {
		display: none;
	}
	
	.breadcrumb {
		font-family: "ABC-Mono-Medium", Helvetica, sans-serif;
		font-size: .6rem;
		text-transform: uppercase;
		letter-spacing: .13em;
		line-height: .8em;
	}
	
	/* Fix heading bottom padding on mobile */
	.heading-2 {
		padding-bottom: 2vw !important;
	}
	
	.heading-3 {
		padding-bottom: 3vw !important;
	}
	
	.heading-4 {
		padding-bottom: 2vw !important;
	}
	
	#grid.grid-three-column {
		grid-template-columns: repeat(2, 1fr) !important;
		grid-auto-rows: auto !important; /* Let aspect ratios control row height on mobile */
		gap: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}
	
	/* Landscape images on mobile - restore aspect ratio */
	#grid.grid-three-column .item {
		aspect-ratio: 10 / 7 !important; /* Wider landscape ratio */
	}
	
	/* Portrait images on mobile - restore aspect ratio */
	#grid.grid-three-column .item-2 {
		grid-row: span 1 !important; /* Single row on mobile, aspect ratio makes it tall */
		aspect-ratio: 4 / 5 !important; /* Taller portrait ratio */
	}
	
	/* Fix sticky header on mobile category pages */
	.heading-wrapper-sticky {
		position: sticky;
		top: 0;
		z-index: 100;
	}
	
	.heading-wrapper-2 {
		position: sticky;
		top: 0;
		z-index: 100;
	}
}
