/*
 * Hub pages (Tools, Blog, Docs home): premium, minimal, Apple-style look that
 * matches the editor's settings and menus. Layered over each page's own markup
 * (body.hub, or .docs-home on the docs home) so filters, search and SEO content
 * keep working. All white, always (no dark mode).
 */
:root {
  --hub-bg: #ffffff;
  --hub-card: #ffffff;
  --hub-text: #1d1d1f;
  --hub-muted: #6e6e73;
  --hub-faint: #86868b;
  --hub-hair: rgba(0, 0, 0, 0.08);
  --hub-fill: #f5f5f7;
  --hub-accent: #0f766e;
  --hub-accent-strong: #0b5f58;
  --hub-link: #0a7a70;
  --hub-radius: 18px;
  --hub-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.04);
  --hub-shadow-hover: 0 0 0 1px rgba(0, 0, 0, 0.09), 0 16px 40px rgba(0, 0, 0, 0.09);
  --hub-glass: rgba(255, 255, 255, 0.82);
  --hub-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --hub-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ── Page ─────────────────────────────────────────────────────────────── */
body.hub {
  background: var(--hub-bg);
  color: var(--hub-text);
  font-family: var(--hub-font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
}
body.hub .container {
  box-sizing: border-box;
  width: min(1120px, 100%);
  padding: 8px 22px 64px;
  display: flex;
  flex-direction: column;
}
body.hub .hero a,
body.hub .grid > .card p a,
body.hub .tool-card p a { color: var(--hub-link); }
body.hub :focus-visible { outline: 2px solid var(--hub-accent); outline-offset: 2px; border-radius: 8px; }

/* Hero: large centred headline, quiet lead. */
body.hub .hero {
  order: -1;
  background: none;
  border: 0;
  box-shadow: none;
  padding: clamp(18px, 3vw, 30px) 0 clamp(10px, 1.6vw, 16px);
  margin: 0;
  text-align: center;
}
body.hub .hero h1 {
  font-family: var(--hub-display);
  font-size: clamp(28px, 3.8vw, 40px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.024em;
  color: var(--hub-text);
  margin: 0 auto 8px;
  max-width: 30ch;
}
body.hub .hero p {
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.45;
  color: var(--hub-muted);
  max-width: 680px;
  margin: 0 auto 4px;
}
body.hub .hero p + p { font-size: 14px; margin-top: 4px; }

/* Small navigation pills under the hero. */
body.hub .top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 6px;
  background: none;
  border: 0;
}
body.hub .top-nav a,
body.hub .top-nav .top-link,
body.hub .top-nav .nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: var(--hub-fill);
  color: var(--hub-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.2s;
}
body.hub .top-nav a:hover { background: var(--hub-hair); }

/* Category switcher: one sticky, frosted row of pills (was a sidebar). */
body.hub .tools-layout,
body.hub .blog-layout { display: block; }
body.hub .tools-category-sidebar,
body.hub .category-sidebar {
  position: sticky;
  /* Just below the site's sticky header (44 px). */
  top: 54px;
  z-index: 20;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: 8px auto 26px;
  padding: 5px;
  background: var(--hub-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hub-hair);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}
body.hub .tools-category-title,
body.hub .category-sidebar h2,
body.hub .category-note { display: none; }
body.hub .tools-category-list,
body.hub .category-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: safe center;
  overflow-x: auto;
  scrollbar-width: none;
  list-style: none;
  margin: 0;
  padding: 0;
}
body.hub .tools-category-list::-webkit-scrollbar,
body.hub .category-list::-webkit-scrollbar { display: none; }
body.hub .tools-category-list li { flex: none; }
body.hub .tools-cat-btn,
body.hub .category-list button {
  flex: none;
  min-height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--hub-muted);
  font: 500 14px/1 var(--hub-font);
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  width: auto;
  min-width: 0;
  text-align: center;
}
body.hub .tools-cat-btn:hover,
body.hub .category-list button:hover { color: var(--hub-text); background: var(--hub-fill); }
body.hub .tools-cat-btn.active,
body.hub .category-list button.active,
body.hub .category-list button[aria-pressed='true'] {
  background: var(--hub-text);
  color: var(--hub-bg);
  border: 0;
}

/* Tools page, wide screens: categories as a vertical list on the left. */
@media (min-width: 900px) {
  body.hub .tools-layout {
    display: grid;
    grid-template-columns: 196px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  body.hub .tools-category-sidebar {
    top: 60px;
    width: auto;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    margin: 0;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    scrollbar-width: thin;
  }
  body.hub .tools-category-title {
    display: block;
    margin: 4px 12px 8px;
    color: var(--hub-faint, #86868b);
    font: 600 12px/1 var(--hub-font);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  body.hub .tools-category-list {
    flex-direction: column;
    gap: 2px;
    overflow: visible;
    justify-content: flex-start;
  }
  body.hub .tools-cat-btn {
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    text-align: left;
    white-space: normal;
    line-height: 1.25;
  }
  body.hub .tools-cat-btn.active {
    background: var(--hub-fill);
    color: var(--hub-text);
    font-weight: 600;
  }
}

/* Cards: borderless, soft shadow, gentle lift; the whole card is the link. */
body.hub .tool-card,
body.hub .blog-layout .card,
body.hub .grid > .card {
  position: relative;
  background: var(--hub-card);
  border: 0;
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow);
  padding: 22px 22px 20px;
  gap: 8px;
  min-height: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}
body.hub .tool-card:hover,
body.hub .grid > .card:hover { transform: translateY(-3px); box-shadow: var(--hub-shadow-hover); }
body.hub .tool-card h2,
body.hub .grid > .card h2 {
  font-family: var(--hub-display);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--hub-text);
  margin: 0;
}
body.hub .tool-card p,
body.hub .grid > .card p {
  color: var(--hub-muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
/* The last link becomes a quiet "›" link that covers the card. */
body.hub .tool-card > a:last-child,
body.hub .tool-card-actions a,
body.hub .grid > .card > .read-btn {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: auto;
  min-height: 0;
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--hub-link);
  font: 500 14px/1.3 var(--hub-font);
  text-decoration: none;
  width: fit-content;
}
body.hub .tool-card > a:last-child::after,
body.hub .tool-card-actions a::after,
body.hub .grid > .card > .read-btn::after { content: ' ›'; font-size: 17px; line-height: 1; }
body.hub .tool-card > a:last-child::before,
body.hub .tool-card-actions a::before,
body.hub .grid > .card > .read-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--hub-radius);
}
body.hub .tool-card p a,
body.hub .grid > .card p a { position: relative; z-index: 1; }

/* Blog cards: illustrated thumbnail, flush with the top of the card. */
body.hub .grid > .card > .card-thumb {
  margin: -22px -22px 8px;
  border-radius: var(--hub-radius) var(--hub-radius) 0 0;
  overflow: hidden;
  aspect-ratio: 1200 / 630;
  background: var(--hub-fill);
}
body.hub .grid > .card > .card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.hub .grid > .card:hover > .card-thumb img { transform: scale(1.035); }
body.hub .tool-card-actions { margin-top: auto; }

/* Tools: icons, badges, grids. */
body.hub .tool-card-head { gap: 12px; align-items: center; }
body.hub .tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 0;
  background: hsl(var(--ti-h) 60% 94%);
  color: hsl(var(--ti-h) 55% 32%);
}
body.hub .tool-icon svg { width: 21px; height: 21px; }
body.hub .featured-badge,
body.hub .grid > .card .tag {
  display: block;
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hub-faint);
  font: 600 11.5px/1.2 var(--hub-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.hub .grid,
body.hub .featured-tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: auto;
  gap: 18px;
}
body.hub .featured-tools { margin: 0 0 40px; }
body.hub .featured-tools-heading,
body.hub .featured-tools h2.featured-tools-heading {
  font-family: var(--hub-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hub-text);
  text-transform: none;
  margin: 8px 0 16px;
}
body.hub .tool-filter-count,
body.hub .blog-results-note { color: var(--hub-faint); font-size: 13px; text-align: center; grid-column: 1 / -1; margin: 0 0 4px; }

/* Tools: search and conversion finder. */
body.hub .tools-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 8px;
}
body.hub .tool-filters-top { width: min(620px, 100%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
body.hub #toolSearch {
  width: 100%;
  height: 52px;
  padding: 0 22px 0 50px;
  border-radius: 999px;
  border: 0;
  background: var(--hub-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 20px center;
  box-shadow: var(--hub-shadow);
  color: var(--hub-text);
  font: 400 17px var(--hub-font);
}
body.hub #toolSearch:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--hub-accent) 25%, transparent), var(--hub-shadow); }
body.hub .conversion-router {
  background: var(--hub-card);
  border: 0;
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow);
  padding: 22px;
  margin: 0 0 40px;
}
body.hub .conversion-router-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 14px; }
body.hub .conversion-router-head span:first-child {
  font-family: var(--hub-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--hub-text);
  text-transform: none;
}
body.hub .conversion-router-head span:last-child { color: var(--hub-muted); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 400; }
body.hub .conversion-field { color: var(--hub-muted); font-size: 13px; font-weight: 500; }
body.hub .conversion-field select {
  height: 44px;
  border-radius: 12px;
  border: 0;
  background-color: var(--hub-fill);
  color: var(--hub-text);
  font: 500 15px var(--hub-font);
  padding: 0 12px;
}
body.hub .conversion-open-btn,
body.hub .conversion-router button {
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--hub-accent);
  color: #fff;
  font: 600 15px var(--hub-font);
  padding: 0 20px;
}
body.hub .conversion-open-btn:disabled { background: var(--hub-fill); color: var(--hub-faint); }

/* Blog: muted "coming soon" cards. */
body.hub .grid > .card.muted-card { opacity: 0.6; box-shadow: none; background: var(--hub-fill); }

/* Sign-up strip (added by site-topbar.js): one calm line. */
body.hub .site-signup-cta {
  order: 0;
  background: var(--hub-card);
  border: 0;
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow);
  margin: 0 0 28px;
}
body.hub .site-signup-cta-title { color: var(--hub-text); }
body.hub .site-signup-cta-sub { color: var(--hub-muted); }
body.hub .site-signup-cta-btn { border-radius: 999px; background: var(--hub-accent); border-color: var(--hub-accent); color: #fff; }
body.hub .site-signup-cta-btn-ghost { background: transparent; color: var(--hub-accent); }

/* Related links and update note. */
body.hub .seo-related,
body.hub .md-related {
  background: none;
  border: 0;
  border-top: 1px solid var(--hub-hair);
  border-radius: 0;
  padding: 28px 0 0 !important;
  margin: 40px 0 0 !important;
  max-width: none !important;
}
body.hub .seo-related h2,
body.hub .md-related h2 { font-family: var(--hub-display); font-size: 21px !important; letter-spacing: -0.015em; color: var(--hub-text); }
body.hub .md-related-grid a { background: var(--hub-card); border: 0; border-radius: 14px; box-shadow: var(--hub-shadow); }
body.hub .md-related-grid a strong { color: var(--hub-text); }
body.hub .md-related-grid a span,
body.hub .md-related .md-ctx { color: var(--hub-muted); }
body.hub .md-updated { color: var(--hub-faint) !important; text-align: center; }

/* ── Docs home (inside the docs layout) ───────────────────────────────── */
/* Same white tokens inside the docs layout. */
.docs-home {
  --hub-card: #ffffff;
  --hub-text: #1d1d1f;
  --hub-muted: #6e6e73;
  --hub-faint: #86868b;
  --hub-hair: rgba(0, 0, 0, 0.08);
  --hub-fill: #f5f5f7;
  --hub-link: #0a7a70;
  --hub-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.04);
  --hub-shadow-hover: 0 0 0 1px rgba(0, 0, 0, 0.09), 0 16px 40px rgba(0, 0, 0, 0.09);
}
.docs-home article { max-width: 880px; }
.docs-home h1 {
  font-family: var(--hub-display);
  font-size: clamp(28px, 3.8vw, 40px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.024em;
  margin: 8px 0 8px;
}
.docs-home .answer {
  background: none;
  border: 0;
  padding: 0;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.45;
  color: var(--hub-muted);
  max-width: 660px;
}
.docs-home .answer strong { display: none; }
.docs-home .meta { color: var(--hub-faint); font-size: 13px; }
.docs-home .hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 4px; }
.docs-home .hero .big {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-height: 104px;
  padding: 18px 22px;
  border-radius: 20px;
  border: 0;
  background: linear-gradient(145deg, #0f766e, #134e4a);
  color: #fff;
  font: 700 21px/1.2 var(--hub-display);
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: 0 12px 34px rgba(15, 118, 110, 0.25);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}
.docs-home .hero .big span { font: 500 15px var(--hub-font); letter-spacing: 0; color: rgba(255, 255, 255, 0.78); }
.docs-home .hero .big::after { content: '›'; position: absolute; top: 18px; right: 22px; font-size: 28px; opacity: 0.7; }
.docs-home .hero .big.alt { background: var(--hub-card); color: var(--hub-text); box-shadow: var(--hub-shadow); }
.docs-home .hero .big.alt span { color: var(--hub-muted); }
.docs-home .hero .big:hover { transform: translateY(-3px); }
.docs-home h2 {
  font-family: var(--hub-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 44px 0 14px;
  border: 0;
}
.docs-home .scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.docs-home .scard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border-radius: var(--hub-radius);
  border: 0;
  background: var(--hub-card);
  box-shadow: var(--hub-shadow);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}
.docs-home .scard:hover { transform: translateY(-3px); box-shadow: var(--hub-shadow-hover); }
.docs-home .scard strong { font: 600 17px/1.3 var(--hub-display); letter-spacing: -0.01em; color: var(--hub-text); }
.docs-home .scard strong::after { content: ' ›'; color: var(--hub-link); }
.docs-home .scard span {
  color: var(--hub-muted);
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Small screens ────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  body.hub .container { padding: 4px 16px 48px; }
  /* The phone header is taller and wraps, so the switcher scrolls with the page. */
  body.hub .tools-category-sidebar,
  body.hub .category-sidebar { position: relative; top: auto; width: 100%; margin: 4px 0 18px; }
  body.hub .tools-category-list,
  body.hub .category-list { justify-content: flex-start; }
  body.hub .grid,
  body.hub .featured-tools-grid { grid-template-columns: 1fr; gap: 12px; }
  body.hub .tool-card,
  body.hub .grid > .card { padding: 18px; }
  body.hub .grid > .card > .card-thumb { margin: -18px -18px 6px; }
  body.hub .conversion-router-grid { grid-template-columns: 1fr; }
  body.hub .conversion-router { padding: 18px; }
  .docs-home .hero .big { min-height: 92px; padding: 16px 18px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  body.hub .tool-card,
  body.hub .grid > .card,
  body.hub .grid > .card > .card-thumb img,
  .docs-home .scard,
  .docs-home .hero .big { transition: none; }
  body.hub .tool-card:hover,
  body.hub .grid > .card:hover,
  body.hub .grid > .card:hover > .card-thumb img,
  .docs-home .scard:hover,
  .docs-home .hero .big:hover { transform: none; }
}
