/* Interactive personal workbook. Answers remain in local browser storage. */

#quarto-document-content .workbook-storage-note {
  margin: 1.5rem 0 0;
  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;
}

.worksheet-use {
  margin-block: 1.5rem;
  padding-block: 0.75rem;
  border-block: 1px solid #c8c2b8;
  color: #6e6560;
}

.workbook-toolbar {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 3rem;
}

.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-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

.workbook-download label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.875rem;
}

.workbook-button,
.workbook-format {
  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-format {
  flex: 1 1 15rem;
  min-width: 0;
  max-width: 100%;
  padding-right: 2rem;
  font-weight: 400;
}

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

.workbook-button:focus-visible,
.workbook-format: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;
}

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

.workbook-field label {
  max-width: 72ch;
  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;
}

@media (max-width: 600px) {
  .workbook-actions,
  .workbook-download {
    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,
  .back-to-top-navigation,
  footer,
  script,
  .worksheet-use {
    display: none !important;
  }

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

  #quarto-document-content {
    display: block;
    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: auto;
    margin-top: 1.5rem;
    padding-bottom: 1.25rem;
    border-color: #aaa;
  }

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

  .workbook-section:first-of-type > h2 {
    break-before: auto;
  }

  .workbook-field {
    break-inside: avoid;
    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: " ";
  }
}
