/*
 * Application-wide styles: design tokens, chrome and helpers shared by
 * more than one page.  Styles for a single page live next to its view
 * path (e.g. studies/show.css) and are linked from that view's
 * content_for :head with data-turbo-track="dynamic".
 */

/**
 * Design tokens
 */
:root {
  --bs-body-bg:         #f4f6f9;
  --bs-modal-bg:        #ffffff;  /* pin modal surface to white; body-bg is off-white */
  --bs-form-control-bg: #ffffff;  /* inputs/selects/textareas stay white regardless of page bg */
  --bs-form-select-bg:  #ffffff;

  /* Navbar chrome */
  --nav-bg:             #0f1923;

  /* Navbar text tones */
  --nav-link-color:     #9aa5b4;
  --nav-link-hover:     #ffffff;
  --nav-meta-color:     #6b7a8d;

  /* Accent (amber) */
  --accent:             #f5a623;
  --accent-dark:        #d4891c;
}

/**
 * Body
 */
body {
  background-color: var(--bs-body-bg);
}

/**
 * Navbar overrides (Bootstrap variables)
 */
.navbar {
  --bs-navbar-color:               var(--nav-link-color);
  --bs-navbar-hover-color:         var(--nav-link-hover);
  --bs-navbar-active-color:        var(--nav-link-hover);
  --bs-navbar-brand-hover-color:   var(--accent);
  --bs-navbar-toggler-border-color:rgba(255,255,255,.15);
}

/**
 * Pagination overrides (Bootstrap variables)
 * The current page matches the btn-warning buttons; other links keep dark
 * text, since yellow text on white is too faint to read.
 */
.pagination {
  --bs-pagination-color:               var(--bs-body-color);
  --bs-pagination-hover-color:         var(--bs-body-color);
  --bs-pagination-hover-bg:            var(--bs-warning-bg-subtle);
  --bs-pagination-hover-border-color:  var(--bs-warning-border-subtle);
  --bs-pagination-focus-color:         var(--bs-body-color);
  --bs-pagination-focus-bg:            var(--bs-warning-bg-subtle);
  --bs-pagination-focus-box-shadow:    0 0 0 .25rem rgba(var(--bs-warning-rgb), .35);
  --bs-pagination-active-color:        var(--bs-dark);
  --bs-pagination-active-bg:           var(--bs-warning);
  --bs-pagination-active-border-color: var(--bs-warning);
}

/* Active nav-link accent underline */
.navbar .nav-link.active {
  color: var(--accent) !important;
}

/* Divider between nav links and the user menu */
.as-nav-divider { height: 1.5rem; }

/* User initials in the accent circle */
.as-nav-avatar {
  width: 28px;
  height: 28px;
  font-size: .7rem;
  background-color: var(--accent);
}

/* Recent study titles in the studies dropdown */
.as-nav-recent-title { max-width: 16rem; }

/**
 * Typography helpers
 */
.as-eyebrow     { letter-spacing: .07em; }   /* card-header eyebrows */
.as-th          { letter-spacing: .06em; }   /* table column headers */
.as-tagline     { letter-spacing: 2px; font-size: .6rem; }        /* login tagline */
.as-nav-tagline { letter-spacing: 2px; font-size: 0.55rem; color: var(--nav-meta-color); } /* navbar brand tagline */
.as-badge       { letter-spacing: .08em; }   /* status pill badges */

/**
 * Muted chrome color on dark background — page header meta strip,
 * navbar user name
 */
.as-page-meta {
  color: var(--nav-link-color);
}

/**
 * Small font sizes — Bootstrap ships fs-1 through fs-6 only.
 * Continues its scale downwards for dense tables, eyebrows and legends.
 */
.fs-7  { font-size: .8125rem !important; }  /* 13px */
.fs-8  { font-size: .75rem !important; }    /* 12px */
.fs-9  { font-size: .6875rem !important; }  /* 11px */
.fs-10 { font-size: .625rem !important; }   /* 10px */

/* Large faded icon above empty-state messages */
.as-empty-icon { font-size: 3rem; }

/**
 * Narrow page containers — Bootstrap's container sizes are breakpoint
 * driven and have no fixed narrow width.
 */
.as-container-sm { max-width: 640px; }
.as-container-md { max-width: 860px; }

/* Flash and toast stacks sit above modals (1055) and toasts (1090) */
.as-z-flash { z-index: 1100; }

/**
 * Sticky trailing columns in wide observation and cycle tables
 */
.sticky-col      { position: sticky; right: 80px; background: inherit; box-shadow: -2px 0 4px rgba(0,0,0,.04); }
.sticky-col-last { position: sticky; right: 0;    background: inherit; box-shadow: -2px 0 4px rgba(0,0,0,.06); }
