/* ================================================
   Toolmana Tools v2 — tool.css
   Clean layout. AdSense auto-ads handles placement.
   ================================================ */

/* ── Reset & Base ──────────────────────────────── */
.tm-tool-page *,
.tm-category-page * {
  box-sizing: border-box;
}

/* ── Container ─────────────────────────────────── */
.tm-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Breadcrumb ────────────────────────────────── */
.tm-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 0 12px;
  font-size: 13px;
  color: #64748b;
}
.tm-breadcrumb a {
  color: #4F46E5;
  text-decoration: none;
}
.tm-breadcrumb a:hover { text-decoration: underline; }
.tm-breadcrumb span[aria-hidden] { color: #cbd5e1; }
.tm-breadcrumb span[aria-current] { color: #334155; font-weight: 500; }

/* ── Layout: 2 columns ─────────────────────────── */
.tm-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
  padding-bottom: 60px;
  width: 100%;
}
@media (max-width: 860px) {
  .tm-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .tm-sidebar {
    position: static !important;
    width: 100%;
    order: 2;
  }
  .tm-content {
    width: 100%;
    min-width: 0;
    order: 1;
  }
}

/* ── Tool Header ───────────────────────────────── */
.tm-tool-header {
  margin-bottom: 24px;
}
.tm-tool-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.tm-cat-link {
  font-size: 13px;
  font-weight: 600;
  color: #4F46E5;
  text-decoration: none;
  background: #EEF2FF;
  padding: 3px 10px;
  border-radius: 20px;
}
.tm-cat-link:hover { background: #e0e7ff; }

.tm-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.tm-badge--free     { background: #ECFDF5; color: #059669; }
.tm-badge--popular  { background: #FFF7ED; color: #EA580C; }
.tm-badge--new      { background: #EFF6FF; color: #2563EB; }
.tm-badge--updated  { background: #F5F3FF; color: #7C3AED; }

.tm-tool-title {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
  margin: 0 0 12px;
}
@media (max-width: 600px) {
  .tm-tool-title { font-size: 22px; }
}
.tm-tool-icon {
  margin-right: 8px;
  font-size: 26px;
}
.tm-tool-desc {
  font-size: 16px;
  color: #475569;
  line-height: 1.6;
  margin: 0;
  max-width: 680px;
}

/* ── Tool Widget ───────────────────────────────── */
.tm-tool-widget {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 36px;
  min-width: 0;
  overflow-x: auto;
}
@media (max-width: 600px) {
  .tm-tool-widget { padding: 16px 12px; }
}

/* ── How To Use ────────────────────────────────── */
.tm-how-to-use {
  margin-bottom: 36px;
  padding: 24px 28px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
}
.tm-how-to-use h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1E293B;
  margin: 0 0 14px;
}
.tm-how-to-use__body {
  font-size: 15px;
  color: #475569;
  line-height: 1.7;
}
.tm-how-to-use__body ol,
.tm-how-to-use__body ul {
  padding-left: 20px;
  margin: 8px 0;
}
.tm-how-to-use__body li { margin-bottom: 6px; }
.tm-how-to-use__body p  { margin: 0 0 10px; }

/* ── Related Tools ─────────────────────────────── */
.tm-related { margin-bottom: 36px; }
.tm-related h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1E293B;
  margin: 0 0 16px;
}
.tm-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.tm-related__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.tm-related__card:hover {
  border-color: #4F46E5;
  box-shadow: 0 2px 8px rgba(79,70,229,.1);
}
.tm-related__icon { font-size: 20px; }
.tm-related__name {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
  line-height: 1.3;
}
.tm-related__cat {
  font-size: 11px;
  color: #94A3B8;
}

/* ── Sidebar ───────────────────────────────────── */
.tm-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
@media (max-width: 860px) {
  .tm-sidebar {
    position: static;
    top: auto;
  }
}
.tm-sidebar__widget {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px;
}
.tm-sidebar__widget h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94A3B8;
  margin: 0 0 14px;
}

/* Category list */
.tm-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tm-cat-list__item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
  transition: background .1s;
}
.tm-cat-list__item a:hover { background: #F1F5F9; }
.tm-cat-list__item--active a {
  background: #EEF2FF;
  color: #4F46E5;
  font-weight: 600;
}
.tm-cat-list__count {
  font-size: 12px;
  color: #94A3B8;
  background: #F1F5F9;
  padding: 2px 7px;
  border-radius: 20px;
}

/* CTA widget */
.tm-sidebar__widget--cta {
  background: #4F46E5;
  border-color: #4F46E5;
  text-align: center;
}
.tm-sidebar__widget--cta p {
  font-size: 14px;
  color: #C7D2FE;
  margin: 0 0 14px;
  line-height: 1.5;
}
.tm-btn-all {
  display: block;
  background: #fff;
  color: #4F46E5;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity .15s;
}
.tm-btn-all:hover { opacity: .9; }

/* ── Category Archive ──────────────────────────── */
.tm-cat-header {
  margin-bottom: 28px;
}
.tm-cat-header h1 {
  font-size: 30px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 8px;
}
.tm-cat-desc {
  font-size: 16px;
  color: #475569;
  margin: 0;
}
.tm-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.tm-tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.tm-tool-card:hover {
  border-color: #4F46E5;
  box-shadow: 0 4px 12px rgba(79,70,229,.1);
}
.tm-tool-card__icon { font-size: 28px; }
.tm-tool-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #1E293B;
  margin: 0;
  line-height: 1.3;
}
.tm-tool-card__desc {
  font-size: 13px;
  color: #64748B;
  margin: 0;
  line-height: 1.5;
  flex: 1;
}
.tm-no-results { color: #64748B; font-size: 15px; }
.tm-pagination { margin-top: 20px; }
