/*
 * Public landing page components.
 *
 * This file stays unlayered because style.css is unlayered; layered rules
 * would lose to it regardless of source order. Components are isolated with
 * @scope, and the page-level layout uses media queries because these
 * components are sized by the viewport rather than a reusable container.
 *
 * The shared style.css still uses legacy BEM class names. This file avoids
 * BEM for its own selectors and overrides shared classes through non-BEM
 * hooks added in the templates.
 */

:root {
  /* A darker public CTA colour that keeps white text at WCAG AA. */
  --color-action: color-mix(
    in srgb,
    var(--color-primary-dark) 85%,
    var(--color-text)
  );
}

.home {
  --home-measure: 38em;
}

[data-theme="light"] .primaryAction,
:root:not([data-theme]) .primaryAction,
[data-theme="light"] .primaryAction:hover,
:root:not([data-theme]) .primaryAction:hover {
  background-color: var(--color-action);
}

[data-theme="light"] .brand,
:root:not([data-theme]) .brand {
  color: var(--color-action);
}

[data-theme="light"] .brand:hover,
:root:not([data-theme]) .brand:hover {
  color: var(--color-text);
}

@scope (.home) {
  :scope > .section:first-child {
    padding-top: 1rem;
    padding-bottom: 3rem;
  }

  .bodyCopy,
  .prose p {
    max-width: var(--home-measure);
  }

  .bodyCopy.lead {
    color: var(--color-text);
    font-size: 1.08rem;
    line-height: 1.9;
  }

  a:not(.button) {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-color: var(--color-primary);
  }

  a:not(.button):hover {
    color: var(--color-primary-dark);
    text-decoration-color: var(--color-primary-dark);
  }

  .prose {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .prose h3 {
    margin: 0.5rem 0 0;
    color: var(--color-text);
    font-size: 1.12rem;
  }

  .prose p {
    margin: 0;
  }

  .contactSection {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .contactSection .form {
    margin-top: 0.25rem;
  }

  @media (width <= 640px) {
    :scope > .section:first-child {
      padding-top: 0;
      padding-bottom: 2.5rem;
    }
  }
}

@scope (.hero) {
  :scope {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
  }

  :scope > div {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
  }

  .eyebrow {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
  }

  h1 {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(1.9rem, 5vw, 2.75rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }

  h1 span {
    color: var(--color-primary-dark);
  }

  .lead {
    margin: 0;
    max-width: 30em;
    font-size: 1rem;
    line-height: 1.9;
  }

  .name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.85rem;
  }

  .name strong {
    color: var(--color-text);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.2rem;
  }

  .actions a:not(.button) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
  }

  figure {
    margin: 0;
  }

  figure img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
  }

  @media (width <= 800px) {
    :scope {
      grid-template-columns: minmax(0, 1fr) 220px;
      gap: 1.5rem;
    }

    h1 {
      font-size: clamp(1.75rem, 5vw, 2.35rem);
    }
  }

  @media (width <= 720px) {
    :scope {
      grid-template-columns: 1fr;
    }

    figure {
      max-width: 220px;
      margin: 0 auto;
    }
  }

  @media (width <= 640px) {
    h1 {
      font-size: clamp(1.6rem, 8vw, 2.05rem);
    }
  }
}

@scope (.summaryList) {
  :scope {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.6rem;
    align-items: baseline;
  }

  li > span {
    color: var(--color-text-light);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
  }

  li p {
    margin: 0;
    max-width: var(--home-measure);
    font-size: 1.05rem;
  }
}

@scope (.factList) {
  :scope {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
  }

  li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--color-border);
  }

  li span:first-child {
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 700;
  }

  li span:last-child {
    color: var(--color-text-light);
    font-size: 0.75rem;
  }

  @media (width <= 640px) {
    :scope {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    li:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
  }
}

@scope (.checkList) {
  :scope {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li {
    display: grid;
    grid-template-columns: 1.2rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    font-size: 1.02rem;
  }

  li > span:first-child {
    color: var(--color-primary-dark);
    font-weight: 700;
    line-height: 1.7;
  }
}

@scope (.valueList) {
  :scope {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.6rem;
    align-items: start;
  }

  li > span {
    color: var(--color-text-light);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 2;
  }

  li h3 {
    margin: 0;
    color: var(--color-text);
    font-size: 1.1rem;
  }

  li p {
    margin: 0.3rem 0 0;
    max-width: var(--home-measure);
  }
}

@scope (.pullQuote) {
  :scope {
    margin: 0.4rem 0;
    padding: 0.35rem 0 0.35rem 1rem;
    border-left: 3px solid var(--color-primary);
    color: var(--color-primary-dark);
  }

  p {
    margin: 0;
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: -0.01em;
  }
}

@scope (.pullQuote[data-size="large"]) {
  p {
    font-size: clamp(1.45rem, 3.5vw, 1.95rem);
  }
}

@scope (.qaList) {
  :scope {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-width: var(--home-measure);
    margin: 0;
  }

  div {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
  }

  dt {
    color: var(--color-text);
    font-weight: 700;
  }

  dd {
    margin: 0;
    max-width: var(--home-measure);
  }
}

@scope (.voiceList) {
  :scope {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 0;
  }

  @media (width <= 640px) {
    :scope {
      grid-template-columns: 1fr;
    }
  }
}

@scope (.voice) {
  :scope {
    margin: 0;
    padding-left: 1rem;
    border-left: 3px solid var(--color-primary);
  }

  blockquote {
    margin: 0;
  }

  blockquote p {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.8;
  }

  figcaption {
    margin: 0.45rem 0 0;
    color: var(--color-text-light);
    font-size: 0.78rem;
  }
}

@scope (.fit) {
  :scope {
    max-width: var(--home-measure);
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
  }

  h3 {
    margin: 0 0 0.45rem;
    color: var(--color-text);
    font-size: 1.02rem;
  }

  ul {
    max-width: var(--home-measure);
    margin: 0;
    padding-left: 1.25rem;
  }

  li + li {
    margin-top: 0.3rem;
  }
}

@scope (.flowList) {
  :scope {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.6rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--color-border);
  }

  li:first-child {
    padding-top: 0;
    border-top: 0;
  }

  li > span {
    color: var(--color-text-light);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 2;
  }

  h3 {
    margin: 0;
    font-size: 1.1rem;
  }

  p:first-of-type {
    margin: 0.2rem 0 0;
    color: var(--color-text-light);
    font-size: 0.82rem;
  }

  p:last-of-type {
    margin: 0.45rem 0 0;
    max-width: var(--home-measure);
  }
}

@scope (.priceList) {
  :scope {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-border);
  }

  li {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  li > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.2rem 1rem;
  }

  h3 {
    margin: 0;
    font-size: 1.02rem;
  }

  li > div p {
    margin: 0;
    color: var(--color-primary-dark);
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
  }

  li > div p span {
    color: var(--color-text-light);
    font-size: 0.72rem;
    font-weight: 400;
  }

  li > p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.8rem;
  }

  @media (width <= 640px) {
    li > div {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.1rem;
    }

    li > div p {
      font-size: 1.12rem;
    }
  }
}

@scope (.hours) {
  :scope {
    margin-top: 0.25rem;
  }

  h3 {
    margin: 0 0 0.4rem;
    font-size: 1.02rem;
  }

  ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--color-text-light);
    font-size: 0.88rem;
  }
}

@scope (.more) {
  :scope {
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }

  summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }

  summary::-webkit-details-marker {
    display: none;
  }

  summary span {
    flex: none;
    color: var(--color-primary-dark);
    transition: transform 0.2s ease;
  }

  :scope[open] summary span {
    transform: rotate(45deg);
  }

  summary + div {
    padding: 0 0 1.25rem;
  }

  summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }

  @media (prefers-reduced-motion: reduce) {
    summary span {
      transition: none;
    }
  }
}

@scope (.faq) {
  :scope {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
  }

  details {
    border-bottom: 1px solid var(--color-border);
  }

  summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }

  summary::-webkit-details-marker {
    display: none;
  }

  summary span {
    flex: none;
    color: var(--color-primary-dark);
    transition: transform 0.2s ease;
  }

  details[open] summary span {
    transform: rotate(45deg);
  }

  details > div {
    padding: 0 0 0.9rem;
  }

  details > div p {
    margin: 0;
    max-width: var(--home-measure);
  }

  summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }

  @media (prefers-reduced-motion: reduce) {
    summary span {
      transition: none;
    }
  }
}
