/* =====================================================================
   HairTC Article Template — Scoped CSS
   All selectors scoped under .hairtc-article-template to prevent
   style bleed into any other page. Loaded only when a post is
   using the HairTC Article Layout template.
   ===================================================================== */

/* Box-sizing reset (scoped) */
.hairtc-article-template *,
.hairtc-article-template *::before,
.hairtc-article-template *::after { box-sizing: border-box; }

/* Template root */
.hairtc-article-template {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #0F172A;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
.hairtc-article-template a { color: #0E2A47; text-decoration: none; }
.hairtc-article-template img { max-width: 100%; height: auto; display: block; }
.hairtc-article-template button { font-family: inherit; }

/* ============================================================
   HERO
   ============================================================ */
.hairtc-article-template .article-hero {
	max-width: 1320px;
	margin: 32px auto 0;
	padding: 0 32px;
}
.hairtc-article-template .hero-cover {
	height: 380px;
	border-radius: 12px;
	background: linear-gradient(135deg, #BCD1EA, #94A3B8) center/cover no-repeat;
}
.hairtc-article-template .hero-fallback {
	background: linear-gradient(135deg, #0E2A47 0%, #2563EB 100%);
}
.hairtc-article-template .hero-meta {
	max-width: 1320px;
	margin: 32px auto 24px;
	padding: 0 32px;
	text-align: center;
}
.hairtc-article-template .hero-category {
	display: inline-block;
	background: #F0FDF4;
	color: #10B981;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	padding: 6px 14px;
	border-radius: 100px;
	margin-bottom: 16px;
}
.hairtc-article-template .hero-title {
	font-family: 'Outfit', sans-serif;
	font-size: 44px;
	font-weight: 800;
	line-height: 1.15;
	color: #0E2A47;
	margin: 0 0 12px;
	letter-spacing: -0.02em;
}
.hairtc-article-template .hero-byline {
	font-size: 14px;
	color: #64748B;
}
.hairtc-article-template .byline-sep { margin: 0 8px; color: #CBD5E1; }

/* ============================================================
   MOBILE TOC (hidden on desktop)
   ============================================================ */
.hairtc-article-template .mobile-toc {
	display: none;
	max-width: 1320px;
	margin: 24px auto 0;
	padding: 0 16px;
}
.hairtc-article-template .mobile-toc details {
	background: #fff;
	border: 1px solid #E2E8F0;
	border-radius: 10px;
	overflow: hidden;
}
.hairtc-article-template .mobile-toc summary {
	padding: 16px 20px;
	font-family: 'Outfit', sans-serif;
	font-weight: 700;
	color: #0E2A47;
	cursor: pointer;
	font-size: 14px;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.hairtc-article-template .mobile-toc summary::-webkit-details-marker { display: none; }
.hairtc-article-template .mobile-toc-arrow { font-size: 10px; color: #94A3B8; transition: transform .2s; }
.hairtc-article-template .mobile-toc details[open] .mobile-toc-arrow { transform: rotate(180deg); }
.hairtc-article-template .mobile-toc ul {
	margin: 0;
	padding: 0 20px 16px;
	list-style: none;
}
.hairtc-article-template .mobile-toc li { margin: 8px 0; }
.hairtc-article-template .mobile-toc a {
	font-size: 13px;
	color: #475569;
	display: block;
	padding: 6px 0;
}
.hairtc-article-template .mobile-toc a.toc-sub { padding-left: 14px; font-size: 12px; color: #64748B; }

/* ============================================================
   GRID — 3 columns: TOC | content | sidebar
   ============================================================ */
.hairtc-article-template .article-grid {
	max-width: 1320px;
	margin: 32px auto 80px;
	padding: 0 32px;
	display: grid;
	grid-template-columns: 180px 1fr 290px;
	gap: 40px;
	align-items: start;
}
/* When the post has no H2/H3 headings, the JS adds .no-toc to the grid.
   We drop to 2 columns so the article fills the freed space instead of
   collapsing into the TOC's narrow slot. */
.hairtc-article-template .article-grid.no-toc {
	grid-template-columns: 1fr 290px;
}

/* ============================================================
   LEFT — sticky TOC
   ============================================================ */
.hairtc-article-template .toc-sidebar {
	position: sticky;
	top: 90px;
	max-height: calc(100vh - 110px);
	overflow-y: auto;
}
.hairtc-article-template .toc-title {
	font-family: 'Outfit', sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: #0E2A47;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #E2E8F0;
}
.hairtc-article-template #tocList {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hairtc-article-template #tocList li { margin: 6px 0; }
.hairtc-article-template #tocList a {
	display: block;
	font-size: 13px;
	color: #64748B;
	padding: 6px 0 6px 12px;
	border-left: 2px solid transparent;
	transition: all .15s;
	line-height: 1.4;
}
.hairtc-article-template #tocList a:hover { color: #0E2A47; }
.hairtc-article-template #tocList a.active {
	color: #0E2A47;
	border-left-color: #10B981;
	font-weight: 600;
}
.hairtc-article-template #tocList a.toc-sub { padding-left: 24px; font-size: 12px; color: #94A3B8; }

/* ============================================================
   CENTER — article content
   ============================================================ */
.hairtc-article-template .article-content {
	min-width: 0; /* prevents grid overflow */
}

/* Breadcrumb (Home / Category / Post title) */
.hairtc-article-template .breadcrumb {
	font-size: 13px;
	color: #64748B;
	margin: 0 0 24px;
	line-height: 1.4;
}
.hairtc-article-template .breadcrumb a {
	color: #64748B;
	text-decoration: none;
}
.hairtc-article-template .breadcrumb a:hover {
	color: #0E2A47;
	text-decoration: underline;
}
.hairtc-article-template .breadcrumb .sep {
	color: #CBD5E1;
	margin: 0 6px;
}
.hairtc-article-template .breadcrumb .here {
	color: #0F172A;
}
.hairtc-article-template .article-content > * { margin: 0 0 20px; }
.hairtc-article-template .article-content > *:last-child { margin-bottom: 0; }

.hairtc-article-template .article-content h2 {
	font-family: 'Outfit', sans-serif;
	font-size: 28px;
	font-weight: 700;
	color: #0E2A47;
	margin: 40px 0 16px;
	letter-spacing: -0.01em;
	line-height: 1.25;
	scroll-margin-top: 100px;
}
.hairtc-article-template .article-content h3 {
	font-family: 'Outfit', sans-serif;
	font-size: 20px;
	font-weight: 600;
	color: #0E2A47;
	margin: 32px 0 12px;
	line-height: 1.3;
	scroll-margin-top: 100px;
}
.hairtc-article-template .article-content h4 {
	font-family: 'Outfit', sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: #0E2A47;
	margin: 24px 0 8px;
}
.hairtc-article-template .article-content p {
	font-size: 17px;
	line-height: 1.7;
	color: #334155;
	margin: 0 0 20px;
}
.hairtc-article-template .article-content ul,
.hairtc-article-template .article-content ol {
	font-size: 17px;
	line-height: 1.7;
	color: #334155;
	padding-left: 24px;
}
.hairtc-article-template .article-content li { margin: 8px 0; }
.hairtc-article-template .article-content a {
	color: #0E2A47;
	text-decoration: underline;
	text-decoration-color: #BCD1EA;
	text-underline-offset: 3px;
}
.hairtc-article-template .article-content a:hover { text-decoration-color: #10B981; }
.hairtc-article-template .article-content blockquote {
	border-left: 4px solid #10B981;
	background: #F8FAFC;
	padding: 20px 24px;
	font-style: italic;
	color: #475569;
	margin: 24px 0;
	border-radius: 0 8px 8px 0;
}
.hairtc-article-template .article-content img { border-radius: 8px; margin: 24px 0; }
.hairtc-article-template .article-content figure { margin: 24px 0; }
.hairtc-article-template .article-content figcaption {
	font-size: 13px;
	color: #94A3B8;
	text-align: center;
	margin-top: 8px;
	font-style: italic;
}
.hairtc-article-template .article-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 24px 0;
	font-size: 15px;
}
.hairtc-article-template .article-content th,
.hairtc-article-template .article-content td {
	border: 1px solid #E2E8F0;
	padding: 10px 14px;
	text-align: left;
}
.hairtc-article-template .article-content th {
	background: #F8FAFC;
	color: #0E2A47;
	font-weight: 600;
}

/* ============================================================
   RIGHT — sidebar widgets (lead form is individually sticky)
   ============================================================ */
.hairtc-article-template .article-sidebar {
	/* Container is not itself sticky — only the lead form widget is. */
}
.hairtc-article-template .sidebar-widget {
	background: #fff;
	border: 1px solid #E2E8F0;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 20px;
}

/* Lead form widget — pinned to viewport on scroll */
.hairtc-article-template .lead-widget {
	background: #fff;
	box-shadow: 0 4px 16px rgba(14, 42, 71, 0.05);
	position: sticky;
	top: 90px;
}
.hairtc-article-template .lead-eyebrow {
	font-size: 11px;
	font-weight: 700;
	color: #10B981;
	letter-spacing: 0.1em;
	margin-bottom: 8px;
}
.hairtc-article-template .lead-heading {
	font-family: 'Outfit', sans-serif;
	font-size: 20px;
	font-weight: 700;
	color: #0E2A47;
	margin: 0 0 8px;
	line-height: 1.25;
}
.hairtc-article-template .lead-sub {
	font-size: 13px;
	color: #475569;
	margin: 0 0 16px;
	line-height: 1.5;
}
.hairtc-article-template .article-lead-form .lead-field { margin-bottom: 12px; }
.hairtc-article-template .article-lead-form label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 4px;
}
.hairtc-article-template .article-lead-form label small {
	font-weight: 400;
	color: #94A3B8;
}
.hairtc-article-template .article-lead-form input[type=text],
.hairtc-article-template .article-lead-form input[type=email],
.hairtc-article-template .article-lead-form input[type=tel] {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #CBD5E1;
	border-radius: 7px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
}
.hairtc-article-template .article-lead-form input:focus {
	outline: none;
	border-color: #0E2A47;
	box-shadow: 0 0 0 3px rgba(14, 42, 71, 0.12);
}
.hairtc-article-template .lead-submit {
	width: 100%;
	background: #10B981;
	color: #fff;
	padding: 11px 16px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 6px;
	transition: background .15s;
}
.hairtc-article-template .lead-submit:hover { background: #0E9F6E; }
.hairtc-article-template .lead-submit:disabled { background: #94A3B8; cursor: not-allowed; }
.hairtc-article-template .lead-disclaimer {
	font-size: 11px;
	color: #94A3B8;
	margin: 10px 0 0;
	text-align: center;
}
.hairtc-article-template .lead-thanks {
	padding: 20px;
	background: #F0FDF4;
	border: 1px solid #BBF7D0;
	border-radius: 8px;
	color: #14532D;
	font-size: 14px;
	line-height: 1.5;
}

/* Article-list widgets (Most Read / Newest) */
.hairtc-article-template .article-list-widget .widget-title {
	font-family: 'Outfit', sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: #0E2A47;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #E2E8F0;
}
.hairtc-article-template .widget-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hairtc-article-template .widget-item { margin-bottom: 14px; }
.hairtc-article-template .widget-item:last-child { margin-bottom: 0; }
.hairtc-article-template .widget-link {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}
.hairtc-article-template .widget-thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: 6px;
	background: linear-gradient(135deg, #BCD1EA, #94A3B8) center/cover no-repeat;
}
.hairtc-article-template .widget-thumb-fallback {
	background: linear-gradient(135deg, #0E2A47, #2563EB);
}
.hairtc-article-template .widget-text { flex: 1; min-width: 0; }
.hairtc-article-template .widget-cat {
	font-size: 10px;
	font-weight: 700;
	color: #10B981;
	letter-spacing: 0.08em;
	margin-bottom: 4px;
}
.hairtc-article-template .widget-title-text {
	font-size: 13px;
	font-weight: 600;
	color: #0E2A47;
	line-height: 1.35;
}
.hairtc-article-template .widget-link:hover .widget-title-text { color: #2563EB; }

/* ============================================================
   RESPONSIVE — tablet (1024 and below)
   ============================================================ */
@media (max-width: 1024px) {
	.hairtc-article-template .hero-title { font-size: 36px; }
	.hairtc-article-template .article-hero,
	.hairtc-article-template .hero-meta,
	.hairtc-article-template .article-grid {
		padding-left: 20px;
		padding-right: 20px;
	}
	.hairtc-article-template .article-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.hairtc-article-template .toc-sidebar { display: none; }
	.hairtc-article-template .mobile-toc { display: block; }
	.hairtc-article-template .article-sidebar {
		position: static;
		max-height: none;
		overflow: visible;
	}
	.hairtc-article-template .lead-widget {
		position: static;
		top: auto;
	}
}

/* ============================================================
   RESPONSIVE — mobile (640 and below)
   ============================================================ */
@media (max-width: 640px) {
	.hairtc-article-template .hero-cover { height: 240px; }
	.hairtc-article-template .hero-title { font-size: 28px; }
	.hairtc-article-template .article-content p,
	.hairtc-article-template .article-content ul,
	.hairtc-article-template .article-content ol { font-size: 16px; }
	.hairtc-article-template .article-content h2 { font-size: 24px; }
	.hairtc-article-template .article-content h3 { font-size: 18px; }
}
