/* ==================================================================
   Repair advice hub (/advice/)
   ------------------------------------------------------------------
   An editorial page, not a grid of cards: search the problem, browse
   by device, one featured guide, the latest guides broken by a help
   band, then a repair specialist. Everything is scoped to the hub so
   the category and article pages keep their own layout.
   ================================================================== */
body.page-advice-hub {
  --ah-forest: #102f25;
  --ah-green: #075b46;
  --ah-lime: #d6f76a;
  --ah-ink: #111a16;
  --ah-soft: #55625c;
  --ah-line: #e7eae7;
  --ah-warm: #f7f7f4;
  --ah-mint: #eef4ec;
  --ah-radius: 14px;
  --ah-gap: clamp(20px, 2.4vw, 32px);
  --ah-section: clamp(56px, 7vw, 104px);
  background: #fff;
}
body.page-advice-hub .ah { color: var(--ah-ink); }
.ah-wrap { width: min(100% - 40px, 1200px); margin-inline: auto; }
.ah :is(h1, h2, h3) { color: var(--ah-forest); letter-spacing: -0.02em; }
.ah :focus-visible { outline: 3px solid var(--ah-green); outline-offset: 3px; border-radius: 6px; }

/* Shared type */
.ah-eyebrow { margin: 0 0 14px; color: var(--ah-green); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ah-eyebrow--on-dark { color: var(--ah-lime); }
.ah-kicker { margin: 0; color: var(--ah-green); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.ah-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--ah-soft); font-size: 13px; }
.ah-section { padding-block: var(--ah-section); }
.ah-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(24px, 3vw, 40px); }
.ah-head h2 { margin: 0; font-size: clamp(28px, 2.4vw + 12px, 36px); line-height: 1.15; font-weight: 700; }
.ah-head p { margin: 10px 0 0; max-width: 560px; color: var(--ah-soft); font-size: 17px; line-height: 1.55; }
.ah-textlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; flex: none; color: var(--ah-green); font-weight: 600; text-decoration: none; }
.ah-textlink:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Buttons */
.ah-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 1px solid transparent; border-radius: 10px; font-size: 16px; font-weight: 600; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; }
.ah-btn--dark { background: var(--ah-forest); color: #fff; }
.ah-btn--dark:hover { background: var(--ah-green); }
.ah-btn--quiet { border-color: #c9d3cb; background: #fff; color: var(--ah-forest); }
.ah-btn--quiet:hover { border-color: var(--ah-forest); }
.ah-btn--lime { background: var(--ah-lime); color: var(--ah-forest); }
.ah-btn--lime:hover { background: #e3fb92; }
.ah-btn--outline { border-color: #5d7a6e; color: #fff; }
.ah-btn--outline:hover { border-color: #fff; }

/* 1. Hero ---------------------------------------------------------- */
.ah-hero { padding-block: clamp(40px, 5vw, 80px) clamp(48px, 6vw, 88px); background: #fff; }
.ah-hero__grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.ah-hero h1 { margin: 0; font-size: clamp(38px, 3.4vw + 12px, 56px); line-height: 1.05; font-weight: 700; text-wrap: balance; }
.ah-hero__lede { max-width: 520px; margin: 20px 0 32px; color: var(--ah-soft); font-size: 18px; line-height: 1.6; }
.ah-search { position: relative; display: flex; align-items: center; max-width: 580px; padding: 6px; border: 1px solid #d6ddd7; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px #102f250d, 0 8px 24px #102f250a; transition: border-color .15s, box-shadow .15s; }
.ah-search:focus-within { border-color: var(--ah-green); box-shadow: 0 0 0 4px #075b461f; }
.ah-search > svg { position: absolute; left: 20px; color: var(--ah-soft); pointer-events: none; }
.ah-search input { flex: 1; min-width: 0; height: 52px; padding: 0 12px 0 48px; border: 0; background: transparent; color: var(--ah-ink); font: inherit; font-size: 17px; }
.ah-search input::placeholder { color: #7a8680; }
.ah-search input:focus { outline: none; }
.ah-search button { flex: none; height: 52px; padding: 0 26px; border: 0; border-radius: 10px; background: var(--ah-forest); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.ah-search button:hover { background: var(--ah-green); }
.ah-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 18px 0 0; color: var(--ah-soft); font-size: 15px; }
.ah-popular > span:first-child { margin-right: 4px; font-weight: 600; color: var(--ah-ink); }
.ah-popular button { min-height: 36px; padding: 0 4px; border: 0; background: none; color: var(--ah-green); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-color: #075b4640; text-underline-offset: 4px; }
.ah-popular button:hover, .ah-popular button[aria-pressed="true"] { text-decoration-color: currentColor; }
.ah-popular button[aria-pressed="true"] { color: var(--ah-forest); font-weight: 700; }
.ah-popular__dot { color: #b3bcb6; }
.ah-hero__media { position: relative; margin: 0; }
.ah-hero__media :is(picture, img) { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; }
.ah-hero__note { position: absolute; left: 20px; bottom: 20px; display: grid; gap: 2px; padding: 14px 18px; border-radius: 12px; background: #ffffffeb; box-shadow: 0 6px 20px #102f251f; backdrop-filter: blur(6px); }
.ah-hero__note strong { color: var(--ah-forest); font-size: 16px; }
.ah-hero__note span { color: var(--ah-soft); font-size: 13px; }

/* 2. Browse by device ---------------------------------------------- */
.ah-devices { padding-top: clamp(40px, 5vw, 72px); background: var(--ah-warm); }
.ah-devices__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.ah-device { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: 100%; padding: 24px 22px 22px; border-radius: var(--ah-radius); background: #fff; color: var(--ah-ink); text-decoration: none; box-shadow: 0 0 0 1px var(--ah-line); transition: box-shadow .2s, transform .2s; }
.ah-device:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px #cfd8d1, 0 10px 24px #102f2512; }
.ah-device__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 12px; background: var(--ah-mint); color: var(--ah-green); }
.ah-device__name { color: var(--ah-forest); font-size: 17px; font-weight: 700; line-height: 1.3; }
.ah-device__count { color: var(--ah-soft); font-size: 14px; }
.ah-device__arrow { position: absolute; top: 24px; right: 20px; color: var(--ah-green); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.ah-device:is(:hover, :focus-visible) .ah-device__arrow { opacity: 1; transform: none; }

/* 3. Featured guide ------------------------------------------------ */
.ah-featured { padding-bottom: 0; }
.ah-feature { position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.ah-feature__media { overflow: hidden; border-radius: 16px; }
.ah-feature__media :is(picture, img) { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .4s ease; }
.ah-feature:hover .ah-feature__media img { transform: scale(1.02); }
.ah-feature__body { display: grid; gap: 14px; align-content: center; }
.ah-feature__body h2 { margin: 0; font-size: clamp(26px, 1.8vw + 12px, 36px); line-height: 1.15; }
.ah-feature__body h2 a { color: inherit; text-decoration: none; }
.ah-feature__body h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.ah-feature:hover h2 a { color: var(--ah-green); }
.ah-feature__dek { margin: 0; color: var(--ah-soft); font-size: 17px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ah-feature__go { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--ah-green); font-weight: 600; }
.ah-feature__go svg { transition: transform .2s; }
.ah-feature:hover .ah-feature__go svg { transform: translateX(3px); }

/* 4. Latest guides ------------------------------------------------- */
.ah-head--row { align-items: flex-end; }
.ah-filters { display: flex; gap: 4px; margin: 0 0 clamp(24px, 3vw, 36px); padding: 4px; overflow-x: auto; border-bottom: 1px solid var(--ah-line); scrollbar-width: none; }
.ah-filters::-webkit-scrollbar { display: none; }
.ah-filters a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px; color: var(--ah-soft); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; margin-bottom: 8px; }
.ah-filters a:hover { color: var(--ah-forest); background: var(--ah-warm); }
.ah-filters a[aria-current="true"] { background: var(--ah-forest); color: #fff; }
.ah-status { margin: -12px 0 24px; color: var(--ah-soft); font-size: 15px; }
.ah-status:empty { display: none; }
.ah-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 3vw, 44px) clamp(24px, 2.4vw, 32px); margin: 0; padding: 0; list-style: none; }
.ah-grid:empty { display: none; }
.ah-card { position: relative; display: flex; flex-direction: column; gap: 18px; transition: transform .2s; }
.ah-card[hidden] { display: none; }
.ah-card:hover { transform: translateY(-3px); }
.ah-card__media { overflow: hidden; border-radius: var(--ah-radius); background: var(--ah-warm); }
.ah-card__media :is(picture, img) { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s ease; }
.ah-card:hover .ah-card__media img { transform: scale(1.02); }
.ah-card__body { display: grid; gap: 8px; }
.ah-card__title { margin: 0; font-size: clamp(19px, .5vw + 16px, 22px); line-height: 1.3; font-weight: 700; }
.ah-card__title a { color: var(--ah-forest); text-decoration: none; }
.ah-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--ah-radius); }
.ah-card:hover .ah-card__title a { color: var(--ah-green); }
.ah-card__dek { margin: 0; color: var(--ah-soft); font-size: 15.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ah-card .ah-meta { margin-top: 4px; }

/* The help band that breaks the list after six guides. */
.ah-band { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; margin-block: clamp(48px, 5vw, 72px); padding: clamp(28px, 3.4vw, 44px) clamp(24px, 4vw, 56px); border-radius: 16px; background: var(--ah-mint); }
.ah-band[hidden] { display: none; }
.ah-band h2 { margin: 0 0 8px; font-size: clamp(22px, 1.2vw + 14px, 28px); line-height: 1.2; }
.ah-band p { margin: 0; max-width: 520px; color: #44534c; font-size: 16px; line-height: 1.6; }
.ah-band__actions { display: flex; flex-wrap: wrap; gap: 12px; flex: none; }
.ah-grid--more:not(:empty) { margin-top: 0; }
.ah-empty { padding: clamp(32px, 4vw, 56px); border-radius: 16px; background: var(--ah-warm); text-align: center; }
.ah-empty[hidden] { display: none; }
.ah-empty h3 { margin: 0 0 10px; font-size: 22px; }
.ah-empty p { max-width: 520px; margin: 0 auto 22px; color: var(--ah-soft); }
.ah-empty .ah-band__actions { justify-content: center; }
.ah-more-wrap { margin: clamp(36px, 4vw, 56px) 0 0; text-align: center; }
.ah-more { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1px solid #c9d3cb; border-radius: 10px; background: #fff; color: var(--ah-forest); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.ah-more:hover { border-color: var(--ah-forest); }
.ah-more[hidden] { display: none; }

/* 5. Repair specialist CTA ----------------------------------------- */
.ah-help { padding-top: 0; }
.ah-cta { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; overflow: hidden; border-radius: 20px; background: var(--ah-forest); }
.ah-cta__copy { padding: clamp(32px, 5vw, 72px); }
.ah-cta h2 { max-width: 560px; margin: 0; color: #fff; font-size: clamp(28px, 2.2vw + 12px, 40px); line-height: 1.12; }
.ah-cta__copy > p:not(.ah-eyebrow) { max-width: 480px; margin: 18px 0 32px; color: #cbd8d0; font-size: 17px; line-height: 1.6; }
.ah-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ah-cta__media { min-height: 280px; }
.ah-cta__media :is(picture, img) { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (prefers-reduced-motion: reduce) {
  .ah :is(.ah-card, .ah-device, .ah-card__media img, .ah-feature__media img, .ah-device__arrow) { transition: none; }
  .ah-card:hover, .ah-device:hover { transform: none; }
}

/* Tablet */
@media (max-width: 1099px) {
  .ah-devices__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ah-band { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 899px) {
  .ah-hero__grid, .ah-feature, .ah-cta { grid-template-columns: minmax(0, 1fr); }
  .ah-hero h1 { max-width: 16ch; }
  .ah-cta__media { order: -1; min-height: 0; aspect-ratio: 16 / 9; }
}

/* Phone */
@media (max-width: 599px) {
  .ah-hero { padding-top: 24px; }
  .ah-hero__lede { font-size: 17px; margin-bottom: 24px; }
  .ah-search input { height: 48px; padding-left: 42px; font-size: 16px; }
  .ah-search > svg { left: 16px; }
  .ah-search button { height: 48px; padding: 0 18px; }
  .ah-hero__note { left: 12px; bottom: 12px; padding: 10px 14px; }
  .ah-popular { gap: 2px 14px; }
  .ah-popular__dot { display: none; }
  .ah-popular > span:first-child { flex-basis: 100%; }
  .ah-devices__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ah-device { padding: 18px 16px; }
  .ah-device__icon { margin-bottom: 12px; }
  .ah-device__arrow { display: none; }
  .ah-head--row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ah-filters { margin-inline: -20px; padding-inline: 20px; }
  .ah-grid { grid-template-columns: minmax(0, 1fr); }
  .ah-band__actions, .ah-cta__actions { width: 100%; flex-direction: column; }
  .ah-band__actions .ah-btn, .ah-cta__actions .ah-btn { width: 100%; }
}
