/* assets/css/news.css
   ==========================================================================
   AIM Austria: News & Press
   Extends assets/css/style.css. Everything is driven by the same design
   tokens (light + dark), so no colours are hard-coded here except the
   reading-surface accent for links, which needs its own contrast tuning.
   ========================================================================== */

:root {
    --news-link: #1d4ed8;
    --news-link-hover: #1e3a8a;
    --news-code-bg: #f1f5f9;
    --news-quote-bg: #f8fafc;
    --news-surface: var(--bg-body);
    /* Table surfaces. Translucent so they read correctly on top of the card
       background in both themes. Do not reuse --news-quote-bg for these: in
       dark mode it is identical to --bg-card, which made the zebra stripes
       invisible. */
    --news-table-head: rgba(100, 116, 139, 0.09);
    --news-table-stripe: rgba(100, 116, 139, 0.045);
}

[data-theme="dark"] {
    --news-link: #7dd3fc;
    --news-link-hover: #bae6fd;
    --news-code-bg: #020617;
    --news-quote-bg: #0f172a;
    --news-table-head: rgba(148, 163, 184, 0.13);
    --news-table-stripe: rgba(148, 163, 184, 0.06);
}

/* ==========================================================================
   1. NAV STATE
   ========================================================================== */

.nav-item.is-active {
    color: var(--aim-blue);
}

.nav-item.is-active::after {
    width: 100%;
}

/* ==========================================================================
   2. INDEX: HERO
   ========================================================================== */

.news-hero {
    padding: 80px 0 56px 0;
    background: linear-gradient(to bottom, var(--bg-body), var(--bg-card));
    border-bottom: 1px solid var(--stroke);
}

.news-hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    margin: 18px 0 0 0;
    max-width: 20ch;
}

.news-hero-sub {
    margin-top: 20px;
    max-width: 62ch;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ==========================================================================
   3. INDEX: ARTICLE LIST
   ========================================================================== */

.news-list {
    padding: 64px 0 96px 0;
}

.news-grid {
    display: grid;
    gap: 24px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: var(--transition-medium);
}

.news-card:hover {
    border-color: var(--aim-blue);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.news-card h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    line-height: 1.25;
    margin: 14px 0 12px 0;
}

.news-card h2 a:hover {
    color: var(--aim-blue);
}

.news-card p {
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 75ch;
}

.news-card-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--news-link);
}

.news-card-more i {
    transition: transform var(--transition-fast);
}

.news-card-more:hover i {
    transform: translateX(4px);
}

.news-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.news-tag {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.news-empty {
    background: var(--bg-card);
    border: 1px dashed var(--stroke);
    border-radius: var(--radius-md);
    padding: 48px 32px;
    text-align: center;
    color: var(--text-muted);
    line-height: 1.7;
}

.news-feed-link {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.news-feed-link a {
    color: var(--news-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==========================================================================
   4. ARTICLE: SHELL
   ========================================================================== */

.news-article {
    /* Intentionally no background: the site's grid pattern lives on <body> in
       style.css, and painting an opaque colour here produced a visible seam
       where the grid stopped. Let it run through. */
    padding: 48px 0 96px 0;
}

/* --------------------------------------------------------------------------
   Element-selector reset.
   style.css styles the site chrome with bare element selectors (`header { }`,
   `nav { }`). Because these article components are real <header> / <nav>
   elements, those rules leak in. Each override below neutralises one leak.
   If you add markup here, check it against the element selectors in style.css:
   a, body, footer, h1-h4, header, html, img, nav, ul.
   -------------------------------------------------------------------------- */

.news-breadcrumb {
    display: flex;
    justify-content: flex-start; /* reset: `nav { justify-content: space-between }` */
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.news-breadcrumb a {
    color: var(--text-muted);
}

.news-breadcrumb a:hover {
    color: var(--news-link);
}

.news-breadcrumb span[aria-current] {
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40ch;
}

.news-article-head {
    /* Reset: `header { }` in style.css is for the sticky site header, and this
       element is a <header> too. Without this it renders as a sticky bar with
       the header background, a bottom border and 16px padding. */
    position: static;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: none;
    z-index: auto;
    padding: 0;
}

.news-article-head h1 {
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    line-height: 1.15;
    margin: 18px 0 0 0;
    max-width: 26ch;
}

.news-lead {
    margin-top: 22px;
    max-width: 68ch;
    font-size: 1.2rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.news-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--stroke);
    flex-wrap: wrap;
}

.news-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--stroke);
    flex: none;
}

.news-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.news-byline-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.news-byline-author {
    font-weight: 700;
    font-size: 0.95rem;
}

.news-byline-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.news-byline-meta {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.news-article-foot {
    margin-top: 72px;
}

/* ==========================================================================
   5. ARTICLE: LAYOUT (prose + sticky TOC)
   ========================================================================== */

.news-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 64px;
    margin-top: 48px;
    align-items: start;
}

.news-body-main {
    min-width: 0;
}

.news-prose {
    max-width: 68ch;
    font-size: 1.075rem;
    line-height: 1.75;
    color: var(--text-main);
}

.news-toc {
    display: block; /* reset: `nav { display: flex }` put the heading beside the list */
    position: sticky;
    top: 104px;
    border-left: 1px solid var(--stroke);
    padding-left: 24px;
}

.news-toc h2 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.news-toc ol {
    list-style: none;
    line-height: 1.5;
}

.news-toc li {
    margin-bottom: 10px;
}

.news-toc a {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.news-toc a:hover {
    color: var(--news-link);
}

/* ==========================================================================
   6. ARTICLE: PROSE
   ========================================================================== */

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

.news-prose p {
    margin: 0 0 1.4em 0;
}

.news-prose h2,
.news-prose h3,
.news-prose h4 {
    scroll-margin-top: 100px;
    line-height: 1.25;
}

.news-prose h2 {
    font-size: 1.75rem;
    margin: 2.4em 0 0.7em 0;
    padding-top: 1.2em;
    border-top: 1px solid var(--stroke);
}

.news-prose h3 {
    font-size: 1.3rem;
    margin: 2em 0 0.6em 0;
}

.news-prose h4 {
    font-size: 1.08rem;
    margin: 1.6em 0 0.5em 0;
}

.news-prose ul,
.news-prose ol {
    margin: 0 0 1.4em 0;
    padding-left: 1.5em;
}

.news-prose ul {
    list-style: disc;
}

.news-prose ol {
    list-style: decimal;
}

.news-prose li {
    margin-bottom: 0.55em;
    padding-left: 0.2em;
}

.news-prose li > ul,
.news-prose li > ol {
    margin: 0.55em 0 0 0;
}

.news-prose strong {
    font-weight: 700;
}

.news-prose a {
    color: var(--news-link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.news-prose a:hover {
    color: var(--news-link-hover);
    text-decoration-thickness: 2px;
}

.news-anchor {
    margin-left: 0.4em;
    font-size: 0.75em;
    color: var(--text-muted);
    opacity: 0;
    text-decoration: none !important;
    transition: opacity var(--transition-fast);
}

.news-prose h2:hover .news-anchor,
.news-prose h3:hover .news-anchor,
.news-anchor:focus-visible {
    opacity: 1;
}

.news-prose blockquote {
    margin: 1.8em 0;
    padding: 20px 24px;
    background: var(--news-quote-bg);
    border-left: 3px solid var(--aim-red);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.news-prose blockquote p {
    margin: 0;
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-main);
}

.news-prose code {
    font-family: var(--font-mono);
    font-size: 0.87em;
    background: var(--news-code-bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 0.15em 0.4em;
}

.news-prose pre.news-code {
    margin: 1.8em 0;
    padding: 20px;
    background: var(--news-code-bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    overflow-x: auto;
    line-height: 1.6;
}

.news-prose pre.news-code code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
}

.news-prose img {
    border-radius: var(--radius-md);
    border: 1px solid var(--stroke);
    margin: 1.8em 0;
}

.news-prose hr {
    margin: 2.6em 0;
    border: none;
    border-top: 1px solid var(--stroke);
}

/* --------------------------------------------------------------------------
   Tables
   The page background is a 40px grid painted on <body>, so a transparent
   table reads as graph paper. Every table surface needs a solid background.
   -------------------------------------------------------------------------- */

.news-table-wrap {
    margin: 1.8em 0;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
}

.news-prose table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    font-size: 0.92rem;
}

.news-prose th,
.news-prose td {
    padding: 12px 18px;
    text-align: left;
    vertical-align: baseline;
    border-bottom: 1px solid var(--stroke);
}

.news-prose thead th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    background: var(--news-table-head);
    white-space: nowrap;
}

.news-prose tbody tr:last-child th,
.news-prose tbody tr:last-child td {
    border-bottom: none;
}

/* Data tables: zebra striping and a tabular numeric column. */
.news-prose tbody tr:nth-child(even) {
    background: var(--news-table-stripe);
}

.news-prose tbody td + td {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Key/value tables (an empty markdown header row): a muted label column and
   a single emphasised value column. */
.news-table-kv th[scope='row'] {
    width: 55%;
    font-weight: 400;
    font-size: 0.95em;
    color: var(--text-muted);
}

.news-table-kv td {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ==========================================================================
   7. ARTICLE: CALLOUTS
   ========================================================================== */

.news-takeaways {
    max-width: 68ch;
    margin: 0 0 44px 0;
    padding: 28px 32px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-left: 3px solid var(--aim-red);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.news-takeaways h2 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--aim-red);
    margin-bottom: 16px;
}

.news-takeaways ul {
    list-style: none;
}

.news-takeaways li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.news-takeaways li:last-child {
    margin-bottom: 0;
}

.news-takeaways li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aim-red);
}

.news-sources {
    margin-bottom: 48px;
}

.news-sources h2,
.news-authorbox h2,
.news-cta h2 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.news-sources ul {
    list-style: none;
    font-size: 0.9rem;
}

.news-sources li {
    padding: 10px 0;
    border-bottom: 1px solid var(--stroke);
    color: var(--text-muted);
    line-height: 1.6;
}

.news-sources li:last-child {
    border-bottom: none;
}

.news-sources a {
    color: var(--news-link);
    word-break: break-word;
}

.news-authorbox {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 28px 32px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.news-authorbox .news-avatar {
    width: 56px;
    height: 56px;
}

.news-authorbox h2 {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-main);
    margin-bottom: 4px;
}

.news-authorbox-role {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.news-authorbox p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.news-authorbox a {
    color: var(--news-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.news-cta {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
}

.news-cta p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 20px;
    max-width: 55ch;
}

.news-cta .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* ==========================================================================
   9. SUBSCRIBE PAGE
   ========================================================================== */

.news-subscribe {
    padding: 56px 0 96px 0;
}

.sub-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: start;
}

.sub-card {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 32px;
}

.sub-card-primary {
    border-left: 3px solid var(--aim-red);
}

.sub-card-muted {
    border-style: dashed;
}

.sub-card h2 {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.sub-card > p {
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 22px;
    max-width: 52ch;
}

.sub-status {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.sub-msg {
    display: none;
    margin-top: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.sub-feeds-block {
    margin-top: 64px;
}

/* Shown when no card channels are live yet, so the page does not look
   accidentally empty above the feeds. */
.sub-notice {
    padding: 26px 30px;
    background: var(--news-quote-bg);
    border-left: 3px solid var(--aim-red);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    max-width: 72ch;
}

.sub-notice strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.sub-notice p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}
.sub-feeds-block h2 {
    font-size: 1.75rem;
    margin-bottom: 14px;
}

.sub-intro {
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 70ch;
    margin-bottom: 28px;
}

.sub-feeds {
    display: grid;
    gap: 16px;
}

.sub-feed {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    /* Grid items default to min-width:auto, so without this the feed URL
       (a single nowrap line) forces the item to its min-content width and it
       overflows the grid on narrow screens. */
    min-width: 0;
}

.sub-feed-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.sub-feed-head strong {
    font-size: 1.05rem;
    font-weight: 700;
}

.sub-feed-head span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sub-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--aim-red);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.sub-feed p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 14px;
    max-width: 65ch;
}

.sub-copy {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.sub-feed-url {
    flex: 1 1 260px;
    min-width: 0;
    padding: 10px 14px;
    background: var(--news-code-bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-main);
    overflow-x: auto;
    white-space: nowrap;
}

.sub-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sub-copy-btn:hover {
    border-color: var(--aim-blue);
    color: var(--news-link);
}

.sub-copy-btn.is-copied {
    border-color: #22c55e;
    color: #22c55e;
}

.sub-readers {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 0.82rem;
}

.sub-readers a {
    color: var(--news-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sub-note {
    margin-top: 32px;
    padding: 22px 26px;
    background: var(--news-quote-bg);
    border-left: 3px solid var(--stroke);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 80ch;
}

.sub-note strong {
    color: var(--text-main);
}

/* ==========================================================================
   10. RESPONSIVE
   ========================================================================== */

@media (max-width: 1000px) {
    .news-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
    }

    .news-toc {
        position: static;
        border-left: none;
        border-top: 1px solid var(--stroke);
        padding: 24px 0 0 0;
        order: -1;
    }

    .news-toc ol {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 20px;
    }

    .news-toc li {
        margin-bottom: 0;
    }
}

@media (max-width: 650px) {
    .news-hero {
        padding: 56px 0 40px 0;
    }

    .sub-grid {
        grid-template-columns: 1fr;
    }

    .sub-card,
    .sub-feed {
        padding: 22px 24px;
    }

    /* Wrap the feed URL instead of giving it a horizontal scrollbar, so the
       whole address is visible and copyable on a phone. */
    .sub-feed-url {
        white-space: normal;
        word-break: break-all;
        overflow-wrap: anywhere;
    }

    /* Full-width action row: a comfortable tap target, stacked under the URL. */
    .sub-copy-btn {
        flex: 1 0 100%;
        justify-content: center;
    }

    .news-card {
        padding: 24px;
    }

    .news-byline-meta {
        margin-left: 0;
        width: 100%;
    }

    .news-takeaways,
    .news-authorbox,
    .news-cta {
        padding: 22px 24px;
    }

    .news-authorbox {
        flex-direction: column;
    }

    .news-prose {
        font-size: 1.02rem;
    }
}
