/* ==========================================================================
   LEGAL PAGES — Impressum and Datenschutz

   Shared by template-impressum-page.php and template-datenschutz-page.php.
   Both are plain documents: a breadcrumb, a title and body copy on white, with
   no hero banner.

   The typography block targets plain HTML rather than classes, so the
   Datenschutz page (which has no hard-coded content) formats whatever is
   written in the WordPress editor without any extra markup.
   ========================================================================== */

/* `clip`, not `hidden` — `overflow-x: hidden` promotes overflow-y to `auto`
   and creates a nested scroll container. */
.lg-page {
    overflow-x: clip;
    background-color: #fff;
}
.lg-inner {
    max-width: 1350px;
    margin: 0 auto;
    padding: 26px 15px 70px;
}

/* ---------- title ---------- */
.lg-title {
    width: auto; /* theme.css sets width:100% on every heading */
    margin: 0 0 26px;
    color: #1c1c1c;
    font-family: 'Inter';
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 800;
    line-height: 1.15;
}

/* ==========================================================================
   BODY COPY
   Element selectors, so editor content on the Datenschutz page is formatted
   with no classes to remember.
   ========================================================================== */
.lg-content {
    color: #444242;
    font-family: 'Inter';
    font-size: var(--fs-base);
    line-height: 1.75;
}

/* font-size/line-height/colour are repeated on the child rather than
   inherited: theme.css carries a bare `p { font-size: var(--fs-base); line-height:1.5 }

`,
   and a rule targeting the element directly always beats an inherited value
   however specific the ancestor's selector is. */
.lg-content p {
    margin: 0 0 16px;
    color: #444242;
    font-size: var(--fs-base);
    line-height: 1.75;
}
.lg-content h2 {
    width: auto;
    margin: 34px 0 12px;
    color: #1c1c1c;
    font-family: 'Inter';
    font-size: clamp(22px, 2.4vw, 27px);
    font-weight: 700;
    line-height: 1.25;
}
.lg-content h3 {
    width: auto;
    margin: 26px 0 10px;
    color: #1c1c1c;
    font-family: 'Inter';
    font-size: clamp(18px, 1.9vw, 21px);
    font-weight: 700;
    line-height: 1.3;
}
.lg-content h4,
.lg-content h5,
.lg-content h6 {
    width: auto;
    margin: 22px 0 8px;
    color: #1c1c1c;
    font-family: 'Inter';
    font-size: 17px;
    font-weight: 700;
}
.lg-content > *:first-child {
    margin-top: 0;
}
.lg-content strong,
.lg-content b {
    color: #1c1c1c;
    font-weight: 700;
}
.lg-content a {
    /* Not #F2A820: orange on white measures 2.02:1, well under the 4.5:1 that
       normal-size text needs. This is 4.91:1. */
    color: #F2A820;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s ease;
}
.lg-content a:hover,
.lg-content a:focus-visible {
    color: #1c1c1c;
}
.lg-content hr {
    height: 1px;
    margin: 32px 0;
    background-color: #eceff3;
    border: 0;
}

/* ---------- lists ---------- */
.lg-content ul,
.lg-content ol {
    margin: 0 0 18px;
    padding: 0;
}
.lg-content li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 26px;
    color: #444242 !important; /* beats theme.css's global li colour */
    list-style: none;
}
.lg-content ul > li::before {
    content: "";
    position: absolute;
    top: .6em;
    left: 4px;
    width: 7px;
    height: 7px;
    background-color: #F2A820;
    border-radius: 50%;
}
.lg-content ol {
    counter-reset: lg-ol;
}
.lg-content ol > li {
    counter-increment: lg-ol;
}
.lg-content ol > li::before {
    content: counter(lg-ol) ".";
    position: absolute;
    top: 0;
    left: 0;
    color: #F2A820;
    font-weight: 700;
}

/* ---------- tables, quotes, media ---------- */
.lg-content blockquote {
    margin: 24px 0;
    padding: 18px 22px;
    background-color: #fffaf0;
    border-left: 4px solid #F2A820;
    border-radius: 10px;
}
.lg-content blockquote p:last-child {
    margin-bottom: 0;
}

.lg-content table {
    width: 100%;
    margin: 0 0 18px;
    border-collapse: collapse;
    font-size: var(--fs-md);
}
.lg-content th,
.lg-content td {
    padding: 11px 13px;
    border: 1px solid #e6e8ee;
    text-align: left;
}
.lg-content th {
    background-color: #f7f8fb;
    color: #1c1c1c;
    font-weight: 700;
}
/* Wide tables scroll in their own box instead of pushing the page. */
.lg-content .wp-block-table,
.lg-content figure.wp-block-table {
    overflow-x: auto;
}
.lg-content img {
    max-width: 100%;
    height: auto;
}
.lg-content figure {
    margin: 24px 0;
}

.lg-content figcaption,
.lg-content .wp-element-caption {
    margin-top: 8px;
    color: #6b7387;
    font-size: var(--fs-sm);
}

/* ---------- company block (Angaben gemäß § 5 DDG) ---------- */
.lg-card {
    margin: 0 0 8px;
    padding: 20px 24px;
    background-color: #fdfaf4;
    border: 1px solid #f2e6d2;
    border-left: 4px solid #F2A820;
    border-radius: 12px;
}
.lg-card p:last-child {
    margin-bottom: 0;
}

/* ---------- agency credit ---------- */
.lg-credit {
    margin-top: 34px;
}
/* Now an <a> wrapping the logo, matching the reference markup. */
.lg-credit-logo {
    display: inline-block;
    margin-top: 18px;
    line-height: 0;
}
.lg-credit-logo img {
    display: block;
    width: auto;
    max-width: 240px;
    height: auto;
}

/* ---------- empty state (Datenschutz before content is written) ---------- */
.lg-placeholder {
    padding: 34px 26px;
    background-color: #f7f8fb;
    border: 1px dashed #d6dae1;
    border-radius: 14px;
    color: #6b7387;
    font-family: 'Inter';
    font-size: var(--fs-md);
    line-height: 1.7;
    text-align: center;
}

@media only screen and (max-width: 767px) {
    .lg-inner {
        padding: 20px 15px 54px;
    }
}

/* ==========================================================================
   eRecht24 — DATENSCHUTZERKLÄRUNG
   template-datenschutz-page.php gibt den Text aus dem eRecht24-Plugin aus
   ([erecht24 type="privacy_policy" lang="de"]). Die Element-Regeln oben
   greifen bereits; hier steht nur, was dieser Text zusätzlich mitbringt:
   seine eigene H1, eine tiefere Gliederung (H2 nummeriert, H3, H4), sehr
   lange Adressen und Links sowie nackte <br>-Absätze.
   ========================================================================== */
.lg-erecht24 h1 {
    width: auto;
    margin: 0 0 26px;
    color: #1c1c1c;
    font-family: 'Inter';
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 800;
    line-height: 1.15;
    /* „Datenschutz­erklärung“ kommt mit weichem Trennstrich — auf schmalen
       Bildschirmen darf das Wort dort umbrechen. */
    hyphens: manual;
    overflow-wrap: anywhere;
}

/* Hauptabschnitte („1. Datenschutz auf einen Blick“) mit Trennlinie, damit
   der lange Text in klare Kapitel zerfällt. */
.lg-erecht24 h2 {
    margin-top: 46px;
    padding-top: 26px;
    border-top: 1px solid #eceff3;
}
.lg-erecht24 h1 + h2,
.lg-erecht24 > h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.lg-erecht24 h4 {
    margin-top: 18px;
    color: #444242;
    font-size: var(--fs-base);
}

/* Lange E-Mail-Adressen und Links dürfen umbrechen statt die Seite seitlich
   aufzuschieben. */
.lg-erecht24 p,
.lg-erecht24 li,
.lg-erecht24 a {
    overflow-wrap: anywhere;
}

/* Die Lesebreite eines Fließtextes, nicht die volle Seitenbreite. */
.lg-erecht24 > p,
.lg-erecht24 > ul,
.lg-erecht24 > ol,
.lg-erecht24 > h3,
.lg-erecht24 > h4 {
    max-width: 920px;
}

/* eRecht24 setzt Quellenangaben gern in ein letztes, kleines <p>. */
.lg-erecht24 p:last-child {
    margin-bottom: 0;
}

/* Leere Absätze, die manche Exporte zwischen Abschnitte setzen. */
.lg-erecht24 p:empty {
    display: none;
}

/* Falls eRecht24 seinen Text in ein eigenes <div> packt, gelten dieselben
   Regeln eine Ebene tiefer. */
.lg-erecht24 > div > *:first-child {
    margin-top: 0;
}

@media only screen and (max-width: 767px) {
    .lg-erecht24 h2 {
        margin-top: 34px;
        padding-top: 20px;
    }
}
