html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    font-size: 11pt;
  }

  /* Hide the site's navigation header and footer, not statement headers (lodge name and title). */
  body > header,
  body > footer,
  .no-print {
    display: none !important;
  }

  .container {
    max-width: none !important;
    width: 100% !important;
  }

  main {
    padding-bottom: 0 !important;
  }

  .table {
    font-size: 9.5pt;
  }

  .table-responsive {
    overflow: visible !important;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }

  section {
    break-inside: avoid;
  }

  tr {
    break-inside: avoid;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Menu entries removed for the signed-in role leave an empty item behind. */
.dropdown-menu li:empty {
  display: none;
}

/* A form shown to a role that cannot submit it: fields stay visible but disabled, buttons go. */
.read-only-form {
  display: contents;
}

/* Keep Bootstrap's column gutters, which only reach direct children of a row. */
.row > .read-only-form > * {
  flex-shrink: 0;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
  margin-top: var(--bs-gutter-y);
}

/* Links inside it still work; only the fields are switched off. */
.read-only-form a.btn {
  pointer-events: auto;
  opacity: 1;
  color: var(--bs-btn-color);
  background-color: var(--bs-btn-bg);
  border-color: var(--bs-btn-border-color);
}

.read-only-form button:not([type="button"]),
.read-only-form input[type="submit"] {
  display: none;
}

.account-form {
  max-width: 720px;
}

.journal-status-link {
  text-decoration: none;
  border: 1px solid transparent;
}

.journal-status-link:hover,
.journal-status-link:focus {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border-color: currentColor;
}

.subscription-steps .list-group-item {
  border-radius: 0;
  color: var(--bs-secondary-color);
}

.subscription-steps .list-group-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: .35rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .8rem;
}

.subscription-steps .step-complete {
  color: var(--bs-success-text-emphasis);
  background: var(--bs-success-bg-subtle);
}

.assessment-table .assessment-amount {
  min-width: 7rem;
  max-width: 9rem;
}

.assessment-table .assessment-reason {
  min-width: 13rem;
}

.member-allocation {
  min-width: 15rem;
}

.receipt-allocation-table select {
  min-width: 14rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.statement-sheet {
  max-width: 820px;
  margin: 0 auto;
  color: #111;
}

.statement-header h2 {
  margin: .25rem 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.statement-entity {
  font-size: 1.15rem;
  font-weight: 700;
}

.statement-table {
  --bs-table-bg: transparent;
  border-color: #111;
}

.statement-table th,
.statement-table td {
  padding: .28rem .5rem;
  border-bottom: 0;
}

.statement-table thead th {
  border-bottom: 1px solid #111;
}

.statement-table .section-row th {
  padding-top: .85rem;
  font-weight: 700;
}

.statement-table .total-row th,
.statement-table .total-row td {
  border-top: 1px solid #111;
  font-weight: 700;
}

.statement-table .statement-subheading {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.statement-table .dining-subtotal-row td {
  border-top: 1px solid #111;
  font-weight: 600;
}

.statement-table .statement-negative {
  color: #b00020;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.statement-signatures {
  margin-top: 1.25rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.statement-signatures .signature-block {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.statement-signatures .signature-role {
  width: 10rem;
  flex-shrink: 0;
  font-weight: 600;
}

.statement-signatures .signature-entry {
  width: 18rem;
}

.statement-signatures .signature-line {
  border-bottom: 1px dotted #111;
  height: 1.5rem;
}

.statement-signatures .signature-name {
  padding-top: .25rem;
  min-height: 1.5rem;
}

.statement-signatures .signature-date {
  padding-bottom: 1.5rem;
  white-space: nowrap;
}

.statement-signatures .signature-date-line {
  display: inline-block;
  width: 8rem;
  border-bottom: 1px dotted #111;
}

.accounts-footer {
  margin-top: 2rem;
  padding-top: .4rem;
  border-top: 1px solid #111;
  font-size: .8rem;
  color: #444;
  text-align: center;
}

.statement-table .grand-total-row th,
.statement-table .grand-total-row td,
.statement-table .balance-check-row th,
.statement-table .balance-check-row td {
  border-top: 1px solid #111;
  border-bottom: 3px double #111;
  font-weight: 700;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 16mm;
  }

  html,
  body {
    font-size: 11pt;
    margin: 0;
  }

  body {
    color: #000;
  }

  body > header,
  body > footer,
  .print-hide {
    display: none !important;
  }

  .container {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  main {
    padding: 0 !important;
  }

  .statement-sheet {
    max-width: none;
    margin: 0;
  }

  .statement-table {
    width: 100%;
    page-break-inside: auto;
  }

  .statement-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  /* Tighter rows so a statement and its signature block fit on one A4 page. */
  .statement-table th,
  .statement-table td {
    padding-top: .12rem;
    padding-bottom: .12rem;
  }

  .statement-table .section-row th {
    padding-top: .5rem;
  }

  .statement-header {
    margin-bottom: .75rem !important;
  }

  .statement-table a {
    color: inherit !important;
    text-decoration: none !important;
  }
}

/* Help guides: section headings, a two-column contents list and a tick-box checklist to print. */
.guide h2 {
  margin-top: 2rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.guide h3 {
  margin-top: 1.25rem;
}

.guide-contents {
  columns: 2;
  column-gap: 2rem;
}

.guide-checklist {
  list-style: none;
  padding-left: 0;
}

.guide-checklist li::before {
  content: "\2610";
  display: inline-block;
  width: 1.6em;
  font-size: 1.1em;
}

@media (max-width: 575.98px) {
  .guide-contents {
    columns: 1;
  }
}

@media print {
  .guide h2,
  .guide h3 {
    break-after: avoid;
  }

  .guide li {
    break-inside: avoid;
  }
}
