/* Statik sayfalar ve duyurular — ortak görünüm.
   Yalnızca Tabler değişkenlerini (--tblr-*) kullanır; böylece açık/koyu tema ile uyumlu kalır.
   Not: text-transform KULLANILMAZ (Türkçe İ/ı dönüşümü tarayıcıda bozuluyor, bkz. _Layout). */

/* ─── Genel okuyucu başlığı (StaticPages/GetById, UserHome/AnnouncementDetails) ───────────── */
.cp-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    color: #fff;
    /* Ana sayfadaki .home-hero ile aynı renk geçişi */
    background: linear-gradient(130deg, #1a2b8c 0%, #3b5bdb 55%, #4c6ef5 100%);
    box-shadow: 0 8px 32px rgba(59, 91, 219, 0.22);
}

.cp-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.cp-hero-body {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cp-hero-text {
    flex: 1 1 0;
    min-width: 0;
}

.cp-hero-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.cp-hero-kicker {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    margin-bottom: 0.15rem;
}

.cp-hero-title {
    margin: 0;
    color: #fff;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.cp-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.cp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.cp-chip-danger {
    background: rgba(250, 82, 82, 0.92);
}

.cp-chip-warn {
    background: rgba(247, 103, 7, 0.92);
}

.cp-hero-actions {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .cp-hero {
        padding: 1.25rem 1.1rem;
    }

    .cp-hero-body {
        flex-wrap: wrap;
    }

    .cp-hero-actions {
        margin-left: 0;
        width: 100%;
    }

    .cp-hero-title {
        font-size: 1.35rem;
    }
}

/* ─── Zengin içerik (CKEditor çıktısı) ──────────────────────────────────────────────────────── */
.rich-content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--tblr-body-color);
    overflow-wrap: anywhere;
}

.rich-content::after {
    content: '';
    display: block;
    clear: both;
}

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

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

/* Metin blokları okunabilir satır uzunluğunda kalır; tablo ve görseller tam genişliği kullanır. */
.rich-content > p,
.rich-content > ul,
.rich-content > ol,
.rich-content > h1,
.rich-content > h2,
.rich-content > h3,
.rich-content > h4,
.rich-content > blockquote {
    max-width: 80ch;
}

.rich-content p {
    margin: 0 0 1rem;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
    margin: 1.75rem 0 0.75rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tblr-heading-color, var(--tblr-body-color));
}

.rich-content h1 { font-size: 1.75rem; }
.rich-content h2 { font-size: 1.45rem; }
.rich-content h3 { font-size: 1.2rem; }
.rich-content h4 { font-size: 1.05rem; }

.rich-content a {
    color: var(--tblr-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.rich-content li {
    margin-bottom: 0.25rem;
}

.rich-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1.1rem;
    border-left: 4px solid var(--tblr-primary);
    border-radius: 0 8px 8px 0;
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary);
    font-style: italic;
}

.rich-content hr {
    margin: 1.75rem 0;
    border-color: var(--tblr-border-color);
    opacity: 1;
}

.rich-content pre,
.rich-content code {
    background: var(--tblr-bg-surface-secondary);
    border-radius: 6px;
    font-size: 0.9em;
}

.rich-content code {
    padding: 0.1rem 0.4rem;
}

.rich-content pre {
    padding: 0.85rem 1rem;
    overflow-x: auto;
}

.rich-content pre code {
    padding: 0;
    background: none;
}

/* Görseller */
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.rich-content figure {
    margin: 1.25rem 0;
}

.rich-content figure.image {
    display: table;
    max-width: 100%;
    margin: 1.25rem auto;
}

.rich-content figure.image img {
    display: block;
    margin: 0 auto;
}

.rich-content figcaption {
    display: table-caption;
    caption-side: bottom;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    color: var(--tblr-secondary);
}

.rich-content .image-style-side,
.rich-content .image-style-align-right {
    float: right;
    max-width: 50%;
    margin: 0.25rem 0 1rem 1.5rem;
}

.rich-content .image-style-align-left {
    float: left;
    max-width: 50%;
    margin: 0.25rem 1.5rem 1rem 0;
}

/* Tablolar */
.rich-content figure.table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    margin: 1.25rem 0;
}

.rich-content table {
    width: 100%;
    margin: 1.25rem 0;
    border-collapse: collapse;
}

.rich-content figure.table table {
    margin: 0;
}

.rich-content table th,
.rich-content table td {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--tblr-border-color);
    vertical-align: top;
}

.rich-content table th {
    background: var(--tblr-bg-surface-secondary);
    font-weight: 600;
    /* Tabler genel th stilini (küçük, büyük harf) kapatır: içerik yazarı ne yazdıysa öyle görünür. */
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
    color: inherit;
}

/* CKEditor boyut sınıfları */
.rich-content .text-tiny { font-size: 0.7em; }
.rich-content .text-small { font-size: 0.85em; }
.rich-content .text-big { font-size: 1.4em; }
.rich-content .text-huge { font-size: 1.8em; }

/* ─── Yönetim formları ──────────────────────────────────────────────────────────────────────── */
.cp-editor .ck-editor__editable_inline {
    min-height: 340px;
}

/* Geniş ekranda ayar paneli, uzun içerik düzenlenirken görünür kalır. */
@media (min-width: 992px) {
    .cp-aside {
        position: sticky;
        top: 1rem;
    }
}

.cp-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    cursor: pointer;
}

.cp-option .form-check {
    margin: 0;
    padding-top: 0.1rem;
    min-height: 0;
}

.cp-org-list {
    max-height: 220px;
    overflow: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    background: var(--tblr-bg-surface);
}

.cp-org-list .form-check {
    margin: 0.2rem 0;
}

/* ─── Yönetim listeleri ─────────────────────────────────────────────────────────────────────── */
.cp-table th {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.cp-table td,
.cp-table th {
    vertical-align: middle;
}

/* Uzun başlıkta simge daralmasın. */
.cp-table .avatar {
    flex-shrink: 0;
}

.cp-row-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.cp-row-sub {
    font-size: 0.78rem;
    color: var(--tblr-secondary);
}

.cp-row-sub.is-warn {
    color: var(--tblr-orange);
}

.cp-row-sub.is-ok {
    color: var(--tblr-green);
}

/* ─── Yazdırma ──────────────────────────────────────────────────────────────────────────────── */
@media print {
    .cp-hero {
        padding: 0 0 1rem;
        color: #000;
        background: none;
        box-shadow: none;
        border-bottom: 2px solid #000;
        border-radius: 0;
    }

    .cp-hero::before {
        display: none;
    }

    .cp-hero-kicker,
    .cp-hero-title {
        color: #000;
    }

    .cp-hero-icon,
    .cp-hero-actions {
        display: none;
    }

    .cp-chip {
        color: #000;
        background: none;
        border: 1px solid #999;
    }
}
