/* Module Custom Styles */

:root {
    --news-card-media-width: 192px;
    --news-card-media-ratio: 16 / 9;
}

.news-card {
    display: grid;
    grid-template-columns: var(--news-card-media-width) 1fr;
    gap: 1rem;
    padding: 1rem;
    min-height: 176px;
    align-items: stretch;
    border: 1px solid #d9d9d9;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background: #fff;
}

.news-card.is-pinned {
    border-color: #e0b400;
}

.news-card.is-draft {
    border-color: #6c757d;
    border-style: dashed;
    background: linear-gradient(180deg, #fbfcfd 0%, #ffffff 100%);
}

.news-card-image-wrap {
    width: var(--news-card-media-width);
    aspect-ratio: var(--news-card-media-ratio);
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0.4rem;
}

.news-card-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.news-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.news-card.no-image .news-card-image-wrap {
    border: 1px dashed #c9d0d7;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f4f7 100%);
}

.news-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card-image-icon {
    width: 44px;
    height: 44px;
    fill: #95a0ab;
}

.news-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.news-card-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.news-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.375rem;
    white-space: nowrap;
}

.news-card-actions > * {
    display: inline-flex;
}

.news-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.news-card-badges {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.news-badge-draft {
    background: #5f6368;
    color: #fff;
}

.news-card-title {
    margin: 0;
    font-size: 1.1rem;
    min-width: 0;
    flex: 1 1 320px;
}

.news-card-meta {
    color: #666;
    margin: 0.25rem 0 0.5rem 0;
}

.news-card-summary {
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}

.news-card-summary-html {
    max-height: calc(var(--summary-lines, 3) * 1.5em);
    overflow: hidden;
}

.news-card-summary-html > :first-child {
    margin-top: 0;
}

.news-card-summary-html > :last-child {
    margin-bottom: 0;
}

.news-card-summary-html img,
.news-card-summary-html video,
.news-card-summary-html iframe {
    max-width: 100%;
    max-height: 8rem;
    display: block;
    object-fit: cover;
}

.news-detail {
    max-width: 900px;
}

.news-back-link {
    margin-bottom: 0.5rem;
}

.news-detail-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: min(56vh, 448px);
    min-height: 280px;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.news-detail-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: calc(min(56vh, 448px) - 2rem);
    border-radius: 0.5rem;
    object-fit: contain;
    object-position: center;
}

.news-detail-body {
    line-height: 1.65;
}

.news-detail-body > :first-child {
    margin-top: 0;
}

.news-detail-body > :last-child {
    margin-bottom: 0;
}

.news-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.news-body-lightbox-link {
    display: inline-block;
    max-width: 100%;
}

.news-body-image {
    display: block;
}

.news-detail-body .ql-align-center {
    text-align: center;
}

.news-detail-body .ql-align-right {
    text-align: right;
}

.news-detail-body .ql-align-justify {
    text-align: justify;
}

.news-detail-body .ql-size-small {
    font-size: 0.875rem;
}

.news-detail-body .ql-size-large {
    font-size: 1.25rem;
}

.news-detail-body .ql-size-huge {
    font-size: 1.75rem;
}

.news-detail-body .ql-indent-1 {
    padding-left: 2rem;
}

.news-detail-body .ql-indent-2 {
    padding-left: 4rem;
}

.news-detail-body .ql-indent-3 {
    padding-left: 6rem;
}

.news-detail-body blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid #d0d7de;
    background: #f8fafc;
}

.news-post-editor .row {
    margin: 0;
}

.news-editor-row {
    margin-bottom: 1rem;
}

.news-editor-row > .col-sm-9 {
    padding-bottom: 1.25rem;
}

.news-editor-row + .row {
    margin-top: 1rem;
}

.news-editor-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.news-editor-tools .btn {
    white-space: nowrap;
}

.news-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.news-edit-actions .btn {
    min-width: 7.5rem;
}

.news-audit-info {
    margin-top: 1rem;
}

.news-post-editor .col {
    padding: 0;
}

.news-post-editor .quill-text-editor {
    width: 100%;
}

.news-post-editor {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.news-post-editor .nav-tabs,
.news-post-editor .app-tabstrip .nav-tabs {
    margin-bottom: 0;
}

.news-post-editor .tab-content,
.news-post-editor .app-tabstrip .tab-content {
    padding-top: 0;
    margin-top: 0;
    font-size: 0;
    line-height: 0;
}

.news-post-editor .tab-content > br,
.news-post-editor .app-tabstrip .tab-content > br {
    display: none !important;
}

.news-post-editor .tab-content > .tab-pane,
.news-post-editor .app-tabstrip .tab-content > .tab-pane {
    font-size: 1rem;
    line-height: normal;
}

.news-post-editor .ql-toolbar .ql-formats:last-child {
    margin-right: 0;
}

.news-post-editor .app-editor-resizable {
    height: 24rem;
    min-height: 24rem;
    overflow: auto;
}

.news-post-editor .ql-container {
    height: 100%;
    min-height: 20rem;
}

.news-post-editor .ql-editor,
.news-post-editor .rz-text-editor-content {
    min-height: 18rem;
    padding-bottom: 1.5rem;
}

.news-body-image-preview {
    min-height: 12rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px dashed #c9d0d7;
    border-radius: 0.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

@media (max-width: 768px) {
    .news-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .news-card-image-wrap {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .news-card.no-image .news-card-image-wrap {
        display: none;
    }

    .news-detail-image-link {
        height: min(48vh, 320px);
        min-height: 200px;
        padding: 0.75rem;
    }

    .news-detail-image {
        max-height: calc(min(48vh, 320px) - 1.5rem);
    }

    .news-post-editor .app-editor-resizable {
        height: 18rem;
        min-height: 18rem;
    }

    .news-post-editor .ql-container {
        min-height: 15rem;
    }

    .news-post-editor .ql-editor,
    .news-post-editor .rz-text-editor-content {
        min-height: 14rem;
    }

    .news-body-image-preview {
        min-height: 10rem;
    }

    .news-editor-tools,
    .news-edit-actions {
        align-items: stretch;
    }

    .news-editor-tools .btn,
    .news-edit-actions .btn {
        width: 100%;
    }
}
