/* SearchMate phone layer (added 12 Nov 2026).
   One file, loaded on every page after the page's own styles.
   Everything is inside phone/tablet media queries, so desktop is unchanged. */

/* Placeholder customer stories: keep hidden on every screen size until real customers exist. */

/* ---------- Homepage: agency vs freelancer vs SearchMate ---------- */
@media (max-width: 900px) {
  .sm-compare {
    grid-template-columns: 1fr 1fr !important;
    border-radius: 16px !important;
  }
  /* the desktop header row (blank, SEO agency, Freelancer, SearchMate) is replaced by labels on each cell */
  .sm-compare > div:nth-child(-n+4) { display: none !important; }

  /* row title spans the full width */
  .sm-compare > div:nth-child(4n+1) {
    grid-column: 1 / -1;
    padding: 20px 18px 8px !important;
    border-top: 1px solid #ECE8E3 !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #161412 !important;
    letter-spacing: -0.01em;
  }
  .sm-compare > div:nth-child(5) { border-top: 0 !important; }

  /* agency and freelancer side by side */
  .sm-compare > div:nth-child(4n+2),
  .sm-compare > div:nth-child(4n+3) {
    border-top: 0 !important;
    padding: 6px 18px 12px !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    color: #3B3834 !important;
  }
  .sm-compare > div:nth-child(4n+3) { border-left: 1px solid #ECE8E3; padding-left: 14px !important; }

  /* SearchMate answer full width, highlighted */
  .sm-compare > div:nth-child(4n+4) {
    grid-column: 1 / -1;
    margin: 4px 12px 16px;
    border: 1px solid #FBD3BF !important;
    border-radius: 12px;
    padding: 12px 14px !important;
    font-size: 16px !important;
  }

  .sm-compare > div:nth-child(n+5)::before {
    display: block;
    margin-bottom: 3px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8C857D;
  }
  .sm-compare > div:nth-child(4n+1)::before { content: none; }
  .sm-compare > div:nth-child(4n+2)::before { content: "SEO agency"; }
  .sm-compare > div:nth-child(4n+3)::before { content: "Freelancer"; }
  .sm-compare > div:nth-child(4n+4)::before { content: "SearchMate"; color: #C2410C; }
}

/* ---------- Every other comparison and article table ---------- */
@media (max-width: 640px) {
  table { min-width: 0 !important; }
  div:has(> table) { overflow-x: visible !important; }

  /* two-column tables just need to fit */
  table th, table td { padding: 12px 14px !important; }

  /* "Them vs SearchMate": first header blank, two columns of answers.
     Row title on its own line, the two answers side by side under the column names. */
  table.sm-vs { display: block; font-size: 15px !important; }
  table.sm-vs thead, table.sm-vs tbody { display: block; }
  table.sm-vs tr { display: grid !important; grid-template-columns: 1fr 1fr; }
  table.sm-vs thead th:first-child { display: none; }
  table.sm-vs thead th { font-size: 14px !important; }
  table.sm-vs tbody th { grid-column: 1 / -1; padding-bottom: 2px !important; font-size: 16px !important; }
  table.sm-vs tbody td { padding-top: 6px !important; }
  table.sm-vs thead { position: sticky; top: 76px; z-index: 2; }

  /* Three or more answer columns: each row becomes a small card with labelled answers */
  table.sm-stack { display: block; border-collapse: separate !important; font-size: 15px !important; }
  table.sm-stack thead { display: none; }
  table.sm-stack tbody, table.sm-stack tr, table.sm-stack th, table.sm-stack td { display: block; width: auto !important; }
  table.sm-stack tr { padding: 6px 0; }
  table.sm-stack tbody tr + tr { border-top: 1px solid #ECE8E3; }
  table.sm-stack tr > :first-child { font-size: 16px !important; font-weight: 800 !important; color: #161412 !important; padding-bottom: 2px !important; }
  table.sm-stack tr > :not(:first-child) { padding-top: 4px !important; padding-bottom: 8px !important; }
  table.sm-stack [data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8C857D;
  }
  table.sm-stack td.sm { margin: 4px 12px 8px; border-radius: 10px; padding: 10px 12px !important; }
  table.sm-stack td.sm::before { color: #C2410C !important; }
}

/* ---------- General phone spacing, numbers and footer ---------- */
@media (max-width: 640px) {
  /* 88px top and bottom on every section adds up to big blank bands on a phone */
  section[style*="padding: 88px 24px"] { padding-top: 60px !important; padding-bottom: 60px !important; }
  section > div[style*="padding: 88px 24px"] { padding-top: 60px !important; padding-bottom: 60px !important; }

  /* "$175,000,000+" ran past its card at 40px */
  [style*="font-variant-numeric: tabular-nums"][style*="clamp(40px, 5vw, 60px)"] { font-size: 34px !important; letter-spacing: -0.04em !important; }

  /* integrations list: two across instead of one long column */
  ul[aria-label="Website platforms SearchMate works with"] { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  ul[aria-label="Website platforms SearchMate works with"] > li { min-height: 64px !important; padding: 0 14px !important; border-radius: 12px !important; font-size: 15px; }
  ul[aria-label="Website platforms SearchMate works with"] > li svg { width: 26px !important; height: 26px !important; }
  ul[aria-label="Website platforms SearchMate works with"] > li span { gap: 9px !important; }

  /* footer: link groups two across with bigger tap areas */
  footer nav[aria-label="Footer"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 28px 16px !important;
    width: 100%;
  }
  footer nav[aria-label="Footer"] > div { min-width: 0 !important; gap: 0 !important; }
  footer nav[aria-label="Footer"] a { display: block; padding: 7px 0; font-size: 15px; line-height: 1.3; }
  footer nav[aria-label="Footer"] p { margin-bottom: 4px !important; }
}

/* ---------- Homepage phone: Without / With cards and price strip ---------- */
#smvm { display: none; }
@media (max-width: 900px) {
  #smvm { display: flex; flex-direction: column; gap: 14px; }
  #smvm + .sm-compare { display: none !important; }
  #smvm[data-open="1"] + .sm-compare { display: grid !important; scroll-margin-top: 96px; }
  #smvm .smvm-card { border-radius: 20px; padding: 22px 20px; }
  #smvm .smvm-without { background: #F7F5F2; border: 1px solid #ECE8E3; }
  #smvm .smvm-with { background: #FFFFFF; border: 2px solid #FF5A1F; box-shadow: 0 18px 36px -24px rgba(194,65,12,.45); }
  #smvm .smvm-h { margin: 0 0 14px; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 900; letter-spacing: -0.02em; color: #161412; }
  #smvm .smvm-without .smvm-h { color: #5E5A55; }
  #smvm ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
  #smvm li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.45; color: #3B3834; }
  #smvm li svg { flex: none; margin-top: 2px; }
  #smvm .smvm-with li { color: #161412; font-weight: 600; }
  #smvm .smvm-price { border: 1px solid #ECE8E3; border-radius: 20px; padding: 18px 20px 8px; background: #FFFFFF; }
  #smvm .smvm-k { margin: 0 0 6px; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8C857D; }
  #smvm .smvm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-top: 1px solid #ECE8E3; font-size: 15px; color: #5E5A55; }
  #smvm .smvm-row:first-of-type { border-top: 0; }
  #smvm .smvm-row b { font-size: 16px; font-weight: 700; color: #3B3834; text-align: right; }
  #smvm .smvm-us { margin: 4px -12px 10px; padding: 14px 12px; border: 0; border-radius: 12px; background: #FFF4EE; }
  #smvm .smvm-us span { font-weight: 800; color: #C2410C; }
  #smvm .smvm-us b { font-size: 22px; font-weight: 900; color: #161412; letter-spacing: -0.02em; }
  #smvm .smvm-us small { font-size: 13px; font-weight: 600; color: #5E5A55; letter-spacing: 0; }
  #smvm .smvm-btn { align-self: stretch; min-height: 50px; border-radius: 12px; border: 1px solid #F3D5C5; background: #FFFFFF; color: #161412; font: 700 16px 'Schibsted Grotesk', system-ui, sans-serif; cursor: pointer; }
}
