/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V4 · design-system: accepted American Butler homepage · role: shared page-v2 foundation */
html,
body {
  overflow-x: clip;
}

.ab-page-document,
.ab-page-document * {
  box-sizing: border-box;
}

.ab-page-document {
  margin: 0;
  background: var(--ab-color-paper);
  color: var(--ab-color-ink);
  font-family: var(--ab-font-body);
  font-size: var(--ab-type-body);
  line-height: var(--ab-leading-body);
}

.ab-page-document :where(h1, h2, h3) {
  text-wrap: balance;
}

.ab-page-wrapper {
  overflow: visible;
}

.ab-page-main {
  min-height: 55vh;
  padding-block-start: clamp(6.5rem, 9vw, 9rem);
}

/* The newsletter boundary owns the terminal rhythm. This keeps the visible
   final-block → newsletter gap stable even when a family nests its last block. */
.ab-page-document main.content > .section.sub {
  margin-block-start: var(--ab-flow-gap-terminal);
}

.ab-page-container {
  width: min(calc(100% - 2rem), var(--ab-container));
  margin-inline: auto;
}

.ab-page-section {
  padding-block: var(--ab-section-standard);
}

.ab-page-section--compact {
  padding-block: var(--ab-section-compact);
}

.ab-page-section--major {
  padding-block: var(--ab-section-major);
}

.ab-page-title,
.ab-page-heading {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--ab-color-ink);
  font-family: var(--ab-font-display);
  font-style: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.ab-page-title {
  max-width: 18ch;
  font-size: var(--ab-type-page-title-regular);
  font-weight: var(--ab-weight-heading);
  letter-spacing: var(--ab-tracking-page-title);
  line-height: var(--ab-leading-page-title);
}

.ab-page-heading {
  max-width: 24ch;
  font-size: var(--ab-type-section);
  font-weight: var(--ab-weight-heading);
  letter-spacing: var(--ab-tracking-section);
  line-height: var(--ab-leading-section);
}

.ab-page-lead {
  max-width: 44rem;
  margin: var(--ab-space-lg) 0 0;
  color: var(--ab-color-ink-soft);
  font-size: var(--ab-type-lead);
}

.ab-page-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  margin: 0 0 var(--ab-space-lg);
  padding: 0;
  color: var(--ab-color-muted);
  font-size: var(--ab-text-sm);
  list-style: none;
}

.ab-page-breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin-inline-start: .65rem;
  color: var(--ab-color-rule-strong);
}

.ab-page-breadcrumbs a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.ab-page-button {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ab-space-xs);
  padding: .85rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--ab-radius-pill);
  background: var(--ab-color-accent);
  color: var(--ab-color-on-dark);
  font: 700 var(--ab-text-sm)/1 var(--ab-font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ab-duration-short) var(--ab-ease-out), transform var(--ab-duration-short) var(--ab-ease-out);
}

/* Submit actions share the orange/on-dark contract across every managed form. */
.ab-page-document :where(form button[type='submit'], form input[type='submit'], .ab-managed-form__submit) {
  color: var(--ab-color-on-dark) !important;
}

.ab-service-price-badge {
  position: absolute;
  z-index: 2;
  inset-block-start: .75rem;
  inset-inline-end: .75rem;
  max-width: calc(100% - 1.5rem);
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .35rem .75rem;
  border-radius: var(--ab-radius-pill);
  background: var(--ab-color-accent);
  color: var(--ab-color-on-dark);
  font-size: var(--ab-text-sm);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.ab-page-button:hover {
  background: var(--ab-color-accent-dark);
  transform: translateY(-1px);
}

.ab-page-button:active {
  transform: translateY(0);
}

.ab-page-button:disabled,
.ab-page-button[aria-disabled='true'] {
  opacity: .5;
  pointer-events: none;
}

.ab-page-card {
  min-width: 0;
  border: 1px solid var(--ab-color-rule);
  border-radius: var(--ab-radius-lg);
  background: var(--ab-color-surface);
}

.ab-page-document :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ab-color-focus);
  outline-offset: 3px;
}

.ab-page-document :where(input:not(.sub__email), select, textarea) {
  max-width: 100%;
  border: 1px solid var(--ab-color-rule-strong);
  border-radius: var(--ab-radius-sm);
  background: var(--ab-color-surface);
  color: var(--ab-color-ink);
  font: inherit;
}

.ab-page-document :where(img, video, iframe) {
  max-width: 100%;
}

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

/* Shared adapters intentionally reuse the accepted homepage components. */
.ab-shared-media-cta {
  padding-block-start: var(--ab-flow-gap-half);
  background: var(--ab-color-paper);
  color: var(--ab-color-ink);
}

.ab-shared-media-cta__inner {
  position: relative;
  min-height: 24rem;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-radius: var(--ab-radius-lg);
  background: var(--ab-color-ink);
  color: var(--ab-color-on-dark);
}

.ab-shared-media-cta__inner::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--ab-color-ink), transparent 85%);
  content: '';
  pointer-events: none;
}

.ab-shared-media-cta__inner > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: .58;
}

.ab-shared-media-cta__content {
  position: relative;
  z-index: 1;
  max-width: 45rem;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.ab-shared-media-cta__content h2 {
  margin: 0;
  color: var(--ab-color-on-dark);
  font-family: var(--ab-font-display);
  font-size: var(--ab-type-cta);
  font-style: normal;
  font-weight: var(--ab-weight-heading);
  letter-spacing: var(--ab-tracking-cta);
  line-height: var(--ab-leading-cta);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.ab-shared-media-cta__content > div {
  max-width: 38rem;
  margin-block-start: var(--ab-space-cta-title-body);
  color: var(--ab-color-on-dark);
  font-size: var(--ab-type-cta-body);
  line-height: var(--ab-leading-cta-body);
  opacity: .82;
}

.ab-shared-media-cta__content .ab-page-button {
  margin-block-start: 1.5rem;
}

.ab-page-document .ab-shared-media-cta__content .ab-page-button {
  color: var(--ab-color-on-dark);
}

/* Category landing pages reuse the homepage CTA markup, but on internal
   pages it represents the same semantic CTA role as the other families. */
.ab-page-document .cta__title {
  font-size: var(--ab-type-cta);
  font-weight: var(--ab-weight-heading);
  letter-spacing: var(--ab-tracking-cta);
  line-height: var(--ab-leading-cta);
}

.ab-page-document .cta__sub {
  font-size: var(--ab-type-cta-body);
  line-height: var(--ab-leading-cta-body);
}

.ab-shared-feedback,
.ab-shared-rail,
.ab-shared-service-rail {
  margin-block-start: 0;
  background: var(--ab-color-paper);
  color: var(--ab-color-ink);
}

.ab-shared-feedback .sec-head,
.ab-shared-rail .sec-head,
.ab-shared-service-rail .sec-head {
  padding-block-start: 0;
}

.ab-shared-feedback .sec-head__title,
.ab-shared-rail .sec-head__title,
.ab-shared-service-rail .sec-head__title {
  max-width: 22ch;
  overflow-wrap: normal;
  word-break: normal;
  font-family: var(--ab-font-display);
  font-size: var(--ab-type-related-section);
  font-weight: var(--ab-weight-heading);
  line-height: var(--ab-leading-related-section);
  letter-spacing: var(--ab-tracking-related-section);
  text-wrap: balance;
}

.ab-shared-rail .art__viewport {
  scrollbar-width: none;
}

.ab-shared-service-rail .svc__viewport {
  scrollbar-width: none;
}

.ab-shared-rail .art__viewport::-webkit-scrollbar,
.ab-shared-service-rail .svc__viewport::-webkit-scrollbar {
  display: none;
}

.claude-home-page--home-preview .ab-shared-service-rail .sec-head__link {
  font-size: var(--preview-text-sm);
}

.claude-home-page--home-preview .ab-shared-service-rail .sec-head__link::after {
  content: none;
}

.ab-shared-rail .art-card__title,
.ab-shared-service-rail .card__title,
.ab-shared-feedback .rev__name {
  overflow-wrap: normal;
  word-break: normal;
}

.ab-shared-rail .art-card__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  letter-spacing: var(--ab-tracking-card);
}

.ab-shared-rail .art-card__text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* Long editorial categories stay inside the shared card at every rail width. */
.ab-shared-rail .art-card__label {
  right: var(--ab-space-2xs);
  left: auto;
  max-width: calc(100% - (var(--ab-space-2xs) * 2));
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CMS rich text follows semantic roles even when formatted text is pasted
   from office editors. Structural markup and intentional bold/emphasis stay
   intact; only foreign font declarations are neutralized. */
.ab-page-document :is(
  .ab-service-prose,
  .ab-service-richtext,
  .ab-editorial-prose,
  .ab-static__rich-text,
  .ab-about__rich-text
) :where([style*='font-family'], [style*='font:'], [style*='font :']) {
  font-family: inherit !important;
}

.ab-page-document :is(
  .ab-service-prose,
  .ab-service-richtext,
  .ab-editorial-prose,
  .ab-static__rich-text,
  .ab-about__rich-text
) :where(
  :not(h2, h3, h4)[style*='font-size'],
  :not(h2, h3, h4)[style*='font:'],
  :not(h2, h3, h4)[style*='font :']
) {
  font-size: inherit !important;
}

.ab-page-document :is(
  .ab-service-prose,
  .ab-service-richtext,
  .ab-editorial-prose,
  .ab-static__rich-text,
  .ab-about__rich-text
) h2:is([style*='font-size'], [style*='font:'], [style*='font :']) {
  font-size: var(--ab-type-section-compact) !important;
}

.ab-page-document :is(
  .ab-service-prose,
  .ab-service-richtext,
  .ab-editorial-prose,
  .ab-static__rich-text,
  .ab-about__rich-text
) h3:is([style*='font-size'], [style*='font:'], [style*='font :']) {
  font-size: var(--ab-type-richtext-h3) !important;
}

.ab-page-document :is(
  .ab-service-prose,
  .ab-service-richtext,
  .ab-editorial-prose,
  .ab-static__rich-text,
  .ab-about__rich-text
) h4:is([style*='font-size'], [style*='font:'], [style*='font :']) {
  font-size: var(--ab-type-richtext-h4) !important;
}

/* Terminal components surrender their duplicated trailing whitespace to the
   shared newsletter-boundary gap above. These selectors describe compositions,
   not routes or CMS ids. */
.ab-page-document--concierge .ab-concierge__cta,
.ab-page-document--about .ab-about__cta,
.ab-page-document--static-content .ab-static__cta {
  margin-block-end: 0;
}

.ab-page-document--static-content .ab-static__cta:last-child {
  padding-block-end: 0;
}

.ab-page-document--service-catalog .ab-service-family-cta,
.ab-page-document--service-catalog .ab-service-catalog__contact,
.ab-page-document--service-detail .ab-service-related--articles,
.ab-page-document--editorial .ab-news-paths,
.ab-page-document--editorial .ab-editorial-related-services,
.ab-page-document--contacts .ab-contact > .ab-shared-rail:last-of-type,
.ab-page-document--reviews .ab-reviews > .ab-shared-rail:last-of-type,
.ab-page-document--search .ab-search-helpful,
.ab-page-document--system .ab-system__index,
.ab-page-document--system .ab-system__error-hero {
  padding-block-end: 0;
}

@media (max-width: 47.99rem) {
  .ab-shared-feedback .sec-head__lead,
  .ab-shared-rail .sec-head__lead,
  .ab-shared-service-rail .sec-head__lead {
    align-items: flex-start;
  }

  .ab-shared-rail .sec-head__lead > .sec-head__link,
  .ab-shared-service-rail .sec-head__lead > .sec-head__link {
    display: none;
  }

}

@media (max-width: 47.99rem) {
  .ab-page-document {
    --ab-flow-gap-terminal: var(--ab-flow-gap-compact);
  }

  .ab-page-main {
    padding-block-start: 6rem;
  }

  .ab-page-section,
  .ab-page-section--major {
    padding-block: var(--ab-section-compact);
  }

}
