/*
Theme Name: CompareThem
Theme URI: https://comparethem.in
Author: comparethem.in
Description: Price-comparison theme for comparethem.in. Search-first homepage, product grids, store price tables, specs and influencer pros/cons reviews. Pairs with the CompareThem Price Engine plugin; works as a clean review theme on its own.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: comparethem
Tags: blog, e-commerce, one-column, grid-layout, custom-logo, custom-menu, featured-images
*/

/* ------------------------------------------------------------------
   Tokens
------------------------------------------------------------------ */
:root {
	--ct-bg: #f4f5f7;
	--ct-surface: #ffffff;
	--ct-ink: #1e232b;
	--ct-ink-soft: #5a6472;
	--ct-ink-faint: #8b95a3;
	--ct-line: #e6e8ec;
	--ct-line-soft: #f0f1f3;
	--ct-accent: #2563eb;
	--ct-accent-ink: #1d4ed8;
	--ct-accent-tint: #eef3fe;
	--ct-good: #047857;
	--ct-good-tint: #ecfdf5;
	--ct-warm: #ea580c;
	--ct-warm-ink: #c2410c;
	--ct-warm-tint: #fff7ed;
	--ct-radius: 14px;
	--ct-radius-sm: 9px;
	--ct-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
	--ct-shadow-lift: 0 12px 32px rgba(16, 24, 40, .10);
	--ct-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ct-font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
	--ct-max: 1160px;
	--ct-gutter: 16px;
	--ct-admin-bar: var(--wp-admin--admin-bar--height, 0px);
}

/* ------------------------------------------------------------------
   Base
------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--ct-bg);
	color: var(--ct-ink);
	font-family: var(--ct-font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--ct-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ct-accent-ink); }
h1, h2, h3, h4 { font-family: var(--ct-font-display); color: var(--ct-ink); letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--ct-accent); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ct-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ct-ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.ct-skip:focus { top: calc(var(--ct-admin-bar) + 8px); color: #fff; }

.ct-container { width: 100%; max-width: var(--ct-max); margin-inline: auto; padding-inline: var(--ct-gutter); }
.ct-main { min-height: 50vh; }

/* ------------------------------------------------------------------
   Buttons, chips, links
------------------------------------------------------------------ */
.ct-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 22px; border: 0; border-radius: var(--ct-radius-sm);
	font: 600 .95rem/1.2 var(--ct-font); text-decoration: none; cursor: pointer;
	transition: background-color .15s ease, transform .15s ease;
}
.ct-btn--primary { background: var(--ct-accent); color: #fff; }
.ct-btn--primary:hover { background: var(--ct-accent-ink); color: #fff; }
.ct-btn--accent { background: var(--ct-warm); color: #fff; }
.ct-btn--accent:hover { background: var(--ct-warm-ink); color: #fff; }
.ct-chip {
	display: inline-block; padding: 3px 11px; border-radius: 999px;
	background: var(--ct-accent-tint); color: var(--ct-accent-ink);
	font-size: .74rem; font-weight: 600; letter-spacing: .01em; text-decoration: none;
}
.ct-chip:hover { background: #dfe8fd; color: var(--ct-accent-ink); }
.ct-chip--lg { padding: 7px 14px; font-size: .85rem; background: var(--ct-surface); border: 1px solid var(--ct-line); color: var(--ct-ink); }
.ct-chip--lg:hover { border-color: var(--ct-accent); color: var(--ct-accent); background: var(--ct-surface); }
.ct-link { font-weight: 600; text-decoration: none; }
.ct-eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ct-accent); }

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------ */
.ct-header {
	position: sticky; top: var(--ct-admin-bar); z-index: 50;
	background: rgba(255, 255, 255, .92);
	-webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--ct-line);
	transition: box-shadow .2s ease;
}
.ct-header.is-scrolled { box-shadow: 0 4px 18px rgba(16, 24, 40, .06); }
.ct-header__bar { display: flex; align-items: center; gap: 24px; min-height: 66px; }
.ct-brand { font-family: var(--ct-font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; color: var(--ct-ink); text-decoration: none; white-space: nowrap; }
.ct-brand span { color: var(--ct-accent); }
.ct-brand:hover { color: var(--ct-ink); }
.custom-logo-link img { max-height: 44px; width: auto; display: block; }
.ct-header__panel { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.ct-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.ct-nav__list > li { position: relative; }
.ct-nav__list a {
	display: block; padding: 8px 12px; border-radius: 8px;
	color: var(--ct-ink); font-weight: 500; font-size: .93rem; text-decoration: none; white-space: nowrap;
}
.ct-nav__list a:hover, .ct-nav__list .current-menu-item > a, .ct-nav__list .current-menu-ancestor > a { color: var(--ct-accent); background: var(--ct-accent-tint); }
.ct-nav__list .menu-item-has-children > a::after {
	content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; vertical-align: 3px;
	border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg);
}
.ct-nav__list .sub-menu {
	list-style: none; margin: 0; padding: 6px; position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px;
	background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 12px; box-shadow: var(--ct-shadow-lift);
	opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.ct-nav__list .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.ct-nav__list li:hover > .sub-menu, .ct-nav__list li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.ct-header__search {
	display: flex; align-items: center; gap: 8px; width: 100%; max-width: 300px;
	padding: 0 14px; height: 40px; border-radius: 999px;
	background: var(--ct-bg); border: 1px solid var(--ct-line); color: var(--ct-ink-faint);
}
.ct-header__search:focus-within { border-color: var(--ct-accent); background: var(--ct-surface); }
.ct-header__search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .9rem; color: var(--ct-ink); outline: none; }

.ct-menu-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--ct-line); border-radius: 10px; background: var(--ct-surface); cursor: pointer; }
.ct-menu-toggle__bars, .ct-menu-toggle__bars::before, .ct-menu-toggle__bars::after { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--ct-ink); border-radius: 2px; position: relative; transition: transform .2s ease; }
.ct-menu-toggle__bars::before, .ct-menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.ct-menu-toggle__bars::before { top: -6px; }
.ct-menu-toggle__bars::after { top: 6px; }
.ct-header.is-open .ct-menu-toggle__bars { background: transparent; }
.ct-header.is-open .ct-menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.ct-header.is-open .ct-menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
	.ct-menu-toggle { display: block; }
	.ct-header__panel {
		display: none; position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column; align-items: stretch; gap: 14px; padding: 14px var(--ct-gutter) 20px;
		background: var(--ct-surface); border-bottom: 1px solid var(--ct-line); box-shadow: var(--ct-shadow-lift);
		max-height: calc(100vh - 66px - var(--ct-admin-bar)); overflow-y: auto;
	}
	.ct-header.is-open .ct-header__panel { display: flex; }
	.ct-header__search { max-width: none; order: -1; height: 44px; }
	.ct-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.ct-nav__list a { padding: 11px 10px; }
	.ct-nav__list .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; }
	.ct-nav__list .menu-item-has-children > a::after { display: none; }
}

/* ------------------------------------------------------------------
   Homepage
------------------------------------------------------------------ */
.ct-hero {
	padding-block: 64px 56px;
	background:
		radial-gradient(900px 380px at 85% -10%, rgba(37, 99, 235, .10), transparent 60%),
		radial-gradient(700px 320px at -5% 110%, rgba(234, 88, 12, .07), transparent 60%),
		var(--ct-surface);
	border-bottom: 1px solid var(--ct-line);
}
.ct-hero__inner { max-width: 860px; text-align: center; }
.ct-hero__title { margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; letter-spacing: -.035em; }
.ct-hero__lead { margin: 0 auto 28px; max-width: 60ch; color: var(--ct-ink-soft); font-size: 1.08rem; }
.ct-hero__search {
	display: flex; gap: 8px; max-width: 640px; margin: 0 auto; padding: 7px;
	background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 14px; box-shadow: var(--ct-shadow);
}
.ct-hero__search:focus-within { border-color: var(--ct-accent); }
.ct-hero__search input { flex: 1; min-width: 0; padding: 10px 12px; border: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--ct-ink); outline: none; }
.ct-hero__cats { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.ct-section { padding-block: 48px; }
.ct-section--tint { background: var(--ct-surface); border-block: 1px solid var(--ct-line); }
.ct-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ct-section__title { margin: 0 0 18px; font-size: 1.5rem; }
.ct-section__head .ct-section__title { margin: 0; }
.ct-section__head .ct-link { white-space: nowrap; flex-shrink: 0; }

.ct-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ct-step { position: relative; padding: 22px 22px 20px; border: 1px solid var(--ct-line); border-radius: var(--ct-radius); background: var(--ct-bg); }
.ct-step__num { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; background: var(--ct-accent); color: #fff; font: 800 1rem var(--ct-font-display); }
.ct-step h3 { margin: 0 0 6px; font-size: 1.08rem; }
.ct-step p { margin: 0; color: var(--ct-ink-soft); font-size: .93rem; }

.ct-cta {
	display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
	padding: 28px 32px; border-radius: 18px; background: var(--ct-warm-tint); border: 1px solid #fed7aa;
}
.ct-cta__title { margin: 0 0 6px; font-size: 1.35rem; color: #9a3412; }
.ct-cta__text { margin: 0; color: #7c2d12; max-width: 60ch; }

/* ------------------------------------------------------------------
   Cards + grids
------------------------------------------------------------------ */
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.ct-post-card {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: box-shadow .2s ease, transform .2s ease;
}
.ct-post-card:hover { box-shadow: var(--ct-shadow-lift); transform: translateY(-2px); }
.ct-post-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #e9eef7, #d4ddeb); }
.ct-post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.ct-post-card:hover .ct-post-card__media img { transform: scale(1.03); }
.ct-post-card__placeholder { display: grid; place-items: center; height: 100%; color: #8aa0c4; font: 700 1rem var(--ct-font-display); }
.ct-post-card__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.ct-post-card__body .ct-chip { align-self: flex-start; }
.ct-post-card__title { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.ct-post-card__title a { color: var(--ct-ink); text-decoration: none; }
.ct-post-card__title a:hover { color: var(--ct-accent); }
.ct-post-card__excerpt { margin: 0; color: var(--ct-ink-soft); font-size: .9rem; line-height: 1.55; }
.ct-post-card__meta { margin: auto 0 0; padding-top: 6px; color: var(--ct-ink-faint); font-size: .8rem; display: flex; gap: 6px; }

/* Product cards come from the plugin; align them with the theme grid. */
.ctpe-grid { gap: 20px; }
.ct-main .ctpe-card { border-radius: var(--ct-radius); }

/* ------------------------------------------------------------------
   Listing pages
------------------------------------------------------------------ */
.ct-page { padding-block: 40px 56px; }
.ct-page__head { margin-bottom: 26px; }
.ct-page__title { margin: 0 0 8px; font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.ct-page__lead { color: var(--ct-ink-soft); max-width: 65ch; }
.ct-page__lead p { margin: 0; }
.ct-empty { padding: 32px; text-align: center; background: var(--ct-surface); border: 1px dashed var(--ct-line); border-radius: var(--ct-radius); color: var(--ct-ink-soft); }
.ct-404 { text-align: center; max-width: 640px; }
.ct-404 .ct-searchform { margin: 22px auto; }

.ct-searchform { display: flex; gap: 8px; max-width: 520px; margin-inline: auto; }
.ct-searchform input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--ct-line); border-radius: var(--ct-radius-sm); font: inherit; background: var(--ct-surface); color: var(--ct-ink); }
.ct-searchform input:focus { border-color: var(--ct-accent); outline: none; }

.ct-pagination { margin-top: 32px; }
.ct-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ct-pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid var(--ct-line); border-radius: 10px; background: var(--ct-surface);
	color: var(--ct-ink); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.ct-pagination .page-numbers.current { background: var(--ct-accent); border-color: var(--ct-accent); color: #fff; }
.ct-pagination a.page-numbers:hover { border-color: var(--ct-accent); color: var(--ct-accent); }

/* ------------------------------------------------------------------
   Articles (reviews) and pages
------------------------------------------------------------------ */
.ct-article { padding-block: 32px 8px; }
.ct-article__head, .ct-article__body, .ct-article__tags, .ct-article__comments { max-width: 800px; }
.ct-article__title { margin: 6px 0 12px; font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; }
.ct-article__meta { margin: 0 0 24px; color: var(--ct-ink-faint); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 8px; }
.ct-article__hero { max-width: 1000px; margin: 0 auto 32px; }
.ct-article__hero img { width: 100%; height: auto; border-radius: 18px; display: block; box-shadow: var(--ct-shadow); }
.ct-article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.ct-article__related, .ct-article__more { max-width: 1160px; padding-block: 16px 24px; }
.ct-article__comments { padding-block: 24px 48px; }

.entry-content { font-size: 1.06rem; line-height: 1.75; color: #2b313a; }
.entry-content > * { margin-block: 0 1.15em; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.8em; margin-bottom: .6em; }
.entry-content h3 { font-size: 1.28rem; margin-top: 1.5em; margin-bottom: .5em; }
.entry-content h4 { font-size: 1.08rem; margin-top: 1.3em; margin-bottom: .4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .35em; }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption { color: var(--ct-ink-faint); font-size: .85rem; text-align: center; margin-top: 6px; }
.entry-content blockquote { margin-inline: 0; padding: 14px 20px; border-left: 4px solid var(--ct-accent); background: var(--ct-accent-tint); border-radius: 0 12px 12px 0; color: var(--ct-ink); }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 10px 14px; border-bottom: 1px solid var(--ct-line-soft); text-align: left; vertical-align: top; }
.entry-content th { background: var(--ct-line-soft); font-weight: 600; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content .wp-block-button__link { background: var(--ct-accent); border-radius: var(--ct-radius-sm); }
.entry-content pre { overflow-x: auto; padding: 14px; background: #0f172a; color: #e2e8f0; border-radius: 12px; font-size: .9rem; }
.entry-content hr { border: 0; border-top: 1px solid var(--ct-line); margin-block: 2em; }
.entry-content .alignwide { max-width: 1000px; margin-inline: auto; }
.entry-content .alignfull { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.ct-builder-page { width: 100%; }

/* Comments */
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--ct-line); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--ct-line); border-radius: var(--ct-radius-sm); font: inherit; background: var(--ct-surface);
}
.comment-form .submit { padding: 11px 22px; border: 0; border-radius: var(--ct-radius-sm); background: var(--ct-accent); color: #fff; font: 600 .95rem var(--ct-font); cursor: pointer; }

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */
.ct-footer { margin-top: 24px; background: #11161d; color: #aab3c0; }
.ct-footer a { color: #d6dce5; text-decoration: none; }
.ct-footer a:hover { color: #fff; }
.ct-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-block: 48px 32px; }
.ct-footer .ct-brand { color: #fff; }
.ct-footer__about p { margin: 12px 0 0; max-width: 46ch; font-size: .92rem; }
.ct-footer__title { margin: 0 0 12px; color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.ct-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.ct-footer__base { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-block: 18px 26px; border-top: 1px solid #252c36; font-size: .8rem; color: #7d8794; }
.ct-footer__base p { margin: 0; max-width: 80ch; }

/* ------------------------------------------------------------------
   Plugin pages sit inside the theme
------------------------------------------------------------------ */
.ctpe-single { background: transparent; }
/* The footer carries the affiliate disclosure site-wide. */
.ct-main .ctpe-disclosure { display: none; }
.ctpe-crumb { font-size: .82rem; }

/* ------------------------------------------------------------------
   Responsive + motion
------------------------------------------------------------------ */
@media (max-width: 860px) {
	.ct-steps { grid-template-columns: 1fr; }
	.ct-footer__grid { grid-template-columns: 1fr 1fr; }
	.ct-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
	.ct-hero { padding-block: 44px 40px; }
	.ct-hero__search { flex-direction: column; }
	.ct-hero__search .ct-btn { width: 100%; }
	.ct-section { padding-block: 36px; }
	.ct-cta { padding: 22px; }
	.ct-footer__grid { grid-template-columns: 1fr; gap: 28px; }
	.ct-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
