/* ============================================================
   Hivipunde admin — newsroom skin
   Loaded only on admin pages via ArticleAdmin.Media.
   Goal: calm, readable, big writing area, clear status.
   ============================================================ */

:root {
  --nw-ink: #0f1115;
  --nw-body: #2b2f38;
  --nw-muted: #6b7280;
  --nw-line: #e2e5ea;
  --nw-soft: #f5f6f8;
  --nw-accent: #d92d27;
  --nw-accent-soft: #fdecea;
  --nw-success: #127a3f;
  --nw-warning: #a35c00;
}

body,
#container {
  background: #f7f8fa !important;
}

#content {
  max-width: 1280px;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ----- Top branding bar ----- */
#header {
  background: linear-gradient(180deg, #0f1115, #1d2128) !important;
  color: #fff !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  padding: 14px 24px !important;
}
#branding h1 {
  font-family: "Encode Sans Condensed", "Inter", sans-serif !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#branding h1 a { color: #fff !important; }
#user-tools { color: #cbd0d8 !important; font-size: 13px; }
#user-tools a { color: #fff !important; border-bottom: none !important; }
#user-tools a:hover { color: var(--nw-accent) !important; }

/* ----- Module headers ----- */
.module h2, .module caption {
  background: var(--nw-ink) !important;
  color: #fff !important;
  font-family: "Encode Sans Condensed", "Inter", sans-serif;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px !important;
  padding: 10px 14px !important;
}

/* ----- Form layout ----- */
.form-row { padding: 14px 0 !important; border-bottom: 1px solid var(--nw-line) !important; }
.aligned label {
  font-weight: 600 !important;
  color: var(--nw-ink) !important;
  width: 180px !important;
  padding-top: 10px !important;
}
.help, .form-row .help, p.help {
  color: var(--nw-muted) !important;
  font-size: 12.5px !important;
  margin-top: 6px !important;
  line-height: 1.4;
}
fieldset.module {
  border: 1px solid var(--nw-line) !important;
  border-radius: 8px !important;
  overflow: hidden;
  margin-bottom: 18px !important;
  background: #fff !important;
}
fieldset.module .description {
  background: var(--nw-soft);
  color: var(--nw-body);
  padding: 10px 14px;
  border-bottom: 1px solid var(--nw-line);
  font-size: 13px;
  line-height: 1.5;
}

/* ----- Inputs ----- */
input[type=text], input[type=url], input[type=email], input[type=search],
input[type=password], textarea, select {
  min-height: 38px;
  border: 1px solid var(--nw-line) !important;
  border-radius: 4px !important;
  padding: 8px 10px !important;
  font-size: 14px !important;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--nw-ink) !important;
  box-shadow: 0 0 0 3px rgba(15, 17, 21, 0.08) !important;
  outline: none !important;
}
textarea { line-height: 1.55 !important; }

/* Title input — make it feel like a real headline field */
#id_title { font-size: 22px !important; font-weight: 700 !important; padding: 12px !important; }

/* Content textarea — wide and quiet */
#id_content_html, #id_excerpt_html {
  width: 100% !important;
  max-width: none !important;
  font-family: Georgia, "Source Serif 4", serif !important;
}

/* ----- Buttons ----- */
.submit-row {
  background: var(--nw-soft) !important;
  border: 1px solid var(--nw-line) !important;
  border-radius: 8px !important;
  padding: 14px !important;
  margin-top: 18px !important;
  box-shadow: 0 8px 24px rgba(15, 17, 21, .06);
}
.submit-row input[type=submit],
.button, input[type=submit], .object-tools a {
  background: var(--nw-ink) !important;
  color: #fff !important;
  border-radius: 4px !important;
  padding: 10px 18px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 0 !important;
  transition: background 120ms ease;
}
.submit-row input.default,
.submit-row input[type=submit][name="_save"] {
  background: var(--nw-accent) !important;
}
.button:hover, input[type=submit]:hover, .object-tools a:hover,
.submit-row input[type=submit]:hover {
  background: var(--nw-accent) !important;
  opacity: 1 !important;
}
.deletelink, .submit-row .deletelink {
  background: #fff !important;
  color: #b71c1c !important;
  border: 1px solid #f0c4c1 !important;
}
.deletelink:hover { background: #b71c1c !important; color: #fff !important; }

/* ----- List view ----- */
#changelist { background: transparent !important; }
#changelist table {
  width: 100%;
  border: 1px solid var(--nw-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 17, 21, .04);
}
#changelist table thead th {
  background: var(--nw-soft) !important;
  color: var(--nw-ink) !important;
  font-family: "Encode Sans Condensed", "Inter", sans-serif;
  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; }
#changelist .results {
  overflow-x: auto;
  border-radius: 8px;
}

/* Filters sidebar */
#changelist-filter {
  background: #fff !important;
  border: 1px solid var(--nw-line) !important;
  border-radius: 8px !important;
  padding: 0 !important;
  max-width: 220px;
}
#changelist-filter h2 {
  background: var(--nw-ink) !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: 12px !important;
  color: var(--nw-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#changelist-filter ul { padding: 0 8px 12px !important; }
#changelist-filter li.selected a { color: var(--nw-accent) !important; font-weight: 700 !important; }

/* Search bar */
#changelist-search input[type=text] { min-width: 280px; }

/* Date hierarchy */
.xfull { background: #fff; border: 1px solid var(--nw-line); border-radius: 8px; padding: 10px 14px; }

/* Breadcrumbs */
.breadcrumbs {
  background: #fff !important;
  border-bottom: 1px solid var(--nw-line) !important;
  color: var(--nw-muted) !important;
  font-size: 12.5px;
  padding: 12px 24px !important;
}
.breadcrumbs a { color: var(--nw-ink) !important; }

/* ----- Dashboard ----- */
#content-main .app-core .module,
#content-main .module {
  border: 1px solid var(--nw-line) !important;
  border-radius: 8px !important;
  overflow: hidden;
  margin-bottom: 16px !important;
}
.dashboard .module table th, .dashboard .module table td { padding: 10px 14px !important; }

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

/* Hide noisy default link colours */
a:link, a:visited { color: var(--nw-ink); }
a:hover { color: var(--nw-accent); }

/* Image preview spacing */
.field-image_preview, .field-thumb_large, .field-avatar_preview {
  padding-top: 8px !important;
}

/* Filter horizontal nicer */
.selector h2 { background: var(--nw-soft) !important; color: var(--nw-ink) !important; }
.selector-available, .selector-chosen { border-radius: 6px !important; overflow: hidden; }

/* Calendar / time pickers */
.calendarbox, .clockbox { border-radius: 8px !important; overflow: hidden; }

/* Make the prepopulated slug feel calm */
.prepopulated_field code { background: var(--nw-soft); padding: 2px 6px; border-radius: 3px; font-size: 12px; }

/* ----- Helpful section header on the Article form ----- */
#article_form fieldset.module:first-of-type h2::before {
  content: "📰 ";
}
fieldset.module h2:not(.collapse-toggle):not(:empty) {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Collapsible look */
fieldset.collapse .description { display: none; }
fieldset.collapse.collapsed .description { display: none; }

/* Smaller "modified_at" readonly value */
.field-modified_at .readonly { color: var(--nw-muted); font-size: 12px; }

/* ----- Mobile ----- */
@media (max-width: 767px) {
  #header {
    padding: 12px 16px !important;
  }
  #branding h1 {
    font-size: 18px !important;
  }
  #user-tools {
    display: block;
    margin-top: 8px;
    line-height: 1.5;
  }
  .aligned label { width: 100% !important; padding-top: 0 !important; }
  #changelist-filter { max-width: none; }
  #changelist-search input[type=text] {
    min-width: 0;
    width: 100%;
  }
  .object-tools {
    float: none !important;
    margin: 0 0 12px !important;
  }
  .object-tools li,
  .object-tools a {
    display: block;
    width: 100%;
  }
  .submit-row input[type=submit] { width: 100% !important; margin: 4px 0; }
}

/* ============================================================
   Newsroom dashboard (admin/index.html overrides)
   ============================================================ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.editor-shortcut {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .08);
}

.newsroom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.newsroom-card {
  display: block;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--nw-line, #e2e5ea);
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--nw-ink, #0f1115);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.newsroom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 17, 21, .08);
  border-color: #cfd4db;
}
.newsroom-card-primary {
  background: linear-gradient(180deg, #0f1115, #1d2128);
  color: #fff;
  border-color: #0f1115;
}
.newsroom-card-primary:hover { color: #fff; border-color: #1d2128; }
.newsroom-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nw-muted, #6b7280);
}
.newsroom-card-primary .newsroom-card-eyebrow { color: #ff8a85; }
.newsroom-card-title {
  font-size: 32px;
  font-weight: 800;
  margin-top: 6px;
  color: inherit;
  line-height: 1;
}
.newsroom-card-desc {
  margin-top: 8px;
  color: var(--nw-muted, #6b7280);
  font-size: 13px;
  line-height: 1.45;
}
.newsroom-card-primary .newsroom-card-desc { color: #cbd0d8; }

.newsroom-recent-module { overflow: hidden; }
.newsroom-recent {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.newsroom-recent td,
.newsroom-recent th {
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--nw-line, #e2e5ea);
  vertical-align: middle;
}
.newsroom-recent th {
  background: var(--nw-soft, #f5f6f8) !important;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--nw-ink, #0f1115) !important;
}
.newsroom-recent tbody tr:hover { background: #fafbfc; }
.newsroom-recent .newsroom-recent-action { text-align: right; }

.newsroom-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef0f3;
  color: var(--nw-ink, #0f1115);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.newsroom-pill-publish { background: #eaf7ee; color: #15803d; }
.newsroom-pill-draft   { background: #fff4df; color: #a76a12; }
.newsroom-pill-pending { background: #eaf0fb; color: #2457a6; }
.newsroom-pill-private { background: #eef0f3; color: var(--nw-ink, #0f1115); }
.newsroom-pill-trash   { background: #fdecea; color: #a91e1a; }

@media (max-width: 900px) {
  .newsroom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .newsroom-grid { grid-template-columns: 1fr; }
  .newsroom-recent th:nth-child(3),
  .newsroom-recent td:nth-child(3) { display: none; }
}
