/* The catalogue theme.
 *
 * Loads after the unmodified Bootstrap bundle and before `app.css`. Bootstrap
 * owns the global semantic palette and its component colours; this sheet keeps
 * the catalogue typography and the few spacing and structural adjustments the
 * application needs. `app.css` retains the independent domain colour scales
 * for readiness, lifecycle and format badges.
 *
 * Doing it this way keeps `app/static/css/vendor/bootstrap-5.3.8.min.css`
 * byte-for-byte upstream and needs no Sass, no Node, and no build step.
 */

:root {
  /* These remain for app-specific and domain UI in `app.css`; Bootstrap
   * semantic roles below deliberately use the stock 5.3 values instead. */
  --press-ink: #1c1a17;
  --press-paper: #f5f2ed;
  --press-surface: #ffffff;
  --press-muted: #6c655c;
  --press-rule: #ddd6cb;
  --press-rule-soft: #ebe5db;
  --press-plum: #5a2a4d;
  --press-plum-dark: #47203d;
  --press-plum-deep: #331a2c;
  --press-plum-tint: #f3e9f0;
  --press-green: #2c6a4a;
  --press-green-dark: #22543a;
  --press-green-tint: #e4efe8;
  --press-brick: #a02a24;
  --press-brick-dark: #82211c;
  --press-brick-tint: #fbe8e6;
  --press-ochre: #8f6710;
  --press-ochre-tint: #fbf1da;
  --press-teal: #2f6377;
  --press-teal-tint: #e6eef2;
  --press-stone: #6c655c;
  --press-stone-dark: #56504a;

  --press-serif:
    "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia,
    serif;

  /* The two layers that can meet each other. The save strip floats over the
   * scrolling form, and an open dropdown floats over the save strip — a
   * combobox in the last card opens straight underneath it otherwise. */
  --press-z-save-bar: 20;
  --press-z-dropdown: 30;

  /* Bootstrap 5.3's stock light-theme semantic palette. */
  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success: #198754;
  --bs-success-rgb: 25, 135, 84;
  --bs-danger: #dc3545;
  --bs-danger-rgb: 220, 53, 69;
  --bs-warning: #ffc107;
  --bs-warning-rgb: 255, 193, 7;
  --bs-info: #0dcaf0;
  --bs-info-rgb: 13, 202, 240;

  --bs-body-bg: #fff;
  --bs-body-color: #212529;
  --bs-body-color-rgb: 33, 37, 41;
  --bs-body-font-size: 0.95rem;
  --bs-body-line-height: 1.5;
  --bs-emphasis-color: #000;
  --bs-secondary-color: rgba(33, 37, 41, 0.75);
  --bs-tertiary-bg: #f8f9fa;
  --bs-border-color: #dee2e6;
  --bs-border-color-translucent: rgba(0, 0, 0, 0.175);
  --bs-border-radius: 0.3rem;
  --bs-border-radius-sm: 0.25rem;
  --bs-border-radius-lg: 0.4rem;

  --bs-link-color: #0d6efd;
  --bs-link-color-rgb: 13, 110, 253;
  --bs-link-hover-color: #0a58ca;
  --bs-link-hover-color-rgb: 10, 88, 202;

  --bs-heading-color: inherit;
  --bs-code-color: #d63384;
  --bs-highlight-bg: #fff3cd;
}

/* Typography. The catalogue's voice is a serif one — headings, the brand and
 * the display numbers are set in it. The data is not: tables, forms and
 * controls stay on the dense sans, which is what makes a 40-row title list
 * readable. */
body {
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
.press-display {
  font-family: var(--press-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.75rem;
  line-height: 1.15;
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1.1rem;
}

/* A small-caps label used for section eyebrows and column-ish headings. */
.press-eyebrow {
  display: block;
  margin: 0;
  color: var(--press-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* Numbers that line up: ISBNs, prices, counts. */
.press-numeric {
  font-variant-numeric: tabular-nums;
}

/* Buttons retain the catalogue's compact sizing. Bootstrap supplies each
 * variant's stock colours and interactions. */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: 0.45rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-font-size: 0.875rem;
}
.btn-lg {
  --bs-btn-padding-y: 0.6rem;
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-font-size: 1rem;
}
.btn-sm {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.6rem;
  --bs-btn-font-size: 0.78rem;
}

/* The quiet ghost is for row-level removal: it remains muted until hover,
 * when it adopts Bootstrap's standard danger treatment. */
.btn-ghost {
  --bs-btn-color: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: var(--bs-danger);
  --bs-btn-hover-bg: var(--bs-danger-bg-subtle);
  --bs-btn-hover-border-color: var(--bs-danger);
  --bs-btn-active-color: var(--bs-danger);
  --bs-btn-active-bg: var(--bs-danger-bg-subtle);
  --bs-btn-active-border-color: var(--bs-danger);
  --bs-btn-disabled-color: var(--bs-secondary);
  --bs-btn-disabled-border-color: var(--bs-border-color);
  border: var(--bs-border-width) solid var(--bs-btn-border-color);
}

/* Cards are the page's sectioning primitive. Their compact spacing and header
 * treatment are catalogue-specific; Bootstrap supplies their surfaces. */
.card {
  --bs-card-cap-padding-y: 0.45rem;
  --bs-card-cap-padding-x: 0.85rem;
  --bs-card-spacer-y: 0.85rem;
  --bs-card-spacer-x: 0.85rem;
}
.card > .card-header {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card > .card-header h1,
.card > .card-header h2,
.card > .card-header h3 {
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}
/* A header that carries controls rather than a title keeps normal type. */
.card > .card-header--toolbar {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.table {
  font-size: 0.86rem;
}
.table > thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.form-label {
  /* `app.css` still lays a bare <label> out as a grid, which is what the
   * unconverted pages want. A Bootstrap form label is not that. */
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-check-label {
  display: inline;
  font-weight: 400;
}
/* A label that wraps its own control — `<label>Alt text <input …></label>` —
 * still stacks the control beneath the text. Without this the control goes
 * inline after an inline-block label and the pair reads as one run-on line. */
label.form-label:has(> input, > select, > textarea) {
  display: grid;
  gap: 0.25rem;
}
.form-text {
  font-size: 0.78rem;
}
/* Bootstrap's default `.form-control` on a textarea is one row tall. The
 * marketing and rights fields are paragraphs; they get room by default. */
textarea.form-control {
  min-height: 7rem;
}
textarea.form-control.form-control-sm {
  min-height: 4rem;
}

.alert {
  --bs-alert-border-color: currentcolor;
  border-width: 0 0 0 5px;
  border-radius: 0;
}
.alert > ul:last-child,
.alert > p:last-child {
  margin-bottom: 0;
}

/* The masthead retains its structural treatment, using Bootstrap's stock
 * primary blue. `data-bs-theme="dark"` on the element supplies its navbar and
 * dropdown contrast. */
.press-masthead {
  background: var(--bs-primary);
  border-bottom: 3px solid var(--bs-primary);
}
.press-masthead .navbar-brand {
  font-family: var(--press-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.press-masthead .navbar-nav {
  --bs-nav-link-font-size: 0.78rem;
  --bs-nav-link-font-weight: 700;
  --bs-nav-link-padding-y: 0.5rem;
}
.press-masthead .nav-link {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* The active section is marked by a rule under the label rather than a filled
 * pill, so the masthead stays a band of type. */
.press-masthead .nav-link {
  position: relative;
}
.press-masthead .nav-link::after {
  content: "";
  position: absolute;
  left: var(--bs-nav-link-padding-x);
  right: var(--bs-nav-link-padding-x);
  bottom: 0.2rem;
  height: 2px;
  background: currentcolor;
  opacity: 0;
  transition: opacity 0.12s ease-in;
}
.press-masthead .nav-link:hover::after {
  opacity: 0.4;
}
.press-masthead .nav-link.active::after,
.press-masthead .show > .nav-link::after {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .press-masthead .nav-link::after {
    transition: none;
  }
}
.press-masthead .dropdown-menu {
  --bs-dropdown-font-size: 0.85rem;
}
.press-masthead .navbar-text {
  font-size: 0.8rem;
}

.press-footer {
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The page's own container width. Bootstrap's `.container` tops out at
 * 1320px, which is wider than a metadata form wants; the catalogue tables
 * want more than 1140px. */
.press-frame {
  width: min(1240px, calc(100% - 2rem));
  margin-inline: auto;
}

/* A sticky save strip at the foot of the long editors. */
.press-save-bar {
  position: sticky;
  bottom: 0;
  z-index: var(--press-z-save-bar);
  display: flex;
  justify-content: end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.75rem 0;
  background: var(--bs-body-bg);
  border-top: 2px solid var(--bs-primary);
}
