/* Modern article page and CKEditor content styles. */

.article-page {
    --article-green: #234f38;
    --article-green-dark: #153420;
    --article-gold: #b79a4e;
    --article-ink: #18231c;
    --article-muted: #667166;
    --article-line: rgba(35, 79, 56, 0.14);
    --article-soft: #f5f8f6;
    --article-sky: #eaf2f6;
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 2rem 0 4rem;
    color: var(--article-ink);
}

.article-preview-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1.25rem;
    color: #6e5316;
    background: #fff7df;
    border: 1px solid rgba(183, 154, 78, 0.35);
    border-radius: 8px;
    font-weight: 700;
}

.article-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin: 0.25rem 0 1.25rem;
    color: var(--article-muted);
    font-size: 0.92rem;
}

.article-breadcrumb a {
    color: var(--article-green);
    font-weight: 750;
}

.article-breadcrumb a:hover {
    color: var(--article-green-dark);
}

.article-breadcrumb i {
    color: rgba(102, 113, 102, 0.6);
    font-size: 0.7rem;
}

.article-breadcrumb span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.article-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
    gap: 2.5rem;
    align-items: end;
    padding: 2.4rem 0 2.7rem;
    border-bottom: 1px solid var(--article-line);
}

.article-hero-no-cover {
    grid-template-columns: minmax(0, 860px);
}

.article-hero-copy {
    min-width: 0;
}

.article-eyebrow,
.comments-eyebrow {
    color: var(--article-gold);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.article-hero h1 {
    color: var(--article-ink);
    font-size: 4rem;
    font-weight: 850;
    line-height: 1.02;
    letter-spacing: 0;
    margin: 0.5rem 0 0;
    overflow-wrap: anywhere;
}

.article-summary {
    max-width: 760px;
    margin: 1.15rem 0 0;
    color: #405145;
    font-size: 1.14rem;
    line-height: 1.68;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
    margin-top: 1.3rem;
    color: var(--article-muted);
    font-size: 0.92rem;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.article-meta i {
    color: var(--article-green);
}

.article-private-badge {
    color: var(--article-green-dark);
    font-weight: 750;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.article-tags a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.32rem 0.62rem;
    color: var(--article-green);
    background: var(--article-soft);
    border: 1px solid var(--article-line);
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 750;
}

.article-tags a:hover {
    color: var(--article-green-dark);
    background: #e9f1ec;
}

.article-cover {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(24, 35, 28, 0.08);
    border-radius: 8px;
    background: var(--article-soft);
    box-shadow: 0 22px 60px rgba(24, 35, 28, 0.1);
}

.article-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    transform-origin: 50% 50%;
    display: block;
}

.article-shell {
    display: grid;
    grid-template-columns: minmax(0, 820px) 92px;
    justify-content: center;
    align-items: start;
    gap: 1.5rem;
    margin-top: 2.4rem;
}

.article-shell-preview {
    grid-template-columns: minmax(0, 760px);
}

.article-actions {
    position: sticky;
    top: 6rem;
}

.news-reactions {
    display: grid;
    gap: 0.55rem;
    padding: 0.55rem;
    background: #ffffff;
    border: 1px solid var(--article-line);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(24, 35, 28, 0.08);
}

.reaction-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 58px;
    width: 100%;
    color: var(--article-muted);
    background: var(--article-soft);
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.reaction-btn:hover {
    color: var(--article-green-dark);
    background: #e9f1ec;
    transform: translateY(-1px);
}

.reaction-btn.is-active {
    color: #ffffff;
    background: var(--article-green);
    border-color: var(--article-green);
}

.reaction-negative.is-active {
    background: #81433f;
    border-color: #81433f;
}

.news-content {
    min-width: 0;
    color: #223022;
    font-size: 1.05rem;
    line-height: 1.78;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.news-content::after {
    content: "";
    display: block;
    clear: both;
}

.news-content > *:first-child {
    margin-top: 0;
}

.news-content > *:last-child {
    margin-bottom: 0;
}

.news-content p {
    margin: 0 0 1.15rem;
}

.news-content h2,
.news-content h3,
.news-content h4 {
    color: #18351f;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.25;
}

.news-content h2 {
    font-size: 1.85rem;
    margin: 2.5rem 0 1rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--article-line);
}

.news-content h3 {
    font-size: 1.45rem;
    margin: 2rem 0 0.85rem;
}

.news-content h4 {
    font-size: 1.2rem;
    margin: 1.6rem 0 0.7rem;
}

.news-content a {
    color: #1f6f45;
    font-weight: 650;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

.news-content a:hover {
    color: #174f33;
}

.news-content ul,
.news-content ol {
    margin: 0 0 1.25rem 1.25rem;
    padding-left: 1rem;
}

.news-content li {
    margin-bottom: 0.45rem;
    padding-left: 0.2rem;
}

.news-content blockquote {
    margin: 1.8rem 0;
    padding: 1.25rem 1.5rem;
    color: #263826;
    background: #f4f8f5;
    border-left: 4px solid var(--article-green);
    border-radius: 0 8px 8px 0;
    font-size: 1.08rem;
}

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

.news-content .article-lead {
    margin-bottom: 1.7rem;
    color: #29402b;
    font-size: 1.22rem;
    line-height: 1.65;
    font-weight: 500;
}

.news-content .article-note {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #f8faf8;
    border: 1px solid var(--article-line);
    border-left: 4px solid var(--article-gold);
    border-radius: 8px;
}

.news-content .article-callout {
    background: #fffaf0;
    border-left-color: var(--article-gold);
}

.news-content .article-muted {
    color: var(--article-muted);
    font-size: 0.94rem;
}

.news-content figure {
    margin: 1.8rem 0;
}

.news-content figure.image {
    display: table;
    max-width: 100%;
}

.news-content figure.image img,
.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.news-content figure.image > figcaption {
    display: table-caption;
    caption-side: bottom;
    padding-top: 0.6rem;
    color: #6b756b;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
}

.news-content .image-style-align-left {
    float: left;
    max-width: min(46%, 360px);
    margin: 0.35rem 1.5rem 1rem 0;
}

.news-content .image-style-align-right {
    float: right;
    max-width: min(46%, 360px);
    margin: 0.35rem 0 1rem 1.5rem;
}

.news-content .image-style-align-center {
    margin-left: auto;
    margin-right: auto;
}

.news-content .image-style-side {
    float: right;
    max-width: min(42%, 340px);
    margin: 0.35rem 0 1rem 1.5rem;
}

.news-content figure.table {
    display: block;
    overflow-x: auto;
    margin: 1.8rem 0;
}

.news-content table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    border: 1px solid rgba(44, 87, 64, 0.16);
    font-size: 0.96rem;
}

.news-content caption,
.news-content .table > figcaption {
    padding: 0.6rem 0;
    color: #6b756b;
    font-size: 0.9rem;
    text-align: left;
}

.news-content th,
.news-content td {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(44, 87, 64, 0.14);
    vertical-align: top;
}

.news-content th {
    color: #18351f;
    background: #edf4ef;
    font-weight: 750;
}

.news-content tr:nth-child(even) td {
    background: #fbfcfb;
}

.news-content pre {
    margin: 1.6rem 0;
    padding: 1rem 1.1rem;
    color: #f4f7f2;
    background: #172017;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.94rem;
    line-height: 1.6;
}

.news-content code {
    padding: 0.12rem 0.32rem;
    color: #1d4d32;
    background: #edf4ef;
    border-radius: 4px;
    font-size: 0.92em;
}

.news-content pre code {
    padding: 0;
    color: inherit;
    background: transparent;
    border-radius: 0;
}

.news-content hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid rgba(44, 87, 64, 0.18);
}

.news-content .media {
    margin: 1.8rem 0;
}

.news-content .media > div,
.news-content div[data-oembed-url] {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.news-content iframe {
    max-width: 100%;
    border: 0;
    border-radius: 8px;
}

.comments-section {
    max-width: 1080px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--article-line);
}

.comments-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comments-header h2 {
    margin: 0.25rem 0 0;
    color: var(--article-ink);
    font-size: 1.7rem;
    font-weight: 850;
    line-height: 1.2;
}

.comment-form,
.reply-form {
    display: grid;
    gap: 0.75rem;
}

.comment-form {
    padding: 1rem;
    margin-bottom: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--article-line);
    border-radius: 8px;
}

.comment-form textarea,
.reply-form textarea {
    width: 100%;
    min-height: 96px;
    color: var(--article-ink);
    border: 1px solid rgba(35, 79, 56, 0.2);
    border-radius: 8px;
    resize: vertical;
}

.reply-form textarea {
    min-height: 76px;
}

.comment-form textarea:focus,
.reply-form textarea:focus {
    border-color: var(--article-green);
    box-shadow: 0 0 0 0.16rem rgba(35, 79, 56, 0.12);
}

.btn-primary {
    color: #ffffff !important;
    background: var(--article-green);
    border-color: var(--article-green);
    border-radius: 8px;
    font-weight: 800;
}

.btn-primary:hover {
    background: var(--article-green-dark);
    border-color: var(--article-green-dark);
}

.comments-login-note {
    padding: 1rem;
    margin: 0 0 1.25rem;
    color: var(--article-muted);
    background: #ffffff;
    border: 1px solid var(--article-line);
    border-radius: 8px;
}

.comments-login-note a {
    color: var(--article-green);
    font-weight: 750;
}

.comments-list {
    display: grid;
    gap: 1rem;
    clear: both;
}

.comment,
.reply {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid rgba(24, 35, 28, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(24, 35, 28, 0.05);
}

.reply {
    margin-top: 0.85rem;
    margin-left: 1.25rem;
    background: #fbfcfb;
    border-left: 3px solid var(--article-green);
}

.comment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.comment-head > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.comment-head strong {
    color: var(--article-ink);
    font-weight: 850;
}

.comment-head time {
    color: var(--article-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.comment p,
.reply p {
    margin: 0 0 0.8rem;
    color: #36453a;
    line-height: 1.62;
}

.reply p:last-child,
.comment p:last-child {
    margin-bottom: 0;
}

.reply-btn,
.comment-delete-form button {
    border: 0;
    background: transparent;
    font-weight: 800;
}

.reply-btn {
    padding: 0.35rem 0.65rem;
    color: var(--article-green);
    background: var(--article-soft);
    border-radius: 8px;
}

.reply-btn:hover {
    color: var(--article-green-dark);
    background: #e9f1ec;
}

.comment-delete-form {
    display: inline;
    margin: 0;
}

.comment-delete-form button {
    padding: 0;
    color: #9b4640;
    font-size: 0.82rem;
}

.comment-delete-form button:hover {
    text-decoration: underline;
}

.reply-form {
    margin-top: 1rem;
    padding: 0.9rem;
    background: #f7faf8;
    border: 1px solid var(--article-line);
    border-radius: 8px;
}

.comments-empty {
    padding: 1.5rem;
    color: var(--article-muted);
    text-align: center;
    background: #ffffff;
    border: 1px dashed rgba(35, 79, 56, 0.25);
    border-radius: 8px;
}

@media (max-width: 991px) {
    .article-hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-hero h1 {
        font-size: 3.1rem;
    }

    .article-cover {
        aspect-ratio: 16 / 9;
    }

    .article-shell {
        grid-template-columns: minmax(0, 760px);
    }

    .article-actions {
        position: static;
        order: -1;
    }

    .news-reactions {
        display: inline-flex;
    }

    .reaction-btn {
        flex-direction: row;
        min-width: 78px;
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .article-page {
        width: min(100% - 20px, 1120px);
        padding: 1rem 0 2.5rem;
    }

    .article-preview-alert,
    .article-breadcrumb {
        font-size: 0.88rem;
    }

    .article-hero {
        padding: 1.6rem 0 2rem;
    }

    .article-hero h1 {
        font-size: 2.25rem;
    }

    .article-summary {
        font-size: 1rem;
    }

    .article-meta {
        gap: 0.55rem 0.8rem;
    }

    .article-shell {
        margin-top: 1.5rem;
    }

    .news-content {
        font-size: 1rem;
        line-height: 1.72;
    }

    .news-content h2 {
        font-size: 1.55rem;
        margin-top: 2rem;
    }

    .news-content h3 {
        font-size: 1.28rem;
    }

    .news-content .article-lead {
        font-size: 1.1rem;
    }

    .news-content .image-style-align-left,
    .news-content .image-style-align-right,
    .news-content .image-style-side {
        float: none;
        max-width: 100%;
        margin: 1.4rem auto;
    }

    .news-content blockquote,
    .news-content .article-note {
        padding: 1rem;
    }

    .comments-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .comments-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .comments-header h2 {
        font-size: 1.35rem;
    }

    .comment-head {
        flex-direction: column;
        gap: 0.3rem;
    }

    .reply {
        margin-left: 0;
    }
}
