﻿/* Copyright (c) Katzenfreunde Bietigheim Bissingen (Noel B.) */

@layer content {
  :where(.prose, .rich-content) {
    --prose-flow-space: 0.72rem;
    font-family: var(--font-main);
  }

  :where(.prose, .rich-content) > section {
    position: relative;
    padding-top: 0.2rem;
  }

  :where(.prose, .rich-content) :where(h1, h2, h3) {
    color: var(--brand-strong);
  }

  :where(.prose, .rich-content) :where(h2, h3) {
    margin-bottom: 0.5rem;
  }

  :where(.prose, .rich-content) :where(p, li) {
    margin: 0;
    max-width: none;
    color: var(--text);
  }

  :where(.prose, .rich-content) :where(p, ul, ol, table)
    + :where(p, ul, ol, table) {
    margin-top: var(--prose-flow-space);
  }

  :where(.prose, .rich-content) :where(ul, ol) {
    margin: 0;
    padding-left: 1.25rem;
  }

  :where(.prose, .rich-content) table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
  }

  :where(.prose, .rich-content) :where(td, th) {
    padding: 0.25rem;
    vertical-align: top;
  }

  :where(.prose, .rich-content) img {
    border-radius: 4px;
    border: 1px solid var(--line);
    box-shadow: 0 14px 26px rgba(16, 31, 22, 0.18);
  }

  .content-prose {
    max-width: none;
  }

  .content-prose p + p {
    margin-top: var(--prose-flow-space, 0.72rem);
  }

  .content-prose strong {
    color: var(--brand-strong);
  }

  .prose--legal :where(h2, h3, h4),
  .legal-document--text-headings :where(h2, h3, h4) {
    font-family: var(--font-main);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.4;
    text-wrap: pretty;
    color: var(--text);
  }

  .prose--legal h2,
  .legal-document--text-headings h2 {
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    font-size: 1.08rem;
  }

  .prose--legal h3,
  .legal-document--text-headings h3 {
    margin-top: 0.85rem;
    margin-bottom: 0.25rem;
    font-size: 1rem;
  }

  .prose--legal h4,
  .legal-document--text-headings h4 {
    margin-top: 0.75rem;
    margin-bottom: 0.2rem;
    font-size: 0.98rem;
  }

  .content-grid {
    display: grid;
    gap: 0.9rem;
    margin: 0.8rem 0;
  }

  .content-grid__row {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .content-grid__row--media-text {
    grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
    align-items: start;
  }

  .content-grid__cell {
    min-width: 0;
  }

  .content-grid__cell > * {
    margin-top: 0;
  }

  .content-grid__cell > * + * {
    margin-top: 0.6rem;
  }

  .content-grid__cell:empty {
    display: none;
  }

  .content-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.22rem;
  }

  .pdf-placeholder {
    width: min(170px, 86%);
    aspect-ratio: 3 / 4;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.9),
      rgba(230, 220, 196, 0.6)
    );
    color: var(--brand-strong);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .content-prose picture {
    display: inline-block;
    max-width: 100%;
  }

  .content-prose picture > img {
    display: block;
    width: 100%;
    height: auto;
  }

  @media (max-width: 1100px) {
    :where(.prose, .rich-content) a,
    .pdf-inline-card__caption,
    .bank-item__value,
    .contact-table a {
      overflow-wrap: anywhere;
      word-break: break-word;
    }
  }

  @media (max-width: 700px) {
    .content-grid__row {
      grid-template-columns: 1fr;
    }
  }
}
