:root {
  --aghc-red: #cc3333;
  --aghc-gray: #6c757d;
  --aghc-tan: #fcf6e5;
  --aghc-beige: #fcf9f0;
  --aghc-page-edge-inset: .75rem;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Keep card and thumbnail geometry consistent throughout the archive. */
.card {
  --bs-card-border-radius: 0;
  --bs-card-inner-border-radius: 0;
  background-color: var(--aghc-beige);
  border: 0;
  border-radius: 0;
}

.card-img,
.card-img-top,
.card-img-bottom,
.collection-card-thumb,
.search-result-thumb,
.thumb-square-fw,
.thumb-square-fw-img,
.thumb-square-fw-file,
.file-card-preview {
  border-radius: 0 !important;
}

/* Continue the Collections masthead rule through overview/search card bodies. */
.search-result-card .card-body {
  border-left: 3px solid var(--aghc-red);
}

.main {
  flex: 1 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  transition: box-shadow .18s ease;
}

.header.is-stuck {
  box-shadow: 0 1px 12px rgba(0, 0, 0, .08);
}

.account-bar {
  background: #3f3f3f;
  color: #fff;
  font-size: .8125rem;
}

.account-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding-top: .375rem;
  padding-bottom: .375rem;
}

.account-bar-status {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-bar-links {
  flex-shrink: 0;
}

.account-bar-links .btn {
  --bs-btn-color: #fff;
  --bs-btn-border-color: #fff;
  --bs-btn-hover-color: #3f3f3f;
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #666;
  --bs-btn-active-border-color: #fff;
  --bs-btn-focus-shadow-rgb: 255, 255, 255;
  font-size: .8125rem;
  line-height: 1.2;
  padding: .125rem .5rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Override the site's global red button interaction styles. */
.account-bar-links .btn:hover,
.account-bar-links .btn:focus,
.account-bar-links .btn:active {
  background-color: #fff !important;
  color: #3f3f3f !important;
  border-color: #fff !important;
}

.account-bar-links a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ===========================
   Header brand & nav colors
   =========================== */

/* Brand block: prevent overflow and allow wrapping on mobile */
.brand {
  max-width: 100%;
}

/* Logo sizing */
.brand-logo {
  max-height: 36px;
  height: auto;
  width: auto;
}
.brand-logo-mobile {
  display: block;
  height: auto;
  max-height: 60px;
  max-width: calc(100vw - 6.5rem);
  width: auto;
}
@media (min-width: 465px) {
  .brand-logo-mobile {
    max-width: 360px;
  }
}
@media (max-width: 575.98px) {
  .brand-logo {
    max-height: 60px; /* larger logo for mobile */
    max-width: 80vw;  /* shrink if viewport very narrow */
  }
}

/* “Archive” text — mobile first: stacked, no pipe */
.brand-archive {
  display: block;
  color: var(--aghc-red);
  font-weight: 600;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-left: 38px;
}
@media (min-width: 576px) {
  .brand-archive {
    display: inline-block;
    font-weight: 400;
    font-size: 1.125rem;
    margin-top: 0;
    margin-left: 21px;
    padding-left: 1rem;
    letter-spacing: 1px;
    border-left: 1px solid var(--aghc-gray);
  }
}

/* Nav links: muted by default */
.header .nav-link {
  color: inherit;
  text-decoration: none;
  font-weight: 400;
}

/* ===========================
   Desktop nav underline (no flicker)
   =========================== */
@media (min-width: 992px) {
  .header .navbar-nav .nav-link {
    display: inline-block;
    line-height: 1.5;
    padding-bottom: .25rem;
    border-bottom: 0;
    background-image: linear-gradient(var(--aghc-red), var(--aghc-red));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 2px;
    transition: color .15s ease, background-size .15s ease;
  }

  .header .navbar-nav .nav-link:hover,
  .header .navbar-nav .nav-link:focus,
  .header .navbar-nav .nav-link.active,
  .header .navbar-nav .nav-link[aria-current="page"] {
    color: var(--aghc-red);
    background-size: 100% 2px;
  }

  /* Horizontal spacing between nav items */
  .navbar-nav .nav-item + .nav-item {
    margin-left: 1rem;
  }
}

/* ===========================
   Hero image
   =========================== */
.album-hero {
  --album-hero-max-height: clamp(18rem, 56vh, 42rem);
  background: var(--aghc-beige);
  margin-bottom: 2rem;
  overflow: hidden;
  padding-block: clamp(1rem, 2vw, 2rem);
}
.album-hero .hero-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: var(--album-hero-max-height);
  height: auto;
}
@media (max-width: 991.98px) {
  .album-hero {
    --album-hero-max-height: clamp(16rem, 48vh, 34rem);
  }
}
@media (max-width: 575.98px) {
  .album-hero {
    --album-hero-max-height: clamp(13rem, 40vh, 24rem);
  }
}

/* ===========================
   Collection cards
   =========================== */
.collection-card {
  border-radius: 0;
  transition: border-color .18s ease;
}

.collection-card:hover,
.collection-card:focus-within {
  border-color: rgba(0, 0, 0, .14);
  box-shadow: none;
}

.collection-card-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f3f5;
  border-top-left-radius: var(--bs-card-inner-border-radius);
  border-top-right-radius: var(--bs-card-inner-border-radius);
}

.collection-card-thumb .card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition: transform .3s ease;
}

.collection-card:hover .collection-card-thumb .card-img-top,
.collection-card:focus-within .collection-card-thumb .card-img-top {
  transform: scale(1.03);
}

/* ===========================
   Header nav adjustments
   =========================== */
.header .navbar {
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: nowrap; /* keep brand/toggler/nav inline */
  min-height: 87px;
}
.header .navbar > .container-fluid {
  padding-left: var(--aghc-page-edge-inset);
  padding-right: var(--aghc-page-edge-inset);
}
.header .navbar .brand {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 0;
}
.header .navbar .navbar-toggler {
  flex: 0 0 auto;
  margin-left: .5rem;
}

.nav-search-item {
  position: relative;
}
.nav-search-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: .25rem;
}
.nav-search-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  transform: translateY(-1px);
}
.nav-search {
  display: none;
}
.nav-search[hidden] {
  display: none !important;
}
.nav-search .form-control,
.modal-search-form .form-control {
  min-width: 0;
}
.nav-search .input-group,
.modal-search-form .input-group {
  width: 100%;
}
.nav-search .form-control,
.nav-search .btn,
.modal-search-form .form-control,
.modal-search-form .btn {
  min-height: 2.5rem;
}
.nav-search .form-control,
.modal-search-form .form-control {
  border-top-left-radius: .65rem;
  border-bottom-left-radius: .65rem;
}
.nav-search .btn,
.modal-search-form .btn {
  border-top-right-radius: .65rem;
  border-bottom-right-radius: .65rem;
}
.archive-search-modal .modal-dialog {
  max-width: min(42rem, calc(100vw - 2rem));
}
.archive-search-modal .modal-content {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .18);
}
.archive-search-modal .modal-body {
  padding-bottom: 1.5rem;
}
@media (min-width: 992px) {
  .nav-search-toggle {
    transform: translateY(.1rem);
  }
}
@media (max-width: 991.98px) {
  .nav-search-item {
    padding: 1rem 0;
  }
  .nav-search-toggle {
    display: none;
  }
  .nav-search {
    display: block;
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

.search-result-card {
  overflow: hidden;
  transition: border-color .18s ease;
}
.search-result-card:hover,
.search-result-card:focus-within {
  border-color: rgba(0, 0, 0, .2);
  box-shadow: none;
}
.search-result-link {
  color: inherit;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}
.search-result-thumb {
  aspect-ratio: 3 / 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--aghc-red);
  color: #fff;
  border: 0;
  box-shadow: none;
  outline: 0;
}
.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.search-result-thumb > span {
  color: #fff;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0;
  line-height: 1;
  text-shadow: none;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
}
.search-result-card:hover .search-result-thumb img,
.search-result-card:focus-within .search-result-thumb img {
  transform: scale(1.03);
}

/* Remove outline/border from hamburger */
.navbar-toggler {
  border: none;
  box-shadow: none !important;
}
.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 1px #cccccc !important;
}

/* ===========================
   Offcanvas navigation (mobile)
   =========================== */
.offcanvas-body .navbar-nav .nav-link {
  font-size: 1.125rem;
  padding: 0.75rem 0 0 0;
  color: inherit;
}
.offcanvas-body .navbar-nav .nav-link:hover,
.offcanvas-body .navbar-nav .nav-link:focus {
  color: var(--aghc-red);
  border-bottom: none; /* no underline in offcanvas */
}
.offcanvas-body .navbar-nav .nav-link[aria-current="page"] {
  color: var(--aghc-red);
}

/* ===========================
   Footer
   =========================== */
.footer {
  padding: 1rem 0;
  border-top: 1px solid #dee2e6;
}
.footer .nav-link {
  color: inherit;
  text-decoration: none;
}
.footer .nav-item:first-child .nav-link {
  padding-left: 0 !important;
}
.footer .nav-link:hover,
.footer .nav-link:focus,
.footer .nav-link:active {
  color: var(--aghc-red);
  text-decoration: none;
}
.footer .nav-link[aria-current="page"] {
  color: var(--aghc-red);
  font-weight: 500;
}

/* ===========================
   Back-to-Top button
   =========================== */
.back-to-top {
  position: fixed;
  bottom: 1.25rem;
  right: var(--aghc-page-edge-inset);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--aghc-red);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease, transform .1s ease;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
body.modal-open .back-to-top {
  z-index: 1030;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.back-to-top svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.back-to-top:hover {
  transform: scale(1.06);
  background-color: #a52929;
}
.back-to-top:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(204, 51, 51, .5);
}
@media (prefers-reduced-motion: reduce) {
  .header {
    transition: none;
  }

  .back-to-top,
  .back-to-top:hover {
    transition: none;
    transform: none;
  }
}

/* ===========================
   Buttons (global red hover/active)
   =========================== */
.btn,
.btn-outline-secondary,
.btn-sm {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover,
.btn:focus,
.btn:active,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background-color: var(--aghc-red) !important;
  color: #fff !important;
  border-color: var(--aghc-red) !important;
}

.nav-search-toggle.btn-danger {
  transition: opacity .2s ease, visibility .2s ease, transform .1s ease, background-color .2s ease, border-color .2s ease;
}
.nav-search-toggle.btn-danger:hover {
  background-color: #a52929 !important;
  border-color: #a52929 !important;
  transform: scale(1.06);
}
@media (min-width: 992px) {
  .nav-search-toggle.btn-danger {
    transform: translateY(.1rem);
  }
  .nav-search-toggle.btn-danger:hover {
    transform: translateY(.1rem) scale(1.06);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav-search-toggle.btn-danger,
  .nav-search-toggle.btn-danger:hover {
    transition: none;
    transform: none;
  }
}
