/*
 * Support section styles.
 *
 * Hand written rather than Tailwind utilities, like tolinku-tools.css, because
 * the build only compiles src/main.css and these class names are referenced
 * from PHP. A new utility used in a template would simply not exist in the
 * stylesheet the server ships.
 *
 * The section has three layouts and they share one vocabulary:
 *
 *   /support/                  hero band, search, a card per topic
 *   /support/topic/<slug>/     breadcrumb, sidebar, a row per answer
 *   /support/<question>/       breadcrumb, sidebar, the answer, a pager
 *
 * The hero rules below are the tool pages' measurements under this section's
 * own names. Borrowing .tolinku-tool-hero directly was tried and was wrong:
 * those rules live in tolinku-tools.css, which functions.php enqueues only
 * when tolinku_is_tool_page() is true, so on a support page the markup carried
 * class names nothing delivered. The hero rendered flush left at 17px.
 */

/* ── Hero band ───────────────────────────────────────────────────────────── */

.tolinku-support-hero {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  text-align: center;
}

@media (min-width: 1024px) {
  .tolinku-support-hero { padding-left: 2rem; padding-right: 2rem; }
}

.tolinku-support-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.tolinku-support-eyebrow a { color: var(--color-orange-ink); }
.tolinku-support-eyebrow a:hover { color: var(--color-orange); }

.tolinku-support-title {
  font-family: var(--font-display, inherit);
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: #000;
  margin-bottom: 1rem;
}

.tolinku-support-lede {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0 auto 2rem;
  max-width: 36rem;
}

/* ── Search ──────────────────────────────────────────────────────────────── */

/*
 * White on sand, so the one thing on the band you can type into looks like it.
 * The submit button is visible rather than hidden behind the Enter key: the
 * field is the only control on the band and a visitor who taps it on a phone
 * gets a keyboard whose go key is labelled by the browser, not by us.
 */
.tolinku-support-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.375rem 0.375rem 0.375rem 0.875rem;
  background: #fff;
  border: 2px solid var(--color-line);
  border-radius: 999px;
  transition: border-color .14s ease;
}

.tolinku-support-search:focus-within { border-color: #000; }

.tolinku-support-searchicon {
  flex: none;
  color: var(--color-muted);
}

.tolinku-support-searchinput {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 1rem;
  color: #000;
  padding: 0.625rem 0;
}

.tolinku-support-searchinput::placeholder { color: var(--color-muted); }
.tolinku-support-searchinput:focus { outline: none; }

/* Safari draws its own clear button inside a type=search and it lands on top
   of the submit button at this radius. */
.tolinku-support-searchinput::-webkit-search-decoration,
.tolinku-support-searchinput::-webkit-search-cancel-button { -webkit-appearance: none; }

.tolinku-support-searchbtn {
  flex: none;
  border: 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: background-color .14s ease;
}

.tolinku-support-searchbtn:hover { background: var(--color-orange); }

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */

/*
 * The strip replaces the hero on the two inner layouts, so it carries the
 * shell's own width and gutter rather than sitting inside .tolinku-support-body.
 * The hairline under it is what separates the header from the content when
 * there is no band to do it.
 */
.tolinku-support-crumbs {
  position: relative;
  width: 100%;
  max-width: var(--tolinku-shell);
  margin-inline: auto;
  /*
   * The header is fixed and transparent, and on these two layouts there is no
   * sand band underneath it to hold the page down: the first run put the
   * breadcrumb behind the logo. --tolinku-header-h is the same measurement
   * .tolinku-blog-band clears itself with.
   */
  padding: calc(var(--tolinku-header-h) + 1.5rem) 0.75rem 1.25rem;
}

/*
 * After the hero band the header is already cleared, so the strip drops back
 * to ordinary spacing. Only the search view has both.
 */
.tolinku-blog-band + .tolinku-support-crumbs { padding-top: 1.5rem; }

/*
 * The hairline runs the full width of the viewport while the trail itself
 * stays on the shell ladder, which is what separates the header from the page
 * when no band does it. 100vw is safe here because html carries
 * overflow-x: clip.
 */
.tolinku-support-crumbs::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  transform: translateX(-50%);
  border-bottom: 1px solid var(--color-line);
}

.tolinku-support-crumblist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.tolinku-support-crumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.tolinku-support-crumb a { color: var(--color-muted); }
.tolinku-support-crumb a:hover { color: #000; }
.tolinku-support-crumb [aria-current] { color: #000; }
.tolinku-support-crumbsep { color: var(--color-line); }

/* ── The two column layout ───────────────────────────────────────────────── */

.tolinku-support-body {
  padding-top: 2rem;
  padding-bottom: 0;
}

/* The hub has no breadcrumb strip above it, so it keeps the old spacing. */
.tolinku-blog-band + .tolinku-support-body { padding-top: 2.5rem; }

.tolinku-support-layout {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .tolinku-support-layout {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 3.5rem;
  }
}

/*
 * On a phone the sidebar goes underneath.
 *
 * It is the first child in the source because that is the reading order on a
 * wide screen and because it is navigation, which belongs before the thing it
 * navigates for anything reading the markup rather than the layout. Stacked in
 * that order on a narrow screen it would put nine topic links and every
 * answer title in the topic above the answer somebody opened, which is the
 * whole page before the point of it. The breadcrumb strip is already doing the orienting
 * at the top.
 */
@media (max-width: 899px) {
  .tolinku-support-main { order: 1; }
  .tolinku-support-side { order: 2; padding-top: 1rem; border-top: 1px solid var(--color-line); }
}

.tolinku-support-main { min-width: 0; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

@media (min-width: 900px) {
  .tolinku-support-side {
    position: sticky;
    /* The same clearance the breadcrumb strip above it uses. */
    top: calc(var(--tolinku-header-h) + 1.5rem);
  }
}

.tolinku-support-backall {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.tolinku-support-backall:hover { color: #000; }
.tolinku-support-backarrow { font-size: 1rem; line-height: 1; }

.tolinku-support-sidenav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-bottom: 1.75rem;
}

.tolinku-support-sidelink {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--color-muted);
  transition: background-color .12s ease, color .12s ease;
}

.tolinku-support-sidelink:hover {
  background: var(--color-sand);
  color: #000;
}

.tolinku-support-sidelink.is-current {
  background: #000;
  color: #fff;
  font-weight: 600;
}

.tolinku-support-sidelink.is-current:hover { background: #000; color: #fff; }

.tolinku-support-sidename { min-width: 0; }
.tolinku-support-sidecount { font-size: 0.8125rem; opacity: 0.65; }

/* The answer list is the second nav in the column, so its rows are quieter
   than the topic rows above them: same component, one level down. */
.tolinku-support-sidenav.is-answers .tolinku-support-sidelink { font-size: 0.875rem; }

.tolinku-support-sidenav.is-answers .tolinku-support-sidelink.is-current {
  background: var(--color-sand);
  color: #000;
}

.tolinku-support-sidehead {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 0.625rem 0.75rem;
}

.tolinku-support-sideask {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-orange-ink);
}

.tolinku-support-sideask:hover { color: var(--color-orange); }

/* ── Headings inside the main column ─────────────────────────────────────── */

.tolinku-support-h1,
.tolinku-support-h2 {
  font-family: var(--font-display, inherit);
  font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 500;
  color: #000;
  margin: 0 0 0.5rem;
}

.tolinku-support-count {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin: 0 0 1.75rem;
}

/* ── The topic grid on the hub ───────────────────────────────────────────── */

.tolinku-support-topicshead {
  text-align: center;
  margin-bottom: 2rem;
}

.tolinku-support-kicker {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-orange-ink);
  margin: 0 0 0.5rem;
}

/*
 * Three across, not auto-fit. Auto-fit at a 15rem minimum leaves whatever is
 * left over sitting alone on the last row, which with nine topics was five
 * and then four. A fixed three fills every row it can at every width.
 */
.tolinku-support-topics {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 4rem;
}

@media (min-width: 640px) {
  .tolinku-support-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .tolinku-support-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tolinku-support-topic {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 2px solid var(--color-line);
  border-radius: 1rem;
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}

.tolinku-support-topic:hover {
  border-color: #000;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #000;
}

.tolinku-support-topicicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--color-sand);
  color: var(--color-orange-ink);
}

.tolinku-support-topicname {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
}

.tolinku-support-topic:hover .tolinku-support-topicname { color: var(--color-orange); }

.tolinku-support-topiccount {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.tolinku-support-topicarrow { transition: transform .14s ease; }
.tolinku-support-topic:hover .tolinku-support-topicarrow { transform: translateX(3px); }

/* ── Answer rows ─────────────────────────────────────────────────────────── */

.tolinku-support-rows {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 3rem;
}

.tolinku-support-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--color-line);
  border-radius: 0.875rem;
  transition: border-color .14s ease, background-color .14s ease;
}

.tolinku-support-row:hover {
  border-color: #000;
  background: var(--color-cream);
}

.tolinku-support-rowq {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #000;
  min-width: 0;
}

.tolinku-support-rowchev {
  flex: none;
  color: var(--color-line);
  transition: color .14s ease, transform .14s ease;
}

.tolinku-support-row:hover .tolinku-support-rowchev {
  color: #000;
  transform: translateX(3px);
}

/* ── One answer ──────────────────────────────────────────────────────────── */

.tolinku-support-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.875rem;
  border-radius: 999px;
  background: var(--color-sand);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-muted);
  transition: background-color .14s ease, color .14s ease;
}

.tolinku-support-badge:hover { background: #000; color: #fff; }

.tolinku-support-answer {
  max-width: 44rem;
  margin: 1.25rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.tolinku-support-answer p { margin: 0 0 1.125rem; }
.tolinku-support-answer p:last-child { margin-bottom: 0; }

.tolinku-support-answer a {
  color: var(--color-orange-ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.tolinku-support-answer a:hover { color: var(--color-orange); }

.tolinku-support-answer code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: var(--color-sand, #f5f1ea);
}

.tolinku-support-answer ul,
.tolinku-support-answer ol { margin: 0 0 1.125rem 1.25rem; }

.tolinku-support-answer li { margin-bottom: 0.4rem; }

/* ── Previous and next, within the topic ─────────────────────────────────── */

.tolinku-support-pager {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-line);
}

.tolinku-support-pagerlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 48%;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--color-muted);
}

.tolinku-support-pagerlink:hover { color: #000; }
.tolinku-support-pagerlink.is-next { text-align: right; }
.tolinku-support-pagerarrow { flex: none; }

@media (max-width: 599px) {
  .tolinku-support-pager { flex-direction: column; gap: 1rem; }
  .tolinku-support-pagerlink { max-width: 100%; }
  .tolinku-support-pagerlink.is-next { align-self: flex-end; }
}

/* ── Still need help ─────────────────────────────────────────────────────── */

.tolinku-support-ask {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 1.5rem;
  background: var(--color-cream);
  border: 2px solid var(--color-line);
}

.tolinku-support-askicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 0.875rem;
  background: #fff;
  color: var(--color-orange-ink);
}

.tolinku-support-asktitle {
  font-family: var(--font-display, inherit);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: #000;
  margin: 0 0 0.75rem;
}

.tolinku-support-asklede {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0 auto 1.75rem;
  max-width: 34rem;
}

.tolinku-support-askrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.tolinku-support-askbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--color-line);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #000;
  background: #fff;
  transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}

.tolinku-support-askbtn:hover { border-color: #000; }

.tolinku-support-askbtn.is-primary {
  background: #000;
  border-color: #000;
  color: #fff;
}

.tolinku-support-askbtn.is-primary:hover { background: var(--color-orange); border-color: var(--color-orange); }

/*
 * A visually hidden label.
 *
 * Its own rule rather than WordPress's .screen-reader-text, which this section
 * cannot rely on: that class is defined in tolinku-overrides.css, and
 * tolinku_enqueue_assets() ships that file on the marketing branch only. A
 * support page takes the blog asset path, where the class does not exist, so
 * the label would simply have been printed above the search field.
 */
.tolinku-support-sronly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
