/* ==========================================================================
   DM Update — main stylesheet
   ========================================================================== */

:root {
	--color-bg: #ffffff;
	--color-bg-muted: #f4f4f5;
	--color-text: #111111;
	--color-text-muted: #666666;
	--color-border: #e2e2e2;
	--color-accent: #1a1a1a;
	--color-accent-dark: #000000;
	--color-accent-light: #ededed;
	--color-dark: #0a0a0a;
	--color-dark-muted: #b3b3b3;
	--font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-heading: 'Sora', 'Inter', -apple-system, sans-serif;
	--radius: 14px;
	--radius-sm: 8px;
	--shadow-sm: 0 1px 2px rgba(16, 17, 20, 0.06);
	--shadow-md: 0 8px 24px rgba(16, 17, 20, 0.08);
	--container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Clip stray horizontal overflow (e.g. the off-canvas mobile nav, which is
   position:fixed + transform and can still push the viewport's scrollWidth
   in some browsers). `clip` (unlike `hidden`) doesn't establish a scroll
   container, so it clips visual overflow without becoming the containing
   block for position:sticky — which `overflow-x: hidden` on html did,
   silently breaking the sticky header. */
html { overflow-x: clip; }
body { overflow-x: clip; }

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--color-text);
	background: var(--color-bg);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
	font-family: var(--font-heading);
	line-height: 1.2;
	margin: 0 0 0.5em;
	font-weight: 700;
}

p { margin: 0 0 1em; }

ul { margin: 0; padding: 0; list-style: none; }

button, input { font-family: inherit; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

.skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background: var(--color-accent);
	color: #fff;
	padding: 10px 16px;
	z-index: 10000;
}
.skip-link:focus { top: 0; }

.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.text-accent { color: var(--color-accent); }

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 24px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 15px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-dark); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-text); }

.eyebrow {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-accent);
	margin-bottom: 14px;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: #ffffff;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--color-border); box-shadow: var(--shadow-sm); }

.site-header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.site-logo img { height: 76px; width: auto; }

.nav-toggle {
	display: none;
	position: relative;
	z-index: 1001;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: #fff;
	margin-left: auto;
	cursor: pointer;
}
.nav-toggle span {
	display: block; height: 2px; background: var(--color-text); margin: 0 8px; border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.2s ease;
}
/* Animate the 3-bar icon into an X once the drawer is open. */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }

.nav-menu { display: flex; align-items: center; gap: 4px; }

.nav-menu > li { position: relative; }

.nav-menu > li > a {
	display: block;
	padding: 10px 14px;
	font-weight: 600;
	font-size: 14.5px;
	border-radius: var(--radius-sm);
	color: var(--color-text);
}
.nav-menu > li > a:hover { background: var(--color-bg-muted); }

.nav-menu > li.current-menu-item > a {
	color: var(--color-accent-dark);
	background: var(--color-accent-light);
}
.sub-menu li.current-menu-item > a {
	color: var(--color-accent-dark);
	background: var(--color-accent-light);
	font-weight: 700;
}
.nav-cta.current-menu-item { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent-dark); }

.menu-item-has-children { position: relative; }

.sub-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 200px;
	max-height: 60vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-md);
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 20;
	scrollbar-width: thin;
	scrollbar-color: var(--color-border) transparent;
}
.sub-menu::-webkit-scrollbar { width: 6px; }
.sub-menu::-webkit-scrollbar-track { background: transparent; }
.sub-menu::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 999px; }
.sub-menu::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
.menu-item-has-children:hover .sub-menu,
.menu-item-has-children:focus-within .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.sub-menu li a {
	display: block;
	padding: 9px 12px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--color-text);
}
.sub-menu li a:hover { background: var(--color-accent-light); color: var(--color-accent-dark); }

.nav-cta { padding: 10px 20px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 60px; background: linear-gradient(180deg, var(--color-bg-muted), #fff); }
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.02em; }
.hero-lede { font-size: 18px; color: var(--color-text-muted); max-width: 620px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Sections ---------- */
/* padding-top/bottom only (not the shorthand) so this never resets the
   left/right padding on elements that also carry .container, e.g. <div
   class="container section">, used across most content templates. */
.section { padding-top: 64px; padding-bottom: 64px; }
.section-muted { background: var(--color-bg-muted); }
.section-dark { background: var(--color-dark); color: #fff; }

.section-header { margin-bottom: 32px; }
.section-header-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.section-header-title { font-size: clamp(24px, 3vw, 32px); }
.section-header-subtitle { color: var(--color-text-muted); margin: 0; }

.link-more { font-weight: 600; color: var(--color-accent); white-space: nowrap; }
.single-sidebar .widget .link-more { display: inline-block; margin-top: 6px; white-space: normal; }
.link-more:hover { text-decoration: underline; }

/* ---------- Chips ---------- */
/* Scrolls horizontally instead of wrapping once there are more category
   chips than comfortably fit on one line (e.g. after new categories are
   added under Updates/Learn in wp-admin). */
.chip-row {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	margin-bottom: 32px;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 10px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--color-border) transparent;
}
.chip-row::-webkit-scrollbar { height: 6px; }
.chip-row::-webkit-scrollbar-track { background: transparent; }
.chip-row::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 999px; }
.chip-row::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--color-bg-muted);
	border: 1px solid var(--color-border);
	font-size: 14px;
	font-weight: 600;
	flex-shrink: 0;
	white-space: nowrap;
}
.chip:hover { border-color: var(--color-accent); color: var(--color-accent-dark); }
.chip-active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.chip-active .chip-icon { filter: grayscale(100%) brightness(2.4); }
.chip-small { padding: 5px 12px; font-size: 12.5px; font-weight: 500; }

/* Emoji glyphs are rendered in full color by the OS font — desaturate them
   so nothing but black/white/grey shows up anywhere in the UI. */
.chip-icon,
.topic-card-icon,
.feature-tile-icon,
.newsletter-benefits li span[aria-hidden] {
	filter: grayscale(100%) contrast(1.15);
}

/* ---------- Article / card grid ---------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.article-card {
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.article-card-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--color-bg-muted);
	overflow: hidden;
}
.article-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card-thumb-fallback {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 100%;
	font-size: 40px; font-weight: 800; font-family: var(--font-heading);
	color: var(--color-accent);
	background: var(--color-accent-light);
}
.article-card-tag {
	position: absolute;
	top: 12px; left: 12px;
	background: rgba(11, 12, 15, 0.85);
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 5px 10px;
	border-radius: 999px;
}
.article-card-tag-inline { position: static; display: inline-block; margin-bottom: 14px; background: var(--color-accent-light); color: var(--color-accent-dark); }

.article-card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card-date { font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.article-card-title { font-size: 18px; margin: 0; }
.article-card-title a:hover { color: var(--color-accent); }
.article-card-excerpt { color: var(--color-text-muted); font-size: 14.5px; margin: 0; flex: 1; }
.article-card-more { font-weight: 700; font-size: 14px; color: var(--color-accent); margin-top: 4px; }

.empty-note { color: var(--color-text-muted); padding: 24px 0; }

/* ---------- Topic grid (Learn) ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.topic-card {
	display: flex; align-items: center; gap: 14px;
	background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
	padding: 18px 20px;
}
.topic-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-sm); }
.topic-card-icon { font-size: 24px; }
.topic-card-label { font-weight: 700; }

/* ---------- Feature strip (home directory teasers) ---------- */
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-tile {
	background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
	padding: 24px 18px; text-align: center;
}
.feature-tile:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-tile-icon { font-size: 30px; display: block; margin-bottom: 10px; }
.feature-tile h3 { font-size: 16px; margin-bottom: 6px; }
.feature-tile p { font-size: 13.5px; color: var(--color-text-muted); margin: 0; }

/* ---------- Directory grid (AI Tools / Marketing Tools / Jobs / Resources) ---------- */
.directory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-card {
	background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
	padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.grid-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); }
.grid-card-top { display: flex; align-items: center; gap: 14px; }
.grid-card-icon {
	width: 44px; height: 44px; border-radius: 12px;
	background: var(--color-accent-light); color: var(--color-accent-dark);
	display: flex; align-items: center; justify-content: center;
	font-weight: 800; font-size: 18px; flex-shrink: 0;
	overflow: hidden;
}
.grid-card-icon-image img { width: 100%; height: 100%; object-fit: cover; }
.grid-card-title { font-size: 17px; margin: 0; }
.grid-card-excerpt { color: var(--color-text-muted); font-size: 14px; margin: 0; flex: 1; }
.grid-card-link { font-weight: 700; font-size: 14px; color: var(--color-accent); }

/* ---------- Newsletter CTA strip (footer top) ---------- */
.footer-cta { background: var(--color-bg-muted); color: var(--color-text); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.footer-cta-inner {
	display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
	padding: 40px 24px;
}
.footer-cta-inner h2 { margin-bottom: 4px; font-size: 22px; }
.footer-cta-inner p { margin: 0; color: var(--color-text-muted); }
.footer-cta .btn-accent { background: var(--color-accent); color: #fff; }
.footer-cta .btn-accent:hover { background: var(--color-accent-dark); }

/* ---------- Home newsletter block (dark section) ---------- */
.newsletter-block { text-align: center; max-width: 620px; margin: 0 auto; }
.newsletter-block h2 { font-size: clamp(22px, 3vw, 30px); }
.newsletter-block p { color: var(--color-dark-muted); }
.newsletter-form { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.newsletter-form input[type="email"] {
	flex: 1; min-width: 240px;
	padding: 13px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2);
	background: rgba(255,255,255,0.08); color: #fff;
}
.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,0.55); }
.newsletter-status { margin-top: 12px; font-size: 14px; color: #fff; }
.newsletter-status.is-error { color: var(--color-dark-muted); font-style: italic; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: var(--color-dark-muted); }
.footer-main { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 56px 24px 40px; }
.footer-brand p { font-size: 14px; }
.footer-logo { height: 44px; margin-bottom: 16px; border-radius: 8px; background: #fff; padding: 4px 10px; }
.footer-widget-title { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { font-size: 14px; }
.footer-col a:hover { color: #fff; }

.footer-bottom {
	border-top: 1px solid rgba(255,255,255,0.1);
	padding: 20px 24px;
	display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
	font-size: 13px;
}
.footer-legal-menu { display: flex; gap: 18px; }

/* ---------- Page / single layouts ---------- */
.page-layout { max-width: 820px; margin: 0 auto; }
.page-thumb { margin-bottom: 28px; border-radius: var(--radius); overflow: hidden; }
.page-content { font-size: 17px; }
.page-content h2 { margin-top: 1.6em; }

.single-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.single-article, .single-sidebar { min-width: 0; }
.single-sidebar .widget { overflow-wrap: break-word; }
.single-article-header h1 { font-size: clamp(26px, 4vw, 38px); }
.single-article-meta { color: var(--color-text-muted); font-size: 14px; }
.single-article-thumb { margin: 24px 0; border-radius: var(--radius); overflow: hidden; }
.single-article-content { font-size: 17.5px; }
.single-article-content h2, .single-article-content h3 { margin-top: 1.6em; }
.single-article-content img { border-radius: var(--radius-sm); }
.single-article-footer { margin-top: 32px; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }

.single-sidebar .widget { background: var(--color-bg-muted); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.widget-title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px; }
.widget-link-list li { margin-bottom: 10px; }
.widget-link-list a:hover { color: var(--color-accent); }
.widget-note { font-size: 14px; color: var(--color-text-muted); margin-bottom: 12px; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--color-border); }
.comments-title { font-size: 20px; }
.comment-list, .comment-list ul { list-style: none; }
.comment-list > li { margin-bottom: 20px; }
.comment-respond input, .comment-respond textarea {
	width: 100%; padding: 11px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 14px;
}
.comment-respond textarea { min-height: 120px; }

/* ---------- Search / 404 ---------- */
.search-form { display: flex; gap: 10px; margin-top: 20px; max-width: 420px; }
.search-form input[type="search"] { flex: 1; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 999px; }
.search-form button { padding: 12px 20px; border-radius: 999px; background: var(--color-accent); color: #fff; border: none; cursor: pointer; }

.error-404 { text-align: center; padding: 100px 24px; }
.error-404-code { font-family: var(--font-heading); font-size: 90px; font-weight: 800; color: var(--color-accent-light); display: block; -webkit-text-stroke: 2px var(--color-accent); }
.error-404 .search-form { margin: 28px auto 0; }

/* ---------- Calculators ---------- */
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 10px; }
.calc-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; }
.calc-card h3 { font-size: 17px; margin-bottom: 4px; }
.calc-help { font-size: 13px; color: var(--color-text-muted); margin-bottom: 16px; }
.calc-form { display: flex; flex-direction: column; gap: 12px; }
.calc-form label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.calc-form input {
	padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 15px; font-weight: 400;
}
.calc-form input:focus, .newsletter-form-card input:focus, .search-form input:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.calc-result { margin: 4px 0 0; font-size: 14.5px; min-height: 20px; }
.calc-result.is-visible { padding: 10px 12px; background: var(--color-accent-light); color: var(--color-accent-dark); border-radius: var(--radius-sm); }
.calc-notes { margin-top: 48px; }

/* ---------- Newsletter page ---------- */
.newsletter-page-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.newsletter-benefits { display: flex; flex-direction: column; gap: 10px; margin: 24px 0; font-size: 15px; }
.newsletter-form-card { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form-card input {
	flex: 1; min-width: 220px; padding: 13px 18px; border: 1px solid var(--color-border); border-radius: 999px; font-size: 15px;
}
.newsletter-status { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--color-text); }
.newsletter-status.is-error { color: var(--color-text-muted); font-style: italic; }
.newsletter-page-visual { display: flex; align-items: center; justify-content: center; background: var(--color-bg-muted); border-radius: var(--radius); padding: 40px; }
.newsletter-page-visual img { max-width: 260px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.card-grid, .directory-grid { grid-template-columns: repeat(2, 1fr); }
	.topic-grid { grid-template-columns: repeat(2, 1fr); }
	.feature-strip { grid-template-columns: repeat(2, 1fr); }
	.calc-grid { grid-template-columns: repeat(2, 1fr); }
	.single-layout { grid-template-columns: minmax(0, 1fr); }
	.footer-main { grid-template-columns: 1fr 1fr; }
	.newsletter-page-grid { grid-template-columns: 1fr; }
}

/* Nav switches to the off-canvas drawer well before the mobile content
   breakpoint below — 9 top-level items plus the larger logo no longer fit
   a horizontal bar once the viewport drops under ~1024px (tablets and
   small laptop windows), so give them the drawer instead of letting the
   bar wrap/overflow. */
@media (max-width: 1180px) {
	.nav-toggle { display: flex; }
	.primary-nav {
		position: fixed; inset: 0 0 0 auto;
		width: min(320px, 86vw);
		background: #fff;
		flex-direction: column;
		align-items: stretch;
		padding: 90px 24px 24px;
		box-shadow: -10px 0 30px rgba(0,0,0,0.15);
		transform: translateX(100%);
		transition: transform 0.25s ease;
		overflow-y: auto;
	}
	.primary-nav.is-open { transform: translateX(0); }
	.nav-menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.nav-menu > li > a { padding: 13px 10px; }
	.sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		display: none; box-shadow: none; border: none; padding-left: 16px;
	}
	.menu-item-has-children:hover .sub-menu,
	.menu-item-has-children.is-open .sub-menu { display: block; }
	.nav-cta { margin-top: 16px; }
}

@media (max-width: 720px) {
	.card-grid, .directory-grid, .topic-grid, .feature-strip, .calc-grid { grid-template-columns: 1fr; }
	.footer-main { grid-template-columns: 1fr; }
	.footer-cta-inner { text-align: center; justify-content: center; }
	.hero { padding: 56px 0 40px; }
	.section { padding-top: 44px; padding-bottom: 44px; }
}

@media (max-width: 480px) {
	.site-logo img { height: 56px; }
}
