/* Stroud Utilities - Investments front-end styles.
   Colors, sizes, fonts, etc. are supplied by the settings page via inline CSS. */

.stroud-investments-wrap {
	--stroud-cols: 4;
}

/* ---------- Section titles ---------- */

/* Space between sections comes from the "Section Separator Height" setting
   (applied as margin-top on the following section via inline CSS). */

.stroud-section-title {
	text-align: center;
	font-weight: 700;
	margin: 0 0 40px;
	line-height: 1.2;
}

/* ---------- Category filter buttons ---------- */

.stroud-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
	margin-bottom: 50px;
}

/* Up to 6 buttons per row, independent of the "Items Per Row" setting.
   Buttons grow to fill the full row width, so fewer buttons = wider buttons. */
.stroud-filters .stroud-filter-btn {
	flex: 1 1 calc((100% - 100px) / 6); /* min basis of 1/6th (100px = 5 gaps of 20px) */
	box-sizing: border-box;
}

.stroud-filter-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 90px;
	padding: 15px 10px;
	border: 0;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 3px;
	text-transform: uppercase;
	line-height: 1.5;
	cursor: pointer;
	transition: filter 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.stroud-filter-btn:hover,
.stroud-filter-btn:focus {
	filter: brightness(1.35);
	transform: translateY(-3px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.stroud-filter-btn.is-active {
	filter: brightness(1.5);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Realized Investments buttons get their own background; hover/active states
   still adapt automatically via the brightness() filters above. */
.stroud-section-realized .stroud-filter-btn {
	background-color: #4a7fb5;
}

/* ---------- "Pick a category" prompt ---------- */

.stroud-grid-prompt {
	text-align: center;
	color: #2f2e34;
	font-family: "Montserrat", Helvetica, Arial, Lucida, sans-serif;
	font-size: 18px;
	font-style: italic;
	margin: 0 0 30px;
}

/* A grid preceded by the prompt is filterable: its items stay hidden until a
   category is chosen (the JS toggles them with inline display values). */
.stroud-grid-prompt + .stroud-grid .stroud-item {
	display: none;
}

/* ---------- Item grid ---------- */

.stroud-grid {
	display: grid;
	grid-template-columns: repeat(var(--stroud-cols, 4), 1fr);
	gap: 30px;
	align-items: stretch;
}

.stroud-divider {
	grid-column: 1 / -1;
	border: 0;
	border-top-style: solid;
	/* Color, thickness, and margins come from settings. */
}

/* ---------- Items ---------- */

.stroud-item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 340px;
	overflow: hidden;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* While the grid is re-filtering, items fade/scale out; removing the class
   fades the remaining items back in. */
.stroud-grid.stroud-fading .stroud-item {
	opacity: 0;
	transform: scale(0.95);
}

.stroud-item-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 20px;
	box-sizing: border-box;
}

.stroud-item-logo img {
	max-width: 100%;
	max-height: 300px;
	width: auto;
	height: auto;
}

/* Hover overlay: semi-transparent so the logo shows through. */

.stroud-item-overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	padding: 25px 20px;
	box-sizing: border-box;
	text-align: center;
	opacity: 0;
	overflow-y: auto;
	transition: opacity 0.3s ease;
}

.stroud-item:hover .stroud-item-overlay,
.stroud-item:focus-within .stroud-item-overlay {
	opacity: 1;
}

.stroud-item-inner {
	margin: auto; /* Vertically/horizontally centers, stays scrollable when content overflows. */
	width: 100%;
}

.stroud-item-title {
	margin: 0 0 14px;
	font-weight: 700;
	letter-spacing: 3px;
	text-transform: uppercase;
	line-height: 1.3;
}

/* On hover the title's bottom spacing shrinks by 5px (font sizes shrink by
   1px via the dynamic inline CSS, since they come from settings). */
.stroud-item:hover .stroud-item-title,
.stroud-item:focus-within .stroud-item-title {
	margin-bottom: 9px;
}

.stroud-item-content {
	line-height: 1.7;
}

.stroud-item-content p {
	margin: 0 0 1em;
	color: inherit;
	font-size: inherit;
}

.stroud-item-content p:last-child {
	margin-bottom: 0;
}

.stroud-item-link {
	display: inline-block;
	margin-top: 18px;
	font-weight: 700;
	letter-spacing: 4px;
	text-transform: uppercase;
	text-decoration: none;
}

.stroud-item-link:hover,
.stroud-item-link:focus {
	text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
	.stroud-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.stroud-filters .stroud-filter-btn {
		flex-basis: calc((100% - 20px) / 2); /* 2 per row */
	}
}

@media (max-width: 600px) {
	.stroud-grid {
		grid-template-columns: 1fr;
	}

	.stroud-filters .stroud-filter-btn {
		flex-basis: 100%;
	}
}
