/* =========================================================================
   Kenyan Bulletin admin — newsroom skin overlay
   Loaded on top of modern.css via ArticleAdmin.Media. Adds dashboard cards,
   tightens the form chrome, and gives the admin a more editorial feel.
   ========================================================================= */

/* ----- Global admin layout cleanup ----- */
#content {
  max-width: 1240px;
  margin: 0 auto;
}

.dashboard #content {
  width: min(1120px, calc(100% - 56px)) !important;
}

.dashboard #content-main {
  float: none !important;
  width: 100%;
  max-width: none;
}

.dashboard .module {
  max-width: 100%;
}

.change-form #content-main {
  max-width: 1080px;
}

.kb-admin-editor-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  margin-right: 8px;
  border-radius: 8px;
  background: #b42318;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}
.kb-admin-editor-link:hover {
  background: #8b1812;
  color: #fff !important;
}

/* ----- Newsroom dashboard cards ----- */
.kb-newsroom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kb-newsroom-card {
  display: block;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--kb-line, #d9dee8);
  border-radius: 8px;
  text-decoration: none !important;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.kb-newsroom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 17, 21, 0.08);
  border-color: #b8c0ca;
}
.kb-newsroom-card-primary {
  background: linear-gradient(180deg, #0c0d0e, #1d2128);
  color: #fff !important;
  border-color: #0c0d0e;
}
.kb-newsroom-card-primary:hover { color: #fff !important; }

.kb-newsroom-card-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kb-muted, #5b6168);
}
.kb-newsroom-card-primary .kb-newsroom-card-eyebrow { color: #ef5048; }

.kb-newsroom-card-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: 0;
  color: inherit;
}

.kb-newsroom-card-desc {
  margin-top: 6px;
  color: var(--kb-muted, #5b6168);
  font-size: 13px;
  line-height: 1.45;
}
.kb-newsroom-card-primary .kb-newsroom-card-desc { color: #cbd0d8; }

.kb-newsroom-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 0 0 22px;
  font-size: 14px;
}
.kb-newsroom-link {
  color: #0f766e;
  font-weight: 700;
  text-decoration: none;
}
.kb-newsroom-link:hover { color: #115e59; }
.kb-newsroom-link--quiet { color: var(--kb-muted, #5b6168); font-weight: 500; }

/* Recently edited table */
.kb-newsroom-recent { width: 100%; border-collapse: collapse; }
.kb-newsroom-recent a {
  overflow-wrap: anywhere;
}
.kb-newsroom-cell-actions { text-align: right; }
.kb-newsroom-recent td,
.kb-newsroom-recent th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--kb-line, #d9dee8);
}
.kb-newsroom-recent th {
  background: var(--kb-soft, #f5f7fb);
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #344054;
}
.kb-newsroom-recent tr:hover td { background: #fafbfc; }

/* ----- Fieldset description styling ----- */
fieldset.module .description {
  background: var(--kb-soft, #f5f7fb);
  color: #344054;
  padding: 10px 14px;
  border-bottom: 1px solid var(--kb-line, #d9dee8);
  font-size: 13px;
  line-height: 1.5;
}

/* ----- Submit row ----- */
.submit-row {
  background: var(--kb-soft, #f5f7fb) !important;
  border: 1px solid var(--kb-line, #d9dee8) !important;
  border-radius: 8px !important;
  padding: 14px !important;
  margin-top: 18px !important;
}
.submit-row input[type=submit] {
  border-radius: 8px !important;
  padding: 10px 18px !important;
  font-weight: 700 !important;
  text-transform: none;
  letter-spacing: 0;
}
.submit-row input.default,
.submit-row input[type=submit][name="_save"] {
  background: #b42318 !important;
  border-color: #b42318 !important;
}
.submit-row input.default:hover { background: #8b1812 !important; }

/* ----- Field rows ----- */
.form-row {
  padding: 14px 0 !important;
  border-bottom: 1px solid var(--kb-line, #d9dee8) !important;
}
.aligned label {
  font-weight: 700 !important;
  color: #172033 !important;
  width: 180px !important;
  padding-top: 10px !important;
}
.help, .form-row .help, p.help {
  color: var(--kb-muted, #5b6168) !important;
  font-size: 12.5px !important;
  margin-top: 6px !important;
  line-height: 1.45;
}

/* Title field — make it feel like a real headline */
#id_title {
  font-family: "Source Serif 4", Georgia, serif !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  padding: 12px !important;
  letter-spacing: 0;
}

/* Body / excerpt — wide and quiet */
#id_dek,
#id_body {
  width: 100% !important;
  max-width: none !important;
  font-family: "Source Serif 4", Georgia, serif !important;
}

/* ----- Change-list table ----- */
#changelist table {
  border: 1px solid var(--kb-line, #d9dee8);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
#changelist {
  overflow-x: auto;
}
#changelist table thead th {
  background: var(--kb-soft, #f5f7fb) !important;
  color: #172033 !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11.5px !important;
  letter-spacing: 0.05em;
  padding: 12px 10px !important;
}
#changelist table tbody td {
  padding: 12px 10px !important;
  vertical-align: middle;
}
#changelist tbody tr:hover { background: #fafbfc !important; }

/* ----- Filters sidebar ----- */
#changelist-filter {
  background: #fff !important;
  border: 1px solid var(--kb-line, #d9dee8) !important;
  border-radius: 8px !important;
  padding: 0 !important;
  max-width: 230px;
}
#changelist-filter h2 {
  background: #0c0d0e !important;
  color: #fff !important;
  padding: 10px 14px !important;
  margin: 0 !important;
  font-size: 12px !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#changelist-filter h3 {
  margin: 14px 14px 6px !important;
  font-size: 11.5px !important;
  color: var(--kb-muted, #5b6168) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#changelist-filter ul { padding: 0 8px 12px !important; }
#changelist-filter li.selected a { color: #b42318 !important; font-weight: 700 !important; }

/* ----- Action bar ----- */
.actions {
  background: var(--kb-soft, #f5f7fb) !important;
  border: 1px solid var(--kb-line, #d9dee8) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  margin-bottom: 12px !important;
}

/* ----- Image preview spacing ----- */
.field-featured_image_preview,
.field-view_link_inline {
  padding-top: 8px !important;
}

.kb-editor-shell {
  max-width: 100% !important;
}

.kb-editor-surface {
  min-height: 460px !important;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .dashboard #content {
    width: min(100% - 28px, 1120px) !important;
  }
  .kb-newsroom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  #content { padding: 18px 14px !important; }
  .kb-newsroom-grid { grid-template-columns: 1fr; }
  .kb-newsroom-cta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .kb-newsroom-recent {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .kb-newsroom-cell-actions { text-align: left; }
  .aligned label { width: 100% !important; padding-top: 0 !important; }
  .kb-editor-surface { min-height: 360px !important; padding: 18px !important; }
}
