/* =========================================================
   Trademark Ignition Blog — layout styles
   Brand tokens (matched from the main Next.js site):
   Navy:    #141952
   Red:     #E83040
   Lavender:#E3E5FF
   Pink:    #FFBFC5
   BG tint: #EEEEFF
   Font:    var(--font-manjari) / "Manjari"
   ========================================================= */

/* =========================================================
   FIX: the --font-manjari CSS variable is only defined inside
   a scoped Next.js module class on the original site, which
   doesn't exist here. Without this, every element using the
   "font-manjari" utility class (footer, headings, etc.) loses
   its font entirely. Defining it globally fixes that. This is
   the main reason the layout looked broken.
   ========================================================= */
:root {
	--font-manjari: "Manjari", "Manjari Fallback", sans-serif;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	color: #141952;
	background: #fff;
	font-family: var(--font-manjari), "Manjari", sans-serif;
}

a { text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

.tib-open { max-height: none !important; opacity: 1 !important; }

/* ---------- Page wrapper ---------- */
.tib-page-wrap {
	width: 100%;
	background: #EEEEFF;
	padding: 2rem 1.5rem 4rem;
}
@media (min-width: 768px) {
	.tib-page-wrap { padding: 2.5rem 4rem 5rem; }
}

.tib-container {
	max-width: 1299px;
	margin: 0 auto;
}

/* ---------- Hero / page header ---------- */
.tib-hero {
	text-align: center;
	max-width: 760px;
	margin: 0 auto 3rem;
}
.tib-hero .tib-eyebrow {
	display: inline-block;
	background: #fff;
	color: #E83040;
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.4rem 1rem;
	border-radius: 999px;
	margin-bottom: 1.25rem;
	box-shadow: 0 2px 10px rgba(20,25,82,0.08);
}
.tib-hero h1 {
	font-size: clamp(1.9rem, 4vw, 2.75rem);
	font-weight: 800;
	color: #141952;
	line-height: 1.15;
	margin: 0 0 1rem;
}
.tib-hero p {
	color: #4b5179;
	font-size: 1.05rem;
	line-height: 1.6;
	margin: 0;
}

/* ---------- Blog grid ---------- */
.tib-blog-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}
@media (min-width: 640px) {
	.tib-blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
	.tib-blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.tib-card {
	background: linear-gradient(135deg, #FFBFC5, #E3E5FF);
	border-radius: 1.25rem;
	padding: 1px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tib-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px rgba(20,25,82,0.12);
}
.tib-card-inner {
	background: #fff;
	border-radius: calc(1.25rem - 1px);
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.tib-card-thumb {
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #EEEEFF;
}
.tib-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.tib-card:hover .tib-card-thumb img { transform: scale(1.05); }

.tib-card-body {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}
.tib-card-meta {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #E83040;
	margin-bottom: 0.6rem;
}
.tib-card-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: #141952;
	line-height: 1.35;
	margin: 0 0 0.6rem;
}
.tib-card-title a { color: inherit; }
.tib-card-title a:hover { color: #E83040; }

.tib-card-excerpt {
	color: #5b6080;
	font-size: 0.92rem;
	line-height: 1.6;
	margin: 0 0 1.25rem;
	flex: 1;
}

.tib-card-readmore {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 700;
	font-size: 0.88rem;
	color: #141952;
}
.tib-card-readmore:hover { color: #E83040; }

/* ---------- Pagination ---------- */
.tib-pagination {
	margin-top: 3.5rem;
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}
.tib-pagination a,
.tib-pagination span {
	min-width: 2.5rem;
	height: 2.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.75rem;
	font-weight: 600;
	font-size: 0.9rem;
	color: #141952;
	background: #fff;
	padding: 0 0.75rem;
}
.tib-pagination a:hover { background: #E83040; color: #fff; }
.tib-pagination .current { background: #141952; color: #fff; }

/* ---------- Breadcrumb ---------- */
.tib-breadcrumb {
	max-width: 1100px;
	margin: 0 auto 1.5rem;
	font-size: 0.85rem;
	color: #6b6f95;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}
.tib-breadcrumb a { color: #6b6f95; }
.tib-breadcrumb a:hover { color: #E83040; }
.tib-breadcrumb .tib-breadcrumb-current { color: #141952; font-weight: 600; }

/* override single-header/thumb max-width to match the wider two-col layout */
.tib-single-header,
.tib-single-thumb { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* ---------- Post layout: TOC sidebar + content ---------- */
.tib-post-layout {
	max-width: 1100px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
	align-items: start;
}
@media (min-width: 992px) {
	.tib-post-layout { grid-template-columns: 280px 1fr; }
}

.tib-toc-sidebar { order: -1; }
@media (min-width: 992px) {
	.tib-toc-sidebar { order: 0; }
}
.tib-toc-sticky { position: sticky; top: 1.5rem; }

.tib-toc {
	background: #fff;
	border: 1px solid #ECECF3;
	border-radius: 1.25rem;
	padding: 1.5rem 1.5rem 1.25rem;
	max-height: calc(100vh - 3rem);
	overflow-y: auto;
}
.tib-toc-title {
	font-size: 0.85rem;
	font-weight: 800;
	color: #1A2148;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0 0 1.1rem;
	padding-bottom: 1rem;
	padding-left: 0.85rem;
	border-bottom: 1px solid #ECECF3;
	border-left: 3px solid #4F46E5;
	line-height: 1.2;
}
.tib-toc-list { list-style: none; margin: 0; padding: 0; }
.tib-toc-list li { margin-bottom: 0.85rem; }
.tib-toc-list li:last-child { margin-bottom: 0; }
.tib-toc-list a {
	display: flex;
	gap: 0.5rem;
	font-size: 0.92rem;
	line-height: 1.45;
	color: #3D4259;
}
.tib-toc-list a::before {
	content: "—";
	color: #9CA0B5;
	flex-shrink: 0;
}
.tib-toc-list a:hover { color: #E83040; }
.tib-toc-list a:hover::before { color: #E83040; }
.tib-toc-list a.tib-toc-active { color: #4F46E5; font-weight: 700; }
.tib-toc-list a.tib-toc-active::before { color: #4F46E5; }
.tib-toc-list .tib-toc-level-3 a { padding-left: 1rem; font-size: 0.88rem; }
.tib-toc-list .tib-toc-level-4 a,
.tib-toc-list .tib-toc-level-5 a,
.tib-toc-list .tib-toc-level-6 a { padding-left: 1.6rem; font-size: 0.85rem; color: #6b6f95; }

/* Single post pages use a plain white background instead of the
   lavender page tint, matching the reference layout exactly */
body.single .tib-page-wrap { background: #fff; padding-top: 1.5rem; }

.tib-post-main { min-width: 0; }
.tib-post-main .tib-content {
	padding: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
}
@media (min-width: 768px) {
	.tib-post-main .tib-content { padding: 0; }
}
.tib-post-main .tib-content h2 {
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #ECECF3;
}
.tib-post-main .tib-author-box,
.tib-post-main .tib-cta,
.tib-post-main .tib-comments { max-width: none; }

/* scroll-margin so anchored headings aren't hidden under sticky elements */
.tib-content h2, .tib-content h3, .tib-content h4, .tib-content h5, .tib-content h6 {
	scroll-margin-top: 1.5rem;
}
.tib-single-wrap {
	max-width: 820px;
	margin: 0 auto;
}
.tib-single-header { text-align: center; margin-bottom: 2.5rem; }
.tib-single-header .tib-card-meta { justify-content: center; display: flex; gap: 0.5rem; }
.tib-single-header h1 {
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 800;
	color: #141952;
	line-height: 1.2;
	margin: 0.75rem 0 1rem;
}
.tib-single-thumb {
	border-radius: 1.25rem;
	overflow: hidden;
	margin-bottom: 2.5rem;
	box-shadow: 0 20px 40px rgba(20,25,82,0.1);
}

.tib-content {
	background: #fff;
	border-radius: 1.25rem;
	padding: 2rem;
	box-shadow: 0 4px 20px rgba(20,25,82,0.06);
	font-size: 1.05rem;
	line-height: 1.8;
	color: #2b2f55;
}
@media (min-width: 768px) {
	.tib-content { padding: 3rem; }
}
.tib-content h2, .tib-content h3, .tib-content h4 {
	color: #141952;
	font-weight: 800;
	line-height: 1.3;
	margin: 1.75rem 0 0.85rem;
}
.tib-content h2 { font-size: 1.5rem; }
.tib-content h3 { font-size: 1.25rem; }
.tib-content p { margin: 0 0 1.25rem; }
.tib-content a { color: #E83040; text-decoration: underline; }
.tib-content a:hover { color: #141952; }
.tib-content ul, .tib-content ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.tib-content li { margin-bottom: 0.5rem; }
.tib-content blockquote {
	border-left: 4px solid #E83040;
	background: #EEEEFF;
	padding: 1rem 1.5rem;
	border-radius: 0.5rem;
	margin: 1.5rem 0;
	color: #141952;
	font-style: italic;
}
.tib-content img { border-radius: 0.85rem; margin: 1.5rem 0; }
.tib-content figcaption { font-size: 0.85rem; color: #888; text-align: center; margin-top: 0.5rem; }
.tib-content pre {
	background: #141952;
	color: #fff;
	padding: 1.25rem;
	border-radius: 0.75rem;
	overflow-x: auto;
	font-size: 0.9rem;
}
.tib-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.tib-content table th, .tib-content table td { border: 1px solid #E3E5FF; padding: 0.6rem 0.9rem; text-align: left; }
.tib-content table th { background: #EEEEFF; color: #141952; }

/* Tags */
.tib-tags { margin-top: 2rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tib-tags a {
	background: #EEEEFF;
	color: #141952;
	font-size: 0.82rem;
	font-weight: 600;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
}
.tib-tags a:hover { background: #E83040; color: #fff; }

/* Author box */
.tib-author-box {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: #fff;
	border-radius: 1.25rem;
	padding: 1.5rem;
	margin-top: 2.5rem;
	box-shadow: 0 4px 20px rgba(20,25,82,0.06);
}
.tib-author-box img { width: 56px; height: 56px; border-radius: 999px; }
.tib-author-box .name { font-weight: 700; color: #141952; }
.tib-author-box .bio { color: #5b6080; font-size: 0.9rem; }

/* CTA banner */
.tib-cta {
	margin-top: 3rem;
	background: linear-gradient(120deg, #141952, #20296e);
	border-radius: 1.5rem;
	padding: 2.5rem;
	text-align: center;
	color: #fff;
}
.tib-cta h3 { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.75rem; }
.tib-cta p { color: rgba(255,255,255,0.7); margin: 0 0 1.5rem; }
.tib-cta a {
	display: inline-flex;
	background: #E83040;
	color: #fff;
	font-weight: 700;
	padding: 0.85rem 2rem;
	border-radius: 0.85rem;
}
.tib-cta a:hover { background: #fff; color: #141952; }

/* ---------- Search / no results / 404 ---------- */
.tib-search-form { display: flex; gap: 0.75rem; max-width: 480px; margin: 0 auto 3rem; }
.tib-search-form input[type="search"] {
	flex: 1;
	padding: 0.85rem 1.25rem;
	border-radius: 0.85rem;
	border: 1px solid #E3E5FF;
	font-family: inherit;
	font-size: 0.95rem;
}
.tib-search-form button {
	background: #E83040;
	color: #fff;
	border: none;
	padding: 0 1.5rem;
	border-radius: 0.85rem;
	font-weight: 700;
	cursor: pointer;
}
.tib-search-form button:hover { background: #141952; }

.tib-empty {
	text-align: center;
	background: #fff;
	border-radius: 1.25rem;
	padding: 3rem 2rem;
	color: #5b6080;
}

/* ---------- Comments ---------- */
.tib-comments {
	max-width: 820px;
	margin: 3rem auto 0;
	background: #fff;
	border-radius: 1.25rem;
	padding: 2rem;
	box-shadow: 0 4px 20px rgba(20,25,82,0.06);
}
.tib-comments h2 { color: #141952; font-weight: 800; margin-top: 0; }

.tib-comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.tib-comment-list .comment-body {
	background: #EEEEFF;
	border-radius: 1rem;
	padding: 1.25rem 1.5rem;
	margin-bottom: 1rem;
}
.tib-comment-list .comment-author .fn { font-weight: 700; color: #141952; }
.tib-comment-list .comment-metadata { font-size: 0.8rem; color: #888; margin-bottom: 0.5rem; }
.tib-comment-list .comment-reply-link { color: #E83040; font-weight: 600; font-size: 0.85rem; }

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	border-radius: 0.75rem;
	border: 1px solid #E3E5FF;
	font-family: inherit;
	margin-bottom: 1rem;
	font-size: 0.95rem;
}
.comment-respond label { display: block; font-weight: 600; color: #141952; margin-bottom: 0.4rem; font-size: 0.9rem; }
.comment-respond .comment-form-comment textarea { min-height: 130px; }
.tib-comment-submit {
	background: #E83040;
	color: #fff;
	border: none;
	padding: 0.85rem 2rem;
	border-radius: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}
.tib-comment-submit:hover { background: #141952; }
