/* Page shell: header, navigation, content column, typography, footer.
   Values follow the Drupal theme's compiled main.css; see the theme-shell change. */

/* Tokens */

:root {
  --blue-dark: #276582;
  --blue-light: #40a5d4;
  --blue-hover: #009acd;
  --text: #333;
  --muted: #8a8a8a;
  --font-head: "Lato", system-ui, sans-serif;
  --font-body: "Merriweather Sans", system-ui, sans-serif;
  --content-max: 62.5rem;
  --measure: 50ch;
  --bar-gradient: linear-gradient(to right, var(--blue-dark), var(--blue-light) 50%, var(--blue-dark));
  --pill: rgb(255 255 255 / 0.3);
  --rule: #ccc;
  --tile-border: #ddd;
  --gallery-bg: #f4f4f4;
  --gallery-ratio: 1086 / 768;
  --button-bg: #606060;
  --button-bg-hover: #e8e8e8;
  --small: 0.8125rem;
}

/* Fonts */

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/lato-v23-latin-300.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lato-v23-latin-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Merriweather Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/merriweather-sans-v22-latin-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Merriweather Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/merriweather-sans-v22-latin-700.woff2") format("woff2");
}

/* Base and typography */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.25;
}

h1 {
  margin: 0 0 1.5rem;
  color: var(--blue-dark);
  font-size: 1.875rem;
}

h2 {
  margin: 1.875rem 0 0.625rem;
  color: var(--blue-dark);
  font-size: 1.2em;
  font-weight: 300;
}

h3,
h4,
h5 {
  color: var(--muted);
}

h3,
h4 {
  font-size: 1.125rem;
}

h4 {
  margin: 1.875rem 0 0.625rem;
}

h5 {
  font-size: 1rem;
}

a {
  color: var(--blue-dark);
  text-decoration: underline;
}

a:hover {
  color: var(--blue-hover);
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

/* Long URLs in running text must not widen the page on phones. */
main a {
  overflow-wrap: anywhere;
}

/* Layout */

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

.row {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

.mainrow {
  flex: 1;
  padding-block: 2.5rem 3rem;
}

main p,
main ul,
main ol {
  max-width: var(--measure);
}

main.full-width {
  --measure: none;
}

/* Header */

#mainheader {
  position: relative;
  z-index: 1;
  background: var(--blue-dark);
  background: var(--bar-gradient);
  box-shadow: 0 2px 12px rgb(0 0 0 / 0.25);
}

#mainheader .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.25rem;
}

.logo a {
  display: block;
  color: #fff;
}

.logo svg {
  display: block;
  width: 155px;
  height: auto;
}

/* Navigation */

.menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

#header .menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 0.5rem;
  font-family: var(--font-head);
  font-size: 1rem;
}

#header .menu a {
  display: block;
  padding: 0.25em 0.6em;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
}

#header .menu a:hover,
#header .menu a.active {
  background: var(--pill);
}

/* Footer */

#footer {
  position: relative;
  background: var(--blue-dark);
  background: var(--bar-gradient);
  box-shadow: 0 -2px 12px rgb(0 0 0 / 0.25);
  color: #fff;
  font-size: 0.75rem;
}

#footer .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2.5rem;
  padding-block: 1.25rem;
}

#footer .menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

#footer a {
  color: #fff;
}

/* Focus */

:focus-visible {
  outline: 2px solid var(--blue-hover);
  outline-offset: 2px;
}

#mainheader :focus-visible,
#footer :focus-visible {
  outline-color: #fff;
}

/* Phone (below 640 px) */

@media (max-width: 39.99em) {
  #mainheader .row {
    flex-direction: column;
    padding-block: 1rem;
  }

  .logo svg {
    width: 120px;
  }

  #header .menu {
    justify-content: center;
    gap: 0.25rem;
  }

  #footer .row {
    flex-direction: column;
    text-align: center;
  }

  #footer .menu {
    justify-content: center;
  }

  .mainrow {
    padding-block: 1.5rem 2rem;
  }
}

/* Page content: home, profile, contact, collections (from the Drupal views) */

.photo-credit {
  color: var(--muted);
  font-size: 0.625rem;
}

/* Home: the image sits above the page heading, as on the Drupal site */

main:has(> .home-image) {
  display: flex;
  flex-direction: column;
}

.home-image {
  order: -1;
  width: 100%;
  margin-bottom: 1.5rem;
}

.home {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem 4rem;
}

.home-text {
  flex: 1 1 30rem;
}

.home-text p {
  max-width: none;
}

.home-text .lead {
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 1.125rem;
}

.collection-logos {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  flex: 0 1 14rem;
  gap: 1.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.collection-logos img {
  display: block;
  width: auto;
  height: 2.25rem;
}

/* Profile: photo floats right on wide screens */

.profile::after {
  content: "";
  display: block;
  clear: both;
}

.profile-image {
  float: right;
  width: 40%;
  max-width: 392px;
  margin: 0 0 1rem 2rem;
}

/* Contact */

.contact h2 {
  margin-top: 0;
}

/* Overview tiles: one column on phones, up to three on wide screens */

.collection-tiles {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.collection-tiles li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.tile-preview img {
  display: block;
  border: 1px solid var(--tile-border);
  border-radius: 3px;
}

.tile-logo img {
  display: block;
  width: auto;
  max-width: 200px;
  max-height: 3.75rem;
}

/* Collection page: logo, description with contacts beside it, gallery, cross-links */

.collection-logo {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.collection-logo img {
  display: block;
  max-width: 200px;
}

.collection-intro {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(12rem, 1fr);
  gap: 1.5rem 3rem;
  margin-top: 1.75rem;
}

.collection-contacts {
  grid-column: 2;
  grid-row: 1;
}

.collection-contacts h2 {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.collection-contacts ul {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.collection-contacts li + li {
  margin-top: 0.5rem;
}

.collection-body {
  grid-column: 1;
  grid-row: 1;
}

.collection-body h2 {
  margin-top: 0;
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 400;
}

.collection-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin-top: 2.5rem;
  padding: 0.75rem 0 1.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: var(--small);
}

.collection-links h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
}

.collection-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.collection-links a.active {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

/* Gallery: one photo at a time, snapping, works without JavaScript */

.gallery {
  margin-top: 2rem;
  border-radius: 3px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  background: var(--gallery-bg);
}

.gallery-track {
  max-width: none;
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-track li {
  flex: 0 0 100%;
  aspect-ratio: var(--gallery-ratio);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.gallery-track img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery:focus-visible {
  outline: 2px solid var(--blue-hover);
  outline-offset: 2px;
}

/* Gallery controls, added by gallery.js */

.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.gallery-prev,
.gallery-next {
  min-width: 44px;
  min-height: 44px;
  padding: 5px 25px;
  border: 0;
  border-radius: 3px;
  background: var(--button-bg);
  color: #fff;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.gallery-prev:hover,
.gallery-next:hover {
  background: var(--button-bg-hover);
  color: var(--text);
}

.gallery-prev:focus-visible,
.gallery-next:focus-visible {
  outline: 2px solid var(--blue-hover);
  outline-offset: 2px;
}

.gallery-counter {
  min-width: 4.5em;
  margin: 0;
  color: var(--text);
  font-size: var(--small);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 39.99em) {
  .profile-image {
    float: none;
    display: block;
    width: 100%;
    margin: 0 auto 1.5rem;
  }

  .collection-intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-contacts,
  .collection-body {
    grid-column: 1;
    grid-row: auto;
  }
}
