/* ============================================================================
 * CMS module styling
 * PATH: /portal/assets/css/cms.css
 * Focus: readable list view, no rounded corners
 * ========================================================================== */

/* 00) Scope + base */

.cms-body {
  background-color: #020617;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* No rounded corners anywhere inside CMS */
.cms-body,
.cms-body * {
  border-radius: 0 !important;
}

/* Keep shell tidy but simple */

.cms-shell.hl-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 16px 32px 16px;
  box-sizing: border-box;
}

/* 01) Page header and tabs */

.cms-header {
  padding: 8px 0 12px 0;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.cms-header-main {
  min-width: 0;
}

.cms-header .hl-page-title {
  margin: 0 0 4px 0;
  font-size: 1.3rem;
  line-height: 1.2;
  font-weight: 650;
  color: #f9fafb;
}

.cms-subnav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid #1f2937;
}

.cms-subnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.82rem;
  text-decoration: none;
  color: #9ca3af;
  border: none;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.cms-subnav a:hover {
  color: #f9fafb;
  background: rgba(15, 23, 42, 0.8);
}

.cms-subnav a.is-active {
  color: #fefce8;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 2px solid #f97316;
}

/* Header actions (New post/page) */

.cms-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 02) Buttons (scoped, simple) */

.cms-body .btn,
.cms-body .link-button {
  font-family: inherit;
  border-radius: 0;
  border: 1px solid transparent;
  font-size: 0.82rem;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.14s ease-out,
    border-color 0.14s ease-out,
    color 0.14s ease-out;
}

.cms-body .btn-primary {
  background: #f97316;
  color: #111827;
  border-color: rgba(248, 250, 252, 0.12);
}

.cms-body .btn-primary:hover {
  background: #fb923c;
}

.cms-body .btn-secondary {
  background: #020617;
  color: #e5e7eb;
  border-color: #374151;
}

.cms-body .btn-secondary:hover {
  background: #030712;
  border-color: #4b5563;
}

/* Default link-button (used in many places) */
.cms-body .link-button {
  padding: 0;
  border: none;
  background: none;
  color: #9ca3af;
}

/* 03) Alerts (flash messages) */

.cms-body .hl-alert {
  margin: 14px 0 0;
  padding: 9px 10px;
  font-size: 0.84rem;
  border-width: 1px;
  border-style: solid;
}

.cms-body .hl-alert-success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.5);
  color: #bbf7d0;
}

.cms-body .hl-alert-error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fecaca;
}

/* 04) LIST VIEW: posts/pages */

/* Panel wrapper */

.cms-body .hl-panel.cms-list {
  margin-top: 18px;
  padding: 14px 16px 16px 16px;
  background-color: #020617;
  border: 1px solid #1f2937;
}

/* List header + filters */

.cms-list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.cms-list-header .hl-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f9fafb;
}

.cms-list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.cms-list-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #9ca3af;
}

.cms-list-filters select,
.cms-list-filters input[type="text"] {
  min-width: 130px;
}

/* Inputs */

.cms-body input[type="text"],
.cms-body input[type="email"],
.cms-body input[type="password"],
.cms-body textarea,
.cms-body select {
  font-family: inherit;
  font-size: 0.86rem;
  color: #e5e7eb;
  padding: 6px 8px;
  border: 1px solid #1f2937;
  background: #020617;
  outline: none;
  box-sizing: border-box;
}

.cms-body input[type="text"]::placeholder,
.cms-body textarea::placeholder {
  color: #6b7280;
}

.cms-body input[type="text"]:focus,
.cms-body input[type="email"]:focus,
.cms-body input[type="password"]:focus,
.cms-body textarea:focus,
.cms-body select:focus {
  border-color: #f97316;
  background: #020617;
}

/* Table: make rows clearly separated and readable */

.cms-body .hl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: transparent;
}

/* Kill global rounded styles inside this table */
.cms-body .cms-list .hl-table,
.cms-body .cms-list .hl-table * {
  border-radius: 0 !important;
}

/* Header row */

.cms-body .hl-table th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #1f2937;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  background: #020617;
}

/* Body rows */

.cms-body .hl-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #0f172a;
}

/* Zebra striping */

.cms-body .hl-table tbody tr:nth-child(odd) {
  background: #020617;
}

.cms-body .hl-table tbody tr:nth-child(even) {
  background: #050816;
}

/* Hover highlight */

.cms-body .hl-table tbody tr:hover {
  background: #0b1120;
}

/* Title column: try to neutralize, but final override is below */

.cms-body .cms-list .hl-table td:first-child a {
  display: inline-block;
  font-weight: 600;
  color: #f9fafb;
  text-decoration: none;
}

.cms-body .cms-list .hl-table td:first-child a:hover {
  color: #fb923c;
}

/* Slug under title */

.cms-body .cms-list .hl-subtext {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* Categories column */

.cms-body .cms-list td:nth-child(2) {
  font-size: 0.84rem;
  color: #e5e7eb;
}

/* Status column */

.cms-body .cms-list td:nth-child(3) {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e5e7eb;
}

/* Dates a bit softer */

.cms-body .cms-list td:nth-child(4),
.cms-body .cms-list td:nth-child(5) {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* 05) Actions column */

.cms-body .hl-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.8rem;
}

/* Remove the dot separator */

.cms-body .hl-actions .hl-subtext-separator {
  display: none;
}

/* Default actions look, will be tightened in overrides */

.cms-body .cms-list .hl-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 0.78rem;
  text-decoration: none;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
}

.cms-body .cms-list .hl-actions a:hover {
  background: #111827;
  border-color: #4b5563;
  color: #fb923c;
}

/* Archive button */

.cms-body .cms-list .hl-actions .cms-inline-form .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 0.78rem;
  border: 1px solid #b91c1c;
  background: #7f1d1d;
  color: #fee2e2;
}

.cms-body .cms-list .hl-actions .cms-inline-form .link-button:hover {
  background: #b91c1c;
  border-color: #fecaca;
}

/* Inline forms */

.cms-inline-form {
  display: inline-block;
  margin: 0;
}

/* 06) Pagination */

.cms-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #1f2937;
  font-size: 0.8rem;
  color: #9ca3af;
}

.cms-pagination-info .hl-subtext {
  color: #6b7280;
}

.cms-pagination-links {
  display: flex;
  gap: 8px;
}

/* 07) Editor + sidebar */

.cms-editor-body > form {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(240px, 1.6fr);
  gap: 16px;
  align-items: flex-start;
}

.cms-editor-main {
  padding: 10px 12px;
  background: #020617;
  border: 1px solid #1f2937;
}

.cms-editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cms-card {
  background: #020617;
  border: 1px solid #1f2937;
  padding: 8px 10px;
}

.cms-card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  margin-bottom: 6px;
}

.cms-card-body {
  font-size: 0.86rem;
}

/* Basic form group styling in editor */

.cms-editor .form-group {
  margin-bottom: 8px;
}

.cms-editor .form-group label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #9ca3af;
}

.cms-editor .form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
}

/* 08) Comments view */

.cms-body .hl-panel.cms-comments {
  margin-top: 18px;
  padding: 14px 16px 16px 16px;
  background-color: #020617;
  border: 1px solid #1f2937;
}

.cms-comments-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.cms-comments-filter {
  padding: 4px 9px;
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid #374151;
  color: #9ca3af;
  background: #020617;
}

.cms-comments-filter.is-active {
  border-color: #f97316;
  color: #fefce8;
}

.cms-comment-body {
  max-width: 380px;
  max-height: 96px;
  overflow: auto;
  font-size: 0.82rem;
}

.cms-comment-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 09) Responsive tweaks */

@media (max-width: 960px) {
  .cms-editor-body > form {
    grid-template-columns: minmax(0, 1fr);
  }

  .cms-editor-sidebar {
    order: -1;
  }
}

@media (max-width: 780px) {
  .cms-shell.hl-shell {
    padding: 14px 10px 26px 10px;
  }

  .cms-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cms-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .cms-list-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cms-list-filters label {
    flex: 1 1 45%;
  }

  .cms-pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 10) CMS list hard overrides for readability */

.cms-body .cms-main .hl-panel.cms-list {
  font-size: 0.86rem;
}

/* Strong title rules so they beat global red links */
.cms-body .cms-main .hl-panel.cms-list .hl-table tbody tr td:first-child {
  max-width: 380px;
}

.cms-body .cms-main .hl-panel.cms-list .hl-table tbody tr td:first-child a {
  display: inline-block;
  font-weight: 600;
  line-height: 1.3;
  color: #f9fafb !important;
  text-decoration: none;
}

.cms-body .cms-main .hl-panel.cms-list .hl-table tbody tr td:first-child a:hover {
  color: #fb923c !important;
}

.cms-body .cms-main .hl-panel.cms-list .hl-table tbody tr td:first-child .hl-subtext {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: #9ca3af;
}

/* Column widths */
.cms-body .cms-main .hl-panel.cms-list .hl-table th:nth-child(1) { width: 38%; }
.cms-body .cms-main .hl-panel.cms-list .hl-table th:nth-child(2) { width: 24%; }
.cms-body .cms-main .hl-panel.cms-list .hl-table th:nth-child(3) { width: 10%; }
.cms-body .cms-main .hl-panel.cms-list .hl-table th:nth-child(4) { width: 13%; }
.cms-body .cms-main .hl-panel.cms-list .hl-table th:nth-child(5) { width: 13%; }
.cms-body .cms-main .hl-panel.cms-list .hl-table th:nth-child(6) { width: 8%; }

.cms-body .cms-main .hl-panel.cms-list .hl-table tbody tr td {
  vertical-align: top;
}

/* Status pill */
.cms-body .cms-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 0;
  border: 1px solid #1f2937;
  background: #020617;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cms-body .cms-status-emoji {
  font-size: 0.9rem;
}

.cms-body .cms-status-text {
  color: #e5e7eb;
}

/* Status colors */
.cms-body .cms-status-pill.status-draft {
  border-color: #6b7280;
}

.cms-body .cms-status-pill.status-in_review {
  border-color: #eab308;
}

.cms-body .cms-status-pill.status-scheduled {
  border-color: #0ea5e9;
}

.cms-body .cms-status-pill.status-published {
  border-color: #22c55e;
}

.cms-body .cms-status-pill.status-archived {
  border-color: #4b5563;
  color: #9ca3af;
}

/* Actions column rework */

.cms-body .cms-main .hl-panel.cms-list .hl-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

/* Kill any global icon font pseudo elements */
.cms-body .cms-main .hl-panel.cms-list .hl-actions a::before,
.cms-body .cms-main .hl-panel.cms-list .hl-actions button::before {
  content: none !important;
}

/* Ensure text or emoji is visible even if global CSS tried to hide it */
.cms-body .cms-main .hl-panel.cms-list .hl-actions a,
.cms-body .cms-main .hl-panel.cms-list .hl-actions button {
  text-indent: 0;
  overflow: visible;
}

/* Icon style buttons for actions */

.cms-body .cms-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  font-size: 0.9rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb !important;
  padding: 0;
  cursor: pointer;
}

.cms-body .cms-action-edit {
  border-color: #4b5563;
}

.cms-body .cms-action-view {
  border-color: #0ea5e9;
}

.cms-body .cms-action-archive {
  border-color: #b91c1c;
  background: #7f1d1d;
  color: #fee2e2 !important;
}

.cms-body .cms-action-btn:hover {
  background: #111827;
  border-color: #f97316;
}

.cms-body .cms-action-archive:hover {
  background: #b91c1c;
  border-color: #fecaca;
}
