/*
Theme Name: Morningside Capital
Theme URI: https://morningsidecap.com/
Description: Refreshed WordPress version of morningsidecap.com. The home page is a regular page ("Home" under Pages) built from blocks: wordmark, intro, email and a logo gallery. Run Appearance → Morningside Setup once to build it.
Version: 2.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: morningside
*/

:root {
	--ms-red: #ef3e36;
	--ms-text: #8b8b8b;
	--ms-ink: #4a4a4a;
	--ms-line: #d9d9d9;
	--ms-side: 230px;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background-color: #f4f4f2;
	background-image: var(--ms-bg-tile);
	background-repeat: repeat;
	color: var(--ms-text);
	font-family: petitamediumregular, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--ms-red); text-decoration: none; transition: color .15s ease; }
a:hover { color: #c92d26; }
::selection { background: #b3d4fc; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}

/* ---------- Home layout: sidebar + content ---------- */
.ms-home {
	max-width: 1040px;
	margin: 0 auto;
	padding: 72px 40px 32px;
	display: grid;
	grid-template-columns: var(--ms-side) minmax(0, 1fr);
	column-gap: 72px;
	align-items: start;
}
/* Every block goes in the right column, except the sidebar group. */
.ms-home > * { grid-column: 2; min-width: 0; }
.ms-home > .ms-side {
	grid-column: 1;
	grid-row: 1 / span 40;
	position: sticky;
	top: 72px;
	margin: 0;
	padding-right: 32px;
	min-height: calc(100vh - 144px);
	border-right: 1px solid var(--ms-line);
	box-shadow: 1px 0 0 #fff;
}
body.admin-bar .ms-home > .ms-side { top: 104px; }

/* Sidebar contents */
.ms-side .ms-wordmark { margin: 0 0 88px; }
.ms-side .ms-wordmark img { width: 190px; height: auto; display: block; }
.ms-side p { font-size: 14px; line-height: 22px; margin: 0 0 22px; }
.ms-side h1, .ms-side h2, .ms-side h3, .ms-side h4, .ms-side h5, .ms-side h6 {
	font-family: inherit; font-size: 11px; font-weight: normal; color: var(--ms-text);
	text-transform: uppercase; letter-spacing: .12em; margin: 48px 0 0;
}
.ms-side h6 + p { margin-top: 0; }
.ms-side a { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

/* Right-column text blocks (anything you add to the page) */
.ms-home > h1, .ms-home > h2, .ms-home > h3 { color: var(--ms-ink); font-weight: normal; letter-spacing: .04em; }
.ms-home > p { max-width: 60ch; }

/* ---------- Logo grid (Gallery block with class "ms-logos") ---------- */
.wp-block-gallery.has-nested-images.ms-logos {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	margin: 36px 0 0;
}
.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image:not(#individual-image) {
	width: auto;
	margin: 0;
	height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid var(--ms-line);
	box-shadow: 0 1px 0 #fff;
}
.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image a {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 160px;
	height: 72px;
}
.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image img {
	width: auto !important;
	height: auto !important;
	max-width: 160px !important;
	max-height: 64px;
	object-fit: contain;
	transform: scale(.9);
	transition: transform .2s ease, opacity .2s ease;
}
.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image:hover img { transform: scale(1); }
.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image figcaption { display: none; }

/* ---------- Footer ---------- */
.ms-footer {
	grid-column: 2;
	margin-top: 28px;
	padding-bottom: 12px;
	font-size: 11px;
	color: #b3b3b3;
	text-transform: uppercase;
	letter-spacing: .06em;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px 20px;
}
.ms-footer a { color: #b3b3b3; }
.ms-footer a:hover { color: var(--ms-red); }

/* ---------- Inner pages (Privacy, Terms, anything else) ---------- */
.ms-page {
	max-width: 760px;
	margin: 0 auto;
	padding: 40px 90px 50px;
	background: #fff;
	font-size: 13px;
	line-height: 1.7;
	box-shadow: 0 0 0 1px rgba(0,0,0,.03);
}
.ms-page .ms-brand { margin: 20px 0 60px; }
.ms-page .ms-brand a {
	display: block; margin: 0 auto; width: 300px; max-width: 100%; height: 51px;
	background: var(--ms-logo-large) no-repeat center / contain;
}
.ms-page article { border-bottom: 1px solid #ccc; padding-bottom: 15px; }
.ms-page h1, .ms-page h2, .ms-page h3 { color: var(--ms-red); text-transform: uppercase; letter-spacing: 3px; }
.ms-page .entry-title { font-family: Arial, Helvetica, sans-serif; font-size: 21px; font-weight: bold; margin: 0 0 1em; }
.ms-page h2:not(.entry-title), .ms-page h3 { font-size: 14px; font-weight: normal; margin: 0; }
.ms-page p { margin: 0 0 1.5em; }
.ms-page .ms-footer { margin-top: 30px; justify-content: space-between; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
	.ms-home { display: block; padding: 40px 24px 24px; }
	.ms-home > .ms-side {
		position: static; min-height: 0; padding: 0 0 28px; margin-bottom: 8px;
		border-right: 0; box-shadow: none; border-bottom: 1px solid var(--ms-line);
	}
	.ms-side .ms-wordmark { margin-bottom: 32px; }
	.ms-side h6 { margin-top: 24px; }
	.wp-block-gallery.has-nested-images.ms-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
	.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image:not(#individual-image) { height: 120px; }
	.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image a { width: 130px; }
	.wp-block-gallery.has-nested-images.ms-logos figure.wp-block-image img { max-width: 130px !important; }
	.ms-footer { justify-content: center; }
	.ms-page { padding: 28px 22px 36px; }
	.ms-page .ms-footer { justify-content: center; }
}
