/* Dialognetz Redaktion - frontend and portal styles. */
.dnpg-managed-content,
.dnpg-description,
.dnpg-pdf-list {
  font-family: var(--dnpg-font-family, "Poppins", Arial, sans-serif);
}
.dnpg-description p:first-child { margin-top: 0; }
.dnpg-description p:last-child { margin-bottom: 0; }
.dnpg-pdf-list { margin: 1.25rem 0 0; padding-left: 1.2rem; }
.dnpg-pdf-list li + li { margin-top: .45rem; }
.dnpg-pdf-link { text-decoration: underline; text-underline-offset: .16em; }

.dnpg-portal-wrap {
  width: min(calc(100% - 32px), 1180px);
  margin: 48px auto;
  color: var(--dnpg-text-color, #151515);
  font-family: var(--dnpg-font-family, "Poppins", Arial, sans-serif);
}
.dnpg-portal-card {
  padding: clamp(24px, 4vw, 44px);
  background: #fff;
  border: 1px solid rgba(0,0,0,.09);
  box-shadow: 0 18px 48px rgba(0,0,0,.08);
}
.dnpg-portal-card h2,
.dnpg-portal-card h3 { margin-top: 0; }
.dnpg-portal-card h2 { margin-bottom: .45rem; }
.dnpg-portal-card > p { margin-top: 0; }
.dnpg-portal-login { max-width: 560px; margin: 0 auto; }
.dnpg-portal-login form,
.dnpg-portal-edit-form { display: grid; gap: 18px; }
.dnpg-portal-card label { display: block; margin-bottom: 7px; font-weight: 600; }
.dnpg-portal-card input[type="text"],
.dnpg-portal-card input[type="password"],
.dnpg-portal-card input[type="file"],
.dnpg-portal-card textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #cfd3d7;
  border-radius: 3px;
  background: #fff;
  color: #151515;
  font: inherit;
  box-sizing: border-box;
}
.dnpg-portal-card textarea { min-height: 420px; line-height: 1.65; resize: vertical; }
.dnpg-portal-card input:focus,
.dnpg-portal-card textarea:focus {
  outline: 2px solid var(--dnpg-accent-color, #ef7015);
  outline-offset: 1px;
  border-color: var(--dnpg-accent-color, #ef7015);
}
.dnpg-portal-button,
.dnpg-token-button,
.dnpg-portal-link-button {
  appearance: none;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.dnpg-portal-button {
  justify-self: start;
  min-height: 46px;
  padding: 11px 22px;
  background: var(--dnpg-accent-color, #ef7015);
  color: #fff;
}
.dnpg-portal-button:hover,
.dnpg-portal-button:focus-visible { filter: brightness(.94); color: #fff; }
.dnpg-portal-link-button {
  padding: 8px 0;
  background: transparent;
  color: var(--dnpg-link-color, #202124);
  text-decoration: underline;
}
.dnpg-portal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.dnpg-portal-head p { margin: 0; }
.dnpg-portal-logout { flex: 0 0 auto; }
.dnpg-portal-field { display: grid; gap: 9px; }
.dnpg-portal-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.dnpg-character-counter { color: #666; font-size: .9em; white-space: nowrap; }
.dnpg-character-counter.is-near-limit { color: #a33a00; font-weight: 600; }
.dnpg-placeholder-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.dnpg-token-button { padding: 7px 11px; background: #f1f2f3; color: #222; font-size: .88em; }
.dnpg-token-button:hover,
.dnpg-token-button:focus-visible { background: #e5e7e9; }
.dnpg-portal-help { margin: 0; color: #666; font-size: .9em; }
.dnpg-pdf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dnpg-pdf-slot { padding: 20px; background: #f7f7f8; border: 1px solid #e3e4e6; }
.dnpg-pdf-slot h3 { margin-bottom: 15px; font-size: 1.1rem; }
.dnpg-pdf-slot > * + label { margin-top: 15px; }
.dnpg-current-pdf { overflow-wrap: anywhere; }
.dnpg-remove-pdf { margin-top: 15px; font-weight: 400 !important; }
.dnpg-remove-pdf input { margin-right: 6px; }
.dnpg-save-button { margin-top: 6px; }
.dnpg-portal-notice { margin-bottom: 18px; padding: 13px 16px; border-left: 4px solid #707070; background: #f4f4f4; }
.dnpg-portal-notice.is-success { border-left-color: #2d7d46; background: #f0f8f2; }
.dnpg-portal-notice.is-warning { border-left-color: #b26a00; background: #fff8e8; }
.dnpg-portal-notice.is-error { border-left-color: #b32d2e; background: #fff1f1; }
@media (max-width: 700px) {
  .dnpg-portal-wrap { margin: 28px auto; }
  .dnpg-portal-head,
  .dnpg-portal-label-row { display: block; }
  .dnpg-portal-logout { margin-top: 10px; }
  .dnpg-character-counter { display: block; margin-top: 4px; }
  .dnpg-pdf-grid { grid-template-columns: 1fr; }
  .dnpg-portal-card textarea { min-height: 300px; }
}

/* PDF output: icon + editor-defined document name. */
.dnpg-pdf-list {
  list-style: none;
  padding-left: 0;
}
.dnpg-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  max-width: 100%;
  text-decoration: none;
  vertical-align: middle;
}
.dnpg-pdf-link:hover .dnpg-pdf-name,
.dnpg-pdf-link:focus-visible .dnpg-pdf-name {
  text-decoration: underline;
  text-underline-offset: .16em;
}
.dnpg-pdf-icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: center;
  width: 1.9em;
  height: 2.25em;
  padding: 0 .12em .22em;
  border: .11em solid currentColor;
  border-radius: .08em;
  box-sizing: border-box;
  font-size: .72em;
  line-height: 1;
}
.dnpg-pdf-icon::before {
  content: "";
  position: absolute;
  top: -.11em;
  right: -.11em;
  width: .65em;
  height: .65em;
  background: #fff;
  border-left: .11em solid currentColor;
  border-bottom: .11em solid currentColor;
  box-sizing: border-box;
}
.dnpg-pdf-icon span {
  position: relative;
  z-index: 1;
  font-size: .62em;
  font-weight: 700;
  letter-spacing: -.02em;
}
.dnpg-pdf-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Editor-defined heading above the managed body text. */
.dnpg-description-heading {
  margin-top: 0;
  margin-bottom: .7em;
}
.dnpg-description-heading + p {
  margin-top: 0;
}

/* Managed frontend content uses the full available Elementor column width.
   PDFs are only rendered where {{PDF1}} / {{PDF2}} are inserted in the text. */
.dnpg-managed-content,
.dnpg-description {
  display: block;
  width: 100%;
  max-width: none;
}

.dnpg-character-counter.is-over-limit {
  color: #b32d2e;
  font-weight: 700;
}
.dnpg-save-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.dnpg-description ul,
.dnpg-description ol {
  margin-top: .75em;
  margin-bottom: .75em;
  padding-left: 1.5em;
}
.dnpg-description blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid currentColor;
}
/* 1.0.6: self-contained rich-text editor. No wp_editor/TinyMCE dependency. */
.dnpg-richtext-editor {
  width: 100%;
  max-width: none;
  border: 1px solid #cfd3d7;
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}
.dnpg-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 8px;
  background: #f5f6f7;
  border-bottom: 1px solid #cfd3d7;
}
.dnpg-format-button {
  appearance: none;
  min-width: 36px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #c7cbd0;
  border-radius: 3px;
  background: #fff;
  color: #202124;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}
.dnpg-format-button:hover,
.dnpg-format-button:focus-visible {
  border-color: #8e949b;
  background: #eceff1;
  outline: none;
}
.dnpg-format-underline { text-decoration: underline; }
.dnpg-toolbar-separator {
  display: inline-block;
  width: 1px;
  height: 25px;
  margin: 0 3px;
  background: #cfd3d7;
}
.dnpg-richtext-surface {
  width: 100%;
  min-height: 420px;
  padding: 14px 16px;
  overflow: auto;
  background: #fff;
  color: #151515;
  font: inherit;
  line-height: 1.65;
  box-sizing: border-box;
  white-space: normal;
}
.dnpg-richtext-surface:focus {
  outline: 2px solid var(--dnpg-accent-color, #ef7015);
  outline-offset: -2px;
}
.dnpg-richtext-surface p:first-child,
.dnpg-richtext-surface div:first-child,
.dnpg-richtext-surface blockquote:first-child,
.dnpg-richtext-surface ul:first-child,
.dnpg-richtext-surface ol:first-child { margin-top: 0; }
.dnpg-richtext-surface p:last-child,
.dnpg-richtext-surface div:last-child,
.dnpg-richtext-surface blockquote:last-child,
.dnpg-richtext-surface ul:last-child,
.dnpg-richtext-surface ol:last-child { margin-bottom: 0; }
.dnpg-richtext-surface ul,
.dnpg-richtext-surface ol { padding-left: 1.6em; }
.dnpg-richtext-surface blockquote {
  margin-left: 0;
  padding-left: 1em;
  border-left: 3px solid #aaa;
}
.dnpg-richtext-value {
  display: none !important;
}
.dnpg-clear-description {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0 !important;
  font-weight: 400 !important;
  font-size: .9em;
  color: #666;
}
.dnpg-clear-description input { margin: 0; }
@media (max-width: 700px) {
  .dnpg-richtext-surface { min-height: 300px; }
  .dnpg-toolbar-separator { display: none; }
}
