/* ================================================
   IFIS – Article CSS
   Lädt nach base.css
================================================ */


/* ------------------------------------------------
   Artikel-Container
------------------------------------------------ */

.article {
    padding-bottom: 3rem;
    padding-top: 0;
}


/* ------------------------------------------------
   Hero Image
   Spiegel-Style: above the fold, nicht dominant
------------------------------------------------ */

.hero {
    z-index: 1;
    height: clamp(180px, 30vw, 340px);
    overflow: hidden;

    margin-top: 0.1rem;
    margin-bottom: 0.1rem;

    width: 100%;
    position: relative;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.hero-label {
    position: absolute;
    bottom: 8px;
    right: 10px;

    font-size: 0.65rem;
    background: none;
    color: #fff;

    padding: 2px 6px;
    border-radius: 3px;
}

/* ------------------------------------------------
   Article Header (Editorial)
------------------------------------------------ */

.article-header {
    padding: 1.8rem 0 1rem;   /* ← kein seitliches padding, erbt vom .article */
    margin: 0;
}

.article-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    line-height: 1.25;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.article-subline {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.article-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0rem;
    margin-top: 0rem;
    opacity: 0.65;
    letter-spacing: 0.02em;
}

.article-intro {
    margin-top: 0.5rem;
    margin-bottom: 0.1rem; 
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text-primary);
    max-width: none;
}

.article-intro > * + * {
    margin-top: 0.5rem;
}

.article-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0rem;
}


/* ------------------------------------------------
   Share Links
------------------------------------------------ */

.article-share {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    margin: 0.6rem 0 1rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.article-share.bottom {
    margin-top: 2.5rem;
}

.article-share a {
    text-decoration: none;
    color: inherit;
    opacity: 0.8;
}

.article-share a:hover {
    opacity: 1;
    text-decoration: underline;
}



/* ------------------------------------------------
   Inhalt
------------------------------------------------ */

.article h2 {
    font-size: 1.2rem;
    margin: 2.5rem 0 1rem;
}

.article h3 {
    font-size: 1rem;
    margin: 1.8rem 0 0.6rem;
}

.article p {
    line-height: 1.6;
    margin-bottom: 0.9rem;
}

/* Anmerkungsziffern verschieben die Grundlinie, ohne die Zeilenhöhe zu ändern. */
.article-content sup {
    position: relative;
    top: -0.5em;
    vertical-align: baseline;
    font-size: 0.7em;
    line-height: 0;
}

.article p:first-of-type {
    margin-top: 0.5rem;
}

.article ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.article-author {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4rem;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.article p + h2 {
    margin-top: 3rem;
}

/* ------------------------------------------------
   Blockquotes
------------------------------------------------ */

.article blockquote {
    margin: 1.2rem 0;
    padding-left: 1rem;
    border-left: 3px solid #ccc;
    color: #444;
    font-style: italic;
}

.article blockquote.highlight {
    border-left: 4px solid #000;
    font-weight: 600;
    font-size: 1.05rem;
    margin: 1.5rem 0;
}

.article blockquote.final {
    margin-top: 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #222;
    font-style: normal;
}

/* ------------------------------------------------
   Related Articles
------------------------------------------------ */

.related-articles {
    margin-top: 5rem;
    padding-top: 2rem;

    border-top: 1px solid #ddd;
}

.related-articles h2 {
    margin-bottom: 1.5rem;
}

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

.related-articles li {
    margin-bottom: 0.75rem;
}

.related-articles a {
    text-decoration: none;
}

/* ------------------------------------------------
   CTA
------------------------------------------------ */

.article-cta {
    margin-top: 3rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-subtle);
    max-width: 520px;
}

.article-cta p {
    font-size: 0.95rem;
    color: #444;
    margin: 0;
}

.article-cta a {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
}

.article-cta a:hover {
    border-bottom: 1px solid #000;
}


/* ------------------------------------------------
   CHECKLIST
------------------------------------------------ */

.checklist {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.checklist li {
    margin-bottom: 0.5rem;
}

.checklist label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
}

.checklist input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    accent-color: var(--text-primary);
    transform: scale(1);
}

/* ------------------------------------------------
   Responsive


@media (max-width: 600px) {

    .hero {
        margin-left: -1rem;
        margin-right: -1rem;
        margin-bottom: 1rem;
        margin-top: 0.2rem;
        width: calc(100% + 2rem);
        height: 42vh;
    }

    .site-header-inner {
        margin-left: -0.9rem;
    }


    .article-header {
        padding: 1.2rem 0 0.8rem;
    }

    .article-header h1,
    .article-title {
        font-size: 1.4rem;
    }

}
------------------------------------------------ */

/* ================================================
   LIGHTBOX / ARTIKELBILDER
================================================ */

/* Markdown-Bilder innerhalb der Textbreite halten */

.article-content img {
    max-width: 100%;
    height: auto;
}

/* Wird erst durch das Lightbox-Skript aktiviert */

.ifis-lightbox-trigger {
    cursor: zoom-in;
}

.ifis-lightbox-trigger:focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 4px;
}

/* Das Bildlabel soll Bildklicks durchlassen */

.hero-label {
    pointer-events: none;
}

/* Dialog liegt außerhalb des normalen Seitenlayouts */

.ifis-lightbox {
    position: fixed;
    inset: 0;

    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;

    margin: 0;
    padding: 0;
    border: 0;

    background: transparent;
    color: #fff;
}

.ifis-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.92);
}

.ifis-lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        calc(68px + env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        max(24px, env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
}

.ifis-lightbox-image {
    display: block;

    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;

    object-fit: contain;
}

.ifis-lightbox-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));

    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;

    background: transparent;
    color: transparent;

    font-size: 0;

    cursor: pointer;
}

.ifis-lightbox-close::before,
.ifis-lightbox-close::after {
    content: "";
    position: absolute;

    top: 50%;
    left: 50%;

    width: 18px;
    height: 1.5px;

    background: #fff;
    border-radius: 1px;
}

.ifis-lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.ifis-lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@media (hover: hover) {
    .ifis-lightbox-close:hover {
        background: rgba(255, 255, 255, 0.10);
    }
}

.ifis-lightbox-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

html.ifis-lightbox-open,
html.ifis-lightbox-open body {
    overflow: hidden;
}

/* ================================================
   RESONANZ / HILFREICH
================================================ */

.ifis-article-actions-right {
    position: fixed;
    z-index: 850;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
}

.ifis-discussion-link {
    display: inline-flex;
    align-items: center;
    
    padding: 8px 10px;
    border: 1px solid rgba(128,128,128,.18);
    border-radius: 9px;
    background: var(--bg, rgba(255,255,255,.96));
    color: var(--text-muted);
    font-size: .78rem;
    line-height: 1.4;
    text-decoration: none;
}

.ifis-discussion-link:hover {
    color: var(--text-main);
}

.ifis-resonance {
    margin: 0;
    color: var(--text-muted);
}

.ifis-resonance[hidden] {
    display: none !important;
}

.ifis-resonance-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(128,128,128,.18);
    border-radius: 9px;
    background: var(--bg, rgba(255,255,255,.96));
    color: inherit;
    font: inherit;
    font-size: .78rem;
    line-height: 1.4;
    cursor: pointer;
    touch-action: manipulation;
}

.ifis-resonance-button:hover,
.ifis-resonance-button[aria-pressed="true"] {
    color: var(--text-main);
}

.ifis-resonance-button[aria-disabled="true"] {
    cursor: default;
}

.ifis-resonance-button:focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 3px;
}

.ifis-resonance-heart {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ifis-resonance-button[aria-pressed="true"] .ifis-resonance-heart {
    fill: currentColor;
}

.ifis-resonance-count {
    font-variant-numeric: tabular-nums;
}

/* Success is announced without adding visible text; errors remain readable. */
.ifis-resonance-status:not(.is-visible) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.ifis-resonance-status.is-visible {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ================================================
   QUELLEN UND WEITERFÜHRENDE FORSCHUNG
================================================ */

.article-sources {
    margin: 32px 0 22px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.article-sources-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 16px 0;

    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;

    cursor: pointer;
    list-style: none;
}

.article-sources-summary::-webkit-details-marker {
    display: none;
}

.article-sources-toggle {
    position: relative;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
}

.article-sources-toggle::before,
.article-sources-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;

    width: 12px;
    height: 1px;

    background: currentColor;

    transform: translate(-50%, -50%);
}

.article-sources-toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: transform 0.18s ease;
}

.article-sources[open] .article-sources-toggle::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

.article-sources-list {
    padding: 4px 0 24px;
}

.article-source {
    margin: 0;
    padding: 18px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.article-source-reference {
    line-height: 1.55;
}

.article-source-reference strong {
    display: block;
    font-size: 0.9rem;
}

.article-source-title {
    display: block;
    margin-top: 2px;

    font-size: 0.9rem;
    font-style: italic;
}

.article-source-journal {
    display: block;
    margin-top: 2px;

    font-size: 0.85rem;
    opacity: 0.65;
}

.article-source-description {
    margin: 8px 0 0;

    font-size: 0.85rem;
    line-height: 1.55;
    opacity: 0.78;
}

.article-source-link {
    display: inline-block;
    margin-top: 8px;

    font-size: 0.82rem;
    text-decoration: none;
}

.article-source-link:hover {
    text-decoration: underline;
}

/* Anmerkungen innerhalb des Quellenblocks */
.article-footnotes {
    margin: 0;
    padding: 18px 0 22px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    font-size: 0.85rem;
    line-height: 1.6;
}

.article-footnotes h2 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 600;
}

.article-footnotes ol {
    margin: 0;
    padding-left: 1.5rem;
    opacity: 0.8;
}

.article-footnotes li + li {
    margin-top: 8px;
}

.article-sources.has-footnotes .article-sources-list {
    padding-bottom: 0;
}

.article-sources.has-footnotes ~ .article-author {
    margin-top: 2rem;
}

/* Article contents */
.article-meta-row{position:relative;display:flex;align-items:center;gap:18px}
.article-meta{display:flex;align-items:center;gap:7px;overflow:visible;opacity:1}
.ifis-article-toc{position:relative;display:inline-block;color:var(--text-muted)}
.ifis-article-toc[hidden]{display:none}
.ifis-article-toc summary{display:flex;align-items:center;justify-content:center;width:20px;height:20px;margin:0;cursor:pointer;list-style:none;color:var(--text-muted);opacity:.65}
.ifis-article-toc summary::-webkit-details-marker{display:none}
.ifis-article-toc summary::before{content:'▼';font-size:9px;line-height:1;transform:none;transition:transform .16s ease}
.ifis-article-toc[open] summary::before{content:'▲';transform:none}
.ifis-article-toc-list{position:absolute;z-index:900;top:calc(100% + 8px);left:-2px;opacity:1;color:var(--text-main);width:min(360px,calc(100vw - 32px));padding:12px 14px;border:1px solid rgba(128,128,128,.16);border-radius:9px;background:var(--bg,#fff);box-shadow:0 10px 32px rgba(0,0,0,.10)}
.ifis-article-toc-list a{display:block;padding:6px 0;color:var(--text-main);font-size:.78rem;line-height:1.35;text-decoration:none}
.ifis-article-toc-list a[data-level="3"]{padding-left:14px;color:var(--text-muted);font-size:.74rem}
.ifis-article-toc-list a:hover{text-decoration:underline;text-underline-offset:3px}
@media(prefers-color-scheme:dark){.ifis-article-toc-list{background:#17191b;border-color:rgba(255,255,255,.12);box-shadow:0 10px 32px rgba(0,0,0,.35)}}

.article-header{position:relative;z-index:20;overflow:visible}
.article-meta-row{overflow:visible}
.ifis-article-toc[open] .ifis-article-toc-list{display:block}

.article-meta > :not(.ifis-article-toc):not(.ifis-article-neighbors){opacity:.65}

/* Article chronology from the date */
.ifis-article-neighbors{position:relative;display:inline-block}
.ifis-article-neighbors summary{cursor:pointer;list-style:none;opacity:1;color:var(--text-secondary)}
.ifis-article-neighbors summary::-webkit-details-marker{display:none}
.ifis-article-neighbors-list{position:absolute;z-index:900;top:calc(100% + 8px);left:0;width:min(330px,calc(100vw - 32px));padding:10px 13px;border:1px solid rgba(128,128,128,.16);border-radius:9px;background:var(--bg,#fff);box-shadow:0 10px 32px rgba(0,0,0,.10);opacity:1;color:var(--text-main)}
.ifis-article-neighbors-list a{display:block;padding:7px 0;color:inherit;font-size:.78rem;line-height:1.35;text-decoration:none}
.ifis-article-neighbors-list a+a{border-top:1px solid rgba(128,128,128,.12)}
.ifis-article-neighbors-list a span{display:block;margin-bottom:2px;color:var(--text-muted);font-size:.66rem;text-transform:uppercase;letter-spacing:.06em}
.ifis-article-neighbors-list a:hover{text-decoration:underline;text-underline-offset:3px}
@media(prefers-color-scheme:dark){.ifis-article-neighbors-list{background:#17191b;border-color:rgba(255,255,255,.12);box-shadow:0 10px 32px rgba(0,0,0,.35)}}

.ifis-article-neighbors-list{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:min(360px,calc(100vw - 32px))}
.ifis-article-neighbors-list a{padding:7px 0}
.ifis-article-neighbors-list a+a{border-top:0}
.ifis-article-neighbors-list a span{margin:0;font-size:.72rem;text-transform:none;letter-spacing:.02em}
.ifis-neighbor-prev{text-align:left}
.ifis-neighbor-next{text-align:right;grid-column:2}

.ifis-article-neighbors-list{background:#fff}
.ifis-article-neighbors-list a span{display:block;margin-bottom:3px;color:var(--text-muted);font-size:.66rem}

/* Article section navigation in the header arrow */
.ifis-header-toc{position:relative;display:inline-block}
.ifis-header-toc>summary{list-style:none;cursor:pointer}
.ifis-header-toc>summary::-webkit-details-marker{display:none}
.ifis-header-toc-list{position:absolute;z-index:1100;top:calc(100% + 10px);right:0;width:min(360px,calc(100vw - 32px));padding:12px 14px;border:1px solid rgba(128,128,128,.16);border-radius:9px;background:#fff;box-shadow:0 10px 32px rgba(0,0,0,.10);color:var(--text-main)}
.ifis-header-toc-list a{display:block;padding:6px 0;color:var(--text-main);font-size:.78rem;line-height:1.35;text-decoration:none}
.ifis-header-toc-list a[data-level="3"]{padding-left:14px;color:var(--text-muted);font-size:.74rem}
.ifis-header-toc-list a[data-level="4"]{padding-left:28px;color:var(--text-muted);font-size:.72rem}
.ifis-header-toc-list a:hover{text-decoration:underline;text-underline-offset:3px}
@media(prefers-color-scheme:dark){.ifis-header-toc-list{background:#17191b;border-color:rgba(255,255,255,.12);box-shadow:0 10px 32px rgba(0,0,0,.35)}}

/* Header section arrow is always visible on article pages */
.ifis-header-toc>.back-to-top{opacity:1}

@media(max-width:600px){
  .ifis-header-toc-list{
    position:fixed;
    top:72px;
    left:16px;
    right:16px;
    width:auto;
    max-width:none;
    box-sizing:border-box;
  }
}

/* Date chronology menu: explicit dark mode override (after light background rule) */
@media(prefers-color-scheme:dark){
  .ifis-article-neighbors-list{
    background:#17191b;
    color:var(--text-main);
    border-color:rgba(255,255,255,.12);
    box-shadow:0 10px 32px rgba(0,0,0,.35);
  }
}


/* Aktueller Artikel in der Übersichts-Sprungliste */
.ifis-header-toc--overview .ifis-header-toc-list a.is-active{
  font-weight:600;
  color:var(--text-main,#222);
  background:rgba(128,128,128,.08);
  border-radius:6px;
  margin:0 -6px;
  padding-left:6px;
  padding-right:6px;
}
@media(prefers-color-scheme:dark){
  .ifis-header-toc--overview .ifis-header-toc-list a.is-active{
    background:rgba(255,255,255,.07);
  }
}


/* Artikelübersicht: Sprungliste kompakt halten und intern scrollen */
.ifis-header-toc--overview .ifis-header-toc-list{
  max-height:min(62vh,560px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

@media(max-width:600px){
    .ifis-resonance-button{
        box-sizing:border-box;
        width:44px;
        min-width:44px;
        height:44px;
        padding:0;
        justify-content:center;
        gap:0;
    }
    .ifis-resonance-count{
        display:none;
    }
}

@media(max-width:600px){
    .ifis-article-actions-right{
        bottom:max(16px,env(safe-area-inset-bottom));
        align-items:flex-end;
        gap:8px;
    }
    .ifis-discussion-link{
        box-sizing:border-box;
        min-height:44px;
        height:44px;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        padding:0 10px;
    }
    .ifis-resonance-button{
        min-height:44px;
        height:44px;
    }
}


/* Zusätzlicher Scrollraum unter Artikeln für die schwebenden Bedienelemente */
article.article{
    padding-bottom:110px;
}
@media(max-width:600px){
    article.article{
        padding-bottom:190px;
    }
}

@media(max-width:600px){
    .ifis-article-actions-right{
        right:max(8px,env(safe-area-inset-right));
        bottom:max(8px,env(safe-area-inset-bottom));
    }
}

/* Keep long chapter lists reachable inside the viewport. */
.ifis-header-toc-list{
  box-sizing:border-box;
  max-height:calc(100vh - 100px);
  max-height:calc(100dvh - 100px - env(safe-area-inset-bottom));
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
@media(max-width:600px){
  .ifis-header-toc-list{
    max-height:calc(100vh - 88px);
    max-height:calc(100dvh - 88px - env(safe-area-inset-bottom));
  }
}
