/* Desktop reading rhythm for the published clinic marketing templates.
   The older page-local styles use unlayered !important declarations. A named
   layer keeps this small set of layout overrides independent of selector depth. */
@layer cg-desktop-layout {
  @media screen and (min-width: 1024px) {
    main {
      --cg-desktop-gutter: clamp(32px, 4vw, 72px);
      --cg-desktop-width: min(1240px, calc(100% - 2 * var(--cg-desktop-gutter)));
      --cg-desktop-section: clamp(48px, 4.2vw, 68px);
      --cg-desktop-gap: clamp(28px, 3vw, 48px);
    }

    :is(header, main) a:is(.btn-copper, .btn-copper-sm),
    header a.header-cta {
      background: #216d70 !important;
      color: #fff !important;
      -webkit-text-fill-color: #fff !important;
      border-color: #216d70 !important;
      border-radius: 8px !important;
      box-shadow: none !important;
    }
    :is(header, main) a:is(.btn-copper, .btn-copper-sm):hover,
    header a.header-cta:hover {
      background: #18595c !important;
      border-color: #18595c !important;
    }
    :is(header, main) a:is(.btn-copper, .btn-copper-sm):focus-visible,
    header a.header-cta:focus-visible {
      outline: 3px solid #216d70 !important;
      outline-offset: 3px !important;
    }

    main :is(.cg-shell, .se-shell, .cg-doc-shell, .cg-inline-shell),
    main #clinic-evidence-intro > div,
    main .cg-canonical-faq > div:first-of-type,
    main section > .mx-auto:is([class*="max-w-[1320px]"], [class*="max-w-[1344px]"], [class*="max-w-[1240px]"]):not(.absolute) {
      width: var(--cg-desktop-width) !important;
      max-width: 1240px !important;
      padding-inline: 0 !important;
      margin-inline: auto !important;
      box-sizing: border-box !important;
    }

    main :is(.cg-premium-home > .cg-section, .cg-inline-enquiry, .cg-canonical-faq),
    main .se-page > section:is(.se-answer, .se-approach, .se-services, .se-work, .se-owner-fit, .se-evidence),
    main section:is([class~="py-20"], [class~="md:py-20"], [class~="md:py-24"]):not(:first-child) {
      padding-block: var(--cg-desktop-section) !important;
    }

    main .cg-premium-home .cg-home-hero__grid {
      column-gap: var(--cg-desktop-gap) !important;
    }
    main .cg-premium-home .cg-home-hero__media {
      justify-self: end !important;
      width: 100% !important;
      max-width: 560px !important;
      margin-inline: 0 !important;
    }

    main .cg-premium-home :is(.cg-shell > h2, .cg-heading-row h2, .cg-home-specialist-intro h2) {
      font-size: clamp(36px, 3.4vw, 52px) !important;
      line-height: 1.12 !important;
      text-wrap: balance;
    }
    main .cg-premium-home :is(.cg-kicker, .cg-eyebrow) {
      margin-block-end: 12px !important;
    }
    main :is(.cg-premium-home, .se-page, .cg-document, .cg-inline-enquiry, .cg-canonical-faq) h2:not(.scroll-animate) {
      animation: none !important;
      translate: none !important;
    }
    main .cg-premium-home :is(.cg-result, .cg-selector-card) {
      animation: none !important;
      translate: none !important;
    }
    main .cg-premium-home .cg-specialist-result {
      margin-top: 36px !important;
      padding-top: 28px !important;
      column-gap: var(--cg-desktop-gap) !important;
    }

    main .cg-inline-shell {
      column-gap: var(--cg-desktop-gap) !important;
    }
    main .cg-inline-intro > p:not([class]) + p:not([class]) {
      margin-top: 14px !important;
    }
    main #clinic-evidence-intro > div {
      padding-block: 0 !important;
      gap: var(--cg-desktop-gap) !important;
    }
    main #clinic-evidence-intro {
      padding-block: var(--cg-desktop-section) !important;
    }

    main .cg-canonical-faq .cg-faq-layout {
      display: grid !important;
      grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr) !important;
      align-items: start !important;
      gap: var(--cg-desktop-gap) !important;
      max-width: none !important;
      width: 100% !important;
      margin: 0 !important;
    }
    main .cg-faq-layout > .section-heading {
      text-align: left !important;
      margin: 0 !important;
    }
    main .cg-faq-layout > .section-heading > div {
      justify-content: flex-start !important;
    }
    main .cg-faq-layout > div {
      min-width: 0;
    }
  }

  @media screen and (min-width: 1200px) {
    header > .relative.mx-auto.w-full,
    .site-header .header-shell {
      width: min(1240px, calc(100% - 2 * clamp(32px, 4vw, 72px))) !important;
      max-width: 1240px !important;
      margin-inline: auto !important;
      padding-inline: 0 !important;
    }

    main section:has(.cgm-services-photo) > div:first-of-type {
      width: var(--cg-desktop-width) !important;
      max-width: 1240px !important;
      padding-inline: 0 !important;
    }
    main :is(.text-center:has(> .cgm-services-photo), .cg-doc-shell:has(> .cgm-case-feature)) {
      display: grid !important;
      max-width: 1240px !important;
      grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr) !important;
      align-content: center !important;
      gap: 0 var(--cg-desktop-gap) !important;
      text-align: left !important;
    }
    main :is(.text-center:has(> .cgm-services-photo), .cg-doc-shell:has(> .cgm-case-feature)) > :is(h1, p, nav, a, .label-tag) {
      grid-column: 1 !important;
      margin-inline: 0 !important;
      justify-self: start !important;
      justify-content: flex-start !important;
      text-align: left !important;
    }
    main :is(.cgm-services-photo, .cgm-case-feature) {
      grid-column: 2 !important;
      grid-row: 1 / span 4 !important;
      align-self: center !important;
      width: 100% !important;
      margin: 0 !important;
    }
    main :is(.cgm-services-photo, .cgm-case-feature) img {
      width: 100% !important;
      height: auto !important;
      aspect-ratio: 4 / 3 !important;
      object-fit: cover !important;
    }
  }
}
