@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700;800&display=swap");

:root {
  --canvas: #f5f8fb;
  --ink: #18344b;
  --muted: #5d7488;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --line: rgba(24, 52, 75, 0.12);
  --navy: #18466b;
  --navy-dark: #123857;
  --blue: #1f73b7;
  --blue-soft: #eaf3fb;
  --accent: #b35a23;
  --accent-dark: #934715;
  --shadow: 0 22px 54px rgba(19, 49, 76, 0.12);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --footer-sans: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top right, rgba(31, 115, 183, 0.1), transparent 25%),
    radial-gradient(circle at left center, rgba(24, 70, 107, 0.08), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, #f3f8fc 44%, #eef5fa 100%);
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
}

a {
  color: inherit;
}

.page-shell {
  flex: 1 0 auto;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 3rem;
}

.site-header {
  margin: 1.25rem 0 1.75rem;
}

.brand-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(24, 70, 107, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  position: relative;
}

.brand-lockup {
  align-items: center;
  display: inline-flex;
  gap: 1rem;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 62px;
  width: auto;
}

.brand-copy {
  display: grid;
  gap: 0.15rem;
}

.brand-eyebrow {
  color: var(--blue);
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-name {
  color: var(--navy);
  font-family: var(--serif);
  font-size: 2.15rem;
  font-weight: 700;
}

.brand-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.brand-nav a,
.brand-menu__panel a {
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-nav a {
  border: 1px solid rgba(31, 115, 183, 0.18);
  border-radius: 999px;
  padding: 0.65rem 0.85rem;
}

.brand-nav a:hover,
.brand-menu__panel a:hover {
  color: var(--blue);
}

.brand-menu {
  display: none;
  position: relative;
}

.brand-menu summary {
  align-items: center;
  background: var(--blue-soft);
  border: 1px solid rgba(31, 115, 183, 0.18);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 0.22rem;
  height: 2.75rem;
  justify-content: center;
  list-style: none;
  width: 2.75rem;
}

.brand-menu summary::-webkit-details-marker {
  display: none;
}

.brand-menu summary span {
  background: var(--navy);
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 1.15rem;
}

.brand-menu__panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(19, 49, 76, 0.16);
  display: grid;
  gap: 0.25rem;
  min-width: min(19rem, calc(100vw - 2.5rem));
  padding: 0.55rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  z-index: 20;
}

.brand-menu__panel a {
  border-radius: 12px;
  display: block;
  padding: 0.8rem 0.9rem;
}

.brand-menu__panel a:hover {
  background: var(--blue-soft);
}

.site-footer {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -18px 48px rgba(19, 49, 76, 0.08);
  overflow: hidden;
  position: relative;
}

.site-footer__topbar {
  background-color: var(--blue);
  background-image: url("https://www.charlevoixlibrary.org/themes/custom/website_theme/assets/images/wave-bg.png");
  background-position: left center;
  background-repeat: repeat-x;
  background-size: auto 100%;
  height: 2rem;
  overflow: hidden;
  position: relative;
}

.site-footer__inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(280px, 1.35fr);
  margin: 0 auto;
  padding: 1.9rem 0 2.4rem;
  position: relative;
  width: min(1180px, calc(100% - 2rem));
}

.site-footer__inner::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='274' height='83' viewBox='0 0 274 83' role='presentation'%3E%3Cdefs%3E%3CclipPath id='clip-footer-decoration'%3E%3Crect width='274' height='83'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg id='footer-decoration' clip-path='url(%23clip-footer-decoration)'%3E%3Cg id='Group_6743' transform='matrix(0.996,-0.087,0.087,0.996,-4.399,18.012)'%3E%3Cg id='Group_6744'%3E%3Cpath id='Path_53253' d='M113.034 47.822c13.025-6.877 27.372-12.727 42.648-8.636-12.183-14.414-31.6-24.7-49.825-27.828C87.3 8.176 64.384 14.505 47.072 21.243A289.669 289.669 0 0 0 2.18 43.779a1.961 1.961 0 0 1-1.98-.293 1.985 1.985 0 0 1 .3-2.174A173.986 173.986 0 0 1 21.859 26.686C43.685 14.049 71.437 3.277 96.66.348a49.377 49.377 0 0 1 26.4 4.108C138.955 11.6 151.954 24.8 162.982 38.04a11.609 11.609 0 0 1-.752 5.359 4.332 4.332 0 0 1-4.8 2.571 65.085 65.085 0 0 0-13.2-1.157 90.831 90.831 0 0 0-31.1 6.073c-.755-.32-1.322-.968-1.287-1.538a2.58 2.58 0 0 1 1.2-1.526' transform='matrix(0.998,-0.07,0.07,0.998,-2.283,9.767)' fill='%23f0dbd4'/%3E%3Cpath id='Path_53254' d='M27.584 29.32C35.14 34.568 39.97 42.553 43.166 50.868c.183.476-.753 1.382-1.194 1.547-3.32 1.241-1.976-3.953-8.9-10.19-6.657-5.995-17.317-10.748-26.145-7.91L1.275 29.27A5.058 5.058 0 0 1 .026 27.428 3.191 3.191 0 0 1 .964 25.1c8.964-8.324 21.531-18.753 32.7-23.642A17.157 17.157 0 0 1 42.425.1c20.822 2.273 46.9 10.934 65.932 19.569a4.224 4.224 0 0 1-.533 4.7C89.452 14.313 69.423 8.4 48.46 8.145c-14.934-.178-15.632.82-26.688 9.74a44.987 44.987 0 0 0-7.5 8.23c4.279 1.307 9.34.448 13.312 3.206' transform='matrix(0.998,-0.07,0.07,0.998,166.295,3.84)' fill='%23f0dbd4'/%3E%3Cpath id='Path_53255' d='M2.442 18.769a2.3 2.3 0 0 1-2.366-.8A2.467 2.467 0 0 1 .8 15.691C18.287-.374 39.343 14.708 60.211 18.3a45.691 45.691 0 0 0 25.881-2.591c5.579-2.351 12.664-7.433 10.262-14.677C102.133-1.235 106.8.6 111.985 3.036c.438.206.756 1.445.66 1.943-.386 2.01-9.909-.135-13.177.874-1.121 5.881-4.767 10.181-9.945 13C80.063 23.99 69.18 25.366 58.5 23.719c-6.47-1-12.456-2.483-18.8-4.027-12.321-3-24.809-5.723-37.254-.922' transform='matrix(0.998,-0.07,0.07,0.998,91.426,54.099)' fill='%23f0dbd4'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  height: 83px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: min(274px, 24vw);
}

.site-footer__column {
  position: relative;
  z-index: 1;
}

.site-footer__column:not(:last-child) {
  border-right: 1px solid rgba(24, 52, 75, 0.35);
  padding-right: 2rem;
}

.site-footer__column h2 {
  color: #151515;
  font-family: var(--footer-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.site-footer__column p,
.site-footer__column a {
  color: var(--blue);
  font-family: var(--footer-sans);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.5;
  margin: 0;
  text-decoration: none;
}

.site-footer__column--contact h2 {
  font-size: 1.16rem;
  white-space: nowrap;
}

.site-footer__column--links {
  display: grid;
  gap: 0.55rem;
  max-width: 240px;
}

.site-footer__column--links a {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}

.footer-link__icon {
  align-items: center;
  display: inline-flex;
  height: 1rem;
  justify-content: center;
  width: 1rem;
}

.footer-link__icon svg {
  fill: none;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.8;
  width: 100%;
}

.site-footer__column--links a:nth-of-type(2) .footer-link__icon svg {
  fill: currentColor;
  stroke: none;
}

.site-footer__column--motto {
  align-self: center;
  justify-self: end;
  max-width: 420px;
  padding-right: min(210px, 24vw);
}

.site-footer__column--motto p {
  color: var(--blue);
  font-family: var(--footer-sans);
  font-size: clamp(2.4rem, 3.25vw, 3.65rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.92;
}

.site-footer__column--motto p + p {
  margin-top: 0.45rem;
}

@media (max-width: 1080px) {
  .site-footer__inner {
    gap: 1.4rem;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.95fr);
  }

  .site-footer__column:not(:last-child) {
    padding-right: 1.4rem;
  }

  .site-footer__column h2 {
    font-size: 1.15rem;
  }

  .site-footer__column p,
  .site-footer__column a {
    font-size: 1rem;
  }

  .site-footer__column--motto {
    align-items: center;
    display: flex;
    gap: clamp(1rem, 3vw, 2.5rem);
    grid-column: 1 / -1;
    justify-self: stretch;
    margin-top: 0.35rem;
    max-width: none;
    padding-right: min(220px, 24vw);
    width: 100%;
  }

  .site-footer__column--motto p {
    font-size: clamp(1.85rem, 4vw, 2.8rem);
    line-height: 1;
    white-space: nowrap;
  }

  .site-footer__column--motto p + p {
    margin-top: 0;
  }

  .site-footer__inner::after {
    bottom: 1.2rem;
    right: 0;
    top: auto;
    transform: none;
    width: min(210px, 20vw);
  }
}

@media (max-width: 940px) {
  .site-footer__inner {
    gap: 1.25rem 1.5rem;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 1fr);
  }

  .site-footer__column:not(:last-child) {
    border-right: 0;
    padding-right: 0;
  }

  .site-footer__column--contact {
    border-right: 1px solid rgba(24, 52, 75, 0.35);
    padding-right: 1.5rem;
  }

  .site-footer__column--links {
    max-width: none;
    padding-left: 0.35rem;
  }

  .site-footer__column--motto {
    gap: clamp(0.9rem, 2vw, 1.6rem);
    padding-right: 170px;
    padding-top: 0.15rem;
  }

  .site-footer__column--motto p {
    font-size: clamp(1.55rem, 4vw, 2.45rem);
  }

  .site-footer__inner::after {
    bottom: 1.15rem;
    right: 0;
    top: auto;
    transform: none;
    width: 180px;
  }
}

.hero,
.panel,
.results-panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(24, 70, 107, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 2.3rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.panel::before {
  background: linear-gradient(90deg, var(--navy) 0%, var(--blue) 100%);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  content: "";
  height: 7px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

.hero h1,
.record-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5.2vw, 3.7rem);
  line-height: 0.95;
  margin: 0;
  max-width: 100%;
}

.hero-copy,
.results-header p,
.result-summary,
.notes-block p,
.metadata-value,
.panel p,
.detail-grid dd {
  color: var(--muted);
}

.search-form {
  margin-top: 1.75rem;
}

.search-mode-bar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1rem;
}

.search-mode-note {
  color: var(--muted);
  margin: 0;
}

.search-mode-link {
  flex-shrink: 0;
  white-space: nowrap;
}

.search-row {
  align-items: stretch;
  display: flex;
  gap: 0.85rem;
  flex-wrap: nowrap;
}

.search-row .secondary-link {
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
}

.advanced-search-form {
  margin-top: 1.5rem;
}

.advanced-search-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.advanced-search-grid .search-input {
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: 0;
  width: 100%;
}

.advanced-search-label {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.advanced-search-actions {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  margin-top: 1rem;
}

.advanced-search-actions .search-button {
  min-width: 9.5rem;
  padding: 0.9rem 1.5rem;
}

.search-input,
.search-button,
.pagination-link,
.secondary-link {
  border-radius: 999px;
  font: inherit;
}

.search-input {
  flex: 1 1 420px;
  border: 1px solid rgba(24, 70, 107, 0.16);
  padding: 1rem 1.2rem;
  background: white;
  font-size: 1rem;
}

.search-button {
  border: 0;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 700;
  padding: 0 1.5rem;
}

.stat-label,
.page-note,
.result-id,
.metadata-key,
.record-years {
  color: var(--muted);
  font-size: 0.92rem;
}

.results-panel,
.panel {
  padding: 1.5rem;
  position: relative;
}

.results-header,
.record-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: space-between;
}

.results-meta {
  color: var(--muted);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.results-meta p {
  margin: 0;
}

.results-filters {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.9rem;
  margin: 0.75rem 0 1.35rem;
  padding-top: 1rem;
}

.results-filter-group {
  align-items: flex-start;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(8.5rem, max-content) minmax(0, 1fr);
}

.results-filter-group p {
  color: var(--navy);
  font-weight: 700;
  margin: 0.45rem 0 0;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-option {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.92rem;
  line-height: 1;
  padding: 0.58rem 0.75rem;
  text-decoration: none;
}

.filter-option.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

.filter-option--clear {
  color: var(--navy);
}

.results-header h2,
.panel h2 {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 0;
}

.result-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.result-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  gap: 1rem;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  padding: 1.3rem;
}

.result-thumb {
  align-self: start;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.result-thumb-link {
  display: block;
}

.result-thumb img {
  display: block;
  height: 112px;
  object-fit: cover;
  width: 112px;
}

.result-card h3,
.panel h3 {
  font-family: var(--serif);
  margin: 0.2rem 0 0;
}

.result-card h3 a {
  text-decoration: none;
}

.result-years,
.record-years {
  font-weight: 700;
  margin: 0.45rem 0 0;
}

.result-summary,
.result-notes {
  line-height: 1.6;
  margin: 0.55rem 0 0;
}

.result-side {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  justify-content: space-between;
  min-width: 125px;
}

.secondary-link,
.pagination-link {
  background: var(--blue-soft);
  border: 1px solid rgba(31, 115, 183, 0.18);
  color: var(--navy);
  display: inline-flex;
  padding: 0.7rem 1rem;
  text-decoration: none;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1.25rem;
}

.pagination-pages {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.pagination-page-link,
.pagination-ellipsis {
  color: var(--muted);
  font-size: 0.96rem;
}

.pagination-page-link {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  justify-content: center;
  min-width: 2.3rem;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
}

.pagination-page-link.is-current {
  background: var(--blue-soft);
  border-color: rgba(31, 115, 183, 0.22);
  color: var(--navy);
  font-weight: 700;
}

.is-disabled {
  color: #9d9a94;
  cursor: default;
}

.empty-state {
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--line);
  border-radius: 20px;
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.record-header {
  display: flex;
  justify-content: flex-end;
  margin: 0.5rem 0 1.5rem;
}

.record-grid {
  margin-bottom: 1.5rem;
}

.record-detail-panel {
  width: 100%;
}

.record-detail-panel::before {
  display: none;
}

.record-panel-heading {
  margin-bottom: 1.5rem;
}

.record-panel-heading h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 0.95;
  margin: 0;
}

.detail-grid {
  column-gap: 1rem;
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  row-gap: 0.8rem;
}

.detail-grid dt {
  font-weight: 700;
}

.detail-grid dd {
  margin: 0;
}

.notes-block {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding-top: 1rem;
}

.notes-block--images {
  margin-top: 1.5rem;
}

.formatted-text p {
  margin: 0;
}

.image-grid,
.metadata-grid {
  display: grid;
  gap: 1rem;
}

.image-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.image-stack {
  display: grid;
  gap: 1.5rem;
}

.detail-image-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.image-card {
  margin: 0;
}

.image-card--full {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
}

.image-card--thumb {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.75rem;
}

.image-link {
  display: block;
  text-decoration: none;
}

.image-card img {
  border-radius: 18px;
  display: block;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.image-card--thumb img {
  aspect-ratio: 1 / 1;
  background: rgba(234, 243, 251, 0.75);
  max-height: 240px;
  object-fit: contain;
  width: 100%;
}

.lightbox {
  align-items: center;
  display: none;
  height: 100vh;
  inset: 0;
  justify-content: center;
  left: 0;
  margin: 0;
  max-width: none;
  padding: 1rem;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 1000;
}

.lightbox:target {
  display: flex;
}

.lightbox-backdrop {
  background: rgba(19, 24, 26, 0.84);
  inset: 0;
  position: absolute;
}

.lightbox-dialog {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  max-height: calc(100vh - 2rem);
  max-width: min(1200px, 100%);
  overflow: auto;
  padding: 1rem;
  position: relative;
  width: 100%;
}

.lightbox-toolbar {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.lightbox-close {
  flex-shrink: 0;
}

.lightbox-image-wrap {
  align-items: center;
  display: flex;
  justify-content: center;
}

.lightbox-image {
  height: auto;
  max-height: calc(100vh - 9rem);
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.metadata-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metadata-item {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

.metadata-key {
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
}

.metadata-value {
  line-height: 1.55;
  margin: 0.4rem 0 0;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 1rem, 1180px);
  }

  .site-header {
    margin-top: 0.85rem;
  }

  .brand-bar {
    border-radius: 22px;
    padding: 0.9rem 1rem;
  }

  .brand-nav {
    display: none;
  }

  .brand-menu {
    display: block;
    flex-shrink: 0;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .brand-logo {
    height: 54px;
  }

  .brand-name {
    font-size: 1.6rem;
  }

  .hero,
  .results-panel,
  .panel {
    padding: 1.2rem;
  }

  .search-mode-bar,
  .search-row,
  .advanced-search-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .advanced-search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .results-header,
  .record-header {
    grid-template-columns: 1fr;
  }

  .results-header,
  .record-header,
  .result-side {
    align-items: flex-start;
  }

  .result-card {
    column-gap: 0.9rem;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    row-gap: 0.75rem;
  }

  .result-thumb {
    grid-row: 1 / span 2;
  }

  .result-thumb img {
    height: 84px;
    width: 84px;
  }

  .result-main { grid-column: 2; }

  .result-side {
    align-items: flex-end;
    grid-column: 3;
    grid-row: 1 / span 2;
    min-width: 0;
  }

  .result-side .secondary-link {
    white-space: nowrap;
  }

  .search-button {
    padding: 0.9rem 1.5rem;
    width: 100%;
  }

  .search-row .secondary-link {
    padding: 0.9rem 1.5rem;
    width: 100%;
  }

  .advanced-search-actions .search-button {
    min-width: 0;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .results-filter-group {
    grid-template-columns: 1fr;
  }

  .results-filter-group p {
    margin-top: 0;
  }

  .pagination-pages {
    order: 3;
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-image-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    gap: 1.35rem;
    grid-template-columns: 1fr;
    padding: 1.5rem 0 2rem;
  }

  .site-footer__inner::after {
    height: 84px;
    opacity: 0.72;
    right: 0.25rem;
    top: auto;
    bottom: 0.75rem;
    transform: none;
    width: 150px;
  }

  .site-footer__column:not(:last-child) {
    border-right: 0;
    border-bottom: 1px solid rgba(24, 52, 75, 0.18);
    padding-bottom: 1.2rem;
    padding-right: 0;
  }

  .site-footer__column--contact {
    border-right: 0;
    padding-right: 0;
  }

  .site-footer__column--motto {
    gap: clamp(0.7rem, 2vw, 1.1rem);
    justify-self: stretch;
    padding-right: 120px;
    width: 100%;
  }

  .site-footer__column--motto p {
    font-size: clamp(1.15rem, 4vw, 1.65rem);
    letter-spacing: -0.03em;
  }
}

@media (max-width: 900px) {
  .advanced-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .advanced-search-grid {
    grid-template-columns: 1fr;
  }
}
