/* Gemeinsame Artikelvorlage. Nur auf Artikelseiten geladen. */

.article-reading-layout {
    display: grid;
    grid-template-columns: minmax(0, 790px);
    justify-content: center;
    padding-top: 57px;
    gap: 0;
}
.article-reading-layout.has-toc {
    grid-template-columns: 215px minmax(0, 760px);
    justify-content: start;
    gap: clamp(40px, 6vw, 96px);
}
.article-reading-layout > .article-body { width: 100%; max-width: 790px; min-width: 0; }
.article-reading-layout .article-toc[hidden] { display: none; }
.article-reading-layout .toc-inner {
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.article-toc-details { border: 0; }
.article-toc-details summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    font-size: .72rem;
    font-weight: 800;
    color: #71776c;
    text-transform: uppercase;
    letter-spacing: .115em;
    cursor: pointer;
}
.article-toc-details summary::-webkit-details-marker { display: none; }
.article-toc-details summary .toc-chevron { color: var(--forest); font-size: 1.16rem; }
.article-toc-links { display: grid; padding-top: 13px; border-left: 2px solid #d8dcd4; }
.article-toc-links a {
    display: block;
    padding: 9px 13px;
    color: #58665d;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 580;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.article-toc-links a:hover, .article-toc-links a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.article-cover img { background: #e5e9e1; }
.article-body .article-summary { margin-bottom: 44px; }
.article-body > h2:first-of-type { margin-top: 43px; }
.article-body h3 { font-weight: 630; font-size: 1.38rem; letter-spacing: -.018em; line-height: 1.3; margin: 37px 0 14px; }
.article-body ul, .article-body ol { color: #46554b; line-height: 1.85; padding-left: 27px; margin-bottom: 28px; }
.article-body li { padding-left: 4px; margin-bottom: 7px; }
.article-body a:not(.button):not(.article-keywords a) { text-underline-offset: 4px; }
.article-body .table-scroll { margin: 26px 0 30px; }
.article-body table caption {
    text-align: left;
    font-size: .84rem;
    color: #69776c;
    font-weight: 670;
    padding: 12px 16px;
    background: #eef0e9;
    caption-side: top;
}
.article-figure { margin: 30px 0 39px; }
.article-figure img {
    display: block;
    height: auto;
    max-height: 720px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-inline: auto;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgb(28 50 40 / 7%);
}
.article-figure figcaption {
    color: #738076;
    font-size: .84rem;
    text-align: center;
    line-height: 1.65;
    margin-top: 11px;
}
.article-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 28px 0 43px; }
.article-gallery figure { margin: 0; min-width: 0; }
.article-gallery img { width: 100%; height: auto; object-fit: contain; border-radius: 7px; }
.article-gallery figcaption { color: #738076; font-size: .82rem; margin-top: 9px; line-height: 1.5; }
.article-callout { border-radius: 0 7px 7px 0; }
.article-callout-warning { border-left-color: #a65d3a; }
.article-callout-info { background: #e9eee6; border-left: 4px solid #5b8b73; }
.code-panel { margin-top: 24px; }
.code-header button { transition: color .18s ease, background .18s ease; }
.code-header button:focus-visible { outline-color: #e4c58e; }
.code-panel pre { scrollbar-color: #7a9589 #1d2926; }
.code-panel .code-key { color: #a9d9be; }
.code-panel .code-value { color: #eac892; }
.code-panel .code-comment { color: #829a8d; }
.code-panel .code-punctuation { color: #dce9dc; }
/* Übernommene Sensor-ID-Markierungen in den Gartenbewässerungs-Beispielen. */
.code-panel .code-line-highlight { color: #a8dcff; background: rgb(100 180 225 / 13%); border-radius: 3px; }
.article-end:empty { display: none; }
.article-project-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 26px;
    border: 1px solid #c9d5c9;
    border-radius: 10px;
    background: #ecf0e9;
    padding: 25px 27px;
    margin-top: 36px;
}
.article-project-eyebrow {
    display: block;
    color: #6b7e6d;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    margin-bottom: 10px;
}
.article-project-link strong { font-size: 1.15rem; font-weight: 690; }
.article-project-link p { font-size: .89rem; margin: 7px 0 0; line-height: 1.6; }
.article-project-link a { flex: 0 0 auto; color: var(--forest); font-size: .86rem; font-weight: 740; text-underline-offset: 4px; }
.article-keywords { margin-top: 34px; }
.article-more { padding-top: 52px; }
@media (max-width: 820px) {
    .article-reading-layout,
    .article-reading-layout.has-toc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 23px; padding-top: 36px; }
    .article-toc-details { border: 1px solid var(--border); border-radius: 8px; background: #eeeee8; padding: 0; }
    .article-toc-details summary { padding: 13px 16px; border-bottom: 0; }
    .article-toc-details[open] summary { border-bottom: 1px solid var(--border); }
    .article-toc-links { border-left: 0; padding: 9px 12px 14px; }
    .article-toc-links a { padding: 7px 6px; }
    .article-reading-layout .toc-inner { position: static; max-height: none; overflow-y: visible; }
    .article-figure img { max-height: none; }
}
@media (max-width: 590px) {
    .article-gallery { grid-template-columns: 1fr; }
    .article-project-link { display: block; padding: 21px; }
    .article-project-link a { display: inline-block; margin-top: 15px; }
    .article-body table caption { font-size: .79rem; }
}


/* Optional: zusätzliche Spaltentrenner nur für komplexe Tabellen. */
.article-body .table-scroll.with-column-lines th:not(:last-child),
.article-body .table-scroll.with-column-lines td:not(:last-child) {
    border-right: 1px solid var(--border);
}

/* Bild und erklärender Text nebeneinander; Bild bleibt vollständig sichtbar. */
.article-text-media {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
    align-items: start;
    gap: clamp(20px, 3.5vw, 34px);
    margin: 38px 0 44px;
}
.article-body .article-text-media h2 {
    margin-top: 0;
}
.article-text-media .article-figure {
    margin: 4px 0 0;
    min-width: 0;
}
.article-text-media .article-figure img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}
.article-text-media .article-figure figcaption {
    text-align: left;
    font-size: .8rem;
}
.article-text-media .article-figure a {
    display: block;
    border-radius: 8px;
}
.article-text-media .article-figure a:focus-visible {
    outline-offset: 5px;
}
@media (max-width: 720px) {
    .article-text-media {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        margin-block: 34px;
    }
    .article-text-media .article-figure {
        margin: 0;
    }
}

/* Kompaktere Bildspalte: Der Text nutzt den frei werdenden Platz. */
.article-text-media.article-text-media--compact {
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
}
.article-text-media--compact .article-figure figcaption {
    text-align: center;
}
@media (max-width: 720px) {
    .article-text-media.article-text-media--compact {
        grid-template-columns: minmax(0, 1fr);
    }
    .article-text-media--compact .article-text-media-visual {
        width: min(100%, 240px);
    }
}


/* Komponenten: oben ausführlich, unten kompakte Zusammenfassung.
   Produktabbildungen bleiben vollständig sichtbar. */
.article-hardware { margin: 52px 0 63px; }
.article-hardware > h2 { margin-top: 0; }
.hardware-product-note {
    border-left: 3px solid #7f9b84;
    background: #edf0e8;
    padding: 15px 19px;
    margin: 24px 0 13px;
    border-radius: 0 7px 7px 0;
}
.hardware-product-note strong {
    display: block;
    color: #365445;
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.article-body .hardware-product-note p {
    font-size: .85rem;
    line-height: 1.65;
    color: #667268;
    margin: 0;
}
.hardware-detail-list { display: grid; }
.hardware-detail {
    display: grid;
    grid-template-columns: minmax(0, 185px) minmax(0, 1fr);
    gap: clamp(19px, 3vw, 30px);
    border-bottom: 1px solid var(--border);
    padding: 30px 0;
    align-items: start;
}
.hardware-detail:last-child { border-bottom: 0; }
.hardware-detail-image {
    min-width: 0;
    margin: 0;
}
.hardware-detail-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    border-radius: 7px;
}
.hardware-detail-image figcaption {
    padding: 9px 2px 0;
    text-align: center;
    color: #768075;
    font-size: .76rem;
    line-height: 1.5;
}
.hardware-detail-label { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 2px 0 11px; }
.hardware-detail-label span:first-child {
    font-size: .69rem;
    font-weight: 760;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #788374;
}
.hardware-detail-label span + span {
    font-size: .7rem;
    color: #665e4d;
    border: 1px solid #ded1b6;
    border-radius: 14px;
    padding: 3px 9px;
    background: #f4eee0;
}
.article-body .hardware-detail h3 {
    font-size: clamp(1.2rem, 2vw, 1.48rem);
    line-height: 1.32;
    letter-spacing: -.025em;
    font-weight: 630;
    margin: 0 0 13px;
}
.article-body .hardware-detail-content p {
    font-size: .96rem;
    line-height: 1.77;
    margin-bottom: 12px;
}
.article-body .hardware-detail-content p.hardware-detail-note {
    color: #6a7468;
    font-size: .86rem;
    line-height: 1.7;
    margin-top: 3px;
}
.hardware-product-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
}
/* Einheitliches Linkbild für Produktverweise in allen Artikeln.
   Die Werbekennzeichnung steht sichtbar unmittelbar hinter dem Link. */
.article-body a.article-product-link {
    color: var(--forest);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: 4px;
}
.article-body a.article-product-link:hover,
.article-body a.article-product-link:focus-visible { color: var(--accent); }
.product-link-label {
    display: inline-block;
    white-space: nowrap;
    font-size: .83rem;
    font-weight: 600;
    color: #6a7468;
    text-decoration: none;
}
.article-hardware-recap {
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin: 52px 0 55px;
}
.article-hardware-recap h2 { margin-top: 45px; }
.hardware-recap-list {
    list-style: none;
    margin: 19px 0 0;
    padding: 0;
    border-top: 1px solid var(--border);
}
.article-body .hardware-recap-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 17px 0;
    border-bottom: 1px solid var(--border);
}
.hardware-recap-list li > div { display: grid; gap: 6px; }
.hardware-recap-product-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.hardware-recap-purpose { color: #68766c; font-size: .85rem; line-height: 1.55; }
.hardware-recap-jump { flex: 0 0 auto; color: var(--forest); font-size: .79rem; font-weight: 700; text-decoration: none; }
.hardware-recap-jump:hover { color: var(--accent); }
@media (max-width: 590px) {
    .hardware-detail { grid-template-columns: 1fr; gap: 18px; padding: 26px 0; }
    .hardware-detail-image { width: min(100%, 300px); }
    .article-body .hardware-recap-list li { align-items: start; gap: 9px; }
    .hardware-recap-jump { padding-top: 3px; }
    .hardware-product-note { padding: 14px 16px; }
}


/* Kleine technische Erläuterungen und Primärquellen im Artikel. */
.article-body p.article-small-note {
    margin: -13px 0 29px;
    color: #69786e;
    font-size: .82rem;
    line-height: 1.65;
}
.article-source-notes {
    margin: 54px 0 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.article-body .article-source-notes h2 {
    font-size: 1.35rem;
    line-height: 1.35;
    margin: 26px 0 13px;
    font-weight: 630;
    letter-spacing: -.02em;
}
.article-body .article-source-notes ul {
    margin: 0;
    padding-left: 22px;
}
.article-body .article-source-notes li {
    font-size: .89rem;
    margin: 7px 0;
    line-height: 1.65;
}
.article-source-notes a {
    color: var(--forest);
    text-underline-offset: 3px;
}


/* Bildvergrößerung nur ausdrücklich ausgewählten Abbildungen anbieten.
   Die Klasse article-image-zoom gehört ausschließlich an diese Links. */
.article-figure > a.article-image-zoom {
    display: block;
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    border-radius: 7px;
    overflow: hidden;
}
.article-figure > a.article-image-zoom::after {
    content: "⤢";
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: grid;
    place-items: center;
    min-width: 31px;
    height: 31px;
    padding: 0 6px;
    color: #244437;
    background: rgba(255, 255, 255, .94);
    border-radius: 6px;
    box-shadow: 0 2px 9px rgba(0, 0, 0, .13);
    font-size: 1.25rem;
    line-height: 1;
    pointer-events: none;
}
.article-figure > a.article-image-zoom:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

/* Untergliederung langer Schritt-für-Schritt-Installationsanleitungen. */
.article-body h4 { color: var(--forest); font-size: 1.13rem; line-height: 1.4; font-weight: 660; margin: 30px 0 14px; }

/* GPS-Projekt: CAD groß, Einbaufotos gleich groß; alle drei Bilder zoombar. */
.gps-enclosure-cad .article-image-zoom { width: min(100%, 760px); }
.gps-enclosure-cad img { width: 100%; max-height: none; }
.gps-enclosure-gallery .article-image-zoom { width: 100%; }
.gps-enclosure-gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
