/*
 * Bootstrap compatibility shim: backfills the look-classes the site's templates
 * use that Bootstrap 5 doesn't provide. Loaded after bootstrap5.min.css and
 * before cinedex-theme.css so the theme can still override. All sizing is
 * rem-based on Bootstrap's 16px root.
 */

/* Body text + brand link/primary colors. */
:root {
  --bs-body-color: #333; --bs-body-color-rgb: 51, 51, 51;
  --bs-link-color: #3077bf; --bs-link-color-rgb: 48, 119, 191;
  --bs-link-hover-color: #004d99; --bs-link-hover-color-rgb: 0, 77, 153;
  --bs-primary: #3077bf; --bs-primary-rgb: 48, 119, 191;
  /* Tertiary brand pair (green), beside the blue and red pairs. */
  --optical-green: #2d7a3e; --optical-green-dark: #1e5e34;
  /* Spacing: three steps, each named for the relationship it expresses. Related
     things sit closer than unrelated ones, and each step doubles the last so the
     difference reads at a glance. */
  --space-together: 0.5rem;  /* parts of one item: label → its panel, headline → its date, heading → its content */
  --space-related: 1rem;     /* items within one group, and a panel's inset */
  --space-separate: 2rem;    /* separate groups and regions: the gutter, card to card, a band's inset */
}
.form-control, .form-select,
.dropdown-menu, .alert, .table { font-size: 0.875rem; }
h1 { font-size: 2.25rem; } h2 { font-size: 1.875rem; } h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; } h5 { font-size: 0.875rem; } h6 { font-size: 0.75rem; }

/* Heading margins the page layouts rely on. */
h1, h2, h3, h4, h5, h6 { margin-bottom: 0.625rem; }
h1, h2, h3 { margin-top: 1.25rem; }
h4, h5, h6 { margin-top: 0.625rem; }
.alert { margin-bottom: 1.25rem; }

/* Brand-blue links, underlined on hover only (the front page loads after this
   and sets its own red link style). */
a { text-decoration: none; color: #3077bf; }
a:hover { text-decoration: underline; color: #004d99; }

/* Muted, smaller <small> inside headings — old-style figures, since a date
   reads as text unlike the lining title number beside it. */
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {
  font-size: 65%; font-weight: 400; color: #999;
  font-variant-numeric: oldstyle-nums;
}

/* Zero the navbar's own vertical padding and pad the colored bar instead, so
   the search controls sit inside the bar rather than escaping its edges. */
.navbar.navbar-optical { padding-top: 0; padding-bottom: 0; }
.navbar-optical .container-fluid { padding: 0.5rem 0.9375rem; }

/* Button sizing via Bootstrap's own custom properties. */
.btn { --bs-btn-padding-x: 0.75rem; --bs-btn-padding-y: 0.375rem; --bs-btn-font-size: 0.875rem; }
.btn-lg { --bs-btn-font-size: 1.125rem; --bs-btn-padding-x: 1rem; --bs-btn-padding-y: 0.625rem; }
.btn-sm { --bs-btn-font-size: 0.75rem; --bs-btn-padding-x: 0.625rem; --bs-btn-padding-y: 0.3125rem; }
/* Grid gutter. Set on container and row together — the row's negative margin
   must match the container padding or it overflows. */
.container, .container-fluid, .row { --bs-gutter-x: var(--space-separate); }

/* Thumbnail corner radius. */
.img-thumbnail { border-radius: 0.25rem; }

/* ---- Jumbotron (removed in BS5) ---------------------------------------- */
.jumbotron {
  padding: 1.875rem 0.9375rem;
  margin-bottom: 1.875rem;
  background-color: #eee;
  border-radius: 0;
}
.jumbotron h1 {
  font-size: 3.9375rem;
  font-weight: 600;
}
.jumbotron p {
  font-size: 1.3125rem;
  font-weight: 400;
}
@media (min-width: 48rem) {
  .jumbotron { padding: 3rem 1.875rem; }
}
@media (max-width: 22.5rem) {
  .jumbotron h1 { font-size: 1.5625rem; }
}

/* ---- Page header (removed in BS5) -------------------------------------- */
.page-header {
  padding-bottom: 0.5625rem;
  margin: 2.5rem 0 1.25rem;
  border-bottom: 0.0625rem solid #eee;
}

/* ---- Well (removed in BS5) --------------------------------------------- */
.well {
  min-height: 1.25rem;
  padding: 1.1875rem;
  margin-bottom: 1.25rem;
  background-color: #f5f5f5;
  border: 0.0625rem solid #e3e3e3;
  border-radius: 0.25rem;
}

/* ---- btn-default (renamed btn-secondary in BS5) ------------------------ */
.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
  color: #333;
  background-color: #e6e6e6;
  border-color: #adadad;
}
.btn-default.disabled,
.btn-default:disabled { opacity: 0.65; }

/* btn-primary ships BS5's hardcoded blue button vars; repoint them at the brand blue. */
.btn-primary {
  --bs-btn-bg: #3077bf; --bs-btn-border-color: #3077bf;
  --bs-btn-hover-bg: #004d99; --bs-btn-hover-border-color: #004d99;
  --bs-btn-active-bg: #004d99; --bs-btn-active-border-color: #004d99;
  --bs-btn-disabled-bg: #3077bf; --bs-btn-disabled-border-color: #3077bf;
  --bs-btn-focus-shadow-rgb: 48, 119, 191;
}

/* btn-outline-primary ships the same hardcoded blue; the brand blue pair again. */
.btn-outline-primary {
  --bs-btn-color: #3077bf; --bs-btn-border-color: #3077bf;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #3077bf; --bs-btn-hover-border-color: #3077bf;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #004d99; --bs-btn-active-border-color: #004d99;
  --bs-btn-disabled-color: #3077bf; --bs-btn-disabled-border-color: #3077bf;
  --bs-btn-focus-shadow-rgb: 48, 119, 191;
}

/* btn-outline-secondary (Fetch, Sign out) in the site's secondary grey. */
.btn-outline-secondary {
  --bs-btn-color: #454547; --bs-btn-border-color: #454547;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #454547; --bs-btn-hover-border-color: #454547;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #454547; --bs-btn-active-border-color: #454547;
  --bs-btn-disabled-color: #454547; --bs-btn-disabled-border-color: #454547;
  --bs-btn-focus-shadow-rgb: 69, 69, 71;
}

/* btn-link (Cancel) takes the brand blue's focus ring, as its text does. */
.btn-link { --bs-btn-focus-shadow-rgb: 48, 119, 191; }

/* ---- btn-block (removed in BS5; was full-width block button) ----------- */
.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: var(--space-together); }

/* ---- btn-group-justified (removed in BS5; stretched buttons to fill) --- */
.btn-group-justified { display: flex; width: 100%; }
.btn-group-justified > .btn,
.btn-group-justified > .btn-group { flex: 1 1 0; }
.btn-group-justified > .btn-group > .btn { width: 100%; }
/* Keep each justified button's content on one line. */
.btn-group-justified > .btn { white-space: nowrap; }
/* Episode prev/list/next labels shrink to fit the narrow thirds without wrapping. */
#buttons > .btn { --bs-btn-font-size: 0.75rem; }

/* ---- table-condensed (renamed to table-sm) ----------------------------- */
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tbody > tr > td,
.table-condensed > thead > tr > td { padding: 0.3125rem; }

/* ---- contextual table rows (BS3 .info etc. → BS5 .table-info) ----------- */
.table tr.info > td, .table tr.info > th { background-color: #d9edf7; }

/* ---- float helpers (renamed to float-start / float-end) ---------------- */
.pull-left { float: left !important; }
.pull-right { float: right !important; }

/* ---- sr-only (renamed to visually-hidden) ------------------------------ */
.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Forms: form-group / help-block / has-error / form-inline (BS5) ---- */
.form-inline { display: flex; flex-flow: row wrap; align-items: center; gap: 0.3125rem; }
.form-inline .form-group { margin-bottom: 0; }
.form-group { margin-bottom: 0.625rem; }
.help-block { display: block; margin-top: 0.3125rem; color: #737373; }
.has-error .form-control { border-color: #a94442; }
.has-error .help-block,
.has-error label { color: #a94442; }

/* ---- Breadcrumb (BS5 uses .breadcrumb-item; footer still uses <li>) ---- */
.breadcrumb { padding: 0.5rem 0.9375rem; background-color: #f5f5f5; border-radius: 0.25rem; list-style: none; display: flex; flex-wrap: wrap; }
.breadcrumb > li { display: inline-block; }
.breadcrumb > li + li::before { content: "/\00a0"; padding: 0 0.3125rem; color: #ccc; }
.breadcrumb > .active { color: #777; }
