/* NetPro News — Google Discover style (Light) */
#news-root {
    --news-bg: #f8fafc;
    --news-card-bg: #ffffff;
    --news-tab-bg: #f1f5f9;
    --news-accent: #1a73e8;
    --news-text: #0f172a;
    --news-muted: #64748b;
    --news-body: #334155;
    height: 100%;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--news-text);
    background: var(--news-bg);
}

.news-discover {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--news-bg);
    position: relative;
    overflow: hidden;
}

.news-discover__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.news-discover__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--news-text);
    letter-spacing: -0.01em;
}

.news-discover__icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    color: #334155;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: background 0.15s, border-color 0.15s;
}

.news-discover__icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.news-discover__cats-wrap {
    position: absolute;
    top: 3.25rem;
    left: 0;
    right: 0;
    z-index: 9;
    padding: 0 0.5rem 0.35rem;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0.96), transparent);
}

.news-discover__cats {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.25rem 0.5rem;
    scrollbar-width: none;
}

.news-discover__cats::-webkit-scrollbar { display: none; }

.news-cat-pill {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--news-tab-bg);
    color: #475569;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.news-cat-pill.is-active {
    background: var(--news-accent);
    color: #fff;
    border-color: var(--news-accent);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.28);
}

.news-feed {
    flex: 1;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-top: 0.5rem;
}

.news-feed::-webkit-scrollbar { display: none; }

.news-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: calc(100% - 0.5rem);
    height: calc(100vh - var(--app-header-height) - var(--mobile-nav-height) - 7rem);
    max-height: 720px;
    margin: 0 0.5rem 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 8px 28px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: newsCardIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card--static {
    cursor: default;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.news-card--static a,
.news-card--static button {
    pointer-events: none;
    cursor: default;
}

@keyframes newsCardIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (min-width: 768px) {
    .news-card {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

.news-card__media {
    position: relative;
    width: 100%;
    height: 55%;
    min-height: 220px;
    flex-shrink: 0;
}

.news-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.news-card__source-badge {
    position: absolute;
    bottom: 0.65rem;
    left: 0.65rem;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.news-card__body {
    padding: 1.1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card__title {
    margin: 0 0 0.55rem;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.45;
    color: var(--news-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--news-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem 1rem;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.news-card__author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--news-muted);
}

.news-card__author-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--news-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
}

.news-card__bookmark {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.85;
}

.news-card__bookmark.is-saved { filter: drop-shadow(0 0 4px #1a73e8); }

.news-dots {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-30%);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 8;
}

.news-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.news-dot.is-active {
    background: var(--news-accent);
    transform: scale(1.35);
}

/* Full article */
.news-article-overlay {
    position: fixed;
    inset: 0;
    z-index: 130;
    background: var(--news-bg);
    overflow-y: auto;
    animation: newsArticleIn 0.28s ease;
}

@keyframes newsArticleIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.news-article__hero {
    position: relative;
    height: 45vh;
    min-height: 240px;
}

.news-article__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-article__actions {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.news-article__actions-left,
.news-article__actions-right {
    display: flex;
    gap: 0.4rem;
}

.news-article__action-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

.news-article__content {
    padding: 1.25rem 1.25rem 5rem;
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
}

.news-article__title {
    margin: 0 0 0.65rem;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--news-text);
}

.news-article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.72rem;
    color: var(--news-muted);
    margin-bottom: 1rem;
}

.news-article__text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--news-body);
    white-space: pre-wrap;
}

.news-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 1.25rem;
}

.news-tag {
    font-size: 0.68rem;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    background: var(--news-tab-bg);
    color: #475569;
    border: 1px solid #e2e8f0;
}

.news-article__ask {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    z-index: 131;
}

.news-article__ask input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    background: #f8fafc;
    color: var(--news-text);
    font-family: inherit;
    font-size: 0.78rem;
}

.news-article__ask input::placeholder { color: #94a3b8; }

.news-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--news-muted);
}

/* Admin */
.admin-news-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.admin-news-tab {
    flex: 1;
    padding: 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-news-tab.is-active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

.admin-news-cat-row,
.admin-news-item-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
}

.admin-news-drag { cursor: grab; color: #94a3b8; }

.news-tab-viewport {
    background: #f8fafc;
}

#news-root {
    flex: 1 1 auto;
    min-height: min(26rem, calc(100dvh - var(--app-header-height) - var(--mobile-nav-height) - 2rem));
}

#mobile-nav .nav-tab-news svg { color: #f97316; stroke: #f97316; }
#mobile-nav .nav-tab-news.active {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    box-shadow: 0 8px 16px -4px rgba(249, 115, 22, 0.35);
}

html.dark #mobile-nav .nav-tab-news.active { background: rgba(249, 115, 22, 0.2); }
