/* ============================================================
 * Menevo News — design system
 *
 * Loaded by:
 *   - dashboard.html  (news widget only)
 *   - news.html       (index page: featured + archive + filters)
 *   - news-article.html (article detail page)
 *
 * Mobile-first. All breakpoints in `em` (40em / 48em / 64em).
 * Hover effects gated behind `(hover: hover) and (pointer: fine)`
 * so they don't trigger sticky-hover on touch devices.
 * Touch targets ≥ 2.75rem (44px) for every icon button.
 * ============================================================ */

/* ── 0. Hidden-attribute guard ─────────────────────────────────
 * The HTML `hidden` attribute relies on UA `[hidden] { display: none }`.
 * That rule has specificity (0,0,1,0) and is defeated by any author
 * rule that sets `display:` on the same element (e.g. `.news-loading
 * { display: flex }`). Without this guard, `el.hidden = true` from JS
 * leaves elements visible whenever they have an explicit display.
 * `!important` is needed so a later author rule can't reintroduce the
 * regression.
 * ----------------------------------------------------------- */
[hidden] { display: none !important; }

/* ── 1. Tokens (defaults — pages may override in :root) ────── */
:root {
    --news-bg:        #FDF3D7;
    --news-text:      #003E54;
    --news-accent:    #F9CD2D;
    --news-card-bg:   #FEFBF0;
    --news-line:      rgba(0, 62, 84, 0.12);
    --news-muted:     rgba(0, 62, 84, 0.65);
    --news-radius:    1rem;
    --news-radius-sm: 0.5rem;
    --news-radius-pill: 100vw;
    --news-shadow-hover: 0 0.5rem 1.25rem rgba(0, 62, 84, 0.15);
    --news-touch:     2.75rem;
}

/* ── 1. Card — base + variants ─────────────────────────────── */
.news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--news-card-bg);
    border: 0.125rem solid var(--news-line);
    border-radius: var(--news-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--news-text);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Featured + archive: fluid card width handled by their grid containers. */

.news-card--featured .news-card-title {
    font-size: clamp(1.05rem, 0.9rem + 0.5vi, 1.35rem);
    line-height: 1.25;
    font-weight: 700;
}

.news-card--archive .news-card-title {
    font-size: clamp(0.95rem, 0.85rem + 0.3vi, 1.15rem);
    line-height: 1.3;
    font-weight: 600;
}

/* Widget variant — vertical "card" inside dashboard's .section-box,
   sized as a sibling to a saved-trip card under the trips column.
   No own border (the wrapping .section-box already provides one);
   slightly shorter cover so total height roughly matches a trip card. */
.news-card--widget {
    border: none;
    border-radius: var(--news-radius-sm);
    background: transparent;
}
.news-card--widget .news-card-cover {
    aspect-ratio: 16 / 9;
    border-radius: var(--news-radius-sm);
    overflow: hidden;
}
.news-card--widget .news-card-body {
    padding: 0.875rem 0 0;
    gap: 0.5rem;
}
.news-card--widget .news-card-title {
    font-size: clamp(1rem, 0.9rem + 0.4vi, 1.2rem);
    line-height: 1.3;
    font-weight: 700;
    /* Cap at two lines so a long title doesn't push the widget past the
       trips column's natural height. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* ── 2. Cover — image / placeholder, with overlay slots ───── */
.news-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--news-bg);
    overflow: hidden;
    flex-shrink: 0;
}
.news-card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.news-card-cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--news-text);
    opacity: 0.55;
}
.news-card-cover--placeholder svg {
    width: 30%;
    max-width: 5rem;
    height: auto;
}

/* ── 3. Card body ─────────────────────────────────────────── */
.news-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem 1rem;
    flex: 1;
}
.news-card-title {
    margin: 0;
    color: var(--news-text);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.news-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.75rem;
    align-items: center;
    font-size: clamp(0.75rem, 0.7rem + 0.1vi, 0.85rem);
    color: var(--news-muted);
}
.news-card-meta-dot {
    width: 0.25rem; height: 0.25rem; border-radius: 50%;
    background: currentColor; opacity: 0.5;
    flex-shrink: 0;
}

/* ── 4. Category badge ─────────────────────────────────────── */
.news-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: var(--news-radius-pill);
    font-size: clamp(0.7rem, 0.65rem + 0.1vi, 0.8rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    white-space: nowrap;
    background: var(--news-text);
    color: var(--news-bg);
}
.news-badge--guides            { background: var(--news-accent); color: var(--news-text); }
.news-badge--stories           { background: var(--news-text);   color: var(--news-accent); }
.news-badge--behind_the_scenes { background: var(--news-text);   color: var(--news-bg); }
.news-badge--tips              { background: var(--news-text);   color: var(--news-bg); }

/* Badge as cover overlay (used in cards + widget) */
.news-card-cover .news-badge {
    position: absolute;
    top: 0.625rem;
    left: 0.625rem;
    z-index: 2;
}

/* ── 5. "Latest" badge — bottom-left of cover, featured only ── */
.news-latest-badge {
    position: absolute;
    bottom: 0.625rem;
    left: 0.625rem;
    z-index: 2;
    padding: 0.3rem 0.75rem;
    border-radius: var(--news-radius-pill);
    background: var(--news-accent);
    color: var(--news-text);
    font-size: clamp(0.7rem, 0.65rem + 0.1vi, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    line-height: 1;
}

/* ── 6. Bookmark button (cuoricino) ───────────────────────── */
.news-bookmark {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 3;
    min-width: var(--news-touch);
    min-height: var(--news-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    color: var(--news-text);
    border: 0.125rem solid var(--news-text);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.news-bookmark:active { transform: scale(0.94); }
.news-bookmark:focus-visible {
    outline: 0.125rem solid var(--news-accent);
    outline-offset: 0.125rem;
}
.news-bookmark svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill 0.12s ease;
}
.news-bookmark.is-saved {
    background: var(--news-accent);
    border-color: var(--news-accent);
}
.news-bookmark.is-saved svg { fill: var(--news-text); stroke: var(--news-text); }

/* ── 7. Toolbar (filter + saved) ──────────────────────────── */
.news-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0 1rem;
}
.news-toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

/* ── 8. Custom dropdown (categoria) ───────────────────────── */
.news-dropdown { position: relative; }
.news-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--news-touch);
    padding: 0 1rem;
    background: var(--news-card-bg);
    color: var(--news-text);
    border: 0.125rem solid var(--news-text);
    border-radius: var(--news-radius-pill);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.news-dropdown-trigger:focus-visible {
    outline: 0.125rem solid var(--news-accent);
    outline-offset: 0.125rem;
}
.news-dropdown-trigger svg {
    width: 0.875rem; height: 0.875rem;
    stroke: currentColor; fill: none;
    stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.18s ease;
}
.news-dropdown[data-open="true"] .news-dropdown-trigger { background: var(--news-accent); }
.news-dropdown[data-open="true"] .news-dropdown-trigger svg { transform: rotate(180deg); }

.news-dropdown-panel {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    z-index: 50;
    min-width: 14rem;
    padding: 0.375rem;
    background: var(--news-card-bg);
    border: 0.125rem solid var(--news-text);
    border-radius: var(--news-radius);
    box-shadow: 0 0.625rem 1.5rem rgba(0, 62, 84, 0.18);
    display: none;
}
.news-dropdown[data-open="true"] .news-dropdown-panel { display: block; }

.news-dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--news-touch);
    padding: 0 0.75rem;
    background: transparent;
    color: var(--news-text);
    border: none;
    border-radius: var(--news-radius-sm);
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    text-transform: lowercase;
}
.news-dropdown-option:hover { background: rgba(0, 62, 84, 0.08); }
.news-dropdown-option[aria-selected="true"] { background: var(--news-accent); font-weight: 700; }
.news-dropdown-option-check {
    width: 1rem; height: 1rem;
    stroke: var(--news-text); fill: none;
    stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
    opacity: 0;
    flex-shrink: 0;
}
.news-dropdown-option[aria-selected="true"] .news-dropdown-option-check { opacity: 1; }

/* ── 9. Saved toggle (cuoricino pill) ─────────────────────── */
.news-saved-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--news-touch);
    padding: 0 1rem;
    background: var(--news-card-bg);
    color: var(--news-text);
    border: 0.125rem solid var(--news-text);
    border-radius: var(--news-radius-pill);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}
.news-saved-toggle:focus-visible {
    outline: 0.125rem solid var(--news-accent);
    outline-offset: 0.125rem;
}
.news-saved-toggle svg {
    width: 1rem; height: 1rem;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    transition: fill 0.12s ease;
}
.news-saved-toggle.is-active {
    background: var(--news-accent);
}
.news-saved-toggle.is-active svg { fill: var(--news-text); }

/* ── 10. "Clear filter" indicator ─────────────────────────── */
.news-filter-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem 0.25rem 1rem;
    border-radius: var(--news-radius-pill);
    background: rgba(0, 62, 84, 0.08);
    color: var(--news-text);
    font-size: clamp(0.75rem, 0.7rem + 0.1vi, 0.85rem);
    font-weight: 600;
}
.news-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem; height: 1.5rem;
    margin-left: 0.125rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--news-text);
    cursor: pointer;
}
.news-filter-clear:hover { background: rgba(0, 62, 84, 0.15); }
.news-filter-clear svg {
    width: 0.875rem; height: 0.875rem;
    stroke: currentColor; fill: none;
    stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ── 11. Section label (Featured / Archive) ───────────────── */
.news-section-label {
    margin: 0 0 0.875rem;
    font-size: clamp(0.75rem, 0.7rem + 0.1vi, 0.875rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--news-muted);
}

/* ── 12. Grids — featured + archive (auto-fit) ────────────── */
.news-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}
.news-archive {
    display: grid;
    /* Fixed-column grid (not auto-fit) so 1 or 2 cards keep the same
       footprint as a full row instead of stretching to fill the width. */
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 40em) {
    .news-archive {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}
@media (min-width: 64em) {
    .news-featured {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    .news-archive {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

/* ── 13. Empty / loading states ───────────────────────────── */
.news-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--news-muted);
    font-size: clamp(1rem, 0.9rem + 0.4vi, 1.15rem);
}
.news-empty-strong { color: var(--news-text); font-weight: 700; }

.news-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}
.news-spinner {
    width: 2.5rem; height: 2.5rem;
    border: 0.1875rem solid rgba(0, 62, 84, 0.2);
    border-top-color: var(--news-text);
    border-radius: 50%;
    animation: news-spin 0.8s linear infinite;
}
@keyframes news-spin { to { transform: rotate(360deg); } }

/* ── 14. /news layout container ───────────────────────────── */
.news-page {
    padding: 1.5rem var(--content-pad, 4vw) 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
 * ARTICLE PAGE — /news-article.html?slug=...
 * Used by commit 4. Lives in the same file because the brief asks
 * for a single CSS file for all 3 surfaces.
 * ════════════════════════════════════════════════════════════ */

.article-page {
    max-width: 56rem;
    margin: 0 auto;
    padding-bottom: 3rem;
}

/* Cover — full-width on mobile, framed on larger screens. */
/* Top toolbar — back / bookmark / share. Lives above the article header
   instead of as an overlay on the cover image (so the cover can breathe
   and the title sits below the toolbar, not over the image). */
.article-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 0 0.5rem;
}
.article-toolbar-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
@media (max-width: 40em) {
    .article-toolbar { padding-left: 1rem; padding-right: 1rem; }
}

/* Cover — shorter than before (was aspect 16/9 ≈ 504px on max-width;
   now ≈ 320px capped). Sits between the article header and the body. */
.article-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 2;
    max-height: 20rem;
    background: var(--news-bg);
    overflow: hidden;
    margin-top: 1rem;
}
@media (min-width: 64em) {
    .article-cover { border-radius: var(--news-radius); }
}
.article-cover-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.article-cover--placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--news-text); opacity: 0.55;
}
.article-cover--placeholder svg { width: 6rem; height: auto; }

/* Excerpt / subtitle — sits between the cover and the body. Hidden by
   the `hidden` attribute (set from JS) when the article has no excerpt. */
.article-excerpt {
    margin: 1.5rem 0 0;
    font-size: clamp(1.05rem, 0.95rem + 0.35vi, 1.25rem);
    line-height: 1.55;
    color: var(--news-muted);
}
@media (max-width: 40em) {
    .article-excerpt { padding-left: 1rem; padding-right: 1rem; }
}

/* When the bookmark button is reused inside the article top toolbar,
   neutralise the absolute positioning it normally uses on a card cover.
   Without this, the button anchors itself to the top-right of its
   nearest positioned ancestor instead of joining the flex flow. */
.article-toolbar-right .news-bookmark {
    position: static;
    top: auto;
    right: auto;
}

.article-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--news-touch);
    min-height: var(--news-touch);
    background: rgba(255, 255, 255, 0.92);
    color: var(--news-text);
    border: 0.125rem solid var(--news-text);
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}
.article-icon-btn:hover { background: var(--news-accent); }
.article-icon-btn:focus-visible {
    outline: 0.125rem solid var(--news-accent); outline-offset: 0.125rem;
}
.article-icon-btn svg {
    width: 1.25rem; height: 1.25rem;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.article-header {
    /* No horizontal padding — title and meta line up with the cover edges
       (the cover already spans the .article-page max-width). On narrow
       viewports a small inset keeps text away from the screen edge. */
    padding: 1.5rem 0 0;
}
@media (max-width: 40em) {
    .article-header { padding-left: 1rem; padding-right: 1rem; }
}
.article-category {
    margin-bottom: 0.875rem;
}
.article-title {
    font-size: clamp(1.5rem, 1.1rem + 1.5vi, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--news-text);
    margin: 0 0 1rem;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    color: var(--news-muted);
    font-size: clamp(0.85rem, 0.78rem + 0.2vi, 0.95rem);
    margin-bottom: 1.5rem;
}
.article-author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--news-text);
    font-weight: 600;
}
.article-author-avatar {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--news-text);
    color: var(--news-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Body markdown — flush with the cover image; small inset on mobile only. */
.article-body {
    padding: 0;
    color: var(--news-text);
    font-size: clamp(1rem, 0.9rem + 0.3vi, 1.125rem);
    line-height: 1.7;
}
@media (max-width: 40em) {
    .article-body { padding-left: 1rem; padding-right: 1rem; }
}
.article-body > * + * { margin-top: 1rem; }
.article-body h2 {
    font-size: clamp(1.25rem, 1rem + 1vi, 1.625rem);
    font-weight: 700;
    margin-top: 2rem;
    line-height: 1.3;
}
.article-body h3 {
    font-size: clamp(1.1rem, 0.95rem + 0.5vi, 1.35rem);
    font-weight: 700;
    margin-top: 1.75rem;
    line-height: 1.35;
}
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--news-radius-sm);
    display: block;
    margin: 1.25rem auto;
}
.article-body a {
    color: var(--news-text);
    text-decoration: underline;
    text-decoration-thickness: 0.125rem;
    text-underline-offset: 0.2em;
}
.article-body a:hover { color: var(--news-accent); background: var(--news-text); padding: 0 0.125rem; border-radius: 0.125rem; }
.article-body blockquote {
    margin-left: 0;
    padding: 0.75rem 1.25rem;
    border-left: 0.25rem solid var(--news-accent);
    color: var(--news-muted);
    font-style: italic;
}
.article-body code {
    background: rgba(0, 62, 84, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.article-body pre {
    background: var(--news-text);
    color: var(--news-bg);
    padding: 1rem;
    border-radius: var(--news-radius-sm);
    overflow-x: auto;
}
.article-body pre code { background: transparent; color: inherit; padding: 0; }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li + li { margin-top: 0.375rem; }

/* Tag list */
.article-tags {
    padding: 1.5rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
@media (max-width: 40em) {
    .article-tags { padding-left: 1rem; padding-right: 1rem; }
}
.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.875rem;
    border-radius: var(--news-radius-pill);
    background: rgba(0, 62, 84, 0.08);
    color: var(--news-text);
    text-decoration: none;
    font-size: clamp(0.8rem, 0.75rem + 0.1vi, 0.9rem);
    font-weight: 600;
    text-transform: lowercase;
    transition: background 0.15s ease, color 0.15s ease;
}
.article-tag:hover { background: var(--news-text); color: var(--news-accent); }
.article-tag::before { content: "#"; opacity: 0.5; margin-right: 0.125rem; }

/* CTA box "Plan with Menevo" — same width as cover/body, with a small
   inset on mobile so it doesn't touch the screen edges. */
.article-cta-plan {
    margin: 2.5rem 0 0;
    padding: 1.75rem;
    background: var(--news-text);
    color: var(--news-bg);
    border-radius: var(--news-radius);
    text-align: center;
}
@media (max-width: 40em) {
    .article-cta-plan { margin-left: 1rem; margin-right: 1rem; }
}
.article-cta-plan h3 {
    color: var(--news-accent);
    font-size: clamp(1.1rem, 0.95rem + 0.5vi, 1.35rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.article-cta-plan p { margin-bottom: 1.25rem; opacity: 0.9; }
.article-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--news-touch);
    padding: 0 1.5rem;
    background: var(--news-accent);
    color: var(--news-text);
    border: none;
    border-radius: var(--news-radius-pill);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.article-cta-btn svg {
    width: 1rem; height: 1rem;
    stroke: currentColor; fill: none;
    stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Comments ────────────────────────────────────────────── */
.article-comments {
    margin-top: 2.5rem;
    padding: 0;
}
@media (max-width: 40em) {
    .article-comments { padding-left: 1rem; padding-right: 1rem; }
}
.article-comments-title {
    font-size: clamp(1.05rem, 0.95rem + 0.4vi, 1.25rem);
    font-weight: 700;
    margin-bottom: 1rem;
}
.article-comment {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 0.0625rem solid var(--news-line);
}
.article-comment:last-child { border-bottom: 0.0625rem solid var(--news-line); }
.article-comment-avatar {
    width: 2.25rem; height: 2.25rem;
    border-radius: 50%;
    background: var(--news-text);
    color: var(--news-accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
    font-size: 0.85rem;
}
.article-comment-body { flex: 1; min-width: 0; }
.article-comment-head {
    display: flex; flex-wrap: wrap;
    gap: 0.375rem 0.75rem;
    align-items: center;
    margin-bottom: 0.375rem;
}
.article-comment-name { font-weight: 700; color: var(--news-text); }
.article-comment-date { font-size: 0.8rem; color: var(--news-muted); }
.article-comment-text {
    color: var(--news-text); line-height: 1.5;
    word-wrap: break-word; overflow-wrap: anywhere;
}
.article-comment-actions {
    display: flex; gap: 0.5rem;
    margin-top: 0.375rem;
}
.article-comment-action-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    color: var(--news-muted);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}
.article-comment-action-btn:hover { color: var(--news-text); }

/* Composer */
.article-composer {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.article-composer-textarea {
    width: 100%;
    min-height: 6rem;
    padding: 0.875rem 1rem;
    background: var(--news-card-bg);
    color: var(--news-text);
    border: 0.125rem solid var(--news-line);
    border-radius: var(--news-radius-sm);
    font: inherit;
    line-height: 1.5;
    resize: vertical;
}
.article-composer-textarea:focus {
    outline: none;
    border-color: var(--news-text);
}
.article-composer-textarea:disabled {
    background: rgba(0, 62, 84, 0.04);
    cursor: not-allowed;
}
.article-composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.article-composer-hint { font-size: 0.85rem; color: var(--news-muted); }
.article-composer-submit {
    display: inline-flex;
    align-items: center;
    min-height: var(--news-touch);
    padding: 0 1.5rem;
    background: var(--news-text);
    color: var(--news-accent);
    border: none;
    border-radius: var(--news-radius-pill);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.article-composer-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Share popover ───────────────────────────────────────── */
.article-share-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 60;
    min-width: 12rem;
    padding: 0.375rem;
    background: var(--news-card-bg);
    border: 0.125rem solid var(--news-text);
    border-radius: var(--news-radius);
    box-shadow: 0 0.625rem 1.5rem rgba(0, 62, 84, 0.18);
    display: none;
}
.article-share-popover[data-open="true"] { display: block; }
.article-share-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: var(--news-touch);
    padding: 0 0.75rem;
    background: transparent;
    color: var(--news-text);
    border: none;
    border-radius: var(--news-radius-sm);
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.article-share-option:hover { background: rgba(0, 62, 84, 0.08); }
.article-share-option svg {
    width: 1.125rem; height: 1.125rem;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
 * Hover (desktop only) — ensures no sticky-hover on touch.
 * ════════════════════════════════════════════════════════════ */
@media (hover: hover) and (pointer: fine) {
    a.news-card:hover {
        transform: translateY(-0.1875rem); /* -3px */
        box-shadow: var(--news-shadow-hover);
    }
}

/* ════════════════════════════════════════════════════════════
 * Reduced motion — respect user preference.
 * ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-bookmark,
    .news-saved-toggle,
    .news-dropdown-trigger svg,
    .news-spinner {
        transition: none;
        animation: none;
    }
}

/* ════════════════════════════════════════════════════════════
 * Print — strip toolbars / comments / CTA from article output.
 * ════════════════════════════════════════════════════════════ */
@media print {
    .news-toolbar,
    .article-toolbar,
    .article-share-popover,
    .article-comments,
    .article-composer,
    .article-cta-plan {
        display: none !important;
    }
    .article-body { font-size: 11pt; line-height: 1.5; }
    .news-card { break-inside: avoid; }
}
