/*
  AquaPulse guide system — shared stylesheet for /guides/ pages.
  Self-contained: includes design tokens, site header/nav/footer and
  guide-specific components, so a new guide page only needs one <link>.
  See ../GUIDE_TEMPLATE.md for the authoring reference.
*/

:root {
  --page-bg: #eef2f7;
  --page-bg-soft: #f5f7fa;
  --surface: #ffffff;
  --surface-tint: #f3f6fa;
  --line: #dde5ee;
  --line-strong: #c7d3e0;

  --text: #0f2039;
  --muted: #5b6b80;
  --soft: #33445c;

  --blue: #2f5fe0;
  --blue-deep: #1f45b0;
  --blue-tint: #e7edfc;
  --cyan: #159fbb;
  --cyan-tint: #e2f4f8;
  --green: #1a9b5c;
  --green-tint: #e5f6ec;
  --amber: #ad7a0c;
  --amber-tint: #fbf1d9;
  --red: #c8362b;
  --red-tint: #fbe9e7;

  --navy-deep: #0c1c33;
  --navy-mid: #142a4a;
  --navy-line: rgba(255, 255, 255, 0.14);
  --navy-text: #eef3fa;
  --navy-muted: #9fb0c7;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 32, 57, 0.05);
  --shadow-md: 0 14px 34px rgba(15, 32, 57, 0.09);

  --max-width: 1120px;
  --guide-width: 780px;
  --page-gutter: clamp(20px, 4vw, 40px);
  --section-space: clamp(40px, 5vw, 68px);
  --gap: clamp(16px, 3vw, 28px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--blue);
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--page-gutter);
  top: 12px;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--blue);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  width: min(var(--max-width), calc(100% - (var(--page-gutter) * 2)));
  margin-inline: auto;
}

/* ---------- Site header (shared with the rest of the site) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 850;
  color: var(--text);
}

.brand-logo {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.brand-by {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--soft);
  font-size: 14px;
  font-weight: 600;
}

.nav-list a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
}

.nav-list a:hover {
  color: var(--blue);
}

.nav-list a[aria-current="page"] {
  color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
  color: inherit;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 26px rgba(47, 95, 224, 0.28);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.nav-cta {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
  box-shadow: none;
}

.nav-download {
  position: relative;
}

.nav-download summary {
  list-style: none;
  cursor: pointer;
  gap: 6px;
}

.nav-download summary::-webkit-details-marker {
  display: none;
}

.nav-download summary::marker {
  content: "";
}

.nav-download-caret {
  transition: transform 160ms ease;
}

.nav-download[open] .nav-download-caret {
  transform: rotate(180deg);
}

.nav-download-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(15, 32, 57, 0.14);
}

.store-badge-link {
  display: inline-flex;
  line-height: 0;
}

.store-badge-link img {
  width: auto;
  display: block;
}

.store-badge-link img[src*="apple-app-store-badge"] {
  height: 29px;
}

.store-badge-link img[src*="google-play-badge"] {
  height: 34px;
}

.nav-toggle-checkbox {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-toggle-label {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
}

.nav-toggle-label svg {
  pointer-events: none;
}

/* ---------- Breadcrumb ---------- */

.breadcrumb-nav {
  padding-block: 18px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb-item a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.breadcrumb-item a:hover {
  color: var(--blue);
}

.breadcrumb-sep {
  color: var(--line-strong);
}

.breadcrumb-current {
  color: var(--soft);
  font-weight: 700;
}

/* ---------- Guide header ---------- */

.guide-header {
  padding-block: 4px clamp(28px, 4vw, 40px);
}

.guide-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.guide-title {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--text);
}

.guide-answer {
  max-width: var(--guide-width);
  margin: 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--blue);
  color: var(--soft);
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.6;
}

/* ---------- At-a-glance ---------- */

.at-a-glance-heading {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--blue-deep);
}

.at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  max-width: var(--guide-width);
  margin: 0 0 clamp(24px, 4vw, 36px);
}

.at-a-glance-item {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}

.at-a-glance-item h3 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--blue-deep);
}

.at-a-glance-item p {
  margin: 0;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---------- Fit check (species guides: suitable/reconsider comparison) ---------- */
/* An editorial alternative to a third equal card: two comparison blocks
   plus one smaller, de-emphasised uncertainty note below, rather than
   three visually equal boxes. */

.fit-check {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  max-width: var(--guide-width);
  margin: 0 0 14px;
}

.fit-check-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}

.fit-check-suitable {
  border-left-color: var(--green);
}

.fit-check-reconsider {
  border-left-color: var(--amber);
}

.fit-check-item h3 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.fit-check-item p {
  margin: 0;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.fit-check-note {
  max-width: var(--guide-width);
  margin: 0 0 clamp(24px, 4vw, 36px);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.fit-check-note strong {
  color: var(--soft);
}

/* ---------- Urgent action box (time-sensitive guides only) ---------- */
/* Sits between the intro answer and "At a glance"/on-this-page nav, so a
   stressed reader sees what to do before any background explanation.
   Each guide includes only the sub-blocks that genuinely apply — this is
   not a fixed four-part template every guide must fill in. */

.urgent-box {
  max-width: var(--guide-width);
  margin: 0 0 clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.urgent-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.urgent-item {
  padding: 16px 18px;
  border-left: 3px solid var(--line-strong);
  border-top: 1px solid var(--line);
}

.urgent-item:nth-child(-n+2) {
  border-top: 0;
}

.urgent-do {
  border-left-color: var(--green);
}

.urgent-check {
  border-left-color: var(--blue);
}

.urgent-avoid {
  border-left-color: var(--amber);
}

.urgent-help {
  border-left-color: var(--red);
}

.urgent-item h2,
.urgent-item h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
  text-transform: uppercase;
}

.urgent-item p,
.urgent-item ul {
  margin: 0;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.urgent-item ul {
  padding-left: 18px;
}

.urgent-item li + li {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .urgent-box-grid {
    grid-template-columns: 1fr;
  }
  .urgent-item:nth-child(-n+2) {
    border-top: 1px solid var(--line);
  }
  .urgent-item:first-child {
    border-top: 0;
  }
}

/* ---------- On this page (compact in-article navigation) ---------- */

.on-this-page {
  max-width: var(--guide-width);
  margin: 0 0 clamp(32px, 4vw, 44px);
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}

.on-this-page-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--blue-deep);
}

.on-this-page-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.on-this-page-list a {
  display: inline-block;
  padding: 4px 0;
  color: var(--soft);
  font-size: 13.5px;
  line-height: 1.5;
  text-decoration: none;
}

.on-this-page-list a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- Guide body ---------- */

.guide-body {
  max-width: var(--guide-width);
}

.guide-body h2 {
  margin: 0 0 14px;
  font-size: clamp(20px, 2.1vw, 24px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  scroll-margin-top: 90px;
}

.guide-body h3 {
  margin: 26px 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  scroll-margin-top: 90px;
}

.guide-body p {
  margin: 0 0 14px;
  color: var(--soft);
  font-size: clamp(16.5px, 1.8vw, 17px);
  line-height: 1.6;
}

.guide-body ul,
.guide-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
  color: var(--soft);
  font-size: clamp(16.5px, 1.8vw, 17px);
  line-height: 1.6;
}

.guide-body li + li {
  margin-top: 6px;
}

.guide-body a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.guide-body a.source-ref {
  margin-left: 2px;
  color: var(--blue-deep);
  font-size: 0.8em;
  font-weight: 800;
  text-decoration: none;
}

.guide-body a.source-ref:hover {
  text-decoration: underline;
}

/* ---------- Inline photography ---------- */

.guide-figure {
  margin: 8px 0 28px;
}

.guide-figure img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.guide-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.guide-figure-species {
  width: min(100%, 480px);
  margin-inline: auto;
}

.guide-figure-species img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.guide-figure-species figcaption {
  width: 100%;
}

/* ---------- Filter flow-path diagram ----------
   All factual content (headings, flow description, intake-safety note) is
   ordinary HTML text at a fixed CSS font-size — it never sits inside the
   scaled SVG coordinate space, so it can't shrink below a readable size on
   a narrow viewport the way SVG-embedded text does. Each icon is purely
   decorative (aria-hidden): the adjacent text already states everything
   the icon shows, so screen-reader users lose nothing by the icon being
   hidden from the accessibility tree. */

.filter-flow-figure {
  width: min(100%, var(--guide-width));
  margin: 8px 0 28px;
}

.filter-flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.filter-flow-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.filter-flow-icon {
  display: block;
  width: 96px;
  max-width: 100%;
  height: auto;
  margin-bottom: 12px;
}

.filter-flow-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
}

.filter-flow-card p {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
}

.filter-flow-note {
  margin-bottom: 0 !important;
  color: var(--muted) !important;
  font-size: 13px !important;
}

.ff-node {
  fill: var(--blue);
}

.ff-line {
  stroke: var(--muted);
  stroke-width: 2;
  fill: none;
}

.ff-arrow {
  fill: var(--muted);
}

.ff-media {
  fill: var(--blue-tint);
  stroke: var(--blue-deep);
  stroke-width: 1.5;
}

.ff-media-porous {
  fill: var(--blue-tint);
  stroke: var(--blue-deep);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.ff-boundary {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
}

.ff-divider {
  stroke: var(--blue-deep);
  stroke-width: 1;
  opacity: 0.5;
}

/* ---------- Callouts (never rely on colour alone — always a text label) ---------- */

.callout {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 14.5px;
  line-height: 1.65;
}

.callout strong {
  display: inline;
}

.callout-info {
  border-color: var(--line-strong);
  background: var(--blue-tint);
  color: var(--blue-deep);
}

.callout-caution {
  border-color: #f0dba3;
  background: var(--amber-tint);
  color: #6b4c08;
}

.callout-urgent {
  border-color: #f0c3bd;
  background: var(--red-tint);
  color: #7a2019;
}

/* ---------- Ordered practical steps ---------- */

.steps-list {
  display: grid;
  gap: 18px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.steps-item {
  display: flex;
  gap: 14px;
}

.steps-num {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--blue-deep);
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.steps-item h3 {
  margin: 2px 0 4px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
}

.steps-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.steps-group-label {
  margin: 30px 0 4px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--blue-deep);
}

/* ---------- Table ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.guide-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 14px;
}

.guide-table caption {
  padding: 12px 16px 0;
  text-align: left;
  color: var(--muted);
  font-size: 12.5px;
}

.guide-table th,
.guide-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  line-height: 1.5;
}

.guide-table thead th {
  background: var(--surface-tint);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.guide-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- FAQ ---------- */

.faq-list {
  margin: 20px 0;
}

.faq-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.faq-item:first-child {
  padding-top: 0;
}

.faq-q {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.faq-a {
  margin: 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- Sources & editorial ---------- */

.editorial-box {
  margin: 28px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  color: var(--soft);
  font-size: 13.5px;
  line-height: 1.7;
}

.editorial-box dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0 0 12px;
}

.editorial-box dt {
  font-weight: 800;
  color: var(--text);
}

.editorial-box dd {
  margin: 0;
}

.sources-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.sources-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.55;
}

.source-num {
  margin-right: 6px;
  color: var(--blue-deep);
  font-weight: 800;
  font-size: 12.5px;
}

.sources-list a {
  font-weight: 700;
}

.sources-list .source-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.disclaimer {
  margin-top: 22px;
  padding: 15px 18px;
  border: 1px solid #f0dba3;
  border-radius: var(--radius-md);
  background: var(--amber-tint);
  color: #6b4c08;
  font-size: 13px;
  line-height: 1.65;
}

/* ---------- Related guidance ---------- */

.related-guides {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: var(--guide-width);
  margin: 20px 0 0;
}

/* Secondary related links, collapsed by default behind a native <details>
   disclosure. Still present and crawlable in the HTML either way — this
   only affects visibility, not whether the links exist. */

.related-more {
  max-width: var(--guide-width);
  margin: 18px 0 0;
}

.related-more summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-deep);
  list-style: none;
}

.related-more summary::-webkit-details-marker {
  display: none;
}

.related-more summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 7px;
  transition: transform 150ms ease;
}

.related-more[open] summary::before {
  transform: rotate(90deg);
}

.related-more summary:hover,
.related-more summary:focus-visible {
  color: var(--blue);
}

.related-more .related-guides {
  margin-top: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .related-more summary::before {
    transition: none;
  }
}

.related-guide-card {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.related-guide-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.related-guide-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
}

.related-guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------- Section wrapper ---------- */
/* Editorial rhythm: one consistent gap between sections (margin only, not
   stacked top+bottom padding), so the article reads as continuous prose
   rather than a sequence of full-viewport panels. */

.guide-section {
  margin-bottom: clamp(28px, 3.5vw, 38px);
}

.guide-section:last-of-type {
  margin-bottom: 0;
}

/* ---------- Contextual bridge (Phase 2 Package 3) ---------- */
/* Used only for the "app-explainer" and "direct-download" bridge outcomes,
   where the section is genuinely about AquaPulse. The "website-first"
   outcome instead reuses a plain .related-guide-card below, deliberately
   NOT this card, so a bridge pointing at another guide doesn't visually
   read as an AquaPulse ad. Cyan is otherwise unused in this stylesheet,
   keeping this visually distinct from .urgent-box (red/amber/green) and
   .disclaimer (amber) so it never reads as a warning. */

.bridge {
  max-width: var(--guide-width);
  margin: 0 0 clamp(28px, 3.5vw, 38px);
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-md);
  background: var(--cyan-tint);
}

/* Self-contained heading size (not relying on .guide-body h2, since this
   component also appears on tool pages that don't use that wrapper). */
.bridge h2,
.bridge h3 {
  margin: 0 0 10px;
  font-size: clamp(18px, 2.1vw, 21px);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.bridge p {
  margin: 0 0 12px;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.65;
}

.bridge p:last-of-type {
  margin-bottom: 0;
}

.bridge-limit {
  color: var(--muted);
}

.bridge-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

/* The app-explainer CTA text is longer than most .btn uses elsewhere on the
   site (e.g. "See how AquaPulse supports ongoing care") — allow it to wrap
   instead of forcing a fixed nowrap width that overflows narrow viewports. */
.bridge-actions .btn {
  white-space: normal;
  height: auto;
  min-height: 46px;
  text-align: center;
}

.bridge-stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

/* ---------- Footer (shared with the rest of the site) ---------- */

.footer {
  margin-top: 0;
  padding-block: 36px 50px;
  border-top: 1px solid var(--line);
  background: var(--page-bg-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.footer-left {
  max-width: 460px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.footer-left strong {
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-size: 13.5px;
  color: var(--soft);
}

.footer-also {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-also a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav {
    flex-wrap: wrap;
  }

  .nav-toggle-label {
    display: inline-flex;
  }

  .nav-toggle-checkbox {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .nav-list {
    order: 3;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-block: 10px 16px;
    border-top: 1px solid var(--line);
  }

  .nav-toggle-checkbox:checked ~ .nav-list {
    display: flex;
  }

  .nav-list a {
    width: 100%;
    min-height: 44px;
  }

  .at-a-glance,
  .fit-check {
    grid-template-columns: 1fr;
  }

  .on-this-page-list {
    grid-template-columns: 1fr;
  }

  .related-guides {
    grid-template-columns: 1fr;
  }

  .filter-flow-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .nav {
    min-height: 60px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
    font-size: 14px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand-by {
    display: none;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-toggle-label {
    width: 34px;
    height: 34px;
  }

  .nav-cta {
    padding-inline: 10px;
    font-size: 12px;
    min-height: 36px;
  }

  .nav-download summary {
    gap: 4px;
  }

  .nav-download-caret {
    width: 8px;
    height: 8px;
  }

  .nav-download-panel {
    right: -8px;
  }

  .editorial-box dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .nav {
    gap: 6px;
  }

  .brand {
    gap: 6px;
    font-size: 13px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .nav-actions {
    gap: 5px;
  }

  .nav-toggle-label {
    width: 32px;
    height: 32px;
  }

  .nav-cta {
    padding-inline: 8px;
    font-size: 11px;
    min-height: 34px;
  }
}

@media (max-width: 340px) {
  .brand {
    gap: 5px;
    font-size: 12px;
  }

  .brand-logo {
    width: 26px;
    height: 26px;
  }

  .nav-actions {
    gap: 4px;
  }

  .nav-toggle-label {
    width: 30px;
    height: 30px;
  }

  .nav-cta {
    padding-inline: 6px;
    font-size: 10px;
    min-height: 32px;
  }

  .nav-download summary {
    gap: 3px;
  }

  .nav-download-caret {
    width: 7px;
    height: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
