/* =========================================================
   ARTICLE STYLES
   ========================================================= */

/* =========================================================
   HERO
   ========================================================= */

.news-hero {
    --article-radius: .85rem;
    --article-shadow: 0 12px 40px rgba(0, 0, 0, .08);

    position: relative;

    min-height: clamp(360px, 48vw, 540px);

    border: 0;
    border-radius: var(--article-radius);

    background-color: #1b1b1b;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    box-shadow: var(--article-shadow);
}

/* =========================================================
   HERO OVERLAY
   ========================================================= */

.news-hero-overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, .08) 0%,
            rgba(0, 0, 0, .18) 32%,
            rgba(0, 0, 0, .52) 68%,
            rgba(0, 0, 0, .88) 100%
        );

    z-index: 1;
}

.news-hero .card-img-overlay {
    z-index: 2;
    display: flex;
}

.news-hero-content {
    max-width: 1100px;
}

/* =========================================================
   CATEGORY
   ========================================================= */

.news-category {
    display: inline-flex;
    align-items: center;

    padding: .45rem .75rem;

    border-radius: 50rem;

    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .01em;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, .12);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.news-category:hover {
    transform: translateY(-1px);

    box-shadow:
        0 6px 20px rgba(0, 0, 0, .18);
}

.news-category i {
    font-size: .42rem;
}

/* =========================================================
   TITLE
   ========================================================= */

.news-title {
    max-width: 1050px;

    margin: 0;

    font-size: clamp(1.75rem, 3.2vw, 3.15rem);

    line-height: 1.12;
    letter-spacing: -.02em;

    text-wrap: balance;

    text-shadow:
        0 2px 8px rgba(0, 0, 0, .28),
        0 6px 25px rgba(0, 0, 0, .18);
}

/* =========================================================
   META
   ========================================================= */

.news-meta {
    gap: .15rem 0;

    font-size: .9rem;
}

.news-meta .nav-item {
    display: flex;
    align-items: center;
}

.news-meta .nav-link {
    color: inherit;
}

.news-meta .avatar {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;
}

.news-meta .avatar-img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border: 2px solid rgba(255, 255, 255, .65);

    box-shadow:
        0 3px 10px rgba(0, 0, 0, .2);
}

/* =========================================================
   ARTICLE TEXT
   ========================================================= */

.main_text {
    width: 100%;
    max-width: 100%;

    font-size: 1.06rem;
    line-height: 1.82;

    overflow-wrap: break-word;
    word-break: normal;
}

.main_text > :first-child {
    margin-top: 0;
}

.main_text > :last-child {
    margin-bottom: 0;
}

.main_text p {
    margin-top: 0;
    margin-bottom: 1.3rem;
}

.main_text h2,
.main_text h3,
.main_text h4,
.main_text h5,
.main_text h6 {
    margin-top: 2.25rem;
    margin-bottom: 1rem;

    color: var(--bs-heading-color);

    font-weight: 700;
    line-height: 1.3;
}

.main_text h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.main_text h3 {
    font-size: clamp(1.3rem, 2vw, 1.65rem);
}

.main_text h4 {
    font-size: 1.35rem;
}

.main_text h5 {
    font-size: 1.15rem;
}

.main_text h6 {
    font-size: 1rem;
}

/* =========================================================
   LINKS
   ========================================================= */

.main_text a {
    color: var(--bs-primary);

    text-decoration-thickness: 1px;
    text-underline-offset: 3px;

    transition:
        color .2s ease,
        opacity .2s ease;
}

.main_text a:hover {
    color: var(--bs-link-hover-color);
}

/* =========================================================
   LISTS
   ========================================================= */

.main_text ul,
.main_text ol {
    margin-top: 0;
    margin-bottom: 1.4rem;

    padding-left: 1.6rem;
}

.main_text li {
    margin-bottom: .45rem;
}

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

/* =========================================================
   IMAGES
   ========================================================= */

.main_text img {
    display: block;

    max-width: 100%;
    height: auto;

    border-radius: .65rem;
}

.main_text figure {
    width: 100%;
    max-width: 100%;

    margin: 1.75rem auto;
}

.main_text figure img {
    margin-right: auto;
    margin-left: auto;
}

.main_text figcaption {
    margin-top: .65rem;

    color: var(--bs-secondary-color);

    font-size: .875rem;
    line-height: 1.5;

    text-align: center;
}

/* =========================================================
   VIDEO / IFRAMES
   ========================================================= */

.main_text iframe,
.main_text video,
.main_text embed,
.main_text object {
    display: block;
    max-width: 100%;
}

.main_text iframe {
    width: 100%;

    border: 0;
    border-radius: .65rem;
}

.main_text video {
    width: 100%;
    height: auto;

    border-radius: .65rem;
}

/* =========================================================
   TABLES
   ========================================================= */

.main_text table {
    width: 100%;
    max-width: 100%;

    margin-bottom: 1.5rem;

    border-collapse: collapse;
}

.main_text th,
.main_text td {
    padding: .7rem .85rem;

    border: 1px solid var(--bs-border-color);

    vertical-align: top;
}

.main_text th {
    font-weight: 600;

    background: var(--bs-tertiary-bg);
}

/* =========================================================
   BLOCKQUOTE
   ========================================================= */

.main_text blockquote {
    position: relative;

    margin: 1.75rem 0;

    padding: 1.15rem 1.3rem 1.15rem 1.4rem;

    border-left: 4px solid var(--bs-primary);
    border-radius: 0 .65rem .65rem 0;

    color: var(--bs-secondary-color);

    background: var(--bs-tertiary-bg);
}

.main_text blockquote p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   CODE
   ========================================================= */

.main_text code {
    padding: .15rem .4rem;

    color: var(--bs-emphasis-color);

    background: var(--bs-tertiary-bg);

    border-radius: .3rem;

    font-size: .9em;
}

.main_text pre {
    max-width: 100%;

    margin: 1.5rem 0;

    padding: 1rem 1.1rem;

    overflow-x: auto;

    color: var(--bs-body-color);

    background: var(--bs-tertiary-bg);

    border: 1px solid var(--bs-border-color);
    border-radius: .65rem;

    -webkit-overflow-scrolling: touch;
}

.main_text pre code {
    padding: 0;

    background: transparent;

    border-radius: 0;

    white-space: pre;
}

/* =========================================================
   HR
   ========================================================= */

.main_text hr {
    margin: 2rem 0;

    border: 0;
    border-top: 1px solid var(--bs-border-color);

    opacity: 1;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.article-pagination {
    display: flex;

    justify-content: center;

    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

.article-pagination > * {
    flex-shrink: 0;
}

/* =========================================================
   EDIT INFO
   ========================================================= */

.article-edit-info {
    color: var(--bs-body-color);

    background-color: var(--bs-tertiary-bg) !important;
}

.article-edit-icon {
    width: 22px;

    margin-top: .15rem;
    margin-right: .55rem;

    text-align: center;
}

/* =========================================================
   TAGS
   ========================================================= */

.article-meta-bottom {
    gap: 1rem;
}

.article-tags {
    max-width: 100%;
}

.article-tags a {
    display: inline-flex;
    align-items: center;

    min-height: 32px;

    padding: .4rem .8rem;

    color: var(--bs-body-color);

    background: var(--bs-tertiary-bg);

    border: 1px solid transparent;
    border-radius: 50rem;

    font-size: .84rem;
    line-height: 1.2;

    text-decoration: none;

    transition:
        color .2s ease,
        background-color .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.article-tags a:hover {
    color: var(--bs-primary);

    background: var(--bs-primary-bg-subtle);

    border-color: var(--bs-primary-border-subtle);

    transform: translateY(-1px);
}

/* =========================================================
   STATISTICS
   ========================================================= */

.article-stats {
    flex-shrink: 0;

    font-size: .9rem;

    white-space: nowrap;
}

.article-stats .nav-item {
    display: flex;
    align-items: center;
}

/* =========================================================
   RATING
   ========================================================= */

.article-rating {
    position: relative;

    overflow: hidden;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, .04);
}

.article-rating::before {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;
    left: 0;

    width: 4px;

    background: var(--bs-primary);
}

.article-rating h2 {
    line-height: 1.35;
}

.article-rating-buttons {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, .06);
}

.article-rating-buttons .btn {
    min-width: 75px;

    font-weight: 600;
}

/* =========================================================
   RELATED NEWS
   ========================================================= */

.related-news {
    position: relative;
}

.related-news .section-heading {
    min-height: 32px;
}

.related-news h2 {
    line-height: 1.3;
}

/* =========================================================
   COMMENTS
   ========================================================= */

.comments-header {
    padding-bottom: 1rem;

    border-bottom: 1px solid var(--bs-border-color);
}

.comments-list {
    width: 100%;
}

.comments-navigation {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

.comment-form {
    width: 100%;
}

/* =========================================================
   DARK MODE
   ========================================================= */

[data-bs-theme="dark"] .news-hero {
    --article-shadow:
        0 12px 40px rgba(0, 0, 0, .35);
}

[data-bs-theme="dark"] .article-tags a {
    color: var(--bs-body-color);

    background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .article-tags a:hover {
    color: var(--bs-primary);

    background: var(--bs-primary-bg-subtle);

    border-color: var(--bs-primary-border-subtle);
}

[data-bs-theme="dark"] .article-rating,
[data-bs-theme="dark"] .article-edit-info {
    background-color: var(--bs-secondary-bg) !important;

    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .main_text blockquote {
    background: var(--bs-secondary-bg);

    border-left-color: var(--bs-primary);
}

[data-bs-theme="dark"] .main_text th {
    background: var(--bs-secondary-bg);
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991.98px) {

    .news-hero {
        min-height: 420px;
    }

    .news-title {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
    }

    .main_text {
        font-size: 1.04rem;
    }

}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767.98px) {

    .news-hero {
        min-height: 380px;

        border-radius: .65rem;
    }

    .news-hero .card-img-overlay {
        padding: 1.25rem !important;
    }

    .news-title {
        font-size: clamp(1.55rem, 6vw, 2rem);

        line-height: 1.18;
    }

    .news-meta {
        font-size: .84rem;

        row-gap: .25rem;
    }

    .news-meta .avatar {
        width: 34px;
        height: 34px;

        flex-basis: 34px;
    }

    .main_text {
        font-size: 1rem;

        line-height: 1.75;
    }

    .main_text h2,
    .main_text h3,
    .main_text h4,
    .main_text h5,
    .main_text h6 {
        margin-top: 1.75rem;
    }

    .main_text table {
        display: block;

        overflow-x: auto;

        white-space: normal;

        -webkit-overflow-scrolling: touch;
    }

    .article-meta-bottom {
        align-items: stretch !important;
    }

    .article-stats {
        justify-content: flex-start !important;

        width: 100%;
    }

    .article-rating {
        padding: 1.15rem !important;
    }

    .related-news {
        margin-top: 2.5rem !important;
    }

}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 575.98px) {

    .news-hero {
        min-height: 340px;

        border-radius: .55rem;
    }

    .news-hero .card-img-overlay {
        padding: 1rem !important;
    }

    .news-category {
        margin-bottom: .7rem !important;

        padding: .38rem .65rem;

        font-size: .72rem;
    }

    .news-title {
        font-size: 1.45rem;

        line-height: 1.2;

        margin-bottom: .85rem !important;
    }

    .news-meta {
        font-size: .78rem;
    }

    .news-meta .avatar {
        width: 31px;
        height: 31px;

        flex-basis: 31px;
    }

    .main_text {
        font-size: .98rem;

        line-height: 1.72;
    }

    .main_text blockquote {
        padding: 1rem 1rem 1rem 1.1rem;
    }

    .article-tags a {
        min-height: 30px;

        padding: .35rem .7rem;

        font-size: .8rem;
    }

    .article-stats {
        font-size: .82rem;
    }

    .article-rating {
        text-align: center;
    }

    .article-rating-buttons {
        display: flex;

        width: 100%;
    }

    .article-rating-buttons .btn {
        flex: 1;

        min-width: 0;
    }

    .comments-header h2,
    .related-news h2 {
        font-size: 1.2rem;
    }

}

/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 400px) {

    .news-hero {
        min-height: 320px;
    }

    .news-title {
        font-size: 1.3rem;
    }

    .news-meta .nav-item {
        font-size: .74rem;
    }

    .main_text {
        font-size: .96rem;
    }

}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .news-category,
    .article-tags a {
        transition: none;
    }

}

/* =========================================================
   PRINT
   ========================================================= */

@media print {

    .news-hero {
        min-height: auto;

        color: #000;

        background: none !important;

        box-shadow: none;
    }

    .news-hero-overlay {
        display: none;
    }

    .news-title {
        color: #000 !important;

        text-shadow: none;
    }

    .news-meta {
        color: #000 !important;
    }

    .related-news,
    .article-rating,
    .comments-header,
    .comments-list,
    .comments-navigation,
    .comment-form {
        display: none !important;
    }

    .main_text {
        font-size: 12pt;

        line-height: 1.6;
    }

}