/*
Theme Name: ToolMetria
Theme URI: https://toolmetria.com
Author: ToolMetria
Author URI: https://toolmetria.com
Description: A fast, editorial WordPress theme built for ToolMetria — AI tools, software reviews, comparisons, and business automation guides. Designed for clear reading, strong internal linking, accessibility, Core Web Vitals, affiliate transparency, and ad-ready layouts.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: toolmetria
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, news, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready
*/

:root {
  --tm-bg: #f7f8fb;
  --tm-surface: #ffffff;
  --tm-surface-2: #f0f3f8;
  --tm-text: #131722;
  --tm-muted: #5f6675;
  --tm-border: #e2e6ee;
  --tm-accent: #4257ff;
  --tm-accent-2: #17248a;
  --tm-success: #0f7a4f;
  --tm-warning: #8a5a00;
  --tm-radius: 18px;
  --tm-radius-sm: 12px;
  --tm-shadow: 0 12px 40px rgba(25, 35, 65, 0.08);
  --tm-content: 760px;
  --tm-wide: 1180px;
  --tm-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--tm-bg);
  color: var(--tm-text);
  font-family: var(--tm-font);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; border-radius: var(--tm-radius-sm); }
iframe { max-width: 100%; }
a { color: var(--tm-accent-2); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--tm-accent); }
button, input, select, textarea { font: inherit; }
button, .button, .wp-element-button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(66, 87, 255, .35); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 9999;
  background: #fff;
  color: #111;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--tm-shadow);
}
.skip-link:focus { top: 12px; }

.tm-container { width: min(calc(100% - 36px), var(--tm-wide)); margin-inline: auto; }
.tm-content-width { width: min(calc(100% - 36px), var(--tm-content)); margin-inline: auto; }
.tm-section { padding: 72px 0; }
.tm-section-sm { padding: 44px 0; }
.tm-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tm-accent-2);
}
.tm-kicker::before { content: ""; width: 18px; height: 3px; border-radius: 10px; background: var(--tm-accent); }
.tm-section-title { margin: 10px 0 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.035em; }
.tm-section-copy { margin: 0; color: var(--tm-muted); max-width: 720px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(226,230,238,.9);
  backdrop-filter: blur(14px);
}
.tm-header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-branding { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tm-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--tm-accent), #7383ff); color: #fff; box-shadow: 0 8px 22px rgba(66,87,255,.25);
}
.tm-mark svg { width: 20px; height: 20px; }
.site-title { margin: 0; font-size: 22px; line-height: 1; letter-spacing: -.04em; font-weight: 850; }
.site-title a { color: var(--tm-text); text-decoration: none; }
.site-description { display: none; }
.primary-navigation { display: flex; align-items: center; }
.primary-navigation ul { margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: 24px; }
.primary-navigation a { color: #303747; text-decoration: none; font-size: 14px; font-weight: 700; }
.primary-navigation a:hover { color: var(--tm-accent); }
.tm-header-search { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--tm-border); border-radius: 12px; color: var(--tm-text); text-decoration: none; }
.tm-nav-toggle { display: none; border: 0; background: transparent; padding: 8px; border-radius: 10px; }
.tm-nav-toggle svg { width: 24px; height: 24px; }

/* Hero */
.tm-hero { padding: 88px 0 64px; overflow: hidden; position: relative; }
.tm-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 78% 10%, rgba(66,87,255,.12), transparent 34%), radial-gradient(circle at 10% 75%, rgba(95,191,255,.12), transparent 28%);
}
.tm-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 64px; align-items: center; }
.tm-hero h1 { margin: 14px 0 20px; max-width: 800px; font-size: clamp(46px, 7vw, 78px); line-height: .98; letter-spacing: -.055em; }
.tm-hero h1 span { color: var(--tm-accent); }
.tm-hero p { max-width: 680px; color: var(--tm-muted); font-size: 20px; line-height: 1.55; }
.tm-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.tm-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 800; font-size: 14px; text-decoration: none; border: 1px solid transparent; transition: transform .18s ease, box-shadow .18s ease; }
.tm-button:hover { transform: translateY(-1px); }
.tm-button-primary { color: #fff; background: var(--tm-accent); box-shadow: 0 10px 24px rgba(66,87,255,.22); }
.tm-button-primary:hover { color: #fff; }
.tm-button-secondary { color: var(--tm-text); background: #fff; border-color: var(--tm-border); }
.tm-trust-line { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 16px; color: var(--tm-muted); font-size: 13px; font-weight: 650; }
.tm-trust-line span { display: inline-flex; align-items: center; gap: 6px; }
.tm-trust-line svg { width: 16px; height: 16px; color: var(--tm-success); }

.tm-hero-card { background: #101629; color: #fff; border-radius: 26px; padding: 26px; box-shadow: 0 28px 70px rgba(20,28,57,.22); transform: rotate(1deg); }
.tm-hero-card-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.tm-hero-card .tm-mini-label { color: #b7c0da; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.tm-score-big { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #101629; font-size: 23px; font-weight: 900; box-shadow: inset 0 0 0 7px #dfe4ff; }
.tm-hero-card h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.1; letter-spacing: -.03em; }
.tm-hero-card p { color: #c6cce0; font-size: 15px; margin: 0; }
.tm-metric-list { display: grid; gap: 14px; margin-top: 24px; }
.tm-metric { display: grid; grid-template-columns: 90px 1fr 42px; align-items: center; gap: 10px; font-size: 12px; color: #d7dbeb; }
.tm-metric-bar { height: 7px; border-radius: 999px; background: #29314a; overflow: hidden; }
.tm-metric-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#7180ff,#a7b0ff); }
.tm-metric strong { text-align: right; }

/* Cards / grids */
.tm-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.tm-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.tm-card { background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); padding: 24px; box-shadow: 0 8px 24px rgba(25,35,65,.035); }
.tm-card:hover { box-shadow: var(--tm-shadow); }
.tm-category-card { text-decoration: none; color: inherit; display: block; min-height: 178px; }
.tm-category-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #eef0ff; color: var(--tm-accent); margin-bottom: 22px; font-weight: 900; }
.tm-category-card h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.025em; }
.tm-category-card p { margin: 0; color: var(--tm-muted); font-size: 14px; }

.tm-post-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.tm-post-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(145deg,#e8eaff,#f7f8ff); }
.tm-post-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .25s ease; }
.tm-post-card:hover .tm-post-thumb img { transform: scale(1.02); }
.tm-post-body { padding: 22px; display: flex; flex: 1; flex-direction: column; }
.tm-post-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; color: var(--tm-muted); font-size: 12px; font-weight: 700; }
.tm-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; background: #eef0ff; color: var(--tm-accent-2); font-size: 11px; font-weight: 800; text-decoration: none; }
.tm-post-card h3 { margin: 0 0 10px; font-size: 22px; line-height: 1.22; letter-spacing: -.03em; }
.tm-post-card h3 a { color: var(--tm-text); text-decoration: none; }
.tm-post-card p { color: var(--tm-muted); font-size: 14px; margin: 0 0 16px; }
.tm-card-link { margin-top: auto; font-weight: 800; font-size: 13px; text-decoration: none; }

/* Feature band */
.tm-band { background: #11172a; color: #fff; }
.tm-band .tm-section-copy { color: #bec6dc; }
.tm-band .tm-kicker { color: #aeb8ff; }
.tm-band-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 54px; align-items: center; }
.tm-principles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.tm-principle { padding: 18px; border: 1px solid #2b334b; border-radius: 14px; background: #151c32; }
.tm-principle strong { display: block; margin-bottom: 3px; font-size: 14px; }
.tm-principle span { color: #aeb6cd; font-size: 13px; }

/* Newsletter / CTA */
.tm-cta { background: linear-gradient(145deg,#4257ff,#2639d8); color: #fff; border-radius: 28px; padding: clamp(30px,5vw,58px); display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.tm-cta h2 { margin: 0 0 8px; font-size: clamp(30px,4vw,44px); line-height: 1.08; letter-spacing: -.04em; }
.tm-cta p { margin: 0; max-width: 650px; color: #e1e5ff; }
.tm-cta .tm-button-secondary { border-color: rgba(255,255,255,.28); background: #fff; }

/* Archives */
.tm-page-header { padding: 64px 0 30px; }
.tm-page-header h1 { margin: 8px 0 10px; font-size: clamp(40px,6vw,64px); line-height: 1; letter-spacing: -.05em; }
.tm-page-header p { color: var(--tm-muted); max-width: 720px; }
.tm-post-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; padding-bottom: 72px; }
.navigation.pagination { margin: 10px 0 72px; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.page-numbers { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 11px; border: 1px solid var(--tm-border); background: #fff; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 800; }
.page-numbers.current { color: #fff; background: var(--tm-accent); border-color: var(--tm-accent); }

/* Single */
.tm-article-shell { padding: 52px 0 80px; }
.tm-article-grid { display: grid; grid-template-columns: minmax(0,760px) 260px; gap: 52px; justify-content: center; align-items: start; }
.tm-breadcrumbs { margin-bottom: 22px; color: var(--tm-muted); font-size: 12px; }
.tm-breadcrumbs a { color: inherit; }
.entry-header h1 { margin: 12px 0 18px; font-size: clamp(38px,6vw,62px); line-height: 1.03; letter-spacing: -.05em; }
.tm-deck { margin: 0 0 22px; color: var(--tm-muted); font-size: 20px; line-height: 1.55; }
.tm-byline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid var(--tm-border); color: var(--tm-muted); font-size: 13px; }
.tm-byline strong { color: var(--tm-text); }
.tm-updated { display: inline-flex; align-items: center; gap: 6px; }
.tm-disclosure { margin: 20px 0 28px; padding: 14px 16px; background: #f0f2ff; border: 1px solid #dfe3ff; border-radius: 12px; color: #48506a; font-size: 13px; }
.tm-disclosure strong { color: var(--tm-text); }
.entry-content { margin-top: 30px; }
.entry-content > * { max-width: 100%; }
.entry-content p { margin: 0 0 1.35em; }
.entry-content h2 { margin: 2em 0 .65em; font-size: clamp(28px,4vw,38px); line-height: 1.15; letter-spacing: -.035em; scroll-margin-top: 100px; }
.entry-content h3 { margin: 1.7em 0 .6em; font-size: 24px; line-height: 1.25; letter-spacing: -.025em; scroll-margin-top: 100px; }
.entry-content h4 { margin: 1.5em 0 .5em; font-size: 20px; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin: .38em 0; }
.entry-content blockquote { margin: 28px 0; padding: 20px 24px; border-left: 4px solid var(--tm-accent); background: #f1f3ff; border-radius: 0 14px 14px 0; }
.entry-content table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 28px 0; border: 1px solid var(--tm-border); border-radius: 14px; overflow: hidden; font-size: 14px; }
.entry-content th, .entry-content td { padding: 13px 14px; border-bottom: 1px solid var(--tm-border); text-align: left; vertical-align: top; }
.entry-content tr:last-child td { border-bottom: 0; }
.entry-content th { background: #f4f6fa; font-weight: 800; }
.entry-content code { padding: 2px 5px; background: #f0f2f6; border-radius: 6px; font-size: .9em; }
.entry-content pre { overflow: auto; padding: 18px; border-radius: 14px; background: #11172a; color: #e6e8f0; }
.entry-content .wp-block-image { margin: 30px 0; }
.entry-content .wp-block-button__link { background: var(--tm-accent); border-radius: 12px; font-weight: 800; }

.tm-review-summary { display: grid; grid-template-columns: 108px 1fr; gap: 22px; align-items: center; margin: 30px 0; padding: 22px; background: #11172a; color: #fff; border-radius: 18px; }
.tm-review-score { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #11172a; font-size: 27px; font-weight: 900; }
.tm-review-summary h3 { margin: 0 0 4px; font-size: 22px; }
.tm-review-summary p { margin: 0; color: #bfc7dc; font-size: 13px; }

.tm-key-takeaways { margin: 28px 0; padding: 22px; border: 1px solid #cfe5d9; background: #f4fbf7; border-radius: 16px; }
.tm-key-takeaways h2, .tm-key-takeaways h3 { margin-top: 0; font-size: 20px; }
.tm-key-takeaways ul { margin-bottom: 0; }

.tm-article-aside { position: sticky; top: 100px; }
.tm-toc { background: #fff; border: 1px solid var(--tm-border); border-radius: 16px; padding: 18px; }
.tm-toc-title { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.tm-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.tm-toc a { color: var(--tm-muted); text-decoration: none; font-size: 12px; line-height: 1.35; }
.tm-toc a:hover { color: var(--tm-accent); }
.tm-toc .tm-toc-h3 { padding-left: 12px; }

.tm-ad-slot { margin: 28px 0; min-height: 90px; display: grid; place-items: center; border-radius: 12px; }
.tm-ad-slot:empty { display: none; }
.tm-ad-label { display: block; margin-bottom: 6px; text-align: center; color: #8b91a0; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.tm-author-box { margin-top: 48px; padding: 22px; background: #fff; border: 1px solid var(--tm-border); border-radius: 18px; }
.tm-author-box h3 { margin: 0 0 6px; }
.tm-author-box p { margin: 0; color: var(--tm-muted); font-size: 14px; }
.tm-related { margin-top: 52px; padding-top: 42px; border-top: 1px solid var(--tm-border); }
.tm-related h2 { margin: 0 0 20px; font-size: 28px; }

/* Pages */
.tm-prose { padding: 58px 0 80px; }
.tm-prose .entry-header { width: min(calc(100% - 36px), var(--tm-content)); margin-inline: auto; }
.tm-prose .entry-content { width: min(calc(100% - 36px), var(--tm-content)); margin-inline: auto; }

/* Search */
.search-form { display: flex; gap: 8px; }
.search-field { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--tm-border); border-radius: 11px; background: #fff; }
.search-submit { min-height: 46px; border: 0; padding: 0 16px; background: var(--tm-accent); color: #fff; border-radius: 11px; font-weight: 800; }

/* Footer */
.site-footer { background: #0f1424; color: #c0c6d8; padding: 60px 0 24px; }
.tm-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3,.65fr); gap: 40px; }
.tm-footer-brand .site-title a { color: #fff; }
.tm-footer-brand p { max-width: 360px; color: #949db6; font-size: 14px; }
.tm-footer-title { color: #fff; font-size: 13px; font-weight: 850; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #aeb6cc; text-decoration: none; font-size: 13px; }
.site-footer a:hover { color: #fff; }
.tm-footer-bottom { display: flex; justify-content: space-between; gap: 18px; margin-top: 48px; padding-top: 20px; border-top: 1px solid #252d43; font-size: 12px; color: #7f899f; }

/* Comments */
.comments-area { margin-top: 50px; padding-top: 35px; border-top: 1px solid var(--tm-border); }
.comment-list { padding: 0; list-style: none; }
.comment-body { margin: 20px 0; padding: 18px; background: #fff; border: 1px solid var(--tm-border); border-radius: 14px; }
.comment-form input:not([type="submit"]), .comment-form textarea { width: 100%; padding: 12px; border: 1px solid var(--tm-border); border-radius: 10px; background: #fff; }
.comment-form label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 5px; }
.form-submit input { border: 0; background: var(--tm-accent); color: #fff; border-radius: 10px; padding: 12px 16px; font-weight: 800; }

/* Utilities */
.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; }
.alignwide { width: min(100vw - 36px, 1040px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }

@media (max-width: 980px) {
  .tm-hero-grid, .tm-band-grid { grid-template-columns: 1fr; }
  .tm-hero-card { max-width: 620px; transform: none; }
  .tm-grid-4 { grid-template-columns: repeat(2,1fr); }
  .tm-grid-3, .tm-post-list { grid-template-columns: repeat(2,1fr); }
  .tm-article-grid { grid-template-columns: minmax(0,760px); }
  .tm-article-aside { display: none; }
  .tm-footer-grid { grid-template-columns: 1.3fr repeat(2,.7fr); }
  .tm-footer-grid > :last-child { grid-column: 2 / -1; }
  .tm-cta { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .tm-header-inner { min-height: 64px; }
  .tm-nav-toggle { display: inline-flex; }
  .primary-navigation { display: none; position: absolute; left: 18px; right: 18px; top: 64px; background: #fff; border: 1px solid var(--tm-border); border-radius: 14px; padding: 12px; box-shadow: var(--tm-shadow); }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { align-items: stretch; flex-direction: column; gap: 2px; }
  .primary-navigation a { display: block; padding: 10px; }
  .tm-header-search { margin-left: auto; }
  .tm-hero { padding: 58px 0 44px; }
  .tm-hero-grid { gap: 36px; }
  .tm-hero h1 { font-size: clamp(44px,15vw,62px); }
  .tm-hero p { font-size: 18px; }
  .tm-section { padding: 54px 0; }
  .tm-grid-4, .tm-grid-3, .tm-post-list { grid-template-columns: 1fr; }
  .tm-principles { grid-template-columns: 1fr; }
  .tm-footer-grid { grid-template-columns: 1fr 1fr; }
  .tm-footer-brand { grid-column: 1/-1; }
  .tm-footer-grid > :last-child { grid-column: auto; }
  .tm-footer-bottom { flex-direction: column; }
  .tm-review-summary { grid-template-columns: 1fr; }
  .tm-article-shell { padding-top: 32px; }
  .entry-header h1 { font-size: clamp(36px,11vw,52px); }
  .tm-deck { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 38px; width: auto; border-radius: 0; }
.widget { font-size: 14px; }
.widget-title { margin: 0 0 10px; font-size: 15px; }
