﻿/* ===============================
   Details.cshtml.css (Mobile-first)
   =============================== */

:root {
    --bg: #fff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #7366ff;
    --radius: 18px;
    --shadow: 0 10px 28px rgba(0,0,0,.07);
    --container: 1400px;
    --gutter: 16px;
    --progress-h: 4px;
    /* if you have a fixed header, adjust this */
    --sticky-top: 90px;
}
 
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.zoomg-article-layout,
.details-grid,
.details-main,
.details-aside,
.article-card,
.article-content {
    min-width: 0;
}

/* ===============================
   Progress Bar
   =============================== */
.reading-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--progress-h);
    background: rgba(17,24,39,.10);
    z-index: 1000;
}

.reading-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #22c55e);
}

/* ===============================
   Outer spacing
   =============================== */
.zoomg-article-layout {
    padding-top: calc(var(--progress-h) + 16px);
    padding-inline: var(--gutter);
    padding-bottom: 32px;
    max-width: var(--container);
    margin-inline: auto;
}

/* breadcrumb spacing */
.breadcrumb-wrap {
    margin-bottom: 16px;
}

/* ===============================
   Mobile-first grid
   =============================== */
.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

/* Desktop: two columns */
@media (min-width: 992px) {
    .details-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 22px;
    }
}

/* ===============================
   Article Card
   =============================== */
.article-card {
    background: #fff;
    border: 1px solid rgba(17,24,39,.10);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.article-header {
    padding: 16px;
    padding-bottom: 10px;
}

@media (min-width: 992px) {
    .article-header {
        padding: 22px;
        padding-bottom: 12px;
    }
}

.article-title {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 2.8vw, 2rem);
    line-height: 1.25;
    letter-spacing: -.02em;
}

.article-subtitle {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: .92rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

    .meta-item i {
        color: var(--primary);
    }

/* hero image */
.article-hero {
    margin: 0;
}

.main-article-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    max-height: 56vh;
}

/* excerpt */
.article-excerpt {
    margin: 12px 16px 0;
    padding: 10px 12px;
    font-weight: 800;
    line-height: 1.9;
    border-inline-end: 4px solid #ef4444;
    background: rgba(239,68,68,.06);
    border-radius: 12px;
}

@media (min-width: 992px) {
    .article-excerpt {
        margin: 12px 22px 0;
    }
}

/* content */
.article-content {
    padding: 16px;
    font-size: 1rem;
    line-height: 1.95;
    color: var(--text);
    overflow-wrap: anywhere; /* prevents long strings from breaking layout */
}

@media (min-width: 992px) {
    .article-content {
        padding: 18px 22px 22px;
    }
}

/* images inside content (Model.Content) */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    margin: 14px auto;
    border-radius: 14px;
}

/* tables: wrap friendly if you add .table-wrap around tables in content.
   If you can't, we still avoid overflow by making table block-scrollable. */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 14px 0;
}

.article-content th,
.article-content td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    vertical-align: top;
    white-space: nowrap; /* prevents ugly breaks; table becomes scrollable */
}

/* tags */
.article-tags {
    padding: 16px;
    border-top: 1px solid var(--border);
}

@media (min-width: 992px) {
    .article-tags {
        padding: 18px 22px;
    }
}

.tags-title {
    margin: 0 0 10px;
    font-weight: 800;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fafafa;
    color: #374151;
    text-decoration: none;
    font-size: .9rem;
}

    .tag-chip:hover {
        background: #f3f4f6;
    }

/* ===============================
   Aside (multi-piece)
   =============================== */
.details-aside {
    min-width: 0;
}

.aside-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

/* Sticky only on desktop (better UX) */
@media (min-width: 992px) {
    .details-aside {
        position: sticky;
        top: var(--sticky-top);
        align-self: start;
    }
}

/* Aside card */
.aside-card {
    border: 1px solid rgba(17,24,39,.10);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 14px;
    overflow: hidden;
}

    /* keep component content from overflowing */
    .aside-card * {
        min-width: 0;
    }

.aside-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.aside-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

/* If the related component renders its own cards/links, help them fit */
.aside-card--related a {
    text-decoration: none;
}
/* ======================================
   Article detail — polished reading UI
   ====================================== */

.article-card {
    border-color: rgba(99, 102, 241, .10);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

.article-header {
    background: radial-gradient(circle at top right, rgba(115, 102, 255, .12), transparent 34%), linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
}

.article-title {
    font-weight: 900;
    font-size: clamp(1.7rem, 4vw, 2.65rem);
    line-height: 1.5;
    color: #172033;
}

.article-meta {
    gap: 8px;
    border-bottom: 0;
    margin-bottom: 18px;
    padding-bottom: 0;
}

.meta-item {
    padding: 7px 10px;
    border: 1px solid rgba(99, 102, 241, .13);
    border-radius: 999px;
    background: rgba(248, 250, 252, .92);
    color: #4b5563;
    font-size: .82rem;
    transition: border-color .2s ease, background-color .2s ease;
}

    .meta-item:hover {
        border-color: rgba(115, 102, 255, .38);
        background: #fff;
    }

    .meta-item a {
        color: #374151;
        font-weight: 700;
    }

.author-avatar {
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .16);
}

.article-hero {
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    background: #eef2ff;
}

.main-article-image {
    transition: transform .45s ease;
}

.article-hero:hover .main-article-image {
    transform: scale(1.015);
}

.article-insight-card,
.article-conversational-card,
.article-key-entities,
.article-faqs,
.article-sources {
    margin: 28px 16px 0;
}

.preferred-source-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0 24px;
    padding: 14px 16px;
    border: 1px solid #e6e9f0;
    border-radius: 16px;
    background: #fff;
}

.preferred-source-card__content,
.preferred-source-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preferred-source-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    background: #f1f3f4;
    color: #4285f4;
    font-size: 1.1rem;
}

.preferred-source-card h2,
.preferred-source-card p {
    margin: 0;
}

.preferred-source-card h2 {
    color: #202124;
    font-size: .95rem;
    font-weight: 800;
}

.preferred-source-card p {
    margin-top: 4px;
    color: #6b7280;
    font-size: .8rem;
    line-height: 1.8;
}

.preferred-source-card__fallback {
    color: #4f46e5;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.preferred-source-card__fallback:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 767.98px) {
    .preferred-source-card {
        align-items: stretch;
        flex-direction: column;
    }

    .preferred-source-card__actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .preferred-source-card__fallback {
        white-space: normal;
    }
}

.article-insight-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(99, 102, 241, .16);
    border-right: 4px solid var(--primary);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(115, 102, 255, .10), rgba(255, 255, 255, .96) 52%), #fff;
    box-shadow: 0 10px 24px rgba(99, 102, 241, .08);
}

    .article-insight-card::before {
        content: "";
        position: absolute;
        width: 120px;
        height: 120px;
        top: -65px;
        left: -45px;
        border-radius: 50%;
        background: rgba(115, 102, 255, .10);
    }

    .article-insight-card h2,
    .article-conversational-card h2,
    .article-key-entities h2,
    .article-faqs h2,
    .article-sources h2 {
        color: #1f2937;
    }

    .article-insight-card p {
        position: relative;
        line-height: 2;
    }

.article-conversational-card {
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

    .article-conversational-card p {
        margin: 0;
        color: #4b5563;
        line-height: 2;
    }

.article-key-entities {
    padding: 20px;
    border: 1px solid #edf0f6;
    border-radius: 16px;
    background: #fafbff;
}

    .article-key-entities .badge {
        font-size: .85rem;
        border-color: #e1e5ff !important;
        background: #fff !important;
        color: #4f46e5 !important;
        transition: transform .2s ease, border-color .2s ease;
    }

        .article-key-entities .badge:hover {
            transform: translateY(-2px);
            border-color: #a5b4fc !important;
        }

.article-content {
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    line-height: 2.15;
}

    .article-content :is(h2, h3, h4) {
        margin-top: 2.2em;
        color: #172033;
        font-weight: 900;
        line-height: 1.6;
        scroll-margin-top: 110px;
    }

    .article-content h2 {
        padding-right: 14px;
        border-right: 4px solid var(--primary);
        font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    }

    .article-content h3 {
        font-size: clamp(1.15rem, 2vw, 1.4rem);
    }

    .article-content a {
        color: #5b50dd;
        font-weight: 700;
        text-decoration-color: rgba(91, 80, 221, .35);
        text-underline-offset: 3px;
    }

    .article-content blockquote {
        margin: 1.6rem 0;
        padding: 16px 18px;
        border-right: 4px solid #f59e0b;
        border-radius: 12px;
        background: #fffbeb;
        color: #78350f;
    }

.article-faqs {
    padding-top: 28px;
    border-top: 1px solid #edf0f6;
}

    .article-faqs .accordion-item {
        overflow: hidden;
        margin-bottom: 10px;
        border: 1px solid #e8eaf1;
        border-radius: 14px !important;
    }

    .article-faqs .accordion-button {
        font-weight: 800;
        line-height: 1.8;
        background: #fff;
        box-shadow: none;
    }

        .article-faqs .accordion-button:not(.collapsed) {
            color: #4f46e5;
            background: #f5f5ff;
        }

    .article-faqs .accordion-body {
        color: #4b5563;
        line-height: 2;
    }

.article-sources {
    padding: 24px 20px;
    border: 1px solid #e6e9f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #fafcff);
}

    .article-sources ol {
        padding-right: 1.25rem;
        padding-left: 0;
    }

    .article-sources li {
        padding: 9px 0;
        color: #6b7280;
    }

    .article-sources a {
        color: #4338ca;
        font-weight: 700;
        text-underline-offset: 3px;
    }

.article-tags {
    margin-top: 28px !important;
    background: #fcfcff;
}

.tag-chip {
    border-color: #e4e7f0;
    background: #fff;
    color: #4b5563;
    transition: transform .2s ease, border-color .2s ease, color .2s ease;
}

    .tag-chip:hover {
        transform: translateY(-2px);
        border-color: #a5b4fc;
        background: #fff;
        color: #4f46e5;
    }

.aside-card {
    border-color: #eceef6;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

@media (min-width: 992px) {
    .article-insight-card,
    .article-conversational-card,
    .article-key-entities,
    .article-faqs,
    .article-sources {
        margin-right: 22px;
        margin-left: 22px;
    }
}

@media (max-width: 575.98px) {
    .zoomg-article-layout {
        padding-inline: 10px;
    }

    .article-header {
        padding: 14px;
    }

    .article-title {
        font-size: 1.55rem;
    }

    .article-meta {
        gap: 7px;
    }

    .meta-item {
        font-size: .76rem;
        padding: 6px 8px;
    }

    .article-insight-card,
    .article-conversational-card,
    .article-key-entities,
    .article-faqs,
    .article-sources {
        margin-right: 14px;
        margin-left: 14px;
    }

    .article-content {
        padding: 16px 14px 20px;
        line-height: 2.05;
    }
}
/* ===============================
   Article comments
   =============================== */

.article-comments {
    width: min(100%, 900px);
    margin: 36px auto 0;
    padding: clamp(18px, 4vw, 34px);
    border: 1px solid #e8eaf1;
    border-radius: 24px;
    background: radial-gradient(circle at top right, rgba(115, 102, 255, .09), transparent 31%), #fff;
    box-shadow: 0 14px 38px rgba(15, 23, 42, .06);
}

.comments-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid #eceef5;
}

.comments-header__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #7366ff;
    font-size: .8rem;
    font-weight: 800;
}

.comments-header h2 {
    margin: 0;
    color: #172033;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 900;
}

.comments-count {
    flex: 0 0 auto;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f0efff;
    color: #5146d6;
    font-size: .82rem;
    font-weight: 800;
}

.comment-list,
.comment-replies {
    padding: 0;
    margin: 0;
    list-style: none;
}

.comment-item + .comment-item {
    margin-top: 14px;
}

.comment-card {
    padding: 16px;
    border: 1px solid #e8eaf1;
    border-radius: 18px;
    background: #fff;
}

.comment-card__header {
    display: flex;
    align-items: center;
    gap: 11px;
}

.comment-avatar {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #7366ff, #9b93ff);
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
}

.comment-author {
    display: grid;
    gap: 2px;
}

    .comment-author strong {
        color: #202a3d;
        font-size: .94rem;
    }

    .comment-author time {
        color: #7b8494;
        font-size: .78rem;
    }

.comment-card__body {
    margin-top: 14px;
    color: #3d4758;
    font-size: .95rem;
    line-height: 2;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.comment-card__footer {
    margin-top: 12px;
}

.comment-reply-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #5d52df;
    font-size: .85rem;
    font-weight: 800;
}

    .comment-reply-button:hover {
        color: #3f34c9;
    }

.comment-replies {
    margin-top: 12px;
    margin-right: clamp(12px, 4vw, 42px);
    padding-right: 14px;
    border-right: 2px solid #e4e1ff;
}

    .comment-replies .comment-card {
        background: #fafaff;
    }

.comments-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border: 1px dashed #d8dbe6;
    border-radius: 16px;
    background: #fcfcff;
    color: #667085;
}

    .comments-empty i {
        color: #7366ff;
        font-size: 1.7rem;
    }

    .comments-empty h3,
    .comments-empty p {
        margin: 0;
    }

    .comments-empty h3 {
        color: #344054;
        font-size: 1rem;
        font-weight: 800;
    }

    .comments-empty p {
        margin-top: 4px;
        font-size: .88rem;
    }

.comment-composer {
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid #eceef5;
}

.comment-composer__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-composer__icon,
.comments-login__icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 14px;
    background: #eeedff;
    color: #5d52df;
    font-size: 1.2rem;
}

.comment-composer__head h3,
.comment-composer__head p {
    margin: 0;
}

.comment-composer__head h3 {
    color: #202a3d;
    font-size: 1rem;
    font-weight: 900;
}

.comment-composer__head p {
    margin-top: 4px;
    color: #7b8494;
    font-size: .84rem;
}

.comment-composer textarea {
    min-height: 130px;
    resize: vertical;
    border-color: #dfe3ed;
    border-radius: 14px;
    box-shadow: none;
    line-height: 1.9;
}

    .comment-composer textarea:focus {
        border-color: #8b83ff;
        box-shadow: 0 0 0 .22rem rgba(115, 102, 255, .13);
    }

.comment-composer__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: #7b8494;
    font-size: .8rem;
}

.comment-submit,
.comments-login__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border: 0;
    border-radius: 12px;
    background: #7366ff;
    color: #fff;
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
}

    .comment-submit:hover,
    .comments-login__button:hover {
        background: #5d52df;
        color: #fff;
    }

.reply-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #dcd9ff;
    border-radius: 12px;
    background: #f7f6ff;
    color: #5146d6;
    font-size: .86rem;
    font-weight: 700;
}

.reply-notice__cancel {
    border: 0;
    background: transparent;
    color: #b42318;
    font-size: .8rem;
}

.comments-login {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e3e1ff;
    border-radius: 16px;
    background: #fafaff;
}

    .comments-login h3,
    .comments-login p {
        margin: 0;
    }

    .comments-login h3 {
        color: #202a3d;
        font-size: 1rem;
        font-weight: 900;
    }

    .comments-login p {
        margin-top: 4px;
        color: #667085;
        font-size: .84rem;
    }

.comments-login__button {
    margin-right: auto;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .article-comments {
        margin-top: 22px;
        padding: 16px;
        border-radius: 18px;
    }

    .comments-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .comment-card {
        padding: 13px;
        border-radius: 14px;
    }

    .comment-replies {
        margin-right: 12px;
        padding-right: 9px;
    }

    .comment-composer__footer,
    .comments-login {
        align-items: stretch;
        flex-direction: column;
    }

    .comment-submit,
    .comments-login__button {
        width: 100%;
    }

    .comments-login__button {
        margin-right: 0;
    }
}

.zoomg-article-layout {
    padding-top: clamp(28px, 4vw, 64px);
}

.zoomg-article-layout .article-header {
    padding: clamp(20px, 3vw, 36px);
}

.zoomg-article-layout .article-title {
    font-size: clamp(1.25rem, 2.1vw, 1.75rem);
    font-weight: 800;
    line-height: 1.75;
    letter-spacing: normal;
    margin-bottom: 20px;
}

.zoomg-article-layout .article-subtitle {
    color: #526078;
    line-height: 2;
}

.zoomg-article-layout .article-content {
    max-width: 78ch;
    margin-inline: auto;
    padding: clamp(20px, 3vw, 36px);
    font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
    font-weight: 400;
    line-height: 2.15;
    color: #293449;
    text-align: start;
    letter-spacing: normal;
    word-spacing: normal;
}

.zoomg-article-layout .article-content :is(p, li) {
    line-height: inherit;
}

.zoomg-article-layout .article-content p {
    margin-block: 0 1.25em;
}

.zoomg-article-layout .article-content :is(h2, h3, h4, h5, h6) {
    margin-block: 1.8em .8em;
    font-weight: 750;
    line-height: 1.8;
    letter-spacing: normal;
}

.zoomg-article-layout .article-content :is(ul, ol) {
    padding-inline-start: 1.6em;
    margin-block: 1em 1.5em;
}

.zoomg-article-layout .article-content li + li {
    margin-top: .55em;
}

.zoomg-article-layout .article-content a {
    text-decoration: underline;
    text-underline-offset: .25em;
}

.zoomg-article-layout .article-content :is(figcaption, caption) {
    font-size: .85em;
    color: #637087;
    line-height: 1.9;
    text-align: center;
}

.zoomg-article-layout .article-content pre {
    direction: ltr;
    text-align: left;
    overflow-x: auto;
    padding: 18px;
    border-radius: 12px;
    background: #f4f6fb;
}

@media (max-width: 575px) {
    .zoomg-article-layout { padding-inline: 12px; }
    .zoomg-article-layout .article-header,
    .zoomg-article-layout .article-content { padding: 20px 16px; }
    .zoomg-article-layout .article-meta { gap: 8px; }
}
