/* ============================================================
   AI TOOLS DIRECTORY — /ai-tools/
   Uses only the design tokens defined in main.css.
   ============================================================ */

/* ============================================================
   1. HERO
   ============================================================ */
.tools-hero {
  padding-top: calc(var(--navbar-height) + var(--space-16));
  padding-bottom: var(--space-12);
  background:
    radial-gradient(60% 90% at 15% 0%, var(--color-purple-light) 0%, transparent 60%),
    radial-gradient(50% 80% at 92% 10%, var(--color-purple-mid) 0%, transparent 55%),
    var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
}

.tools-hero__inner {
  max-width: 780px;
}

.tools-hero__heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: var(--space-4);
  color: var(--color-dark);
}

.tools-hero__sub {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-muted);
  max-width: 62ch;
}

/* Stat strip */
.tools-hero__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-8);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.tools-hero__stat {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.tools-hero__stat strong {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-dark);
}

.tools-hero__stat svg {
  color: var(--color-purple);
  flex-shrink: 0;
}

/* ============================================================
   2. STICKY TOOLBAR — search + two filter rows
   ============================================================ */
.tools-toolbar {
  position: sticky;
  top: var(--navbar-height);
  z-index: 40;
  padding: var(--space-5) 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--color-border-light);
}

.tools-toolbar__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tools-toolbar__row + .tools-toolbar__row {
  margin-top: var(--space-4);
}

/* --- Search field --- */
.tools-search {
  position: relative;
  flex: 1 1 auto;
  max-width: 420px;
}

.tools-search__icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}

.tools-search__input {
  width: 100%;
  height: 46px;
  padding: 0 var(--space-10) 0 calc(var(--space-4) + 24px);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-dark);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.tools-search__input::placeholder { color: var(--color-muted); }

.tools-search__input:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 4px rgba(108, 59, 255, 0.12);
}

/* Hide the native WebKit clear button — we ship our own */
.tools-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.tools-search__clear {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: none;
  place-items: center;
  color: var(--color-muted);
  background: var(--color-border-light);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.tools-search__clear:hover { color: var(--color-dark); background: var(--color-border); }
.tools-search__clear.is-visible { display: grid; }

/* --- Result count --- */
.tools-count {
  flex-shrink: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: nowrap;
}

.tools-count strong {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-dark);
}

/* --- Reset --- */
.tools-reset {
  flex-shrink: 0;
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-purple);
  background: none;
  border: 1px solid var(--color-purple);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.tools-reset:hover { background: var(--color-purple); color: var(--color-white); }
.tools-reset.is-visible { display: inline-flex; }

/* --- Filter pill rows --- */
/* Wraps on desktop; becomes a single scrolling row on narrow screens. */
.tools-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 2px;
}

.tools-filters::-webkit-scrollbar { display: none; }

.tools-filters__label {
  flex-shrink: 0;
  margin-right: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.tools-pill {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-dark);
  white-space: nowrap;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tools-pill:hover {
  border-color: var(--color-purple);
  color: var(--color-purple);
}

.tools-pill.active {
  color: var(--color-white);
  background: var(--color-purple);
  border-color: var(--color-purple);
  box-shadow: var(--shadow-purple);
}

.tools-pill:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

/* ============================================================
   3. GRID
   ============================================================ */
.tools-library { padding-top: var(--space-12); padding-bottom: var(--space-16); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--space-5);
}

/* ============================================================
   4. TOOL CARD
   ============================================================ */
.tool-card { display: flex; position: relative; }

/* A class-level display beats the UA [hidden] rule, so restate it —
   the filters hide cards via card.hidden and rely on this. */
.tool-card[hidden] { display: none; }

.tool-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-6);
  font-family: var(--font-body);
  text-align: left;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}

.tool-card:hover .tool-card__body {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}

.tool-card:focus-within .tool-card__body {
  outline: 2px solid var(--color-purple);
  outline-offset: 3px;
}

.tool-card__top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Letter mark, tinted per tool via the --mark custom property */
.tool-card__mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1;
  color: var(--mark, #6C3BFF);
  background: color-mix(in srgb, var(--mark, #6C3BFF) 13%, #FFFFFF);
  border-radius: var(--radius-md);
  transition: transform var(--transition-base);
}

.tool-card:hover .tool-card__mark { transform: scale(1.06) rotate(-3deg); }

.tool-card__titles { min-width: 0; }

.tool-card__name {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-dark);
  overflow-wrap: anywhere;
}

.tool-card__cat {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-muted);
}

.tool-card__desc {
  flex: 1 1 auto;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-muted);
}

.tool-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

.tool-card__more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-purple);
}

.tool-card__more svg { transition: transform var(--transition-fast); }
.tool-card:hover .tool-card__more svg { transform: translateX(3px); }

/* --- Pricing pills --- */
.tool-pill {
  display: inline-block;
  padding: 3px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
}

.tool-pill--free     { color: #0F7B4F; background: #E4F6ED; }
.tool-pill--freemium { color: #5528e0; background: var(--color-purple-light); }
.tool-pill--paid     { color: #8A5A00; background: #FCF1DC; }

/* Card entry stagger — one-shot. Scoped to the un-settled grid so that
   re-showing a filtered-out card does not replay the fade-in: display:none
   cancels a running animation and restarts it when the card comes back. */
.tools-grid:not(.is-settled) .tool-card {
  opacity: 0;
  animation: toolCardIn 0.5s ease forwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}

@keyframes toolCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   5. EMPTY STATE
   ============================================================ */
.tools-empty {
  padding: var(--space-20) var(--space-6);
  text-align: center;
}

.tools-empty__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  color: var(--color-purple);
  background: var(--color-purple-light);
  border-radius: var(--radius-full);
}

.tools-empty h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-dark);
}

.tools-empty p {
  margin-top: var(--space-2);
  color: var(--color-muted);
}

/* ============================================================
   6. MODAL
   ============================================================ */
.tool-modal {
  width: min(620px, calc(100vw - 2rem));
  max-height: min(86vh, 860px);
  /* main.css resets margin to 0 on every element, which defeats the
     <dialog> default of `margin: auto` — restore it so the modal centres. */
  margin: auto;
  padding: 0;
  color: var(--color-dark);
  background: var(--color-white);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.tool-modal::backdrop {
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.tool-modal[open] { animation: toolModalIn 0.22s ease; }

@keyframes toolModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.tool-modal__inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.tool-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--color-muted);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-modal__close:hover {
  color: var(--color-dark);
  background: var(--color-border-light);
}

.tool-modal__body {
  flex: 1 1 auto;
  padding: var(--space-8) var(--space-8) var(--space-6);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* --- Detail content (cloned from the card) --- */
.tool-detail__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-right: var(--space-10);
}

.tool-detail__mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
  color: var(--mark, #6C3BFF);
  background: color-mix(in srgb, var(--mark, #6C3BFF) 13%, #FFFFFF);
  border-radius: var(--radius-md);
}

.tool-detail__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-dark);
}

.tool-detail__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.tool-detail__cat {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-muted);
}

.tool-detail__lede {
  margin-top: var(--space-6);
  font-size: var(--text-base);
  line-height: 1.75;
  color: #3A3A3A;
}

.tool-detail h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-purple);
}

.tool-detail ul {
  display: grid;
  gap: var(--space-2);
  list-style: none;
}

.tool-detail li {
  position: relative;
  padding-left: var(--space-6);
  font-size: var(--text-sm);
  line-height: 1.65;
  color: #3A3A3A;
}

.tool-detail li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--color-purple);
  border-radius: var(--radius-full);
}

.tool-detail__watch {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: #3A3A3A;
}

.tool-detail__price {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: #3A3A3A;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.tool-detail__price strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* --- Modal footer --- */
.tool-modal__foot {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-8);
  background: var(--color-white);
  border-top: 1px solid var(--color-border-light);
}

.tool-modal__note {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-muted);
  max-width: 30ch;
}

.tool-modal__visit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   7. DISCLAIMER STRIP
   ============================================================ */
.tools-note {
  padding-bottom: var(--space-20);
}

.tools-note__inner {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.tools-note__inner svg { flex-shrink: 0; color: var(--color-purple); margin-top: 3px; }
.tools-note__inner strong { color: var(--color-dark); }

/* ============================================================
   8. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 768px) {
  .tools-hero { padding-top: calc(var(--navbar-height) + var(--space-10)); }
  .tools-hero__sub { font-size: var(--text-base); }

  .tools-toolbar { padding: var(--space-4) 0; }
  .tools-toolbar__row { flex-wrap: wrap; }
  .tools-search { max-width: none; flex-basis: 100%; }

  /* One scrolling row per filter group, bleeding to the screen edges
     so the overflow reads as swipeable rather than clipped. */
  .tools-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-inline: calc(var(--space-6) * -1);
    padding-inline: var(--space-6);
  }

  .tools-filters::-webkit-scrollbar { display: none; }

  .tools-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .tool-card__body { padding: var(--space-5); }
}

@media (max-width: 560px) {
  .tools-grid { grid-template-columns: 1fr; }

  /* Keep the group labels: both rows start with an "All" pill, so without
     them it is not clear which "All" belongs to which filter. */
  .tools-filters__label {
    position: sticky;
    left: 0;
    z-index: 1;
    padding-right: var(--space-2);
    background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.95) 78%, rgba(255, 255, 255, 0) 100%);
  }

  .tool-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .tool-modal__body { padding: var(--space-6) var(--space-5) var(--space-4); }
  .tool-modal__foot { padding: var(--space-4) var(--space-5); }
  .tool-modal__note { max-width: none; order: 2; }
  .tool-modal__visit { width: 100%; justify-content: center; }
}

/* ============================================================
   9. MOTION PREFERENCES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* Must match the stagger selector's specificity to win over it. */
  .tools-grid:not(.is-settled) .tool-card {
    opacity: 1;
    animation: none;
  }
  .tool-modal[open] { animation: none; }
  .tool-card:hover .tool-card__body { transform: none; }
  .tool-card:hover .tool-card__mark { transform: none; }
  .tool-card:hover .tool-card__more svg { transform: none; }
}

/* ============================================================
   10. CATEGORY JUMP LIST (hero)
   ============================================================ */
.tools-jumps { margin-top: var(--space-10); }

.tools-jumps ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}

.tools-jump {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-dark);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tools-jump:hover {
  background: var(--color-white);
  border-color: var(--color-purple);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tools-jump:focus-visible { outline: 2px solid var(--color-purple); outline-offset: 2px; }

.tools-jump__emoji { font-size: var(--text-base); line-height: 1; }

.tools-jump__count {
  min-width: 22px;
  padding: 1px 6px;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center;
  color: var(--color-purple);
  background: var(--color-purple-light);
  border-radius: var(--radius-full);
}

/* ============================================================
   11. STAR RATING
   ============================================================ */
.tool-rating {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.tool-rating__stars {
  position: relative;
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 1px;
  white-space: nowrap;
}

.tool-rating__base { color: var(--color-border); }

.tool-rating__fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #F5A623;
}

.tool-rating__num {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
}

/* ============================================================
   12. CARD — "Best for" line
   ============================================================ */
.tool-card__bestfor {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-muted);
}

.tool-card__bestfor strong {
  font-weight: 600;
  color: #3A3A3A;
}

/* Tighten the gap now that cards carry more rows. */
.tool-card__body { gap: var(--space-3); }
.tool-card__top  { margin-bottom: var(--space-1); }
.tool-card__foot { margin-top: var(--space-1); }

/* ============================================================
   13. MODAL — verdict block, category line, spec grid
   ============================================================ */
.tool-detail__cat {
  margin-top: 3px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.tool-detail__verdict {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--color-purple-light);
  border: 1px solid var(--color-purple-mid);
  border-radius: var(--radius-lg);
}

.tool-detail__verdict-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.tool-detail__verdict-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-purple);
}

.tool-detail__verdict p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: #2E2140;
}

/* The lede sits under an h3 now, so it needs no extra top margin. */
.tool-detail__lede { margin-top: 0; }

.tool-detail__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.tool-detail__specs > div {
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.tool-detail__specs dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.tool-detail__specs dd {
  margin-top: 2px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-dark);
}

.tool-detail__reviewed {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

@media (max-width: 560px) {
  .tool-detail__specs { grid-template-columns: 1fr; }
  .tools-jumps ul { gap: var(--space-2); }
}

/* Pricing group sits inline with the search field on desktop. */
.tools-filters--price { flex: 0 0 auto; }

@media (max-width: 900px) {
  .tools-filters--price { flex: 1 1 100%; }
}

/* ============================================================
   14. INDIVIDUAL TOOL PAGE — /ai-tools/<slug>/
   ============================================================ */
.tp-head {
  padding-top: calc(var(--navbar-height) + var(--space-10));
  padding-bottom: var(--space-10);
  background:
    radial-gradient(70% 100% at 10% 0%,
      color-mix(in srgb, var(--mark, #6C3BFF) 10%, #FFFFFF) 0%, transparent 65%),
    var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
}

/* --- Breadcrumbs --- */
.tp-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.tp-crumbs li + li::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--color-border);
}

.tp-crumbs a { color: var(--color-muted); text-decoration: none; }
.tp-crumbs a:hover { color: var(--color-purple); }
.tp-crumbs [aria-current] { color: var(--color-dark); font-weight: 500; }

/* --- Header --- */
.tp-head__top {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.tp-head__mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
  color: var(--mark, #6C3BFF);
  background: color-mix(in srgb, var(--mark, #6C3BFF) 13%, #FFFFFF);
  border-radius: var(--radius-lg);
}

.tp-head__titles h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-dark);
}

.tp-head__type {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.tp-head__type a { color: var(--color-purple); text-decoration: none; }
.tp-head__type a:hover { text-decoration: underline; }

.tp-head__lede {
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-muted);
}

.tp-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-6);
}

.tp-head__reviewed { font-size: var(--text-xs); color: var(--color-muted); }

.tp-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.tp-head__actions .btn { display: inline-flex; align-items: center; gap: var(--space-2); }

/* --- Body --- */
.tp-body { padding-block: var(--space-16) var(--space-20); }

.tp-body section + section,
.tp-body section + .tp-author { margin-top: var(--space-12); }

.tp-body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-dark);
  margin-bottom: var(--space-4);
}

.tp-body p {
  font-size: var(--text-base);
  line-height: 1.8;
  color: #3A3A3A;
}

/* --- Verdict --- */
.tp-verdict {
  padding: var(--space-6) var(--space-8);
  background: var(--color-purple-light);
  border: 1px solid var(--color-purple-mid);
  border-radius: var(--radius-lg);
}

.tp-verdict__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.tp-verdict__head h2 { margin-bottom: 0; font-size: var(--text-xl); }
.tp-verdict p { color: #2E2140; }

/* --- Spec grid --- */
.tp-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.tp-specs > div {
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.tp-specs dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.tp-specs dd {
  margin-top: 3px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-dark);
}

/* --- Lists --- */
.tp-list { display: grid; gap: var(--space-3); list-style: none; }

.tp-list li {
  position: relative;
  padding-left: var(--space-8);
  font-size: var(--text-base);
  line-height: 1.7;
  color: #3A3A3A;
}

.tp-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  width: 7px;
  height: 7px;
  background: var(--color-purple);
  border-radius: var(--radius-full);
}

/* --- Warning + pricing --- */
.tp-warn {
  padding: var(--space-5) var(--space-6);
  background: #FFFBF2;
  border: 1px solid #F2E4C9;
  border-radius: var(--radius-md);
}

.tp-price {
  padding: var(--space-5) var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.tp-price__note {
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm) !important;
  color: var(--color-muted) !important;
}

.tp-body .btn { display: inline-flex; align-items: center; gap: var(--space-2); }

/* --- FAQ --- */
.tp-faq__item + .tp-faq__item {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border-light);
}

.tp-faq__item h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: var(--space-2);
}

/* --- Alternatives --- */
.tp-alts__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.tp-alt {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  text-decoration: none;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
}

.tp-alt:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.tp-alt__mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--mark, #6C3BFF);
  background: color-mix(in srgb, var(--mark, #6C3BFF) 13%, #FFFFFF);
  border-radius: var(--radius-md);
}

.tp-alt__body { min-width: 0; }

.tp-alt__name {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-dark);
}

.tp-alt__desc {
  display: block;
  margin-top: 3px;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-muted);
}

.tp-alt__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.tp-alts__more { margin-top: var(--space-5); }
.tp-alts__more a { color: var(--color-purple); font-weight: 600; text-decoration: none; }
.tp-alts__more a:hover { text-decoration: underline; }

/* --- Author note --- */
.tp-author {
  padding: var(--space-6);
  background: var(--color-bg);
  border-left: 3px solid var(--color-purple);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.tp-author p { font-size: var(--text-sm) !important; line-height: 1.75; }
.tp-author a { color: var(--color-purple); font-weight: 600; }

/* --- Tool page responsive --- */
@media (min-width: 700px) {
  .tp-alts__grid { grid-template-columns: repeat(3, 1fr); }
  .tp-alt { flex-direction: column; }
}

@media (max-width: 700px) {
  .tp-specs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .tp-head__top { gap: var(--space-4); }
  .tp-head__mark { width: 56px; height: 56px; font-size: var(--text-2xl); }
  .tp-specs { grid-template-columns: 1fr; }
  .tp-head__actions .btn { width: 100%; justify-content: center; }
  .tp-verdict { padding: var(--space-5); }
}

/* ============================================================
   15. CARD AS LINK + QUICK-LOOK BUTTON
   The whole card links to the tool's own page (crawlable, and the
   primary action). The Quick look button sits above the overlay and
   opens the modal instead. Avoids nesting a button inside an anchor.
   ============================================================ */
.tool-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
}

.tool-card__link {
  color: var(--color-dark);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* Stretches the anchor's hit area over the entire card. */
.tool-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
}

.tool-card:hover .tool-card__link { color: var(--color-purple); }

.tool-card__link:focus-visible { outline: none; }

.tool-card:focus-within .tool-card__body {
  outline: 2px solid var(--color-purple);
  outline-offset: 3px;
}

/* Quick look — lifted above the stretched link so it stays clickable. */
.tool-card__quick {
  position: relative;
  z-index: 1;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-purple);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-card__quick:hover {
  color: var(--color-white);
  background: var(--color-purple);
  border-color: var(--color-purple);
}

.tool-card__quick:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

/* The card body owns the box now, so it must fill the article. */
.tool-card__body { width: 100%; }

/* Modal → full review link */
.tool-detail__full { margin-top: var(--space-2); }

.tool-detail__full a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-purple);
  text-decoration: none;
}

.tool-detail__full a:hover { text-decoration: underline; }

/* Modal footer: internal "Full review" link beside the outbound CTA. */
.tool-modal__full {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-purple);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.tool-modal__full:hover { border-bottom-color: var(--color-purple); }

@media (max-width: 560px) {
  .tool-modal__full { order: 2; width: 100%; text-align: center; }
}

/* ============================================================
   16. HUB FAQ (accordion)
   ============================================================ */
.tools-faq {
  padding-block: var(--space-20);
  background: var(--color-white);
  border-top: 1px solid var(--color-border-light);
}

.tools-faq__heading {
  margin-top: var(--space-4);
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-dark);
}

.tools-faq__intro {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-muted);
}

.tools-faq__intro a { color: var(--color-purple); font-weight: 600; }

.tools-faq__list { margin-top: var(--space-10); }

.tools-faq__item {
  border-bottom: 1px solid var(--color-border-light);
}

.tools-faq__item:first-child { border-top: 1px solid var(--color-border-light); }

.tools-faq__item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-dark);
  cursor: pointer;
  list-style: none;
  transition: color var(--transition-fast);
}

/* Remove the native disclosure triangle in every engine. */
.tools-faq__item summary::-webkit-details-marker { display: none; }
.tools-faq__item summary::marker { content: ""; }

.tools-faq__item summary:hover { color: var(--color-purple); }

.tools-faq__item summary:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Custom +/– indicator */
.tools-faq__item summary::after {
  content: "";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  background:
    linear-gradient(var(--color-purple), var(--color-purple)) center/11px 2px no-repeat,
    linear-gradient(var(--color-purple), var(--color-purple)) center/2px 11px no-repeat;
  transition: transform var(--transition-base);
}

.tools-faq__item[open] summary::after { transform: rotate(135deg); }

.tools-faq__answer {
  padding: 0 var(--space-10) var(--space-6) 0;
}

.tools-faq__answer p {
  font-size: var(--text-base);
  line-height: 1.8;
  color: #3A3A3A;
}

@media (max-width: 560px) {
  .tools-faq { padding-block: var(--space-16); }
  .tools-faq__item summary { font-size: var(--text-base); gap: var(--space-4); }
  .tools-faq__answer { padding-right: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  .tools-faq__item summary::after { transition: none; }
}

/* ============================================================
   17. FOOTER — AI Tools column
   ============================================================ */
.footer__col--tools ul { columns: 1; }

.footer__col--tools .footer__col-more a {
  font-weight: 600;
  color: var(--color-purple);
}
