/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Rows that navigate on click (see controllers/row_link_controller). The row is a
   convenience; the link inside it remains the accessible path. */
.linked-row {
  cursor: pointer;
}

/* Holiday row states.
 *
 * Not Bootstrap's .table-light / .table-warning / .table-success: those are
 * fixed light-palette colours that do not change with the theme, so in dark
 * mode a "dimmed" past row came out brighter than the table around it - the
 * opposite of dimmed - and the next-up row was a slab of bright yellow.
 *
 * These set the same custom properties Bootstrap's own variants set, but from
 * the theme's subtle/emphasis tokens, which Bootstrap redefines under
 * [data-bs-theme=dark]. One rule, correct in both themes.
 */
.holiday-row-past {
  --bs-table-color: var(--bs-secondary-color);
  --bs-table-bg: var(--bs-tertiary-bg);
}

.holiday-row-next {
  --bs-table-color: var(--bs-warning-text-emphasis);
  --bs-table-bg: var(--bs-warning-bg-subtle);
}

.holiday-row-now {
  --bs-table-color: var(--bs-success-text-emphasis);
  --bs-table-bg: var(--bs-success-bg-subtle);
}

/* Contrast fixes, measured against the rendered page rather than guessed.
 *
 * Bootstrap dims navbar links to rgba(255, 255, 255, .55), which over bg-primary
 * measures 2.36:1 - less than half the 4.5:1 AA asks for body text. This is not
 * a dark-mode problem; the navbar has always been bg-primary with a dark theme
 * on it, so those links have always failed.
 *
 * Solid white on that blue is exactly 4.50:1, which passes with nothing to
 * spare - any transparency at all drops it under. So the links are opaque, and
 * the current page is marked by weight rather than by being the only one bright
 * enough to read. It already carries aria-current="page" for anyone not going
 * by appearance.
 */
.navbar,
.navbar[data-bs-theme="dark"],
.navbar[data-bs-theme="light"] {
  /* The attribute selectors are not decoration: Bootstrap sets
     --bs-navbar-color from `.navbar[data-bs-theme=dark]`, which outranks a bare
     `.navbar`, so without matching that specificity this rule is ignored. */
  --bs-navbar-color: #fff;
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
}

.navbar .nav-link[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

/* Outline buttons in dark mode. Bootstrap keeps --bs-primary (#0d6efd) as the
 * text colour for .btn-outline-primary in both themes; on the dark body that is
 * 3.43:1. The -text-emphasis tokens are the theme-aware lighter variants, and
 * measure 6.4:1 and above.
 */
[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color: var(--bs-primary-text-emphasis);
  --bs-btn-border-color: var(--bs-primary-text-emphasis);
}

[data-bs-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: var(--bs-secondary-text-emphasis);
  --bs-btn-border-color: var(--bs-secondary-text-emphasis);
}

/* Inline code. Bootstrap's --bs-code-color is #d63384, which measures 3.86:1
 * against the tinted alert the settings hints sit in - under AA. A darker pink
 * of the same hue clears it. Dark mode's lighter pink already passes, so this
 * is scoped to light rather than set unconditionally.
 */
:root,
[data-bs-theme="light"] {
  --bs-code-color: #ab296a;
}
