:root {
    --navbar-height: 56px;
    --progress-height: 4px
}

@keyframes fadeIn {
    0% {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

body {
    display: flex;
    margin: 0;
    min-height: 100vh;
    overflow-y: auto;
    padding-top: 0;
    position: relative;
    -webkit-overflow-scrolling: touch;
    flex-direction: column
}

.article-content blockquote>:last-child,
.article-content>:last-child {
    margin-bottom: 0
}

.news-card:has(.share-dropdown.show):after {
    background: rgba(0, 0, 0, .5);
    border-radius: inherit;
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1040
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0 1rem;
    max-width: 95%;
    overflow: visible;
    position: relative
}

.article-content h1 {
    font-size: 2.5rem
}

.article-content h1,
.article-content h2 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 1rem;
    margin-top: 2rem
}

.article-content h2 {
    font-size: 2rem
}

.article-content h3 {
    font-size: 1.75rem
}

.article-content h3,
.article-content h4 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 1rem;
    margin-top: 2rem
}

.article-content h4 {
    font-size: 1.5rem
}

.article-content h5 {
    font-size: 1.25rem
}

.article-content h5,
.article-content h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 1rem;
    margin-top: 2rem
}

.article-content h6 {
    font-size: 1.1rem
}

.article-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    white-space: pre-wrap
}

.article-content ol,
.article-content ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem
}

.article-content li {
    line-height: 1.6;
    margin-bottom: .5rem
}

.article-content img {
    border-radius: 4px;
    display: block;
    height: auto;
    max-width: 100%;
    position: relative;
    z-index: 1
}

.article-content pre {
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 1.5rem 0;
    overflow-x: auto;
    padding: 1rem
}

.article-content code {
    background-color: #f8f9fa;
    border-radius: 3px;
    font-family: Monaco, Consolas, Courier New, monospace;
    font-size: .9em;
    padding: .2rem .4rem
}

.article-content blockquote {
    background-color: #f8f9fa;
    border-left: .25rem solid #3498db;
    color: #555;
    font-style: italic;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem
}

.article-content hr {
    border: 0;
    border-top: 2px solid #eee;
    margin: 2rem 0
}

.article-content b,
.article-content strong {
    font-weight: 600
}

.article-content em,
.article-content i,
.article-meta {
    font-style: italic
}

.article-meta {
    color: #6c757d
}

.page-wrapper {
    flex: 1 0 auto;
    padding-bottom: 2rem;
    width: 100%
}

.footer-spacer {
    display: none
}

.error-container {
    margin: 2rem auto;
    max-width: 600px;
    padding: 2rem
}

.error-container h2 {
    color: var(--primary-color-darker);
    margin-bottom: 1rem
}

.error-container p {
    color: #6c757d;
    margin-bottom: 1.5rem
}

.article-page #timeSliderMobile,
.article-page .dropdown-divider,
.article-page .time-filter-container,
.article-page .time-range-display {
    display: none !important
}

.article-page .navbar-nav {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: .5rem;
    margin-left: auto;
    width: auto
}

.article-page #topicLinks {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    width: 100%
}

.article-page .nav-item {
    margin: 0;
    width: auto
}

.article-page .nav-link {
    border-radius: 4px;
    color: var(--light-color) !important;
    font-size: .85rem;
    padding: .5rem 1rem;
    transition: all var(--transition-speed) ease;
    white-space: nowrap
}

.article-page .nav-link:hover {
    background: hsla(0, 0%, 100%, .1)
}

.article-page .nav-link.active {
    background: var(--button-color);
    color: #fff !important
}

.article-page #topicLinks .nav-item {
    margin: 0;
    width: auto
}

.article-page #topicLinks .nav-link {
    border-radius: 4px;
    color: var(--light-color) !important;
    padding: .5rem 1rem;
    transition: all var(--transition-speed) ease;
    white-space: nowrap
}

.article-page #topicLinks .nav-link:hover {
    background: hsla(0, 0%, 100%, .1)
}

.article-page #topicLinks .nav-link.active {
    background: var(--button-color);
    color: #fff !important
}

.article-page .navbar-collapse {
    background: var(--navbar-color);
    background-color: var(--navbar-color);
    display: none !important;
    justify-content: flex-end;
    padding: 1rem;
    z-index: 1000
}

.article-page #navbarNav,
.article-page .controls-right,
.article-page .navbar-toggler {
    display: none !important
}

.article-page .container-fluid {
    justify-content: flex-start
}

.article-page {
    padding-top: 0
}

.article-page .content {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column
}

.no-content-card {
    align-items: center;
    background: #fff;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 300px
}

.no-content-content i {
    color: #dc3545;
    display: block;
    font-size: 3.5rem;
    margin-bottom: 1.5rem
}

.no-content-content h5 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem
}

.no-content-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 2rem
}

.no-content-content .nav-button {
    align-items: center;
    background: var(--button-color);
    border: 2px solid var(--button-color);
    color: #fff;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 500;
    gap: .5rem;
    padding: .75rem 1.5rem;
    transition: all .2s ease
}

.no-content-content .nav-button:hover {
    background: var(--button-hover-color, #0056b3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    transform: translateY(-2px)
}

.no-content-content .nav-button i {
    color: #fff;
    font-size: 1rem;
    margin: 0
}

.share-button {
    cursor: pointer;
    position: relative;
    z-index: 1045
}

.share-dropdown {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    display: none;
    min-width: 200px;
    padding: 1rem;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    transform: none;
    z-index: 1050
}

.share-dropdown.show {
    display: block
}

.share-container {
    display: inline-block;
    position: relative;
    z-index: 1045
}

.share-overlay {
    align-items: center;
    background: rgba(0, 0, 0, .5);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1049
}

.article-actions {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin: 1rem 0
}

.article-actions .share-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: .5rem;
    transition: color .2s ease
}

.article-actions .share-button:hover {
    color: var(--primary-color)
}

.article-actions .share-dropdown {
    margin-top: .5rem;
    right: 0;
    top: 100%
}

.loading-state {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 200px
}

.navbar-loading {
    transition: opacity .3s ease
}

.navbar-loading.fade-out {
    opacity: 0
}

.article-page .article-meta {
    margin: .5rem 0
}

.article-page .article-meta h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: .5rem
}

.article-page .article-content p {
    margin-bottom: 1rem
}

.article-page .article-content img {
    border-radius: 0;
    margin: .5rem -.5rem;
    max-width: calc(100% + 1rem);
    width: calc(100% + 1rem)
}

.article-page .meta-info {
    font-size: .875rem;
    opacity: .8
}

.article-page .back-button-container {
    margin: .25rem 0 .5rem
}

.article-page .article-content {
    font-size: 1rem;
    hyphens: auto;
    line-height: 1.6;
    margin: .5rem 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word
}

.article-page .article-content blockquote {
    margin: 1rem 0;
    padding: .5rem 1rem
}

.article-page .article-content ol,
.article-page .article-content ul {
    margin: .5rem 0;
    padding-left: 1.25rem
}

#article-container {
    margin-top: 0;
    max-height: none;
    max-width: none;
    overflow-y: auto;
    padding: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch
}

.back-button-container {
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    background: #fff;
    left: 0;
    margin: 0;
    padding: .5rem .8rem;
    right: 0;
    top: calc(var(--navbar-height)*.8 + var(--progress-height));
    z-index: 99
}

.article-page .article-image-container {
    align-items: center;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    margin: 1rem auto;
    max-width: 800px;
    position: relative;
    width: 100%
}

.article-page .article-image-container img {
    border-radius: 4px;
    display: block;
    height: auto;
    width: 100%
}

.reading-progress-container {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, .1);
    height: var(--progress-height);
    left: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 10000
}

.reading-progress-bar {
    backface-visibility: hidden;
    background: var(--primary-color, var(--button-color));
    height: 100%;
    left: 0;
    min-width: 5%;
    position: absolute;
    top: 0;
    transform: translateZ(0);
    transition: width .15s cubic-bezier(.4, 0, .2, 1);
    will-change: width
}

#navbar-placeholder,
.navbar-article-view {
    top: var(--progress-height) !important
}

.article-image-container+.markdown-content {
    margin-top: 1rem
}

.content {
    height: 100%;
    padding-bottom: 2rem
}

footer {
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    width: 100%
}

.no-content-content {
    margin: 0 auto;
    max-width: 400px;
    padding: 2rem;
    text-align: center
}

@media (max-width:767px) {
    @keyframes fadeIn {
        0% {
            opacity: 0
        }

        to {
            opacity: 1
        }
    }

    .article-page .article-meta {
        margin: .5rem 0
    }

    .article-page .article-meta h1 {
        font-size: 1.5rem;
        font-weight: 600;
        line-height: 1.3;
        margin-bottom: .5rem
    }

    .article-page .article-content p {
        margin-bottom: 1rem
    }

    .article-page .article-content img {
        border-radius: 0;
        margin: .5rem -.5rem;
        max-width: calc(100% + 1rem);
        width: calc(100% + 1rem)
    }

    .article-page .meta-info {
        font-size: .875rem;
        opacity: .8
    }

    .article-page .back-button-container {
        margin: .25rem 0 .5rem
    }

    .article-page .article-content blockquote {
        margin: 1rem 0;
        padding: .5rem 1rem
    }

    .article-page .article-content ol,
    .article-page .article-content ul {
        margin: .5rem 0;
        padding-left: 1.25rem
    }

    .back-button-container {
        background: #fff;
        padding: .5rem .8rem;
        top: calc(var(--navbar-height)*.8 + var(--progress-height))
    }

    #navbar-placeholder.navbar-article-view {
        top: var(--progress-height) !important
    }

    .article-page .content {
        padding-top: calc(var(--navbar-height)*.8)
    }

    .article-page #article-container {
        animation: fadeIn .3s ease forwards;
        max-width: 100vw;
        opacity: 0;
        padding: 1.5rem max(.5rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left));
        width: 100vw
    }

    .navbar-article-view {
        height: auto !important;
        min-height: auto !important;
        padding-top: max(0, env(safe-area-inset-top)) !important
    }

    #article-container {
        margin-top: 0;
        max-width: 100vw;
        padding: 0 0 max(.5rem, env(safe-area-inset-bottom));
        width: 100vw
    }

    .article-page .article-content {
        font-size: 1rem;
        hyphens: auto;
        line-height: 1.6;
        margin: .5rem 0;
        max-width: 100%;
        overflow-wrap: break-word;
        padding: 0 max(.8rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.8rem, env(safe-area-inset-left));
        word-wrap: break-word
    }

    .article-page .article-image-container {
        border-radius: 0;
        margin: .5rem -.5rem;
        max-width: none;
        width: calc(100% + 1rem)
    }

    .article-page .article-image-container img {
        border-radius: 0
    }
}

@media (max-width:768px) {
    .news-grid {
        padding-top: 0
    }

    .content {
        padding-bottom: 1rem;
        padding-top: calc(var(--navbar-height))
    }

    .container {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        width: 100%
    }

    #article-container {
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
        max-width: none;
        padding: 0;
        width: 100vw
    }

    .article-content p {
        line-height: 1.7;
        margin-bottom: 1.2rem
    }

    .article-content h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
        margin-top: 2rem
    }

    .article-content h3 {
        font-size: 1.5rem;
        margin-top: 1.8rem
    }

    .article-content ol,
    .article-content ul {
        margin-bottom: 1.2rem;
        padding-left: 1.8rem
    }

    .article-content li {
        font-size: 1.2rem;
        line-height: 1.7;
        margin-bottom: .8rem
    }

    .article-content blockquote {
        font-size: 1.2rem;
        margin: 1.5rem 0;
        padding: 1rem 1.2rem
    }

    .article-content code,
    .article-page .meta-info {
        font-size: 1.1rem
    }

    .article-content {
        font-size: 1.2rem;
        line-height: 1.7;
        max-width: none;
        padding: 0
    }

    .article-content h1 {
        font-size: 2.2rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        margin-top: 0
    }

    .article-content img {
        border-radius: 0;
        margin: .5rem -.8rem;
        max-width: calc(100% + 1.6rem);
        width: calc(100% + 1.6rem)
    }

    .article-image-container img {
        border-radius: 0;
        margin: 0;
        width: 100%
    }

    .article-image-container+.markdown-content>h1:first-child,
    .article-image-container+.markdown-content>h2:first-child,
    .article-image-container+.markdown-content>h3:first-child,
    .article-image-container+.markdown-content>img:first-child {
        margin-top: 1rem
    }

    .article-meta {
        padding: 0 .8rem
    }

    .back-button-container {
        background: #fff;
        padding: .5rem .8rem;
        top: calc(var(--navbar-height) + 1rem)
    }

    .share-dropdown {
        left: 50%;
        max-width: 320px;
        position: fixed;
        top: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 32px)
    }

    .share-overlay .share-dropdown {
        margin: 16px
    }

    .article-image-container+.markdown-content {
        margin-top: .5rem
    }
}

@media (max-width:991.98px) {
    .article-page .navbar-collapse {
        background: var(--navbar-color);
        border-top: 1px solid hsla(0, 0%, 100%, .1);
        left: 0;
        max-height: calc(100vh - var(--navbar-height));
        overflow-y: auto;
        padding: 1rem;
        position: absolute;
        right: 0;
        top: var(--navbar-height)
    }

    .article-page #topicLinks {
        flex-direction: column;
        gap: .25rem;
        width: 100%
    }

    .article-page .nav-item {
        width: 100%
    }

    .article-page .nav-link {
        font-size: 1rem;
        padding: .75rem 1rem;
        width: 100%
    }

    .article-page #topicLinks .nav-item {
        width: 100%
    }

    .article-page #topicLinks .nav-link {
        padding: .75rem 1rem;
        width: 100%
    }

    .article-page .navbar-nav {
        flex-direction: column;
        width: 100%
    }
}