:root {
    --action-button-height: 44px;
    --header-bg: #0d6efd; /* Default header color */
    --header-text-color: #f8f9fa; /* Default header color */
    --footer-bg: #0d6efd; /* Default footer color */
    --footer-text-color: #f8f9fa; /* Default header color */
    --container-bg: #f8f9fa; /* Default container color */
    --container-text-color: #000000; /* Default header color */
    --page-background-image: none; /* Default background image */
}

.tight-pagination {
    --bs-pagination-padding-x: 0.25rem;
    --bs-pagination-padding-y: 0.375rem;
    --bs-pagination-font-size: 10pt;
    --bs-pagination-hover-color: var(--bs-link-hover-color);
    --bs-pagination-hover-bg: var(--bs-tertiary-bg);
    --bs-pagination-focus-color: var(--bs-link-hover-color);
    --bs-pagination-focus-bg: var(--bs-secondary-bg);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: #0d6efd;
    --bs-pagination-active-border-color: #0d6efd;
    --bs-pagination-disabled-color: var(--bs-secondary-color);
    --bs-pagination-disabled-bg: var(--bs-secondary-bg);
    --bs-pagination-disabled-border-color: var(--bs-border-color);
    display: flex;
    padding-left: 0;
    list-style: none;
}

.tight-pagination a {
    color: var(--bs-link-color);
    text-decoration: underline; /* Ensures links are underlined */
}

.btn-bad {
    color: blue;
    background-color: rgba(220, 53, 69, 0.49);
    border-color: #dc3545;
}

.btn-bad:hover {
    color: white;
    background-color: rgba(220, 53, 69);
    border-color: #dc3545;
}

.btn-good {
    color: blue;
    background-color: rgba(53, 106, 220, 0.49);
    border-color: #3556dc;
}

.btn-good:hover {
    color: white;
    background-color: rgba(53, 106, 220);
    border-color: #3556dc;
}

.ql-snow.ql-toolbar button.ql-div::before {
    content: '<div>';
    border-radius: 5px;
}

.ql-snow.ql-toolbar button.ql-backgroundColor::before {
    content: 'Background';
    min-width: 20em;
    border-radius: 5px;
}

.header-bg {
    background-color: #0d6efd;
    background-color: var(--header-bg);
}

.header-text {
    color: #f8f9fa;
    color: var(--header-text-color);
}

.footer-bg {
    background-color: #f8f9fa;
    background-color: var(--footer-bg);
}

.footer-text {
    color: #f8f9fa;
    color: var(--footer-text-color);
}

.container-bg {
    background-color: #0d6efd;
    background-color: var(--container-bg);
}

.container-text {
    color: #000000;
    color: var(--container-text-color);
}

.background-image {
    background-image: none;
    background-image: var(--page-background-image);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.auto-size {
    width: auto;
    height: fit-content;
}

.error-box {
    padding: 10px;
    margin: 10px 0;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    position: relative;
}

.flex-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2em;
}

.distributed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.center-item {
    margin: 0 auto;
}

.col-quarter {
    flex: 0 0 2.0833335%;
    max-width: 2.0833335%;
}

.col-half {
    flex: 0 0 4.166667%;
    max-width: 4.166667%;
}

.col-1-and-a-half {
    flex: 0 0 12.4999995%;
    max-width: 12.4999995%;
}

.col-2-and-a-half {
    flex: 0 0 20.8333325%;
    max-width: 20.8333325%;
}

.col-3-and-a-half {
    flex: 0 0 29.1666655%;
    max-width: 29.1666655%;
}

.col-4-and-a-half {
    flex: 0 0 37.4999985%;
    max-width: 37.4999985%;
}

.btn-link {
    background: none;
    border: none;
    color: blue;
    text-decoration: underline;
    cursor: pointer;
    padding: 0
}

.btn-link:disabled {
    color: gray; /* Change the color to gray */
    text-decoration: none; /* Remove the underline */
    cursor: not-allowed; /* Optional: Change the cursor to indicate it's disabled */
}

.rtf-text-area {
    max-height: 14em;
    overflow: auto;
    resize: none;
    box-sizing: border-box;
}

.action-links {
    white-space: nowrap;
    margin: 3px 10px 0 0;
    padding: 0px;
    font-size: 8pt;
    float: right;
}

.action-link {
    white-space: nowrap;
    margin: 3px 0 0 0;
    padding: 0px;
    font-size: 8pt;
}

.rounded-box {
    border: 1px solid #000;
    border-radius: 5px;
}

div.reset-styles {
    all: unset; /* Resets all inherited and applied styles */
    display: block; /* Reapply block display since 'unset' removes it */
}

.scrollable-container {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 1rem;
}

.slideshow-container {
    max-width: 100%;
    position: relative;
    margin: auto;
}

.slide {
    display: none;
}

.fade-3 {
    animation: fadeEffect 3s;
}

.fade-5 {
    animation: fadeEffect 3s;
}

.fade-10 {
    animation: fadeEffect 10s;
}

.fade-20 {
    animation: fadeEffect 20s;
}

.fade-30 {
    animation: fadeEffect 30s;
}

@keyframes fadeEffect {
    from {
        opacity: 0.4
    }
    to {
        opacity: 1
    }
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.grid-item {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

/* Shared pastel buttons, including small buttons and form submit controls. */
body .btn {
  --bs-btn-font-size: 14pt;
  --bs-btn-line-height: 1.25;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--action-button-height);
  min-height: var(--action-button-height);
  font-size: 14pt;
  line-height: 1.25;
  white-space: nowrap;
  vertical-align: middle;
}
body .navbar-toggler {
  box-sizing: border-box;
  height: var(--action-button-height);
  min-height: var(--action-button-height);
}
body .btn-primary {
  --bs-btn-color: #273f64;
  --bs-btn-bg: #cbdfff;
  --bs-btn-border-color: #cbdfff;
  --bs-btn-hover-color: #273f64;
  --bs-btn-hover-bg: #b8d1f7;
  --bs-btn-hover-border-color: #b8d1f7;
  --bs-btn-active-color: #273f64;
  --bs-btn-active-bg: #b8d1f7;
  --bs-btn-active-border-color: #b8d1f7;
  --bs-btn-disabled-color: #273f64;
  --bs-btn-disabled-bg: #cbdfff;
  --bs-btn-disabled-border-color: #cbdfff;
}
body .btn-secondary {
  --bs-btn-color: #494255;
  --bs-btn-bg: #e0dceb;
  --bs-btn-border-color: #e0dceb;
  --bs-btn-hover-color: #494255;
  --bs-btn-hover-bg: #cec7de;
  --bs-btn-hover-border-color: #cec7de;
  --bs-btn-active-color: #494255;
  --bs-btn-active-bg: #cec7de;
  --bs-btn-active-border-color: #cec7de;
  --bs-btn-disabled-color: #494255;
  --bs-btn-disabled-bg: #e0dceb;
  --bs-btn-disabled-border-color: #e0dceb;
}
body .btn-danger {
  --bs-btn-color: #722f3a;
  --bs-btn-bg: #f5ced3;
  --bs-btn-border-color: #f5ced3;
  --bs-btn-hover-color: #722f3a;
  --bs-btn-hover-bg: #ecb9c1;
  --bs-btn-hover-border-color: #ecb9c1;
  --bs-btn-active-color: #722f3a;
  --bs-btn-active-bg: #ecb9c1;
  --bs-btn-active-border-color: #ecb9c1;
  --bs-btn-disabled-color: #722f3a;
  --bs-btn-disabled-bg: #f5ced3;
  --bs-btn-disabled-border-color: #f5ced3;
}
body .btn-success {
  --bs-btn-color: #305a42;
  --bs-btn-bg: #cfe7d8;
  --bs-btn-border-color: #cfe7d8;
  --bs-btn-hover-color: #305a42;
  --bs-btn-hover-bg: #b9dac6;
  --bs-btn-hover-border-color: #b9dac6;
  --bs-btn-active-color: #305a42;
  --bs-btn-active-bg: #b9dac6;
  --bs-btn-active-border-color: #b9dac6;
  --bs-btn-disabled-color: #305a42;
  --bs-btn-disabled-bg: #cfe7d8;
  --bs-btn-disabled-border-color: #cfe7d8;
}
body .btn-warning {
  --bs-btn-color: #665322;
  --bs-btn-bg: #f9e7b6;
  --bs-btn-border-color: #f9e7b6;
  --bs-btn-hover-color: #665322;
  --bs-btn-hover-bg: #efd99b;
  --bs-btn-hover-border-color: #efd99b;
  --bs-btn-active-color: #665322;
  --bs-btn-active-bg: #efd99b;
  --bs-btn-active-border-color: #efd99b;
  --bs-btn-disabled-color: #665322;
  --bs-btn-disabled-bg: #f9e7b6;
  --bs-btn-disabled-border-color: #f9e7b6;
}
body .btn-info {
  --bs-btn-color: #305965;
  --bs-btn-bg: #cde8ee;
  --bs-btn-border-color: #cde8ee;
  --bs-btn-hover-color: #305965;
  --bs-btn-hover-bg: #b7dce5;
  --bs-btn-hover-border-color: #b7dce5;
  --bs-btn-active-color: #305965;
  --bs-btn-active-bg: #b7dce5;
  --bs-btn-active-border-color: #b7dce5;
  --bs-btn-disabled-color: #305965;
  --bs-btn-disabled-bg: #cde8ee;
  --bs-btn-disabled-border-color: #cde8ee;
}
body .btn-light {
  --bs-btn-color: #535963;
  --bs-btn-bg: #f1f2f5;
  --bs-btn-border-color: #f1f2f5;
  --bs-btn-hover-color: #535963;
  --bs-btn-hover-bg: #e3e6eb;
  --bs-btn-hover-border-color: #e3e6eb;
  --bs-btn-active-color: #535963;
  --bs-btn-active-bg: #e3e6eb;
  --bs-btn-active-border-color: #e3e6eb;
  --bs-btn-disabled-color: #535963;
  --bs-btn-disabled-bg: #f1f2f5;
  --bs-btn-disabled-border-color: #f1f2f5;
}
body .btn-dark {
  --bs-btn-color: #343d4b;
  --bs-btn-bg: #d4d8df;
  --bs-btn-border-color: #d4d8df;
  --bs-btn-hover-color: #343d4b;
  --bs-btn-hover-bg: #c1c8d2;
  --bs-btn-hover-border-color: #c1c8d2;
  --bs-btn-active-color: #343d4b;
  --bs-btn-active-bg: #c1c8d2;
  --bs-btn-active-border-color: #c1c8d2;
  --bs-btn-disabled-color: #343d4b;
  --bs-btn-disabled-bg: #d4d8df;
  --bs-btn-disabled-border-color: #d4d8df;
}
body .admin-main .admin-column-heading {
  color: #757b84;
  background-color: #eceef1;
  border-color: #eceef1;
}

/* Protected admin navigation uses a neutral disabled Save button. */
body .btn.admin-navigation-readonly:disabled {
  color: #6c757d;
  background-color: #e2e3e5;
  border-color: #d3d6d8;
  opacity: 1;
}

/* Use Quill's saved formatting in read-only cell content without editor chrome. */
.ql-editor.rich-text-content {
  height: auto;
  max-height: none;
  white-space: normal;
  min-height: 0;
  padding: 0;
  overflow: visible;
  font-size: inherit;
  line-height: inherit;
  text-align: inherit;
}

/* Saved text is ordinary HTML. Quill 2's stylesheet hides list markers inside
   .ql-editor (its editor draws its own), so show normal bullets and numbers. */
.ql-editor.rich-text-content ul,
.ql-editor.rich-text-content ol {
  padding-left: 1.5em;
}
.ql-editor.rich-text-content li {
  padding-left: 0;
}
.ql-editor.rich-text-content ul > li {
  list-style-type: disc;
}
.ql-editor.rich-text-content ol > li {
  list-style-type: decimal;
}

/* Keep published Quill sizes readable on phones without changing saved content
   or the editable Quill surface. Desktop sizing and Div Ratio stay intact. */
@media (max-width: 575.98px) {
  .row > .content-section-cell {
    /* Saved percentages/auto flex otherwise override Bootstrap's mobile layout. */
    width: 100% !important;
    flex: 0 0 100% !important;
    min-width: 0;
  }

  .ql-editor.rich-text-content {
    font-size: 1rem;
  }

  .ql-editor.rich-text-content .ql-size-small {
    font-size: 0.875em;
  }

  .ql-editor.rich-text-content .ql-size-large {
    font-size: 1.25em;
  }

  .ql-editor.rich-text-content .ql-size-huge {
    font-size: 1.75em;
  }

  .ql-editor.rich-text-content h1 {
    font-size: 1.75rem;
  }

  .ql-editor.rich-text-content h2 {
    font-size: 1.5rem;
  }

  .ql-editor.rich-text-content h3 {
    font-size: 1.25rem;
  }
}

/* Editing a page from the public site (administrators only) */
.page-edit-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 3rem 3rem;
  min-height: 3rem;
}
.page-edit-state { font-style: italic; opacity: 0.85; margin-right: 4px; }
.page-edit-hint { color: #5b6475; font-size: 0.875rem; }
.page-edit-message { color: #1d6b3c; font-size: 0.9rem; }
/* Sections keep the space around them, so a right-click there finds them. */
.page-editing .page-editing-section { display: flow-root; outline: 1px dashed transparent; }
.page-editing .page-editing-section:hover { outline-color: rgba(31, 95, 214, 0.35); }
.page-editing [data-cell-id]:hover { outline: 1px dashed rgba(31, 95, 214, 0.5); outline-offset: -1px; }
.page-edit-target { outline: 2px solid #1f5fd6 !important; outline-offset: -2px; }
.page-edit-menu {
  position: fixed;
  z-index: 2000;
  min-width: 170px;
  padding: 4px;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 14px;
}
.page-edit-menu-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1d2433;
  text-align: left;
}
.page-edit-menu-item:hover, .page-edit-menu-item:focus { background: #eef4ff; outline: none; }
.page-edit-menu-hint { padding: 4px 10px 2px; color: #667085; font-size: 12px; }
/* Moving sections while editing a page */
.page-editing .page-editing-section { position: relative; }
.page-edit-section-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 20;
  display: flex;
  gap: 2px;
  padding: 2px;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s;
}
.page-editing-section:hover > .page-edit-section-handle,
.page-edit-section-handle:focus-within { opacity: 1; }
.page-edit-section-handle .page-edit-drag { cursor: grab; padding: 2px 8px; color: #1d2433; user-select: none; }
.page-edit-section-handle button { border: 0; background: transparent; padding: 2px 8px; border-radius: 6px; color: #1d2433; }
.page-edit-section-handle button:hover, .page-edit-section-handle button:focus { background: #eef4ff; outline: none; }
.page-edit-dragging { opacity: 0.45; }
.page-edit-drop-before { box-shadow: 0 -4px 0 #1f5fd6; }
.page-edit-drop-after { box-shadow: 0 4px 0 #1f5fd6; }
.page-edit-moving {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2100;
  padding: 8px 16px; border-radius: 8px; background: #1d2433; color: #fff; font-size: 14px;
}

/* Where the site's menu sits (Settings > Appearance > Menu position). "top" is
   the normal header. On narrow screens every position uses the top bar with
   its ☰ button. */
@media (min-width: 992px) {
  body.site-menu-left, body.site-menu-right { --site-menu-width: 250px; }
  body.site-menu-left { padding-left: var(--site-menu-width); }
  body.site-menu-right { padding-right: var(--site-menu-width); }
  body.site-menu-left > header, body.site-menu-right > header,
  body.site-menu-left header:has(> div > .site-menu), body.site-menu-right header:has(> div > .site-menu) {
    position: fixed; top: 0; bottom: 0; width: var(--site-menu-width); z-index: 1030;
  }
  body.site-menu-left header:has(.site-menu) { left: 0; }
  body.site-menu-right header:has(.site-menu) { right: 0; }
  body.site-menu-left header:has(.site-menu) > div,
  body.site-menu-right header:has(.site-menu) > div { height: 100%; }
  body.site-menu-left .site-menu, body.site-menu-right .site-menu {
    height: 100%; align-items: flex-start; padding: 24px 0 !important; overflow-y: auto;
  }
  body.site-menu-left .site-menu > .container, body.site-menu-right .site-menu > .container {
    flex-direction: column; align-items: stretch; justify-content: flex-start; max-width: none; padding: 0 16px;
  }
  body.site-menu-left .site-menu > .container > .nav-link, body.site-menu-right .site-menu > .container > .nav-link {
    white-space: normal; font-size: 1.5rem !important; line-height: 1.2; padding: 0 12px 12px;
  }
  body.site-menu-left .site-menu .navbar-collapse, body.site-menu-right .site-menu .navbar-collapse { flex-grow: 0; }
  body.site-menu-left .site-menu .navbar-nav, body.site-menu-right .site-menu .navbar-nav {
    flex-direction: column; margin-left: 0 !important; width: 100%;
  }
  body.site-menu-left .site-menu .nav-link, body.site-menu-right .site-menu .nav-link {
    padding: 10px 12px !important;
  }
  body.site-menu-left .site-menu .navbar-nav img.nav-link, body.site-menu-right .site-menu .navbar-nav img.nav-link {
    width: 48px; padding: 10px 12px !important;
  }
  /* The sidebar scrolls when it is taller than the window, so its dropdowns
     open beside it, fixed to the window, rather than inside it. */
  body.site-menu-left .site-menu .navbar-nav .dropdown-menu,
  body.site-menu-right .site-menu .navbar-nav .dropdown-menu {
    position: fixed; top: auto; margin: -44px 0 0; min-width: 220px;
  }
  body.site-menu-left .site-menu .navbar-nav .dropdown-menu { left: var(--site-menu-width); }
  body.site-menu-right .site-menu .navbar-nav .dropdown-menu { left: auto; right: var(--site-menu-width); }

  body.site-menu-bottom { padding-bottom: var(--site-menu-height, 88px); }
  body.site-menu-bottom header:has(.site-menu) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
  }
  body.site-menu-bottom .site-menu { padding: 8px 0 !important; }
  body.site-menu-bottom .site-menu .nav-link { padding-top: 12px !important; padding-bottom: 12px !important; }
  body.site-menu-bottom .site-menu .navbar-nav .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 4px; }
  body.site-menu-bottom .page-edit-moving { bottom: calc(var(--site-menu-height, 88px) + 16px); }
}

/* Page editing: the box that asks for a duplicate's name. */
.page-edit-dialog { border: 0; border-radius: 12px; padding: 20px 22px; width: min(440px, 92vw); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
.page-edit-dialog::backdrop { background: rgba(15, 20, 30, 0.35); }
.page-edit-dialog h2 { font-size: 1.15rem; margin: 0 0 12px; }
.page-edit-dialog-hint { margin: 6px 0 0; }
.page-edit-dialog-error { color: #b42318; margin: 6px 0 0; font-size: 14px; min-height: 1em; }
.page-edit-dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
