/* ============================================================================
 * Quiltler - Help centre: the "How do I…?" search, the topic lists and the
 * guide pages. Layered on styles.css and content.css (hero, breadcrumbs, CTA
 * banner), in the same stitched-card look as What's new.
 * ==========================================================================*/

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Search ------------------------------------------------------------- */
.hp-hero {
  padding-bottom: 56px;
}

.hp-search {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hp-search input {
  width: 100%;
  padding: 20px 56px 20px 24px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(20, 28, 48, 0.28);
  color: var(--text-primary);
  font: inherit;
  font-size: 1.15rem;
}

.hp-search input:focus {
  outline: 4px solid rgba(243, 201, 105, 0.85);
  outline-offset: 2px;
}

.hp-search-key {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  min-width: 26px;
  padding: 2px 8px;
  border: 1px solid rgba(46, 58, 89, 0.25);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.hp-status {
  max-width: 720px;
  min-height: 1.4em;
  margin: 14px auto 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

.hp-status a {
  color: #fff;
  font-weight: 700;
}

.hp-results {
  display: grid;
  gap: 10px;
  max-width: 720px;
  margin: 8px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.hp-result {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.hp-result:hover,
.hp-result:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  outline: 3px solid rgba(243, 201, 105, 0.9);
}

.hp-result-top {
  outline: 2px dashed rgba(226, 114, 91, 0.6);
  outline-offset: -6px;
}

.hp-result img,
.hp-result-swatch {
  flex: none;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: #e6e9f1;
}

.hp-result-swatch {
  background:
    linear-gradient(45deg, #7ea8be 25%, transparent 25%, transparent 75%, #7ea8be 75%),
    linear-gradient(45deg, #7ea8be 25%, #f5f3ef 25%, #f5f3ef 75%, #7ea8be 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.hp-result-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hp-result-area {
  color: var(--primary-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hp-result strong {
  font-size: 1.05rem;
}

.hp-result-summary {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---- Hub ---------------------------------------------------------------- */
.hp-page {
  background:
    radial-gradient(38% 30% at 100% 0%, rgba(126, 168, 190, 0.16), transparent 70%),
    var(--cream-linen);
  padding: 8px 0 88px;
}

.hp-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.hp-page h2 {
  color: var(--text-primary);
}

.hp-popular h2,
.hp-area-nav p {
  margin: 8px 0 14px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hp-popular ul,
.hp-area-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.hp-popular a,
.hp-area-nav a {
  display: inline-block;
  padding: 9px 16px;
  border: 1px dashed rgba(46, 58, 89, 0.3);
  border-radius: 999px;
  background: #fff;
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.hp-area-nav a {
  padding: 6px 13px;
  font-size: 0.9rem;
  font-weight: 500;
}

.hp-popular a:hover,
.hp-area-nav a:hover {
  border-style: solid;
  border-color: var(--primary-strong);
  color: var(--primary-strong);
}

.hp-areas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.hp-area {
  position: relative;
  padding: 24px 24px 20px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.hp-area::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(126, 168, 190, 0.5);
  border-radius: 13px;
  pointer-events: none;
}

.hp-area:target {
  outline: 3px solid rgba(226, 114, 91, 0.6);
}

.hp-area h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.hp-area-count {
  margin-left: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: #e3eef3;
  color: #2c5568;
  font-size: 0.8rem;
  vertical-align: middle;
}

.hp-area p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hp-area ul {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hp-area li + li {
  border-top: 1px solid rgba(46, 58, 89, 0.08);
}

.hp-area li a {
  display: block;
  padding: 8px 0;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.4;
}

.hp-area li a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.hp-searching .hp-popular {
  display: none;
}

.hp-stuck {
  margin-top: 40px;
  padding: 24px 28px;
  border: 2px dashed rgba(226, 114, 91, 0.45);
  border-radius: 18px;
  background: #fff;
}

.hp-stuck h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.hp-stuck p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hp-stuck-links {
  margin-top: 10px !important;
  font-size: 0.95rem;
}

/* ---- A guide ------------------------------------------------------------ */
.hp-guide-page {
  padding-top: calc(var(--nav-height) + env(safe-area-inset-top, 0px) + 16px);
}

.hp-guide-page .hp-inner {
  max-width: 820px;
}

.hp-mini-search {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
}

.hp-mini-search input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid rgba(46, 58, 89, 0.2);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.hp-mini-search button {
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--midnight-indigo);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.hp-guide {
  padding: 36px 40px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.hp-eyebrow {
  margin: 0 0 8px;
  color: var(--primary-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hp-guide h1 {
  margin: 0 0 14px;
  color: var(--text-primary);
  font-size: 2.3rem;
  line-height: 1.15;
}

.hp-lead {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.6;
}

.hp-guide h2 {
  margin: 32px 0 12px;
  font-size: 1.3rem;
}

.hp-where {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 20px;
  align-items: center;
  padding: 18px 22px;
  border-radius: 14px;
  background: #e6e9f1;
}

.hp-where h2 {
  grid-column: 1 / -1;
  margin: 0;
  color: #2e3a59;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hp-where p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.55;
}

.hp-cta {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--primary-strong);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.hp-cta:hover {
  background: var(--primary-strong-hover);
}

.hp-media {
  margin: 24px 0 0;
}

.hp-media video,
.hp-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #e6e9f1;
  box-shadow: var(--shadow-sm);
}

.hp-media figcaption {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.hp-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.hp-steps li {
  position: relative;
  padding: 10px 0 10px 48px;
  counter-increment: step;
  line-height: 1.6;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.hp-steps li::before {
  content: counter(step);
  position: absolute;
  top: 8px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fbe7e1;
  color: #8f3524;
  font-weight: 800;
}

.hp-tips ul,
.hp-questions ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.hp-tips li + li,
.hp-questions li + li {
  margin-top: 6px;
}

.hp-questions li {
  color: var(--text-secondary);
}

.hp-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}

.hp-facts div {
  padding: 14px 16px;
  border: 1px dashed rgba(46, 58, 89, 0.22);
  border-radius: 12px;
}

.hp-facts dt {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hp-facts dd {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-weight: 600;
}

.hp-related {
  margin-top: 36px;
}

.hp-related h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.hp-related ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hp-related a {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.hp-related a:hover {
  box-shadow: var(--shadow-md);
}

.hp-related span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* ---- Narrow screens ----------------------------------------------------- */
@media (max-width: 640px) {
  .hp-search input {
    padding: 16px 18px;
    font-size: 1rem;
  }

  .hp-search-key {
    display: none;
  }

  .hp-result img,
  .hp-result-swatch {
    width: 64px;
    height: 44px;
  }

  .hp-guide {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .hp-guide h1 {
    font-size: 1.8rem;
  }

  .hp-where {
    grid-template-columns: 1fr;
  }

  .hp-where .hp-cta {
    justify-self: start;
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-result {
    transition: none;
  }
}
