/* Interactive workbook, scoped to the Analysebogen page. */

#quarto-document-content .workbook-storage-note {
  margin: 2rem 0 0;
  padding: 1rem;
  border: 1px solid #C8C2B8;
  background: #EDE7DA;
  color: #4F4945;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
}

#quarto-document-content .workbook-storage-note p {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.workbook-toolbar {
  display: grid;
  gap: 0.75rem;
  margin: 2rem 0 3rem;
  padding: 1rem;
  border-block: 1px solid #C8C2B8;
}

.workbook-status {
  min-height: 1.5rem;
  color: #6E6560;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.workbook-status[data-state="saved"] {
  color: #1E3A5F;
}

.workbook-status[data-state="error"] {
  color: #8A3226;
}

.workbook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.workbook-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #6E6560;
  background: transparent;
  color: #1A1714;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.workbook-button:hover {
  border-color: #A63D2F;
  background: rgba(166, 61, 47, 0.06);
  color: #8A3226;
}

.workbook-button:focus-visible {
  outline: 3px solid rgba(166, 61, 47, 0.3);
  outline-offset: 2px;
}

.workbook-button-primary {
  border-color: #A63D2F;
  background: #A63D2F;
  color: #F5F0E8;
}

.workbook-button-primary:hover {
  border-color: #8A3226;
  background: #8A3226;
  color: #F5F0E8;
}

.workbook-button-quiet {
  border-color: transparent;
  color: #6E6560;
}

.workbook-section {
  margin-top: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #D8D2CA;
}

.workbook-section > h2 {
  margin-top: 0;
}

#quarto-document-content .workbook-optional {
  display: inline-block;
  margin: -0.25rem 0 1.25rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #B8821A;
  color: #72500F;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.workbook-field {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.workbook-field label {
  max-width: 68ch;
  color: #1A1714;
  font-family: "Literata", serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
}

.workbook-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 7.5rem;
  padding: 1rem;
  overflow: hidden;
  resize: none;
  border: 1px solid #9A9490;
  background: rgba(255, 255, 255, 0.34);
  color: #1A1714;
  font-family: "Literata", serif;
  font-size: 1rem;
  line-height: 1.6;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.workbook-field textarea:hover {
  border-color: #6E6560;
  background: rgba(255, 255, 255, 0.5);
}

.workbook-field textarea:focus {
  border: 2px solid #A63D2F;
  outline: none;
  background: rgba(255, 255, 255, 0.68);
}

.workbook-field-compact textarea {
  min-height: 3.5rem;
}

.workbook-print-value {
  display: none;
}

.workbook-end {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid #1E3A5F;
  background: rgba(30, 58, 95, 0.06);
}

#quarto-document-content .workbook-end p {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .workbook-actions,
  .workbook-button {
    width: 100%;
  }

  .workbook-section {
    margin-top: 2.75rem;
  }

  .workbook-field textarea {
    padding: 0.85rem;
  }
}

@media print {
  @page {
    margin: 16mm 18mm 18mm;
  }

  .navbar,
  .quarto-secondary-nav,
  #quarto-sidebar,
  #quarto-margin-sidebar,
  .quarto-title-meta,
  .workbook-toolbar,
  .workbook-end,
  .back-to-top-navigation,
  footer,
  script {
    display: none !important;
  }

  body,
  #quarto-content,
  #quarto-document-content {
    background: #fff !important;
  }

  #quarto-document-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #quarto-document-content .workbook-storage-note {
    display: none;
  }

  .workbook-section {
    break-inside: avoid;
    margin-top: 1.5rem;
    padding-bottom: 1.25rem;
    border-color: #aaa;
  }

  .workbook-section > h2 {
    font-size: 15pt;
  }

  .workbook-field {
    gap: 0.35rem;
    margin-top: 0.85rem;
  }

  .workbook-field label {
    font-size: 10.5pt;
  }

  .workbook-field textarea {
    display: none;
  }

  .workbook-print-value {
    display: block;
    min-height: 2.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #aaa;
    color: #111;
    font-family: "Literata", serif;
    font-size: 10.5pt;
    line-height: 1.45;
    white-space: pre-wrap;
  }

  .workbook-print-value:empty::after {
    content: " ";
  }

  .workbook-optional {
    print-color-adjust: exact;
  }
}
