/*
Theme Name: Search That Works
Author: Nick Platten
Description: Hand-built block theme for Search That Works — fractional SEO leadership.
Version: 1.0.3
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stw
*/

/* ===== Search That Works components ===== */

/* Polish #5: consistent visible focus */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--wp--preset--color--green);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Polish #6: motion only when welcome */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a.card { transition: box-shadow .25s, transform .25s; }
  a.card:hover { transform: translateY(-3px); }
}
a:hover { text-underline-offset: 3px; }

/* ---------- Header ---------- */
/* The header block sets position:sticky, but WordPress applies it to the inner
   .site-header group, whose parent <header class="wp-block-template-part"> is
   only as tall as the header itself — so the sticky element has no room to
   travel and scrolls away with its parent. Sticking the template-part wrapper
   is what actually holds the bar to the viewport. top: follows WP's own
   admin-bar offset variable so the bar doesn't slide under the admin bar when
   logged in. */
.wp-site-blocks > header.wp-block-template-part {
  position: sticky;
  top: var(--wp-admin--admin-bar--position-offset, 0px);
  z-index: 50;
}
.site-header {
  border-bottom: 1px solid var(--wp--preset--color--line);
  z-index: 50;
}
/* backdrop-filter lives on a pseudo-element, not .site-header itself, so this
   element doesn't become the containing block for the nav block's
   position:fixed mobile overlay (which would otherwise get trapped inside
   the header's own box instead of covering the viewport). */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 249, 246, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header .wp-block-site-title a {
  font-family: var(--wp--preset--font-family--poppins);
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--wp--preset--color--ink);
  letter-spacing: -.01em;
  white-space: nowrap;
  text-decoration: none;
}
.site-header .wp-block-site-title a::after { content: "."; color: var(--wp--preset--color--green); }
.site-header .wp-block-site-title a:hover { color: var(--wp--preset--color--green); }
.site-header .wp-block-navigation a { font-size: .95rem; font-weight: 500; }
.site-header .wp-block-navigation a:hover { text-decoration: none; color: var(--wp--preset--color--ink); }
.site-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--green); }
.nav-cta a, a.nav-cta {
  background: var(--wp--preset--color--green);
  color: var(--wp--preset--color--white) !important;
  padding: .55rem 1.15rem;
  border-radius: 6px;
  font-weight: 600;
  /* Body line-height (1.7) makes the pill ~43px tall, leaving only 14px of
     clearance to the header edge and separator. 1.2 shrinks it to ~36px
     without changing the button's padding or the header's height. */
  line-height: 1.2;
}
.nav-cta a:hover, a.nav-cta:hover { background: var(--wp--preset--color--green-deep); }
.wp-block-navigation__submenu-container {
  border: 1px solid var(--wp--preset--color--line) !important;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(28, 39, 51, .10);
  min-width: 280px !important;
  padding: .5rem !important;
}
.wp-block-navigation__submenu-container a:hover {
  background: var(--wp--preset--color--green-tint);
  color: var(--wp--preset--color--green-deep);
}

/* ---------- Type helpers ---------- */
.eyebrow {
  font-family: var(--wp--preset--font-family--inter);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--green);
  margin-bottom: 1rem;
}
.lead, .has-lead-font-size { color: var(--wp--preset--color--ink-soft); line-height: 1.6; }
/* Polish #7: hero-note darkened from ink-faint to ink-soft */
.hero-note { font-size: .92rem; color: var(--wp--preset--color--ink-soft); margin-top: 1.5rem; }
.pull {
  font-family: var(--wp--preset--font-family--poppins);
  font-size: var(--wp--preset--font-size--pull);
  line-height: 1.4;
  color: var(--wp--preset--color--ink);
  max-width: 20em;
}
.pull em { color: var(--wp--preset--color--green); font-style: italic; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline .wp-block-button__link {
  border: 1.5px solid var(--wp--preset--color--line);
  color: var(--wp--preset--color--ink);
  background: transparent;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--green);
  color: var(--wp--preset--color--green);
}
@media (prefers-reduced-motion: no-preference) {
  .wp-block-button__link { transition: all .2s; }
  .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { transform: translateY(-1px); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 10px;
  padding: 2rem 1.8rem;
  height: 100%;
}
a.card { color: inherit; display: block; text-decoration: none; }
a.card:hover { box-shadow: 0 14px 36px rgba(28, 39, 51, .09); }
.card h3 { margin-bottom: .6rem; }
.card p { color: var(--wp--preset--color--ink-soft); font-size: .97rem; }
.card .more { display: inline-block; margin-top: 1rem; color: var(--wp--preset--color--green); font-weight: 600; font-size: .92rem; }
.card.is-featured { border-color: var(--wp--preset--color--green); box-shadow: 0 10px 30px rgba(30, 92, 70, .10); }
.card-num {
  font-family: var(--wp--preset--font-family--poppins);
  font-size: .95rem;
  color: var(--wp--preset--color--green);
  background: var(--wp--preset--color--green-tint);
  border: 1px solid var(--wp--preset--color--green-tint);
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem; font-weight: 600;
}
.tag {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--wp--preset--color--green);
  background: var(--wp--preset--color--green-tint);
  padding: .25rem .6rem; border-radius: 99px; margin-bottom: 1rem;
}
.price { font-family: var(--wp--preset--font-family--poppins); font-size: 1.35rem; color: var(--wp--preset--color--ink); margin: .4rem 0 0; }
.price-note { font-size: .82rem; color: var(--wp--preset--color--ink-faint); margin: .2rem 0 1rem; }

/* Polish #2: proof numbers are styled paragraphs, not headings */
.proof-num {
  font-family: var(--wp--preset--font-family--poppins);
  font-size: 2.4rem; line-height: 1.15;
  color: var(--wp--preset--color--green);
  margin-bottom: .3rem;
}
.section-dark .proof-num { color: #A9D3BB; }

/* ---------- Dark sections ---------- */
.section-dark { color: #E8EFE9; }
.section-dark h2, .section-dark h3 { color: var(--wp--preset--color--white); }
.section-dark .eyebrow { color: #9CC5AF; }
.section-dark p { color: #C9D9CD; }
.cta-band { text-align: center; }
.cta-band h2 { max-width: 18em; margin-left: auto; margin-right: auto; }
.cta-band p { max-width: 38em; margin: 0 auto 2rem; }
.cta-band .wp-block-button__link { background: var(--wp--preset--color--white); color: var(--wp--preset--color--green-deep); }
.cta-band .wp-block-button__link:hover { background: var(--wp--preset--color--green-tint); }

/* ---------- Lists ---------- */
.check-list { list-style: none; padding-left: 0; margin-top: 1.2rem; }
.check-list li { padding-left: 1.9em; position: relative; margin-bottom: .7em; color: var(--wp--preset--color--ink-soft); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .48em; width: .9em; height: .5em;
  border-left: 2px solid var(--wp--preset--color--green);
  border-bottom: 2px solid var(--wp--preset--color--green);
  transform: rotate(-45deg);
}
.pain-list { list-style: none; padding-left: 0; margin-top: 1.2rem; }
.pain-list li { padding-left: 1.6em; position: relative; margin-bottom: .7em; color: var(--wp--preset--color--ink-soft); }
.pain-list li::before { content: "—"; position: absolute; left: 0; color: var(--wp--preset--color--ink-faint); }

/* ---------- Section intros ---------- */
/* Plain className instead of layout.selfStretch/flexSize block-support keys:
   those only take effect inside a flex-type parent layout, and these groups
   sit in a constrained parent, so core's save() never re-emits the
   max-width, which was tripping the editor's "invalid content" check. */
.section-head { max-width: 640px; margin-bottom: 3rem; }
.footer-blurb { max-width: 26em; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding-left: 0; counter-reset: step; max-width: 640px; }
.steps li { counter-increment: step; position: relative; padding: 0 0 2rem 3.4rem; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: .1em;
  font-family: var(--wp--preset--font-family--poppins);
  font-size: 1.05rem; color: var(--wp--preset--color--green); font-weight: 600;
}
.steps li::after { content: ""; position: absolute; left: .72em; top: 2.1em; bottom: .5em; width: 1px; background: var(--wp--preset--color--line); }
.steps li:last-child::after { display: none; }
.steps strong { display: block; font-size: 1.12rem; margin-bottom: .25rem; color: var(--wp--preset--color--ink); }
.steps li { color: var(--wp--preset--color--ink-soft); font-size: .97rem; }

/* ---------- Q&A rows ---------- */
.qa { border-top: 1px solid var(--wp--preset--color--line); }
.qa-item { border-bottom: 1px solid var(--wp--preset--color--line); padding: 1.8rem 0; }
.qa-item h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.qa-item p { color: var(--wp--preset--color--ink-soft); font-size: .99rem; }

/* ---------- Forms ---------- */
.stw-form { max-width: 620px; }
.stw-form label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .4rem; color: var(--wp--preset--color--ink); }
.stw-form .field { margin-bottom: 1.3rem; }
.stw-form input, .stw-form textarea, .stw-form select {
  width: 100%; padding: .75rem .9rem;
  border: 1.5px solid var(--wp--preset--color--line); border-radius: 6px;
  font-family: var(--wp--preset--font-family--inter); font-size: 1rem;
  background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink);
}
.stw-form input:focus, .stw-form textarea:focus, .stw-form select:focus { border-color: var(--wp--preset--color--green); outline: none; }
.stw-form .hidden { display: none; }

/* ---------- Footer ---------- */
.footer-head { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--wp--preset--color--ink-faint); margin-bottom: 1rem; }
.site-footer { border-top: 1px solid var(--wp--preset--color--line); }
.site-footer ul { list-style: none; padding-left: 0; }
.site-footer li { margin-bottom: .55rem; }
.site-footer li a { color: var(--wp--preset--color--ink-soft); font-size: .93rem; }
.site-footer li a:hover { color: var(--wp--preset--color--green); }
.footer-legal { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1.8rem; font-size: .85rem; color: var(--wp--preset--color--ink-faint); }

/* ---------- Prose (guide/article bodies) ---------- */
.prose h2 { margin-top: 2.8rem; }
.prose p, .prose li { color: var(--wp--preset--color--ink-soft); }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
  background: var(--wp--preset--color--bg-alt);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 4px; padding: .1em .4em;
}

/* ---------- Grid parity: 3 → 2 → 1 (core columns only do 3 → 1) ---------- */
@media (min-width: 782px) and (max-width: 960px) {
  .grid-3 { flex-wrap: wrap !important; }
  .grid-3 > .wp-block-column { flex-basis: calc(50% - .8rem) !important; flex-grow: 1; }
}
@media (max-width: 620px) { body { font-size: 1rem; } }
