/* Advice page and guides (1.0.16, layout from Kieran's 4 Nov handover). Uses the site's tokens (styles.css) and the
   inner page parts (inner-pages.css). The body already clears the fixed header (padding-top: var(--header-h)). */
.advice {
  background: var(--paper);
}
/* The site skips drawing sections below the fold until they scroll in (styles.css); the guide lists are light enough
   to draw at once, which also keeps the scroll bar steady and the topic links exact. */
main.advice > section,
main.advice > section:not(.hero):not(.trust):not(.conversion) {
  content-visibility: visible;
}
.advice-narrow {
  max-width: calc(760px + 2 * var(--gutter));
}

/* ---------------------------------------------------------------- hub -- */
.advice-hub__intro {
  padding-block: clamp(1.75rem, 4vw, 3.25rem) clamp(1rem, 3vw, 1.75rem);
}
.advice-hub__title {
  max-width: 15em;
  margin: 0;
  font-size: clamp(2.3rem, 1.4rem + 3vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.advice-hub__lead {
  max-width: 38em;
  margin: 1rem 0 0;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
}
.advice-hub__callout {
  max-width: 46em;
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fff;
  line-height: 1.55;
  color: var(--ink-2);
}
.advice-hub__callout a {
  font-weight: 650;
  color: var(--accent-dark);
}
.advice-hub__topics ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}
.advice-hub__topics a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 0.93rem;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}
.advice-hub__topics a:hover {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}
.advice-hub__topics a:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}
.advice-hub__count {
  min-width: 1.6em;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-2);
}
.advice-hub__group {
  padding-block: clamp(1.5rem, 3.5vw, 2.5rem);
  scroll-margin-top: calc(var(--header-h) + 8px);
}
.advice-hub__label,
.advice-related__title {
  margin: 0 0 1.1rem;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.advice-hub__cta {
  padding-block: clamp(1.5rem, 4vw, 2.5rem) clamp(3.5rem, 8vw, 5.5rem);
}

/* --------------------------------------------------------------- cards -- */
.advice-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) {
  .advice-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .advice-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.advice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.advice-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}
.advice-card:focus-within {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}
.advice-card__media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--soft);
}
.advice-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.advice-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem 1.1rem;
}
.advice-card__title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.advice-card__title a {
  color: var(--ink);
  text-decoration: none;
}
.advice-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.advice-card__title a:focus-visible {
  outline: none;
}
.advice-card__text {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.advice-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: auto 0 0;
  padding-top: 0.6rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-dark);
}
.advice-card__more .icon,
.advice-related__all .icon {
  width: 16px;
  height: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .advice-card,
  .advice-card:hover {
    transition: none;
    transform: none;
  }
}

/* ------------------------------------------------------------- article -- */
.advice-article__head {
  padding-block: clamp(1.75rem, 4vw, 3.25rem) 0;
}
.advice-article__head .advice-byline {
  margin-bottom: 0;
}
/* Kieran's opening overview: before the hero, so the useful advice is in view first. */
.advice-overview {
  padding-block: clamp(1.1rem, 2.5vw, 1.5rem) clamp(1.4rem, 3vw, 2rem);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.15rem);
  line-height: 1.7;
  color: var(--ink);
}
.advice-overview > * {
  margin-block: 0;
}
.advice-overview > * + * {
  margin-top: 1em;
}
.advice-overview a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.advice-overview strong {
  font-weight: 650;
}
.advice-article__title {
  margin: 0;
  font-size: clamp(1.95rem, 1.3rem + 2.3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.advice-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  margin: 1rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}
.advice-byline__author {
  font-weight: 650;
  color: var(--ink-2);
}
.advice-byline__sep {
  margin-inline: 0.5rem;
  color: var(--line-strong);
}
.advice-byline__sep--main {
  margin-inline: 0;
}
@media (max-width: 599px) {
  .advice-byline {
    flex-direction: column;
    gap: 0.15rem;
  }
  .advice-byline__sep--main {
    display: none;
  }
}
.advice-hero {
  max-width: calc(1100px + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.advice-hero__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  background: var(--soft);
}
/* Room scenes only: a wider frame, centred. Labelled explainers are never cropped. */
.advice-hero--crop .advice-hero__img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 50% 50%;
}
.advice-hero figcaption,
.advice-figure figcaption,
.advice-note {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
.advice-hero figcaption {
  max-width: 760px;
}
.advice-figure__label {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--soft);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.08em;
  color: var(--ink-2);
}

.advice-body {
  padding-block: clamp(1.75rem, 4vw, 2.5rem) clamp(3rem, 7vw, 4.5rem);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
}
.advice-body > * {
  margin-block: 0;
}
.advice-body > * + * {
  margin-top: 1.1em;
}
.advice-cta > * {
  margin-block: 0;
}
.advice-cta > * + * {
  margin-top: 0.8em;
}
/* Contents links land below the fixed header: the page already keeps var(--header-h) + 12px clear when jumping
   (styles.css scroll-padding-top); a little more room here so the heading is not tight against the header. */
.advice-body h2,
.advice-body h3 {
  color: var(--ink);
  scroll-margin-top: 12px;
}
.advice-body h2 {
  margin-top: 2.2em;
  margin-bottom: 0;
  font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.advice-body h3 {
  margin-top: 1.8em;
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.3;
}
.advice-body h2 + *,
.advice-body h3 + * {
  margin-top: 0.6em;
}
.advice-body a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.advice-body a:hover {
  color: var(--accent-deep);
}
.advice-body a[href^="tel:"] {
  font-weight: 650;
  white-space: nowrap;
}
.advice-body strong {
  font-weight: 650;
  color: var(--ink);
}
.advice-body ul,
.advice-body ol {
  padding-left: 1.35em;
}
.advice-body li + li {
  margin-top: 0.45em;
}
.advice-body li::marker {
  color: var(--accent-dark);
}

/* On this page (collapsible, straight after the hero) */
.advice-toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.advice-toc summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.6rem 1rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.advice-toc__count {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.advice-toc li + li {
  margin-top: 0.35em;
}
.advice-toc a {
  text-decoration-color: rgba(0, 0, 0, 0.2);
}
.advice-toc summary::-webkit-details-marker {
  display: none;
}
.advice-toc summary::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  margin-top: -0.25em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.advice-toc[open] summary::after {
  margin-top: 0.25em;
  transform: rotate(-135deg);
}
.advice-toc ol {
  margin: 0;
  padding: 0 1rem 1rem 2.2rem;
  font-size: 0.95rem;
  line-height: 1.45;
}
.advice-toc summary:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Tables: scroll sideways on small screens */
.advice-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.advice-table:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}
.advice-table table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 0.94rem;
  line-height: 1.45;
}
.advice-table th,
.advice-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.advice-table th {
  background: var(--soft);
  font-weight: 700;
  color: var(--ink);
}
.advice-table tr:last-child td {
  border-bottom: 0;
}
.advice-table td:first-child {
  font-weight: 600;
  color: var(--ink);
}

/* Figures */
.advice-body .advice-figure {
  margin-top: 1.8em;
  margin-bottom: 0;
}
.advice-body .advice-figure + * {
  margin-top: 1.6em;
}
.advice-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.advice-figure--illustration img {
  background: var(--soft);
}
.advice-figure__scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
.advice-figure__zoom {
  display: block;
  cursor: zoom-in;
}
.advice-figure__zoom:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}
@media (min-width: 1040px) {
  .advice-body .advice-figure,
  .advice-body .advice-video {
    margin-inline: -100px;
  }
  .advice-body .advice-figure figcaption {
    margin-inline: 100px;
  }
}
/* Phones: diagrams keep a readable width and scroll sideways; a tap opens the full size image. */
@media (max-width: 699px) {
  .advice-figure--diagram .advice-figure__scroll img {
    width: 680px;
    max-width: none;
  }
  .advice-figure--diagram.advice-figure--portrait .advice-figure__scroll img {
    width: 520px;
  }
  .advice-figure--diagram:not(.advice-figure--stacked)::after {
    content: "Swipe to see the whole diagram, or tap to open it full size.";
    display: block;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--muted);
  }
}
/* A two panel drawing with a phone layout (both panels stacked): it fits the screen, no sideways scrolling. */
.advice-figure--stacked picture,
.advice-figure--stacked img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 699px) {
  .advice-figure--stacked img {
    max-width: 480px;
    margin-inline: auto;
  }
}

/* Video */
.advice-video {
  margin: 1.8em 0 0;
}
.advice-video video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #1c1b19;
}
.advice-transcript {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.advice-transcript summary {
  min-height: 44px;
  padding: 0.65rem 1rem;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
}
.advice-transcript ol {
  margin: 0;
  padding: 0 1rem 1rem 2.2rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
@media (min-width: 1040px) {
  .advice-transcript {
    margin-inline: 100px;
  }
}

/* Calls to action: the guide's own closing section, and the panel on guides without one */
.advice-cta,
.advice-panel {
  padding: clamp(1.3rem, 3vw, 1.9rem);
  border-radius: var(--radius-lg);
  background: var(--dark);
  color: var(--on-dark-muted);
}
.advice-body .advice-cta {
  margin-top: 2.4em;
}
.advice-body .advice-cta h2,
.advice-panel h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--on-dark);
}
.advice-cta p,
.advice-panel p {
  margin: 0;
  color: var(--on-dark-muted);
}
.advice-body .advice-cta a,
.advice-panel p a:not(.btn) {
  color: var(--on-dark);
  text-decoration-color: rgba(247, 244, 238, 0.5);
}
.advice-body .advice-cta a[href^="tel:"] {
  color: #fff;
}
.advice-panel--article {
  margin-top: 2.6em;
}
.advice-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem !important;
}
.advice-body .advice-panel__actions a.btn {
  text-decoration: none;
}
/* Button text keeps its own colour in the guide body (it used to inherit the panel's muted text: 3.2:1 on the
   orange button, below the 4.5:1 needed). */
.advice-body .advice-panel__actions a.btn--primary {
  color: #fff;
}
.advice-body .advice-panel__actions a.btn--ghost-dark {
  color: var(--on-dark);
}
.advice-panel .btn--primary {
  color: #fff;
}

/* Related guides */
.advice-related {
  padding-block: clamp(2rem, 5vw, 3rem) clamp(3.5rem, 8vw, 5rem);
  border-top: 1px solid var(--line);
}
.advice-related__all {
  margin: 1.4rem 0 0;
}
.advice-related__all a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-weight: 700;
  color: var(--accent-dark);
}

@media print {
  .advice-related,
  .advice-panel,
  .advice-figure--diagram::after {
    display: none;
  }
}
