/* ==========================================================================
   My Spectacles – Blog (archive + single post)
   Same design language as the homepage: navy headings, purple accents,
   Poppins headings, Montserrat text, grey bands, rounded white cards.
   ========================================================================== */

/* ---------- Tokens ---------- */
.msb {
	--ms-navy: #333974;
	--ms-purple: #575d9b;
	--ms-purple-dark: #454a85;
	--ms-ink: #1d1f2b;
	--ms-text: #3a3a3a;
	--ms-muted: #5f6470;
	--ms-grey: #f2f2f2;
	--ms-soft: #f1f2fa;
	--ms-line: #e2e4ea;
	--ms-sale: #c8102e;
	--ms-head: "Poppins", "Helvetica Neue", Arial, sans-serif;
	--ms-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;

	font-family: var(--ms-body);
	color: var(--ms-text);
	font-size: 16px;
	line-height: 1.6;
}
.msb *, .msb *::before, .msb *::after { box-sizing: border-box; }
.msb ul, .msb ol { list-style: none; margin: 0; padding: 0; }
.msb img { max-width: 100%; height: auto; }
.msb :focus-visible { outline: 2px solid var(--ms-purple); outline-offset: 3px; border-radius: 4px; }
.msb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Let the template run edge to edge inside Astra (header/footer stay as they are). */
body.ms-blog-page .site-content > .ast-container { max-width: 100%; padding: 0; display: block; }
body.ms-blog-page #primary { width: 100%; margin: 0; padding: 0; }

.msb-container { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 20px; }
.msb-container--narrow { max-width: 900px; }
.msb-container--article, .msb-hero--post .msb-container { max-width: 1140px; }
.msb-hero--post .msb-hero__title, .msb-hero--post .msb-hero__text { max-width: 880px; }

/* ---------- Hero ---------- */
.msb-hero {
	padding: clamp(36px, 5vw, 64px) 0 clamp(40px, 5.5vw, 72px);
	text-align: center;
	background: linear-gradient(313deg, #d1e3e3 38%, #ecebd7 57%);
}
.msb-hero--post { text-align: left; padding-bottom: clamp(56px, 7vw, 96px); }
.msb-eyebrow {
	margin: 0 0 8px; font-family: var(--ms-head); font-weight: 600; font-size: .85rem;
	letter-spacing: .08em; text-transform: uppercase; color: var(--ms-purple);
}
.msb-hero__title {
	margin: 0 0 14px; font-family: var(--ms-head); font-weight: 700; color: var(--ms-navy);
	font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.15; text-wrap: balance;
}
.msb-hero:not(.msb-hero--post) .msb-hero__title { text-transform: uppercase; }
.msb-hero__title { display: block !important; visibility: visible !important; } /* never let a site-wide ".entry-title {display:none}" rule hide the H1 */
.msb-hero__text { margin: 0 auto 8px; max-width: 62ch; font-size: 1.08rem; color: var(--ms-text); text-wrap: pretty; }
.msb-hero--post .msb-hero__text { margin-inline: 0; }

/* Breadcrumb */
.msb-crumbs { margin: 0 0 18px; font-size: .86rem; color: var(--ms-muted); }
.msb-crumbs ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.msb-hero--post .msb-crumbs ol { justify-content: flex-start; }
.msb-crumbs li + li::before { content: "/"; margin: 0 8px; color: #9aa0b4; }
.msb-crumbs a { color: var(--ms-muted); text-decoration: none; }
.msb-crumbs a:hover { color: var(--ms-purple); text-decoration: underline; }
.msb-crumbs [aria-current] { color: var(--ms-ink); font-weight: 500; }

/* Category chips (filter) */
.msb-filter { margin-top: 26px; }
.msb-filter ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.msb-filter a {
	display: inline-block; padding: 9px 20px; border: 1px solid var(--ms-line); border-radius: 999px; background: #fff;
	font-family: var(--ms-head); font-weight: 500; font-size: .9rem; color: var(--ms-ink); text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s;
}
.msb-filter a:hover, .msb-filter a:focus { background: var(--ms-soft); border-color: var(--ms-purple); color: var(--ms-navy); }
.msb-filter a[aria-current="page"], .msb-filter a[aria-current="page"]:hover { background: var(--ms-purple); border-color: var(--ms-purple); color: #fff; }

/* Small label chip on cards / posts */
.msb-chip { margin: 0 0 10px; }
.msb-chip, .msb-chip a {
	display: inline-block; font-family: var(--ms-head); font-weight: 600; font-size: .72rem; letter-spacing: .08em;
	text-transform: uppercase; color: var(--ms-purple); text-decoration: none;
}
.msb-chip a:hover { text-decoration: underline; }

/* Meta line */
.msb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; font-size: .85rem; color: var(--ms-muted); }
.msb-meta--post { margin-top: 18px; font-size: .92rem; }

/* ---------- Sections ---------- */
.msb-section { padding-block: clamp(44px, 6vw, 80px); }
.msb-section--grey { background: var(--ms-grey); }
.msb-head { margin-bottom: clamp(24px, 3.5vw, 40px); text-align: center; }
.msb-section__title {
	margin: 0; font-family: var(--ms-head); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.125rem);
	line-height: 1.2; color: var(--ms-navy); text-transform: uppercase; text-wrap: balance;
}
.msb-section__title::after { content: ""; display: block; width: 56px; height: 4px; margin: 14px auto 0; border-radius: 4px; background: var(--ms-purple); }

/* ---------- Card grid ---------- */
.msb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.msb-card {
	position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
	background: #fff; border: 1px solid var(--ms-line); border-radius: 14px;
	transition: transform .25s, box-shadow .25s, border-color .25s;
}
.msb-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(51, 57, 116, .12); border-color: #cfd3ea; }
.msb-card__media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ms-soft); }
.msb-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.msb-card:hover .msb-card__media img { transform: scale(1.04); }
.msb-card__ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ms-purple); background: linear-gradient(135deg, #e7e9f6, #f6f1e4); }
.msb-card__body { display: flex; flex: 1; flex-direction: column; padding: 22px 22px 24px; }
.msb-card__title { margin: 0 0 10px; font-family: var(--ms-head); font-weight: 600; font-size: 1.15rem; line-height: 1.3; color: var(--ms-ink); text-transform: none; }
.msb-card__link { color: inherit; text-decoration: none; }
.msb-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is clickable */
.msb-card__link:hover { color: var(--ms-purple); }
.msb-card__excerpt {
	margin: 0 0 14px; font-size: .95rem; color: var(--ms-text);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.msb-card .msb-meta { margin-top: auto; }
.msb-card__more { margin-top: 14px; font-family: var(--ms-head); font-weight: 600; font-size: .9rem; color: var(--ms-purple); }
.msb-card__more span { display: inline-block; transition: transform .2s; }
.msb-card:hover .msb-card__more span { transform: translateX(4px); }

/* Wide first card: image left, text right, kept compact */
.msb-card--feature { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.msb-card--feature .msb-card__media { aspect-ratio: auto; height: 100%; min-height: 280px; max-height: 360px; }
.msb-card--feature .msb-card__body { justify-content: center; padding: clamp(22px, 3vw, 40px); }
.msb-card--feature .msb-card__title { margin-bottom: 12px; font-size: clamp(1.3rem, 2.1vw, 1.7rem); line-height: 1.25; color: var(--ms-navy); }
.msb-card--feature .msb-card__excerpt { font-size: .98rem; -webkit-line-clamp: 3; }
.msb-card--feature .msb-card__body .msb-meta { margin-top: 0; }

/* ---------- Pagination ---------- */
.msb-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 44px; }
.msb-pager .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px;
	border: 1px solid var(--ms-line); border-radius: 10px; background: #fff;
	font-family: var(--ms-head); font-weight: 500; color: var(--ms-ink); text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s;
}
.msb-pager a.page-numbers:hover { background: var(--ms-soft); border-color: var(--ms-purple); color: var(--ms-navy); }
.msb-pager .page-numbers.current { background: var(--ms-purple); border-color: var(--ms-purple); color: #fff; }
.msb-pager .page-numbers.dots { border-color: transparent; background: none; }

/* Empty state */
.msb-empty { max-width: 560px; margin: 0 auto; padding: 48px 24px; text-align: center; background: #fff; border: 1px solid var(--ms-line); border-radius: 16px; }
.msb-empty h2 { margin: 0 0 8px; font-family: var(--ms-head); color: var(--ms-navy); font-size: 1.4rem; }
.msb-empty p { margin: 0 0 20px; }

/* ---------- Buttons (links styled as buttons) ---------- */
.msb-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 28px;
	border: 2px solid transparent; border-radius: 6px; font-family: var(--ms-head); font-weight: 500; font-size: .95rem;
	line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.msb-btn--primary { background: var(--ms-purple); color: #fff; }
.msb-btn--primary:hover { background: var(--ms-purple-dark); color: #fff; transform: translateY(-2px); }
.msb-btn--dark { background: #2b2b2b; color: #fff; text-transform: uppercase; letter-spacing: .02em; }
.msb-btn--dark:hover { background: var(--ms-navy); color: #fff; }
.msb-btn--light { background: #fff; color: var(--ms-navy); }
.msb-btn--light:hover { background: #eceef7; color: var(--ms-navy); transform: translateY(-2px); }
.msb-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.msb-btn--ghost:hover { background: #fff; color: var(--ms-navy); }

/* ---------- Closing banner ---------- */
.msb-cta { background: #fff; padding: 56px 0 88px; }
.msb-cta__inner {
	padding: 64px 32px; border-radius: 24px; text-align: center; color: #fff;
	background: linear-gradient(135deg, var(--ms-navy), var(--ms-purple)); box-shadow: 0 20px 50px rgba(51, 57, 116, .2);
}
.msb-cta__title { margin: 0 0 12px; font-family: var(--ms-head); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); text-transform: uppercase; color: #fff; text-wrap: balance; }
.msb-cta__text { margin: 0 auto 28px; max-width: 60ch; font-size: 1.05rem; opacity: .92; text-wrap: balance; }
.msb-cta__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ==========================================================================
   Single post
   ========================================================================== */

/* Cover image overlaps the hero */
.msb-cover { margin: calc(-1 * clamp(36px, 5vw, 64px)) 0 0; }
.msb-cover img {
	display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: #fff;
	border-radius: 18px; border: 1px solid var(--ms-line); box-shadow: 0 20px 50px rgba(51, 57, 116, .16);
}

/* Article + sidebar */
.msb-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: clamp(32px, 4.5vw, 56px) clamp(48px, 6vw, 80px); }
.msb-main { min-width: 0; max-width: 760px; margin-inline: auto; width: 100%; }
.msb-aside { min-width: 0; }

@media (min-width: 1024px) {
	.msb-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; }
	.msb-aside__sticky { position: sticky; top: calc(var(--ms-hd-h, 0px) + var(--ms-adminbar, 0px) + 24px); display: grid; gap: 24px; }
}

/* Reading text */
.msb-prose { font-size: 1.0625rem; line-height: 1.85; color: #2f3340; overflow-wrap: break-word; }
.msb-prose > :first-child { margin-top: 0; }
.msb-prose p { margin: 0 0 1.35em; }
.msb-prose h2, .msb-prose h3, .msb-prose h4 { font-family: var(--ms-head); color: var(--ms-navy); line-height: 1.3; text-transform: none; scroll-margin-top: 96px; }
.msb-prose h2 { margin: 2em 0 .6em; font-size: clamp(1.45rem, 2.4vw, 1.75rem); font-weight: 700; }
.msb-prose h3 { margin: 1.7em 0 .5em; font-size: clamp(1.2rem, 2vw, 1.35rem); font-weight: 600; }
.msb-prose h4 { margin: 1.5em 0 .4em; font-size: 1.1rem; font-weight: 600; }
.msb-prose a { color: var(--ms-purple); text-decoration: underline; text-underline-offset: 3px; }
.msb-prose a:hover { color: var(--ms-navy); }
.msb-prose strong { color: var(--ms-ink); }
.msb-prose ul, .msb-prose ol { margin: 0 0 1.35em; padding-left: 1.4em; }
.msb-prose ul { list-style: disc; }
.msb-prose ol { list-style: decimal; }
.msb-prose li { margin-bottom: .45em; padding-left: .2em; }
.msb-prose li::marker { color: var(--ms-purple); }
.msb-prose img, .msb-prose video { max-width: 100%; height: auto; border-radius: 12px; }
.msb-prose figure { margin: 1.8em 0; }
.msb-prose figcaption { margin-top: 8px; font-size: .88rem; text-align: center; color: var(--ms-muted); }
.msb-prose iframe { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }
.msb-prose blockquote { margin: 1.8em 0; padding: 18px 22px; border-left: 4px solid var(--ms-purple); border-radius: 0 12px 12px 0; background: var(--ms-soft); font-size: 1.05rem; }
.msb-prose blockquote > :last-child { margin-bottom: 0; }
.msb-prose hr { margin: 2.2em 0; border: 0; border-top: 1px solid var(--ms-line); }
.msb-prose table { display: block; width: 100%; max-width: 100%; margin: 0 0 1.5em; overflow-x: auto; border-collapse: collapse; font-size: .95rem; }
.msb-prose th, .msb-prose td { padding: 10px 14px; border: 1px solid var(--ms-line); text-align: left; vertical-align: top; }
.msb-prose th { background: var(--ms-soft); color: var(--ms-navy); font-family: var(--ms-head); font-weight: 600; }
.msb-prose pre, .msb-prose code { font-size: .92em; background: var(--ms-soft); border-radius: 6px; }
.msb-prose code { padding: 2px 6px; }
.msb-prose pre { padding: 16px; overflow-x: auto; }
.msb-prose .alignleft, .msb-prose .alignright { float: none; margin: 0 auto 1.4em; display: block; }
.msb-prose .aligncenter { display: block; margin-inline: auto; }
.msb-prose > *:last-child { margin-bottom: 0; }

/* Table of contents */
.msb-toc { background: #fff; border: 1px solid var(--ms-line); border-radius: 14px; }
.msb-toc--side { padding: 20px 22px; }
.msb-toc__title, .msb-toc summary { margin: 0 0 10px; font-family: var(--ms-head); font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ms-navy); }
.msb-toc ol { display: grid; gap: 2px; }
.msb-toc a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid var(--ms-line); font-size: .9rem; line-height: 1.4; color: var(--ms-text); text-decoration: none; }
.msb-toc a:hover { color: var(--ms-purple); border-color: var(--ms-purple); }
.msb-toc a.is-current { color: var(--ms-purple); border-color: var(--ms-purple); font-weight: 600; }
.msb-toc__l3 a { padding-left: 24px; font-size: .86rem; }
.msb-toc--inline { margin: 0 0 28px; padding: 6px 18px; }
.msb-toc--inline summary { margin: 0; padding: 12px 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.msb-toc--inline summary::-webkit-details-marker { display: none; }
.msb-toc--inline summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--ms-purple); }
.msb-toc--inline[open] summary::after { content: "–"; }
.msb-toc--inline ol { padding-bottom: 12px; }
@media (min-width: 1024px) { .msb-toc--inline { display: none; } }
@media (max-width: 1023px) { .msb-toc--side { display: none; } }

/* Sidebar promo */
.msb-promo { padding: 24px; border-radius: 14px; text-align: center; color: #fff; background: linear-gradient(135deg, var(--ms-navy), var(--ms-purple)); }
.msb-promo__title { margin: 0 0 16px; font-family: var(--ms-head); font-weight: 700; font-size: 1.15rem; line-height: 1.3; color: #fff; }
.msb-promo .msb-btn { width: 100%; }
@media (max-width: 1023px) { .msb-promo { max-width: 760px; margin: 0 auto; } }

/* Share */
.msb-share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 40px; padding: 20px 0; border-block: 1px solid var(--ms-line); }
.msb-share__label { margin: 0; font-family: var(--ms-head); font-weight: 600; font-size: .9rem; color: var(--ms-navy); }
.msb-share ul { display: flex; flex-wrap: wrap; gap: 8px; }
.msb-share__btn {
	display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--ms-line); border-radius: 999px;
	background: #fff; color: var(--ms-ink); font-family: var(--ms-head); font-weight: 500; font-size: .85rem; line-height: 1.2;
	text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.msb-share__btn:hover, .msb-share__btn:focus { background: var(--ms-soft); border-color: var(--ms-purple); color: var(--ms-navy); }
.msb-share__copy.is-done, .msb-share__copy.is-done:hover { background: var(--ms-purple); border-color: var(--ms-purple); color: #fff; }

/* Tags */
.msb-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.msb-tags a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--ms-soft); color: var(--ms-navy); font-size: .85rem; text-decoration: none; }
.msb-tags a:hover { background: var(--ms-purple); color: #fff; }

.msb-comments { margin-top: 48px; }

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
	.msb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
	.msb-card--feature .msb-card__media { min-height: 240px; }
	.msb-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.msb-grid--3 .msb-card:nth-child(3) { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.msb-container { padding-inline: 16px; }
	.msb-grid, .msb-grid--3 { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.msb-grid--3 .msb-card:nth-child(3) { display: flex; }
	.msb-card--feature { display: flex; flex-direction: column; }
	.msb-card--feature .msb-card__media { height: auto; min-height: 0; max-height: none; aspect-ratio: 3 / 2; }
	.msb-card__body { padding: 18px 18px 20px; }
	.msb-hero--post { padding-bottom: 64px; }
	.msb-cover img { border-radius: 14px; aspect-ratio: 16 / 10; }
	.msb-prose { font-size: 1.02rem; line-height: 1.8; }
	.msb-cta { padding: 36px 0 56px; }
	.msb-cta__inner { padding: 44px 20px; border-radius: 20px; }
	.msb-pager { margin-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.msb * { transition: none !important; }
	.msb-card:hover, .msb-card:hover .msb-card__media img { transform: none; }
}
