/* ===================================================================
   news-editor.css
   Haber ekleme/düzenleme sayfaları için: zengin metin editörü, kaynak
   yönetimi ve il/ilçe/mahalle seçimi. Kapak görseli (dropzone/önizleme/
   kaldır butonu) ve mobil tam-ekran textarea modalı zaten news-admin.css
   içinde tanımlı - burada TEKRAR tanımlanmıyor, sadece üstüne ekleniyor.
=================================================================== */

/* ----- Zengin Metin Editörü (içerik alanı) ----- */
.news-editor-shell {
    display: block;
}

.news-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    border: 1px solid #d7dce3;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f7f8fa;
}

.news-editor-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.news-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.news-editor-btn:hover {
    background: #eceff3;
}

.news-editor-btn.is-active {
    background: #dce8fb;
    border-color: #bcd4f6;
    color: #1a56b0;
}

.news-editor-divider {
    width: 1px;
    background: #d7dce3;
    margin: 4px 2px;
}

.news-editor-expand-btn {
    border: 1px solid #d7dce3;
    flex-shrink: 0;
    color: #2a6fdb;
}

.news-editor-expand-btn:hover {
    background: #eaf1fd;
}

.news-editor-content {
    min-height: 220px;
    max-height: 520px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid #d7dce3;
    border-radius: 0 0 8px 8px;
    background: #fff;
    font-size: 14.5px;
    line-height: 1.6;
    color: #222;
}

.news-editor-content:focus {
    outline: none;
    border-color: #2a6fdb;
}

.news-editor-content p {
    margin: 0 0 10px;
}

.news-editor-content h2,
.news-editor-content h3 {
    margin: 16px 0 8px;
    line-height: 1.3;
}

.news-editor-content ul,
.news-editor-content ol {
    margin: 0 0 10px;
    padding-left: 30px;
}

.news-editor-content li {
    margin-bottom: 6px;
}

.news-editor-content mark {
    background: #fff59d;
    padding: 0 2px;
    border-radius: 2px;
}

.news-editor-content a {
    color: #2a6fdb;
    text-decoration: underline;
}

.news-editor-content:empty::before {
    content: attr(data-placeholder);
    color: #9aa1ab;
    pointer-events: none;
}

/* Mobilde küçük kutunun içinde direkt yazmak yerine tam ekran editöre
   yönlendiriyoruz (ilan formlarındaki textarea davranışıyla aynı mantık). */
@media (max-width: 768px) {
    .news-editor-content[contenteditable="false"] {
        cursor: pointer;
        background: #fafbfc;
    }

    .news-editor-content[contenteditable="false"]::after {
        content: "✏️ Tam ekran düzenlemek için dokunun";
        display: block;
        margin-top: 10px;
        font-size: 12.5px;
        color: #8b93a0;
        font-style: italic;
    }
}

/* ----- Tam Ekran Düzenleme Modali (mevcut .textarea-modal-* kalıbını
   kullanır; buraya sadece zengin metin editörünü barındıran gövdeyi
   ekliyoruz - bkz. news-admin.js: initFullscreenEditModal) ----- */
.news-editor-modal-body {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.news-editor-shell.is-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.news-editor-shell.is-fullscreen .news-editor-toolbar {
    border-radius: 10px 10px 0 0;
}

.news-editor-shell.is-fullscreen .news-editor-content {
    flex: 1;
    max-height: none;
    min-height: 0;
    border-radius: 0 0 10px 10px;
}

/* ----- Kaynaklar (Sources) ----- */
.news-sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.news-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 6px 8px 6px 12px;
    border-radius: 999px;
    background: #eef2f7;
    border: 1px solid #dde3ea;
    font-size: 13px;
    color: #333;
}

.news-source-chip a {
    color: #1a56b0;
    text-decoration: none;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-source-chip a:hover {
    text-decoration: underline;
}

.news-source-chip-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #d7e6fb;
    color: #1a56b0;
    cursor: pointer;
    font-size: 10.5px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.news-source-chip-edit:hover {
    background: #2a6fdb;
    color: #fff;
}

.news-source-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #d7dce3;
    color: #444;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.news-source-chip-remove:hover {
    background: #e74c3c;
    color: #fff;
}

.news-source-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px dashed #2a6fdb;
    background: #fff;
    color: #2a6fdb;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.news-source-add-btn:hover {
    background: #f0f5fe;
}

.news-empty-hint {
    color: #8b93a0;
    font-size: 13px;
    margin: 4px 0;
}

/* ----- Kaynak Ekle Popup (modal) ----- */
.news-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 30, .5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.news-modal-overlay.active {
    display: flex;
}

.news-modal-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}

.news-modal-box h4 {
    margin: 0 0 14px;
    font-size: 16px;
}

.news-modal-field {
    margin-bottom: 12px;
}

.news-modal-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.news-modal-field input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d7dce3;
    border-radius: 7px;
    font-size: 14px;
    box-sizing: border-box;
}

.news-modal-field input:focus {
    outline: none;
    border-color: #2a6fdb;
}

.news-modal-error {
    color: #e74c3c;
    font-size: 12.5px;
    margin: -6px 0 10px;
    display: none;
}

.news-modal-error.active {
    display: block;
}

.news-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.news-modal-cancel-btn,
.news-modal-confirm-btn {
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.news-modal-cancel-btn {
    background: #f0f2f5;
    color: #444;
}

.news-modal-confirm-btn {
    background: #2a6fdb;
    color: #fff;
}

.news-modal-confirm-btn:hover {
    background: #1f5cc0;
}

/* ----- İl / İlçe / Mahalle select durumları ----- */
.news-field select:disabled {
    background: #f2f3f5;
    color: #9aa1ab;
    cursor: not-allowed;
}

/* ----- Haber detay sayfasında konum rozeti ve kaynaklar ----- */
.news-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eef2f7;
    color: #445;
    font-size: 13px;
    margin: 4px 8px 4px 0;
}

.news-sources-section {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #e5e8ee;
}

.news-sources-section h3 {
    font-size: 15px;
    margin: 0 0 10px;
    color: #444;
}

.news-sources-section ol {
    margin: 0;
    padding-left: 20px;
}

.news-sources-section li {
    margin-bottom: 6px;
    font-size: 14px;
}

.news-sources-section a {
    color: #2a6fdb;
}