/* GALLERY / GALLERI — upload beside homepage-modern.css and the HTML pages. */

.gallery-page .main-nav a[aria-current="page"] { color: var(--burgundy); }
.gallery-page .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.gallery-page [hidden], .photo-viewer [hidden] { display: none !important; }
.gallery-page button { font: inherit; }
.gallery-page .eyebrow { font-size: .875rem; }
.gallery-page .brand-role { font-size: .875rem; letter-spacing: .06em; }
.gallery-page .brand { min-width: 0; max-width: 100%; }
.gallery-page .brand-copy { min-width: 0; }
.gallery-page .brand-name { white-space: normal; }
.gallery-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.gallery-page .main-nav a, .gallery-page .language-nav { font-size: .875rem; }
.gallery-page .contact-label, .gallery-page .footer-bottom { font-size: .875rem; }
.gallery-page .contact-item { grid-template-columns: 5rem minmax(0, 1fr); }

.gallery-intro { padding-block: 4.5rem 3rem; }
.gallery-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: end;
  gap: 4rem;
}
.gallery-intro .eyebrow { margin-bottom: 1rem; }
.gallery-intro h1 {
  font-size: clamp(3.4rem, 6.8vw, 5.8rem);
  line-height: 1.03;
  letter-spacing: -.045em;
}
.gallery-intro-copy { max-width: 47ch; color: var(--muted); }
.gallery-intro-copy p + p { margin-top: 1rem; }
.gallery-intro-hint { font-size: .875rem; }
.gallery-section { padding-bottom: 5rem; }
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.gallery-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.gallery-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: .875rem !important;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.gallery-filter:hover { color: var(--burgundy); border-color: var(--burgundy); }
.gallery-filter[aria-pressed="true"] {
  color: var(--light-text);
  border-color: var(--burgundy);
  background: var(--burgundy);
}
.gallery-count { color: var(--muted); font-size: .875rem; white-space: nowrap; }

/* Natural image proportions: no fixed photo height and no cropping. */
.photo-grid { column-count: 3; column-gap: 1.75rem; }
.photo-card {
  display: inline-block;
  width: 100%;
  min-width: 0;
  break-inside: avoid;
  vertical-align: top;
  margin: 0 0 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.photo-link { position: relative; display: block; background: var(--paper-deep); }
.photo-link img { display: block; width: 100%; height: auto; }
.photo-link:hover, .photo-link:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 4px; }
.photo-enlarge {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.65);
  color: #fff;
  background: rgba(33,26,23,.8);
}
.photo-enlarge svg { width: 21px; height: 21px; }
.photo-card figcaption { padding-top: .8rem; }
.photo-caption { font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.photo-credit { margin-top: .35rem; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.gallery-credit-note {
  max-width: 76ch;
  margin-top: .5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}

/* The browser's native modal provides focus containment and Escape-to-close. */
.gallery-viewer-open { overflow: hidden; }
.photo-viewer:not([open]) { display: none; }
.photo-viewer {
  width: min(1280px, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1rem 1.5rem 1.2rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #655449;
  color: var(--light-text);
  background: var(--dark);
}
.photo-viewer::backdrop { background: rgba(12, 8, 7, .9); }
.photo-viewer :focus-visible { outline-color: #efd3b7; }
.viewer-toolbar, .viewer-navigation { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.viewer-toolbar { margin-bottom: .8rem; }
.viewer-position { color: #d4c8bf; font-size: .875rem; }
.viewer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .5rem .85rem;
  border: 1px solid #a28b7b;
  border-radius: 0;
  color: var(--light-text);
  background: transparent;
  font-size: .875rem !important;
  cursor: pointer;
}
.viewer-button:hover:not(:disabled) { color: var(--dark); background: var(--paper); }
.viewer-button:disabled { color: #a49588; border-color: #655449; cursor: default; }
.viewer-close { gap: .7rem; }
.viewer-close span { font-size: 1.5rem; line-height: 1; }
.viewer-figure { margin: 0; }
.viewer-image-stage { display: grid; place-items: center; min-height: min(48vh, 28rem); }
.viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 62vh;
  max-height: 62dvh;
  margin-inline: auto;
}
.viewer-message { max-width: 42ch; padding: 2rem 1rem; text-align: center; color: #d4c8bf; }
.viewer-figure figcaption { max-width: 85ch; margin: 1rem auto 0; text-align: center; }
.viewer-caption { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.65rem); line-height: 1.4; }
.viewer-details, .viewer-credit { margin-top: .35rem; color: #d4c8bf; font-size: .875rem; line-height: 1.6; }
.viewer-navigation { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid #655449; }
.viewer-original { min-height: 44px; display: inline-flex; align-items: center; color: #e7c1a4; font-size: .875rem; text-decoration: underline; text-underline-offset: .3em; }
.viewer-original:hover { color: #fff; }

@media (max-width: 960px) {
  .gallery-intro-grid { gap: 2.5rem; }
  .photo-grid { column-count: 2; column-gap: 1.5rem; }
}
@media (max-width: 700px) {
  .gallery-intro { padding-block: 2.8rem 2.2rem; }
  .gallery-intro-grid { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .gallery-intro h1 { font-size: clamp(3.2rem, 12vw, 4.5rem); }
  .gallery-intro-copy { max-width: 48ch; }
  .gallery-toolbar { gap: .9rem; margin-bottom: 1.5rem; }
  .gallery-filters { gap: .4rem; }
  .gallery-filter { padding-inline: .8rem; }
  .gallery-count { width: 100%; }
  .gallery-section { padding-bottom: 3.2rem; }
  .photo-grid { column-count: 1; }
  .photo-card { margin-bottom: 1.6rem; }
  .photo-viewer { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); padding: .65rem .8rem 1rem; }
  .viewer-image { max-height: 56vh; max-height: 56dvh; }
  .viewer-image-stage { min-height: min(42vh, 20rem); }
  .viewer-caption { font-size: 1.25rem; }
  .viewer-navigation { gap: .6rem; }
  .viewer-button { padding-inline: .7rem; }
  .gallery-page .contact-item { grid-template-columns: 4.3rem minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-filter { transition: none; }
}
