
/* ==========================================================================
   INSIGHTS — Premium 2026 (thought-leadership listing + article prose)
   Reuses .legal-page--premium / .legal-hero scaffolding for the page shell;
   adds an editorial list (listing) and a long-form prose system (article).
   ========================================================================== */

/* --- Back-to-top button (article pages only) ---
   Visibility toggled by initBackToTopInline() (js/inline-init.js) via a
   scroll listener; CSS only handles the fade/transform, never display,
   so the transition always has something to animate. */
.back-to-top {
    position: fixed;
    right: clamp(1.25rem, 3vw, 2.5rem);
    bottom: clamp(1.25rem, 3vw, 2.5rem);
    z-index: 4500;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: var(--bg-primary);
    color: var(--accent-color);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease, background 0.2s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
}

.back-to-top svg {
    width: 18px;
    height: 18px;
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: opacity 0.15s linear;
        transform: none;
    }
}

/* --- Reading progress bar (article pages only) ---
   Pure CSS via animation-timeline: scroll(), no JavaScript. Chromium
   supports it today; everywhere else the @supports fallback hides the bar
   entirely rather than shipping a static, broken-looking line. */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 6000;
    background: linear-gradient(90deg, var(--accent-color), #f4d03f);
    transform: scaleX(0);
    transform-origin: 0 0;
    animation: reading-progress-fill linear;
    animation-timeline: scroll(root);
    pointer-events: none;
}

@keyframes reading-progress-fill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@supports not (animation-timeline: scroll()) {
    .reading-progress {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Direct scroll-position feedback, not decorative motion — but the
       blanket reduced-motion rule below forces animation-duration to
       ~0, which would break scroll-linked tracking. Opt this one back in. */
    .reading-progress {
        animation-duration: auto !important;
    }
}

/* --- Listing: editorial row list (mirrors .project-item--premium rhythm) --- */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.insight-item {
    position: relative;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    transition: background 0.35s ease;
}

.insight-item:hover {
    background: rgba(212, 175, 55, 0.04);
}

.insight-item-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: clamp(1.75rem, 4vw, 2.5rem) 0;
    text-decoration: none;
    color: inherit;
}

.insight-item-num {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: clamp(0.9rem, 1.5vw, 1.15rem);
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    opacity: 0.55;
    padding-top: 0.35rem;
    min-width: 2.5rem;
}

.insight-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.insight-item-tag {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-color);
    opacity: 0.85;
}

.insight-item-title {
    font-family: var(--font-family-heading);
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
    overflow-wrap: break-word;
    transition: color 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.insight-item:hover .insight-item-title {
    color: var(--accent-color);
    transform: translateX(4px);
}

.insight-item-excerpt {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0;
    max-width: 42rem;
}

.insight-item-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    text-align: right;
    padding-top: 0.25rem;
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}

.insights-empty {
    padding: clamp(2rem, 5vw, 3rem) 0;
    color: var(--text-secondary);
}

.insights-empty h2 {
    font: inherit;
    color: inherit;
    margin: 0;
}

@media (max-width: 768px) {
    .insight-item-link {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .insight-item-num {
        padding-top: 0;
    }

    .insight-item-aside {
        align-items: flex-start;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .insight-item:hover .insight-item-title {
        transform: none;
    }
}

/* --- Article hero meta row (date · reading time · tags) --- */
.article-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.article-meta-row .article-tag {
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 100px;
    color: var(--accent-color);
}

.article-meta-row .article-tag--lang {
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.article-meta-row .article-tag--lang:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-color);
}

.article-back-link {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    transition: color 0.2s ease, gap 0.2s ease;
}

.article-back-link:hover {
    color: var(--accent-color);
    gap: 0.6rem;
}

.article-hero-image {
    margin: clamp(2rem, 5vw, 3rem) 0;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.18);
}

.article-hero-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* --- Long-form article typography (first use in the project) --- */
.article-prose {
    max-width: 68ch;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.article-prose > *:first-child {
    margin-top: 0;
}

.article-prose p {
    margin: 0 0 1.5em;
    color: var(--text-primary);
}

.article-prose h2 {
    font-family: var(--font-family-heading);
    font-weight: 400;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 2.25em 0 0.75em;
    color: var(--text-primary);
}

.article-prose h3 {
    font-family: var(--font-family-heading);
    font-weight: 500;
    font-size: clamp(1.2rem, 2.5vw, 1.45rem);
    line-height: 1.3;
    margin: 1.85em 0 0.65em;
    color: var(--text-primary);
}

.article-prose h2:first-child,
.article-prose h3:first-child {
    margin-top: 0;
}

.article-prose ul,
.article-prose ol {
    margin: 0 0 1.5em;
    padding-left: 1.35em;
    color: var(--text-primary);
}

.article-prose li {
    margin-bottom: 0.5em;
    line-height: 1.75;
}

.article-prose li > ul,
.article-prose li > ol {
    margin-top: 0.5em;
    margin-bottom: 0;
}

/* TEAM_Albert: accent-colored list markers — small brand detail */
.article-prose li::marker {
    color: var(--accent-color);
}

.article-prose strong {
    font-weight: 600;
    color: var(--text-primary);
}

.article-prose em {
    font-family: var(--font-family-accent, 'Cormorant Garamond', serif);
    font-style: italic;
}

.article-prose a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    transition: border-color 0.2s ease;
}

.article-prose a:hover {
    border-color: var(--accent-color);
}

.article-prose blockquote {
    margin: 2em 0;
    padding: 0.25em 0 0.25em 1.5em;
    border-left: 2px solid var(--accent-color);
    font-family: var(--font-family-accent, 'Cormorant Garamond', serif);
    font-style: italic;
    font-size: 1.25em;
    line-height: 1.6;
    color: var(--text-secondary);
}

.article-prose blockquote p:last-child {
    margin-bottom: 0;
}

.article-prose code {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.88em;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 0.15em 0.4em;
}

.article-prose pre {
    margin: 0 0 1.5em;
    padding: 1.25em;
    overflow-x: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
}

.article-prose pre code {
    background: none;
    border: none;
    padding: 0;
}

.article-prose hr {
    margin: 2.5em 0;
    border: none;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

/* TEAM_Albert: markdown tables had no base styling — mirrored .tool-table
   (gold hairlines, mono small-caps header); the mobile display:block/scroll
   override below stays for overflow */
.article-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2rem;
    font-size: 0.9rem;
}
.article-prose th,
.article-prose td {
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.article-prose th {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom-color: rgba(212, 175, 55, 0.3);
}

.article-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    margin: 0.5em 0 1.5em;
}

.article-footer {
    max-width: 68ch;
    margin: clamp(2.5rem, 6vw, 3.5rem) auto 0;
    padding-top: clamp(1.5rem, 4vw, 2rem);
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

/* --- Related articles (auto-picked by shared tags, see
   buildRelatedArticles() in build-insights.mjs) — mirrors the
   .insights-list row rhythm instead of introducing a separate card grid. --- */
.related-articles {
    max-width: 68ch;
    margin: clamp(2.5rem, 6vw, 3.5rem) auto 0;
    padding-top: clamp(1.5rem, 4vw, 2rem);
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.related-articles-title {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.related-articles-grid {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-article-card {
    border-top: 1px solid rgba(212, 175, 55, 0.12);
}

.related-article-card:last-child {
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.related-article-link {
    display: block;
    padding: 1.1rem 0;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.related-article-card:hover .related-article-link {
    transform: translateX(4px);
}

.related-article-tag {
    display: inline-block;
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-color);
    opacity: 0.85;
    margin-bottom: 0.4rem;
}

.related-article-title {
    font-family: var(--font-family-heading);
    font-weight: 400;
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0 0 0.35rem;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.related-article-card:hover .related-article-title {
    color: var(--accent-color);
}

.related-article-excerpt {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .related-article-card:hover .related-article-link {
        transform: none;
    }
}

/* --- Learning-path hub: progress tracker + read-state on module cards.
   Shared component (not scoped to one article) so any future topic hub
   built the same way — a curated path through existing articles — can
   reuse it without new CSS. Mirrors .check-progress (checkliste/) but as
   a real shared rule instead of a page-local inline <style>. --- */
.hub-progress {
    max-width: 68ch;
    margin: 0 auto clamp(2rem, 5vw, 2.5rem);
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 2px;
}

.hub-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.hub-progress-label strong {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.hub-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}

.hub-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.related-article-card.is-read .related-article-link {
    opacity: 0.72;
}

.related-article-tag .hub-read-badge {
    color: var(--text-secondary);
    opacity: 1;
    margin-left: 0.4em;
}

.related-article-tag .hub-read-badge::before {
    content: "✓ gelesen";
}

html[lang="en"] .related-article-tag .hub-read-badge::before {
    content: "✓ read";
}

/* --- Breadcrumb --- */
.article-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.article-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-breadcrumb a:hover {
    color: var(--accent-color);
}

.article-breadcrumb [aria-current] {
    color: var(--text-primary);
    max-width: 24ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Share links (reuse .article-tag) --- */
.article-share-link {
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.article-share-link:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-color);
}

/* --- Table of contents (only rendered for 3+ H2 sections) --- */
.article-toc {
    max-width: 68ch;
    margin: 0 auto clamp(2rem, 5vw, 3rem);
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 2px;
}

.article-toc-title {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

.article-toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-toc-link {
    position: relative;
    display: inline-block;
    padding-left: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.article-toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.article-toc-link:hover {
    color: var(--accent-color);
}

/* Set by initArticleTocScrollspyInline() (js/inline-init.js) via
   IntersectionObserver as the reader scrolls past each heading. */
.article-toc-link.is-active {
    color: var(--accent-color);
    font-weight: 500;
}

.article-toc-link.is-active::before {
    opacity: 1;
    transform: scale(1);
}

/* --- Author bio --- */
.article-author-bio {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.article-author-bio-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.25);
    object-fit: cover;
    flex-shrink: 0;
}

.article-author-bio-kicker {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.4rem;
}

.article-author-bio-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.article-author-bio-text p {
    margin: 0;
}

.article-author-bio-text a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    /* TEAM_Albert: was missing — border-color changed abruptly on hover */
    transition: border-color 0.2s ease, color 0.2s ease;
}

.article-author-bio-text a:hover {
    border-color: var(--accent-color);
}

/* --- Listing: tag filter + RSS link --- */
.insights-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.insights-tag-pill {
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: none;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 100px;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.insights-tag-pill:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.insights-tag-pill.is-active {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.insight-item.is-hidden {
    display: none;
}

.insights-rss-link {
    display: inline-flex;
    margin-top: clamp(1.5rem, 4vw, 2rem);
    font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.insights-rss-link:hover {
    color: var(--accent-color);
}

@media (max-width: 640px) {
    .article-author-bio {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* --- Mobile touch targets: breadcrumb links + tag pills (>=40px) --- */
@media (max-width: 768px) {
    .article-breadcrumb a {
        padding: 0.55rem 0.2rem;
    }
    /* flex children must shrink, otherwise max-width ellipsis on
       [aria-current] can't work (min-width:auto wins) -> page overflow */
    .article-breadcrumb > * {
        min-width: 0;
    }
    .insights-tag-pill {
        padding: 0.65rem 1.05rem;
    }
    .article-meta-row .article-tag,
    .article-share-link {
        padding: 0.6rem 0.9rem;
    }
    /* wide markdown tables scroll instead of breaking the layout */
    .article-prose table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
