@font-face {
  font-family: "GD-JoinedDashedArrows";
  src: url(../fonts/Getty-DubayJoinedDashed-DashedArrows.otf) format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "GD-JoinedStandard";
  src: url(../fonts/Getty-DubayJoined-Standard.otf) format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "GD-PrecursiveDashedArrows";
  src: url(../fonts/Getty-DubayPrecursiveDashed-DashedArrows.otf)
    format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "GD-BasicDashedDots";
  src: url(../fonts/Getty-DubayBasicDashed-DashedArrowsDots.otf)
    format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "GD-BasicStandard";
  src: url(../fonts/Getty-DubayBasic-basicstandard.otf) format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "GD-PrecursiveStandard";
  src: url(../fonts/Getty-DubayPrecursive-Precursive.otf) format("opentype");
  font-weight: 400;
  font-style: normal;
}

:root {
  --shg-paper-w: 215.9mm;
  --shg-paper-h: 279.4mm;
  --shg-baseline-color: rgb(220 84 69);
  --shg-midline-color: rgb(104 189 239);
  --shg-indent-tab: 6.35mm;
  --shg-vertline-width: 0.35mm;
}

#shg-container {
  max-width: 950px;
  margin: 0 auto;
}

#shg-editor-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--shg-paper-w);
  height: var(--shg-paper-h);
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid #888;
  background: #fff;
}

.shg-sheet-header,
.shg-sheet-footer {
  flex: 0 0 auto;
  padding: 6mm 10mm;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14pt;
  line-height: 2;
  color: #000;
  background: #fff;
}

.shg-sheet-disclaimer {
  text-align: center;
  font-size: 8pt;
}

.shg-sheet-meta {
  display: flex;
  justify-content: space-between;
  gap: 20mm;
  margin-top: 4mm;
}

.shg-sheet-name,
.shg-sheet-date {
  white-space: nowrap;
}

#shg-editor {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #ccc;
}

#shg-editor .ql-container {
  height: 100%;
}

#shg-editor .ql-editor {
  --shg-pad-top: 6mm;
  --shg-pad-right: 10mm;
  --shg-pad-bottom: 10mm;
  --shg-pad-left: 10mm;
  --shg-origin-x: calc(var(--shg-pad-left) + var(--shg-indent-tab));
  --shg-text-shift: 0px;
  --shg-baseline-offset: 0mm;

  position: relative;
  z-index: 0;
  box-sizing: border-box;
  height: 100%;
  padding: var(--shg-pad-top) var(--shg-pad-right) var(--shg-pad-bottom)
    var(--shg-pad-left);
  padding-left: calc(var(--shg-origin-x) + 2mm);
  overflow: hidden !important;
  isolation: isolate;
  background: transparent !important;
  font-family: "GD-BasicStandard", sans-serif;
  font-size: var(--shg-font-size, 18pt);
  line-height: var(--shg-line-height, 140px) !important;
}

#shg-editor .ql-editor > * {
  position: relative;
  z-index: 1;
  transform: translateY(var(--shg-baseline-offset))
    translateY(var(--shg-text-shift));
}

#shg-editor .ql-editor p,
#shg-editor .ql-editor li {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  font-family: "GD-BasicStandard", sans-serif !important;
  font-size: var(--shg-font-size, 10pt);
  line-height: var(--shg-line-height, 140px) !important;
}

#shg-editor .ql-editor .ql-font-GD-BasicStandard,
.ql-font-GD-BasicStandard {
  font-family: "GD-BasicStandard", sans-serif !important;
}
#shg-editor .ql-editor .ql-font-GD-BasicDashedDots,
.ql-font-GD-BasicDashedDots {
  font-family: "GD-BasicDashedDots", sans-serif !important;
}
#shg-editor .ql-editor .ql-font-GD-JoinedStandard,
.ql-font-GD-JoinedStandard {
  font-family: "GD-JoinedStandard", sans-serif !important;
}
#shg-editor .ql-editor .ql-font-GD-JoinedDashedArrows,
.ql-font-GD-JoinedDashedArrows {
  font-family: "GD-JoinedDashedArrows", sans-serif !important;
}
#shg-editor .ql-editor .ql-font-GD-PrecursiveStandard,
.ql-font-GD-PrecursiveStandard {
  font-family: "GD-PrecursiveStandard", sans-serif !important;
}
#shg-editor .ql-editor .ql-font-GD-PrecursiveDashedArrows,
.ql-font-GD-PrecursiveDashedArrows {
  font-family: "GD-PrecursiveDashedArrows", sans-serif !important;
}

#shg-guides-host {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  overflow: hidden;
  pointer-events: none !important;
}

#shg-print-guides {
  display: block;
  max-width: none !important;
}

#shg-toolbar {
  position: relative;
  z-index: 100;
}

#shg-toolbar .shg-lineheight-group,
#shg-toolbar .shg-font-group,
#shg-toolbar .shg-print-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#shg-toolbar .shg-font-group,
#shg-toolbar .shg-print-group {
  margin-left: 12px;
}

#shg-toolbar .shg-lineheight-label,
#shg-toolbar .shg-font-label,
#shg-toolbar .shg-print-label {
  margin-right: 4px;
  font-size: 13px;
}

#shg-toolbar .shg-lineheight-select,
#shg-toolbar .shg-font-select,
#shg-toolbar .shg-print-button {
  display: inline-block;
  min-width: 120px;
  padding: 2px 6px !important;
  border: 1px solid #ccc !important;
  border-radius: 3px !important;
  color: #000 !important;
  background-color: #fff !important;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  text-indent: 0 !important;
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}

#shg-toolbar .shg-font-select,
#shg-toolbar .shg-print-button {
  min-width: 160px;
}

#shg-toolbar .shg-print-button {
  font-size: 12px !important;
}

#shg-toolbar .ql-picker-label::before,
#shg-toolbar .ql-picker-item::before {
  content: attr(data-label);
}

.shg-watermark {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  transform: rotate(-42deg) scale(1);
  transform-origin: center;
  font-family: "GD-JoinedStandard", cursive;
  font-size: clamp(30px, 5vw, 72px);
  opacity: 0.35;
  mix-blend-mode: multiply;
  user-select: none;
}

.shg-watermark-track {
  display: flex;
  justify-content: center;
  gap: 9mm;
  width: 180%;
  margin-left: -60%;
  white-space: nowrap;
}

.shg-watermark-offset {
  margin-left: -15%;
}

.shg-watermark-red,
.shg-watermark-blue {
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: 0.8px;
}

.shg-watermark-red {
  -webkit-text-stroke-color: rgba(220, 40, 35, 0.35);
}

.shg-watermark-blue {
  -webkit-text-stroke-color: rgba(25, 105, 190, 0.35);
}

.shg-logged-in .shg-watermark {
  display: none !important;
}

html body #shg-container {
  width: fit-content !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  box-sizing: content-box !important;
}

html body #shg-editor-wrapper,
html body #shg-editor,
html body #shg-editor .ql-container,
html body #shg-editor .ql-editor {
  box-sizing: border-box !important;
}

html body #shg-editor-wrapper {
  width: var(--shg-paper-w) !important;
  margin: 0 !important;
}

.fl-module:has(#shg-container),
.fl-module-html:has(#shg-container) {
  margin: 0 !important;
  padding: 0 !important;
}

@media print {
  @page {
    size: letter portrait;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  html,
  body {
    width: 215.9mm !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  header,
  footer,
  nav,
  aside,
  #wpadminbar,
  #shg-toolbar,
  .no-print,
  .site-header,
  .site-footer {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #shg-container {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 215.9mm !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  #shg-editor-wrapper {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 215.9mm !important;
    height: 275mm !important;
    max-height: 275mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
    page-break-before: avoid !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
    break-inside: avoid-page !important;
  }

  #shg-editor {
    position: relative !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    border: none !important;
    page-break-inside: avoid !important;
  }

  #shg-editor .ql-container,
  #shg-editor .ql-editor {
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
  }

  #shg-editor .ql-editor {
    --shg-pad-top: 6mm;
    --shg-pad-right: 10mm;
    --shg-pad-bottom: 10mm;
    --shg-pad-left: 10mm;
    --shg-origin-x: calc(var(--shg-pad-left) + var(--shg-indent-tab));
    padding: var(--shg-pad-top) var(--shg-pad-right) var(--shg-pad-bottom)
      var(--shg-pad-left) !important;
    padding-left: calc(var(--shg-origin-x) + 2mm) !important;
    caret-color: transparent !important;
  }

  #shg-editor-wrapper *,
  #shg-editor *,
  .ql-editor * {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  #shg-print-guides {
    display: block !important;
  }

  .shg-sheet-disclaimer,
  .shg-sheet-disclaimer em {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
  }

  .shg-sheet-header,
  .shg-sheet-footer {
    position: relative !important;
    flex: 0 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .shg-watermark {
    position: absolute !important;
    inset: -35% !important;
    z-index: 20 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 12mm !important;
    transform: rotate(-32deg) scale(1.2) !important;
    transform-origin: center center !important;
  }

  .shg-watermark-track {
    display: block !important;
    width: 220% !important;
    margin-left: -60% !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  .shg-watermark-track span {
    display: inline-block !important;
    margin-right: 18mm !important;
    white-space: nowrap !important;
  }

  .fl-row:not(:has(#shg-container)),
  .fl-col:not(:has(#shg-container)),
  .fl-module:not(:has(#shg-container)) {
    display: none !important;
  }

  .fl-row:has(#shg-container),
  .fl-col:has(#shg-container),
  .fl-module:has(#shg-container),
  .fl-row-content:has(#shg-container),
  .fl-col-content:has(#shg-container),
  .fl-module-content:has(#shg-container) {
    display: block !important;
    width: 215.9mm !important;
    max-width: 215.9mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* Remove Genesis theme geometry from the printable worksheet branch. */
  .site-container:has(#shg-container),
  .site-inner:has(#shg-container),
  .content-sidebar-wrap:has(#shg-container),
  #genesis-content:has(#shg-container),
  article.entry:has(#shg-container),
  .entry-content:has(#shg-container) {
    display: block !important;
    position: static !important;
    inset: auto !important;
    float: none !important;
    clear: none !important;
    transform: none !important;

    width: 215.9mm !important;
    max-width: none !important;
    min-width: 0 !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .site-container:has(#shg-container)::before,
  .site-container:has(#shg-container)::after,
  .site-inner:has(#shg-container)::before,
  .site-inner:has(#shg-container)::after,
  .content-sidebar-wrap:has(#shg-container)::before,
  .content-sidebar-wrap:has(#shg-container)::after,
  #genesis-content:has(#shg-container)::before,
  #genesis-content:has(#shg-container)::after,
  article.entry:has(#shg-container)::before,
  article.entry:has(#shg-container)::after,
  .entry-content:has(#shg-container)::before,
  .entry-content:has(#shg-container)::after {
    content: none !important;
    display: none !important;
    clear: none !important;
  }
}

/*
 * Some browser print engines allocate a trailing blank fragment even when the
 * worksheet itself fits on page one. Keep the complete print branch shorter
 * than the physical Letter page and clip only the unused outer document area.
 */
@media print {
  html,
  body,
  .site-container:has(#shg-container) {
    height: 275mm !important;
    min-height: 0 !important;
    max-height: 275mm !important;
    overflow: hidden !important;
  }
}
