/*
 * The site's theme (restyle-site-theme): fonts, colour tokens, and Bootstrap mapped onto them.
 * Loaded after Bootstrap and before site.css.
 */

/*
 * Fonts (D3). Latin subsets, self-hosted so no page calls another host. Taken from
 * @fontsource/exo-2@5.3.0 and @fontsource/lato@5.3.0; each folder carries its OFL licence.
 */
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../lib/fonts/exo-2/exo-2-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../lib/fonts/exo-2/exo-2-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../lib/fonts/lato/lato-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../lib/fonts/lato/lato-latin-700-normal.woff2") format("woff2");
}

/* Tokens (D2), sampled from the Insights reference, and Bootstrap's variables mapped onto them (D1). */
:root {
  --brand-navy: #002b5c;
  --brand-blue: #0b4ea2;
  --brand-blue-rgb: 11, 78, 162;
  --brand-blue-dark: #083b7a;
  --brand-sky: #a9c7f0;
  --page-bg: #f1f4f9;
  --card-border: #d6dde8;
  --text: #1f2a3d;
  --text-muted: #5b6b85;
  --callout-bg: #e8f0fc;
  --callout-border: #b5cbee;
  --danger: #d71920;
  --accent-warning: #c27c00;
  --accent-success: #1e7b34;
  --font-display: "Exo 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Bootstrap paints fields, radios and tables with the body colour, so it stays white; the page is grey below. */
  --bs-body-bg: #fff;
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font-text);
  --bs-heading-color: var(--brand-navy);
  --bs-secondary-color: var(--text-muted);
  --bs-primary: var(--brand-blue);
  --bs-primary-rgb: var(--brand-blue-rgb);
  --bs-danger: var(--danger);
  --bs-link-color: var(--brand-blue);
  --bs-link-color-rgb: var(--brand-blue-rgb);
  --bs-link-hover-color: var(--brand-blue-dark);
  --bs-link-hover-color-rgb: 8, 59, 122;
  --bs-border-color: var(--card-border);
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-focus-ring-color: rgba(var(--brand-blue-rgb), 0.35);
}

body {
  background-color: var(--page-bg);
}

/* Radios and checkboxes keep a 3:1 outline against white. */
.form-check-input {
  border-color: #7d8aa0;
}

.form-check-input:checked {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: 700;
}

h1, .h1 {
  font-size: 1.625rem;
}

/* Buttons take the brand blue; the outlined secondary button is white with a quiet border. */
.btn-primary {
  --bs-btn-bg: var(--brand-blue);
  --bs-btn-border-color: var(--brand-blue);
  --bs-btn-hover-bg: var(--brand-blue-dark);
  --bs-btn-hover-border-color: var(--brand-blue-dark);
  --bs-btn-active-bg: var(--brand-blue-dark);
  --bs-btn-active-border-color: var(--brand-blue-dark);
  --bs-btn-disabled-bg: var(--brand-blue);
  --bs-btn-disabled-border-color: var(--brand-blue);
  --bs-btn-focus-shadow-rgb: var(--brand-blue-rgb);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand-blue);
  --bs-btn-bg: #fff;
  --bs-btn-border-color: var(--brand-blue);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-blue);
  --bs-btn-hover-border-color: var(--brand-blue);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand-blue-dark);
  --bs-btn-active-border-color: var(--brand-blue-dark);
  --bs-btn-focus-shadow-rgb: var(--brand-blue-rgb);
}

.btn-outline-secondary {
  --bs-btn-color: var(--text);
  --bs-btn-bg: #fff;
  --bs-btn-border-color: var(--card-border);
  --bs-btn-hover-color: var(--brand-blue);
  --bs-btn-hover-bg: var(--callout-bg);
  --bs-btn-hover-border-color: var(--callout-border);
  --bs-btn-active-color: var(--brand-blue);
  --bs-btn-active-bg: var(--callout-bg);
  --bs-btn-active-border-color: var(--callout-border);
  --bs-btn-focus-shadow-rgb: var(--brand-blue-rgb);
}

/* Layout (D4): content keeps Bootstrap's widest container, 1,320 px, so the standup table's text columns stay short. */

/* The navy header: logo, site name and subtitle on the left, the person and Sign out on the right. */
.site-header {
  background: var(--brand-navy);
  color: #fff;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding-block: 0.5rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.site-brand:hover {
  color: #fff;
}

.site-logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  line-height: 1.2;
}

.site-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.site-subtitle {
  color: var(--brand-sky);
  font-size: 0.8125rem;
}

.site-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.site-user form {
  margin: 0;
}

/* The outlined white pill on the navy header. */
.btn-pill {
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255, 255, 255, 0.6);
  --bs-btn-hover-color: var(--brand-navy);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: #fff;
  --bs-btn-active-color: var(--brand-navy);
  --bs-btn-active-bg: var(--brand-sky);
  --bs-btn-active-border-color: var(--brand-sky);
  --bs-btn-focus-shadow-rgb: 255, 255, 255;
  border-radius: 50rem;
  padding-inline: 0.9rem;
}

/* On a phone the header keeps the logo, the site name and Sign out; the subtitle and name make way. */
@media (max-width: 575.98px) {
  .site-subtitle,
  .site-user-name {
    display: none;
  }
}

/* The white tab bar: the current section is underlined in blue. On a phone it scrolls sideways within itself. */
.site-tabs {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
}

.site-tabs ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.site-tabs a {
  display: block;
  padding: 0.7rem 0 calc(0.7rem - 3px);
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.site-tabs a:hover {
  color: var(--brand-blue);
}

.site-tabs a[aria-current="page"] {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

.site-main {
  padding-block: 1.25rem 2rem;
}

/* The prompt, the flash message and info blocks (D5). */
.callout {
  padding: 0.5rem 0.75rem;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: var(--bs-border-radius);
  color: var(--text);
}

/* Components (D5) */

/* Cards: white, a thin border, 8 px corners, no shadow. */
.card {
  --bs-card-bg: #fff;
  --bs-card-border-color: var(--card-border);
  --bs-card-border-radius: var(--bs-border-radius);
  --bs-card-inner-border-radius: calc(var(--bs-border-radius) - 1px);
  --bs-card-cap-bg: #fff;
}

/* The uppercase, letter-spaced label over a section. */
.section-label {
  margin: 0 0 0.375rem;
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* A page's title row: a label and title on the left, the page's own controls on the right. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.page-title {
  margin: 0;
  font-size: 1.625rem;
  line-height: 1.15;
}

/* A row of filters with a prompt at its end. */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.page-toolbar > * {
  margin-bottom: 0;
}

.submit-prompt.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem;
}

.submit-prompt.callout:not(:has([data-day-off-note])) {
  padding-left: 0.4rem;
}

/* Segmented controls: quiet white segments, the current one filled blue. */
.segmented > .btn-outline-primary {
  --bs-btn-color: var(--text);
  --bs-btn-border-color: var(--card-border);
  --bs-btn-hover-color: var(--brand-blue);
  --bs-btn-hover-bg: var(--callout-bg);
  --bs-btn-hover-border-color: var(--card-border);
}

/* Status blocks: white cards with a coloured left edge. */
.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.status-cards:not(:has(*)) {
  display: none;
}

.accent-card {
  margin: 0;
  padding: 0.6rem 0.9rem;
  background: #fff;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent, var(--brand-blue));
  border-radius: var(--bs-border-radius);
}

.accent-warning {
  --accent: var(--accent-warning);
}

.accent-danger {
  --accent: var(--danger);
}

.accent-success {
  --accent: var(--accent-success);
}

/* A table in a card: it scrolls within the card rather than widening the page. The standup table's layout is in
   site.css; on a phone its rows become cards of their own (.standup-card below). */
.table-card {
  overflow-x: auto;
}

.table-card > .table {
  margin-bottom: 0;
}

/* Tables sit on white, whatever the page behind them. */
.table {
  --bs-table-bg: #fff;
  --bs-table-border-color: var(--card-border);
}

/* Every table's column names are small uppercase labels. */
.table > thead > tr > th {
  padding-block: 0.5rem;
  background: #f7f9fc;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card > .table > :not(caption) > tr > :first-child {
  padding-left: 0.75rem;
}

.card > .table > :not(caption) > tr > :last-child {
  padding-right: 0.75rem;
}

.card > .table > tbody > tr:last-child > * {
  border-bottom-width: 0;
}

.page-subtitle {
  max-width: 60rem;
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* A report's days, one labelled card each. */
.report-day + .report-day {
  margin-top: 1.25rem;
}

/* Field labels and the legends of radio groups read the same everywhere. */
.form-label,
legend.form-label {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
}

/* The entry view: the form in a card, the previous standup in a tinted card beside it. */

.previous-card {
  padding: 1rem 1.1rem;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: var(--bs-border-radius);
}

.previous-card .section-label {
  margin-bottom: 0.75rem;
  color: var(--brand-navy);
}

.previous-card dl {
  margin-bottom: 0;
}

.previous-card dl + dl {
  margin-top: 0.75rem;
}

.previous-card dt {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.previous-card dd {
  margin-bottom: 0.6rem;
}

.missed-days a {
  white-space: nowrap;
}

/* Narrow single-purpose cards: sign in, not allowed, choose your team. */
.narrow-card {
  max-width: 28rem;
}

/* My Team: the team name in the display face, and each team's people as a compact list. */
.team-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.team-group h3 {
  margin: 0.75rem 0 0.25rem;
  color: var(--brand-blue);
}

.team-group .table {
  margin-bottom: 0.5rem;
}

.team-group td.pick {
  width: 2rem;
}

/* Choose your team: each team is a tile, the chosen one outlined in blue. */
.option-tiles {
  display: grid;
  gap: 0.5rem;
}

.option-tiles .form-check {
  margin: 0;
  padding: 0.6rem 0.75rem 0.6rem 2.25rem;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--bs-border-radius);
}

.option-tiles .form-check:has(:checked) {
  background: var(--callout-bg);
  border-color: var(--brand-blue);
}

.option-tiles .form-check-label {
  font-weight: 700;
}

/* Time off: the days already marked, one per row. */
.days-off-list li {
  padding-block: 0.4rem;
  border-bottom: 1px solid var(--card-border);
}

.days-off-list li:last-child {
  border-bottom: 0;
}

.days-off-list form {
  margin: 0;
}

/* The entry pop-up: a page-coloured panel over a navy wash, with Close in its top corner. */
dialog.entry-dialog {
  width: min(1180px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.5rem;
  background: var(--page-bg);
  border: 0;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgba(0, 43, 92, 0.35);
}

dialog.entry-dialog::backdrop {
  background: rgba(0, 43, 92, 0.55);
}

.entry-dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  margin: 0;
}

dialog.entry-dialog .entry-view > [data-entry-date] {
  padding-right: 5rem;
}

@media (max-width: 575.98px) {
  dialog.entry-dialog {
    padding: 1rem;
  }

  .entry-dialog-close {
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* Yesterday and Today get the room; the counts take what they need. Phones stack the fields instead (site.css). */
@media (min-width: 768px) {
  .standup-table td[data-field="Yesterday"],
  .standup-table td[data-field="Today"] {
    width: 25%;
  }

  .standup-table td[data-field="Blockers"] {
    width: 10%;
  }

  /* On track holds the reason when someone is behind, so it never narrows to a word per line. */
  .standup-table tr.standup > td:last-child {
    width: 12%;
    min-width: 9rem;
  }

  /* A light line between neighbouring columns, header included, so one answer doesn't run into the next
     (add-standup-table-column-borders). Wide screens only: on a phone the cells are stacked fields. */
  .standup-table > :not(caption) > tr > * + * {
    border-left: 1px solid var(--card-border);
  }
}

.not-submitted .list-inline-item:not(:last-child) {
  margin-right: 0.3rem;
}

.standup-table tr.table-danger > * {
  --bs-table-bg: #fdeeee;
  --bs-table-color: var(--text);
}

.standup-table tr.table-danger > th {
  box-shadow: inset 3px 0 0 var(--danger);
}

@media (max-width: 767.98px) {
  .standup-card {
    background: transparent;
    border: 0;
  }

  .standup-table tr.standup,
  .standup-table tr.day-off {
    background: #fff;
  }

  .standup-table tr.day-off {
    margin-bottom: 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: var(--bs-border-radius);
  }

  .standup-table > tbody > tr > * {
    padding-inline: 0.75rem;
  }
}
