/*
 * Made of Mark's look on top of Bootstrap 5.3 (vendor/assets/stylesheets/bootstrap).
 * Loaded after Bootstrap, so these settings win. Bootstrap's own classes do the layout;
 * this file only sets the colors and fonts, and has the few bits Bootstrap does not have.
 */

:root,
[data-bs-theme="light"] {
  --mom-accent: #8a4b2a;
  --mom-accent-rgb: 138, 75, 42;
  --mom-accent-dark: #6d3b21;
  --mom-accent-darker: #5e331d;

  --bs-primary: var(--mom-accent);
  --bs-primary-rgb: var(--mom-accent-rgb);
  --bs-link-color: var(--mom-accent);
  --bs-link-color-rgb: var(--mom-accent-rgb);
  --bs-link-hover-color: var(--mom-accent-dark);
  --bs-link-hover-color-rgb: 109, 59, 33;

  --bs-body-color: #23201c;
  --bs-body-color-rgb: 35, 32, 28;
  --bs-body-bg: #faf7f1;
  --bs-body-bg-rgb: 250, 247, 241;
  --bs-secondary-color: rgba(35, 32, 28, 0.66);
  --bs-secondary-bg: #efe9dc;
  --bs-tertiary-bg: #f4efe4;
  --bs-border-color: #e2dccf;
  --bs-body-font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --bs-body-font-size: 1.0625rem;
}

/* Staff screens read better in a plain sans-serif font. */
body.admin {
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bs-body-font-size: 1rem;
}

/* Bootstrap's buttons take their colors from these variables; point them at the accent. */
.btn-primary {
  --bs-btn-bg: var(--mom-accent);
  --bs-btn-border-color: var(--mom-accent);
  --bs-btn-hover-bg: var(--mom-accent-dark);
  --bs-btn-hover-border-color: var(--mom-accent-dark);
  --bs-btn-active-bg: var(--mom-accent-darker);
  --bs-btn-active-border-color: var(--mom-accent-darker);
  --bs-btn-disabled-bg: var(--mom-accent);
  --bs-btn-disabled-border-color: var(--mom-accent);
  --bs-btn-focus-shadow-rgb: var(--mom-accent-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--mom-accent);
  --bs-btn-border-color: var(--mom-accent);
  --bs-btn-hover-bg: var(--mom-accent);
  --bs-btn-hover-border-color: var(--mom-accent);
  --bs-btn-active-bg: var(--mom-accent);
  --bs-btn-active-border-color: var(--mom-accent);
  --bs-btn-disabled-color: var(--mom-accent);
  --bs-btn-disabled-border-color: var(--mom-accent);
  --bs-btn-focus-shadow-rgb: var(--mom-accent-rgb);
}
.btn-outline-secondary {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-border-color: #c9c0ad;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #6b645a;
  --bs-btn-hover-border-color: #6b645a;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #6b645a;
  --bs-btn-active-border-color: #6b645a;
}

.form-control:focus,
.form-select:focus {
  border-color: #c4977f;
  box-shadow: 0 0 0 0.25rem rgba(var(--mom-accent-rgb), 0.25);
}
.form-check-input:checked {
  background-color: var(--mom-accent);
  border-color: var(--mom-accent);
}
.form-check-input:focus {
  border-color: #c4977f;
  box-shadow: 0 0 0 0.25rem rgba(var(--mom-accent-rgb), 0.25);
}

.navbar-brand { font-weight: 700; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--mom-accent); }

/* Cover photos on cards and the gallery on product and space pages */
.cover { aspect-ratio: 4 / 3; object-fit: cover; background: var(--bs-secondary-bg); }
.gallery-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--bs-border-radius); background: var(--bs-tertiary-bg); }
.gallery a { display: block; cursor: zoom-in; }

/* Photo cards on the admin edit pages */
.photo-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--bs-tertiary-bg); }
/* A video's preview in the admin takes the video's own shape (a photo keeps its 4:3 frame), so a tall
   phone clip is not squeezed into a wide box. 16:9 until the browser has read the real size. */
video.photo-thumb { height: auto; aspect-ratio: auto 16 / 9; }
.photo-card { position: relative; }
.photo-card a[data-gallery-target] { cursor: zoom-in; }
.crop-stage img { display: block; max-width: 100%; }

/* The button that shows or hides a batch of files on the admin delivery screen: a chevron that points
   down while the batch is open and right while it is collapsed. */
.batch-chevron {
  display: inline-block; width: 0.5em; height: 0.5em; margin-top: -0.2em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform 0.15s ease-in-out;
}
.batch-toggle.collapsed .batch-chevron { margin-top: 0; transform: rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .batch-chevron { transition: none; } }

/* Bootstrap's d-flex and similar utilities would otherwise show an element that has the hidden attribute. */
[hidden] { display: none !important; }
