/**
 * GEWO heading card, release 1.1.0.
 *
 * The stylesheet is route-gated by the system plugin. Its selectors also
 * require the release-specific .gewo-heading-description structure so an
 * incomplete article update keeps the existing presentation unchanged.
 */

@supports selector(:has(*)) {
  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  ) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    isolation: isolate;
  }

  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  )::before {
    content: "";
    display: block;
    grid-column: 1;
    z-index: 0;
    pointer-events: none;
    background: #fff;
    border: 1px solid #e1e5dc;
    border-top: 4px solid #95c11f;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.07);
  }

  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  )::after {
    content: "";
    display: block;
    grid-column: 1;
    height: 32px;
    pointer-events: none;
  }

  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  ) > .com-content-article__body {
    /*
     * This neutral Joomla div must stop generating a box so its description
     * can share the parent grid with the sibling page header. DOM, heading
     * order and focus order remain unchanged; see the release risk note for
     * legacy browser/assistive-technology handling of display: contents.
     */
    display: contents;
  }

  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  ) > .page-header {
    grid-column: 1;
    position: relative;
    z-index: 1;
    margin: 0 !important;
    padding: 48px 52px 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  ) > .page-header > :is(h1, h2) {
    margin: 0 !important;
  }

  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  ) > .com-content-article__body > .gewo-heading-description {
    grid-column: 1;
    position: relative;
    z-index: 1;
    margin: 0 !important;
    padding: 14px 52px 48px !important;
    border: 0 !important;
    background: transparent !important;
  }

  :where(
    body.site.com_content.view-article:not(.itemid-109)
      .com-content-article.item-page:has(
        > .page-header + .com-content-article__body > .gewo-heading-description
      ),
    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      )
  ) > .com-content-article__body > .gewo-heading-description > :last-child {
    margin-bottom: 0;
  }

  body.site.com_content.view-article:not(.itemid-109)
    .com-content-article.item-page:has(
      > .page-header + .com-content-article__body > .gewo-heading-description
    )::before {
    grid-row: 1 / 3;
  }

  body.site.com_content.view-article:not(.itemid-109)
    .com-content-article.item-page:has(
      > .page-header + .com-content-article__body > .gewo-heading-description
    ) > .page-header {
    grid-row: 1;
  }

  body.site.com_content.view-article:not(.itemid-109)
    .com-content-article.item-page:has(
      > .page-header + .com-content-article__body > .gewo-heading-description
    ) > .com-content-article__body > .gewo-heading-description {
    grid-row: 2;
  }

  body.site.com_content.view-article:not(.itemid-109)
    .com-content-article.item-page:has(
      > .page-header + .com-content-article__body > .gewo-heading-description
    )::after {
    grid-row: 3;
  }

  body.site.com_content.view-article:not(.itemid-109)
    .com-content-article.item-page:has(
      > .page-header + .com-content-article__body > .gewo-heading-description
    ) > .com-content-article__body > .gewo-page {
    grid-column: 1;
    grid-row: 4;
    min-width: 0;
  }

  body.site.com_content.view-article.itemid-109
    .com-content-article.item-page:has(
      > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
    )::before {
    grid-row: 1 / 4;
  }

  body.site.com_content.view-article.itemid-109
    .com-content-article.item-page:has(
      > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
    ) > .page-header {
    grid-row: 1;
  }

  body.site.com_content.view-article.itemid-109
    .com-content-article.item-page:has(
      > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
    ) > .page-header + .page-header {
    grid-row: 2;
    padding-top: 10px !important;
  }

  body.site.com_content.view-article.itemid-109
    .com-content-article.item-page:has(
      > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
    ) > .com-content-article__body > .gewo-heading-description {
    grid-row: 3;
  }

  body.site.com_content.view-article.itemid-109
    .com-content-article.item-page:has(
      > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
    )::after {
    grid-row: 4;
  }

  body.site.com_content.view-article.itemid-109
    .com-content-article.item-page:has(
      > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
    ) > .com-content-article__body > .gewo-page {
    grid-column: 1;
    grid-row: 5;
    min-width: 0;
  }

  @media (max-width: 767.98px) {
    :where(
      body.site.com_content.view-article:not(.itemid-109)
        .com-content-article.item-page:has(
          > .page-header + .com-content-article__body > .gewo-heading-description
        ),
      body.site.com_content.view-article.itemid-109
        .com-content-article.item-page:has(
          > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
        )
    ) > .page-header {
      padding: 28px 22px 0 !important;
    }

    :where(
      body.site.com_content.view-article:not(.itemid-109)
        .com-content-article.item-page:has(
          > .page-header + .com-content-article__body > .gewo-heading-description
        ),
      body.site.com_content.view-article.itemid-109
        .com-content-article.item-page:has(
          > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
        )
    ) > .com-content-article__body > .gewo-heading-description {
      padding: 12px 22px 28px !important;
    }

    body.site.com_content.view-article.itemid-109
      .com-content-article.item-page:has(
        > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
      ) > .page-header + .page-header {
      padding-top: 8px !important;
    }

    :where(
      body.site.com_content.view-article:not(.itemid-109)
        .com-content-article.item-page:has(
          > .page-header + .com-content-article__body > .gewo-heading-description
        ),
      body.site.com_content.view-article.itemid-109
        .com-content-article.item-page:has(
          > .page-header + .page-header + .com-content-article__body > .gewo-heading-description
        )
    )::after {
      height: 22px;
    }
  }
}
