/* ==========================================================================
   SHEETS.CSS - Shared Sheet Styling
   Source of truth for .sheet-block appearance on both screen and print
   ========================================================================== */

/* ---------------------------------------------------------------------
   Sheet Block Container
   --------------------------------------------------------------------- */
.sheet-block {
  border-left: 4px solid var(--color-electric-blue);
  border-radius: 4px;
  padding: 1.5rem 1.25rem;
  margin: 2rem 0;
  background: var(--color-white);

  /* Rough torn-paper edges */
  clip-path: polygon(
    0% 1%, 4% 0%, 8% 0.5%, 12% 0%, 16% 1%, 20% 0.5%, 24% 0%, 28% 1%,
    32% 0.5%, 36% 0%, 40% 1%, 44% 0.5%, 48% 0%, 52% 1%, 56% 0.5%, 60% 0%,
    64% 1%, 68% 0.5%, 72% 0%, 76% 1%, 80% 0.5%, 84% 0%, 88% 1%, 92% 0.5%, 96% 0%, 100% 1%,
    100% 99%, 96% 100%, 92% 99.5%, 88% 100%, 84% 99%, 80% 99.5%, 76% 100%, 72% 99%,
    68% 99.5%, 64% 100%, 60% 99%, 56% 99.5%, 52% 100%, 48% 99%, 44% 99.5%, 40% 100%,
    36% 99%, 32% 99.5%, 28% 100%, 24% 99%, 20% 99.5%, 16% 100%, 12% 99%, 8% 99.5%, 4% 100%, 0% 99%
  );
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ---------------------------------------------------------------------
   Compact Typography Within Sheet Blocks
   --------------------------------------------------------------------- */
.sheet-block h1 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem 0;
  padding: 0;
  color: var(--color-electric-blue);
}

.sheet-block h2 {
  font-size: 0.9rem;
  margin: 0.5rem 0 0.15rem 0;
  padding: 0;
  color: var(--color-hot-pink);
}

.sheet-block h3 {
  font-size: 0.85rem;
  margin: 0.4rem 0 0.1rem 0;
  padding: 0;
  color: var(--color-ink-black);
}

.sheet-block h4 {
  font-size: 0.8rem;
  margin: 0.3rem 0 0.1rem 0;
  padding: 0;
  color: var(--color-ink-black);
}

.sheet-block p {
  margin: 0.1rem 0;
  font-size: 0.75rem;
  line-height: 1.3;
}

/* ---------------------------------------------------------------------
   Sheet Layout Patterns
   --------------------------------------------------------------------- */

/* Multi-column layout for form fields */
.sheet-block > p + p {
  display: inline-block;
  width: 48%;
  vertical-align: top;
  margin-right: 2%;
}

.sheet-block > p + p + p {
  width: 48%;
  margin-right: 0;
}

/* Lists within sheets */
.sheet-block ul,
.sheet-block ol {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
  font-size: 0.75rem;
  columns: 1;
}

.sheet-block li {
  margin: 0.1rem 0;
  break-inside: avoid;
}

/* Tables within sheets */
.sheet-block table {
  margin: 0.25rem 0;
  font-size: 0.7rem;
  width: 100%;
  border-collapse: collapse;
}

.sheet-block th,
.sheet-block td {
  padding: 0.15rem 0.35rem;
}

.sheet-block hr {
  margin: 0.35rem 0;
  border: none;
  border-top: 1px dashed var(--color-border-gray);
}

/* ---------------------------------------------------------------------
   Fill-Line Form Fields
   --------------------------------------------------------------------- */
.fill-line {
  display: inline-block;
  border-bottom: 1px solid var(--color-border-gray);
  height: 1em;
  vertical-align: bottom;
}

.fill-sm { width: 4rem; }
.fill-md { width: 8rem; }
.fill-lg { width: 100%; max-width: 20rem; }
.fill-full { width: 100%; }

/* Hide bullets on list items with fill lines */
.sheet-block li:has(.fill-line) {
  list-style: none;
  margin-left: -1rem;
}

/* List item fill lines should be wide (for sentences) */
.sheet-block li .fill-line {
  width: 100%;
  display: block;
}

/* ---------------------------------------------------------------------
   Dark Mode Adjustments
   --------------------------------------------------------------------- */
body.dark-mode .sheet-block {
  background: var(--color-ink-black);
  border-left-color: var(--color-electric-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark-mode .sheet-block h3,
body.dark-mode .sheet-block h4,
body.dark-mode .sheet-block p {
  color: var(--color-light-gray);
}

body.dark-mode .fill-line {
  border-bottom-color: var(--color-medium-gray);
}
