:root {
  --text: #222;
  --muted: #777;
  --light: #e5e5e5;
  --lighter: #f5f5f5;
  --link: #2777a8;
  --link-hover: #174f72;
  --max: 1180px;
  --font: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
}

button, a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.site {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------
   HEADER — 50% of original banner size
   ------------------------------------------------------------------ */

.site-header {
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.header-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 64px;      /* was 118px → ~50% */
  display: flex;
  align-items: center;
}

.site-logo {
  display: block;
  width: 225px;          /* was 450px → 50% */
  max-width: 100%;
  line-height: 0;
}

.site-logo img {
  display: block;
  width: 225px;          /* was 450px → 50% */
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------------------
   GALLERY
   ------------------------------------------------------------------ */

.gallery-page {
  width: min(var(--max), calc(100% - 40px));
  flex: 1;
  margin: 0 auto;
  padding: 26px 0 34px;
}

.gallery-intro {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
}

.intro-line {
  height: 1px;
  background: var(--light);
}

.intro-label {
  margin: 0;
  color: #888;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.viewer {
  position: relative;
  width: 100%;
  min-height: 420px;
  max-height: calc(100vh - 140px);  /* always fits within the viewport */
  border: 1px solid #ddd;
  background: #fff;
  display: flex;
  align-items: stretch;
}

.viewer-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 25px 56px 18px;
}

.caption-area {
  flex: 0 0 auto;
  text-align: center;
  padding: 0 10px 18px;
}

.image-number {
  margin-bottom: 4px;
  color: #999;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .12em;
}

.caption-area h1 {
  margin: 0;
  color: #222;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 2.2vw, 30px);
  font-weight: normal;
  line-height: 1.25;
}

/* Secondary caption: subsequent sentences in smaller, muted text */
.caption-sub {
  margin: 7px 0 0;
  color: #666;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 1.15vw, 16px);
  font-weight: normal;
  line-height: 1.5;
}

.image-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;   /* let the anchor fill full height */
  justify-content: center;
  overflow: hidden;
  background: #fafafa;
}

/*
  image-button is an <a> element. Using display:flex + align-self:stretch
  so it fills the full height of the image-frame. The browser then handles
  target="_blank" natively — no window.open(), no popup blocker issues.
*/
.image-button {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  min-height: 250px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}

.image-button img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 5px 22px rgba(0,0,0,.12);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}

.image-button.loaded img {
  opacity: 1;
}

.image-button:hover img,
.image-button:focus-visible img {
  transform: scale(1.008);
}

.zoom-label {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 6px);
  padding: 5px 9px;
  color: #fff;
  background: rgba(0,0,0,.72);
  font-size: 10px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
}

.image-button:hover .zoom-label,
.image-button:focus-visible .zoom-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.gallery-arrow {
  align-self: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0 9px;
  border: 1px solid #d5d5d5;
  border-radius: 50%;
  background: #fff;
  color: #444;
  font-size: 31px;
  font-family: Georgia, serif;
  line-height: 34px;
  cursor: pointer;
  transition: all .18s ease;
  z-index: 2;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  color: #fff;
  background: var(--link);
  border-color: var(--link);
}

.viewer-controls {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(100px, 260px) auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 16px;
}

.viewer-controls button {
  border: 0;
  padding: 2px 3px;
  color: #777;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.viewer-controls button:hover {
  color: var(--link);
}

.progress {
  height: 2px;
  background: #ddd;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--link);
}

/* ------------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid #ddd;
  background: #fafafa;
}

.footer-inner {
  width: min(var(--max), calc(100% - 40px));
  min-height: 62px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #888;
  font-size: 11px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner p + p::before {
  content: "•";
  margin-right: 14px;
  color: #bbb;
}

/* ------------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------------ */

@media (max-width: 760px) {
  .header-inner,
  .gallery-page,
  .footer-inner {
    width: calc(100% - 24px);
  }

  .header-inner {
    min-height: 50px;      /* was 90px → ~50% */
    justify-content: center;
  }

  .site-logo {
    width: 195px;          /* was 390px → 50% */
  }

  .gallery-page {
    padding-top: 18px;
  }

  .gallery-intro {
    margin-bottom: 12px;
  }

  .intro-label {
    font-size: 9px;
  }

  .viewer {
    min-height: 0;
    max-height: none;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    border-left: 0;
    border-right: 0;
  }

  .viewer-inner {
    padding: 18px 5px 12px;
  }

  .caption-area {
    padding-bottom: 12px;
  }

  .caption-area h1 {
    font-size: 21px;
  }

  .caption-sub {
    font-size: 12px;
  }

  .image-frame {
    min-height: 42vh;
    min-height: 42svh;
    max-height: 52vh;
    max-height: 52svh;
  }

  .image-button {
    min-height: 0;
    padding: 4px;
  }

  .gallery-arrow {
    align-self: center;
    width: 32px;
    height: 32px;
    margin: 0;
    font-size: 24px;
    line-height: 25px;
  }

  .viewer-controls {
    grid-template-columns: auto minmax(80px, 150px) auto;
    padding-top: 12px;
  }

  .zoom-label {
    display: none;
  }

  .footer-inner {
    min-height: 56px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition-duration: .01ms !important;
  }
}
