/* Scholarly Publisher — frontend dashboard styles.
 * Loaded twice by design: once normally (Inherit Theme mode, where the
 * :host rule below is simply ignored) and once again, injected inside
 * the Shadow DOM by dashboard.js, for Clean Canvas mode. `all: initial`
 * on :host is what actually blocks the active theme's fonts/colors from
 * bleeding into the shadow tree — plain CSS specificity can't do that
 * across a shadow boundary, since normal inherited properties still
 * cross it by default.
 */

:host {
  all: initial;
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1d2327;
  --sch-pub-accent: #2271b1;
  --sch-pub-border: #dcdcde;
  --sch-pub-bg: #ffffff;
  --sch-pub-muted-bg: #f6f7f7;
}

.sch-pub-dashboard,
.sch-pub-dashboard * ,
.sch-pub-dashboard *::before,
.sch-pub-dashboard *::after {
  box-sizing: border-box;
}

.sch-pub-dashboard-inner {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--sch-pub-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sch-pub-bg);
}

.sch-pub-dashboard-nav {
  flex: 0 0 220px;
  background: var(--sch-pub-muted-bg);
  border-right: 1px solid var(--sch-pub-border);
  padding: 1rem 0;
}

.sch-pub-dashboard-role-badge {
  font-weight: 600;
  padding: 0 1rem 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sch-pub-accent);
}

.sch-pub-dashboard-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sch-pub-dashboard-nav a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: #1d2327;
  border-left: 3px solid transparent;
}

.sch-pub-dashboard-nav a:hover {
  background: #eaeaea;
}

.sch-pub-dashboard-nav a.is-active {
  border-left-color: var(--sch-pub-accent);
  background: var(--sch-pub-bg);
  font-weight: 600;
}

.sch-pub-dashboard-panel {
  flex: 1 1 auto;
  padding: 1.5rem 1.75rem;
  min-width: 0;
}

.sch-pub-panel.is-hidden {
  display: none;
}

.sch-pub-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.sch-pub-coming-soon {
  color: #646970;
  font-style: italic;
}

.sch-pub-settings-form p {
  margin: 0 0 1.1rem;
  max-width: 420px;
}

.sch-pub-settings-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.sch-pub-settings-form input[type="text"],
.sch-pub-settings-form select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--sch-pub-border);
  border-radius: 4px;
  font: inherit;
  color: inherit;
}

.sch-pub-field-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #646970;
}

.sch-pub-button {
  background: var(--sch-pub-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.55rem 1.2rem;
  font: inherit;
  cursor: pointer;
}

.sch-pub-button:hover {
  opacity: 0.9;
}

.sch-pub-settings-status {
  margin-left: 0.75rem;
  font-size: 0.85rem;
  color: #646970;
}

.sch-pub-login-prompt,
.sch-pub-no-access {
  padding: 1rem;
  border: 1px solid var(--sch-pub-border);
  border-radius: 6px;
  background: var(--sch-pub-muted-bg);
}

@media (max-width: 640px) {
  .sch-pub-dashboard-inner {
    flex-direction: column;
  }

  .sch-pub-dashboard-nav {
    flex: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--sch-pub-border);
  }
}

/* Issues & Publishing panel */

.sch-pub-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.sch-pub-inline-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.sch-pub-inline-form input,
.sch-pub-inline-form textarea {
  font: inherit;
  color: inherit;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--sch-pub-border);
  border-radius: 4px;
  min-width: 160px;
}

.sch-pub-inline-form textarea {
  min-width: 260px;
}

.sch-pub-form-status {
  font-size: 0.8rem;
  color: #646970;
}

.sch-pub-issue-card {
  border: 1px solid var(--sch-pub-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.sch-pub-issue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sch-pub-issue-card-header h4 {
  margin: 0;
}

.sch-pub-issue-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--sch-pub-muted-bg);
}

.sch-pub-issue-status--published {
  background: #d7f5df;
  color: #1a7a34;
}

.sch-pub-issue-articles {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}

.sch-pub-issue-articles li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--sch-pub-muted-bg);
}

.sch-pub-link-button {
  background: none;
  border: none;
  color: #b32d2e;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}

.sch-pub-link-button:hover {
  text-decoration: underline;
}

.sch-pub-add-article {
  margin: 0.75rem 0;
}

.sch-pub-add-article summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--sch-pub-accent);
}

.sch-pub-add-article .sch-pub-inline-form {
  margin-top: 0.75rem;
}

.sch-pub-issue-card-footer {
  margin-top: 0.5rem;
}

.sch-pub-button--secondary {
  background: transparent;
  color: var(--sch-pub-accent);
  border: 1px solid var(--sch-pub-accent);
}
