@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,400;6..72,500&display=swap');

:root {
  color-scheme: light;
  --paper: #f7f5ee;
  --surface: #fffdf8;
  --ink: #24342c;
  --line: #dcdcd0;
  --body: "DM Sans", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--body); }
h1, h2, h3, p, figure { margin: 0; }
button { font: inherit; }
a { color: inherit; }
img { display: block; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #956027; outline-offset: 4px; }

.skip-link {
  position: absolute;
  z-index: 2;
  top: 1rem;
  left: 1rem;
  transform: translateY(-200%);
  background: var(--surface);
  padding: .65rem 1rem;
}
.skip-link:focus { transform: none; }

#gallery {
  width: min(calc(100% - 2rem), 58rem);
  max-height: calc(100% - 2rem);
  border: 1px solid var(--line);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
}
#gallery::backdrop { background: rgb(15 25 20 / 84%); }
html:has(#gallery[open]) { overflow: hidden; }
.dialog-header, .dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem 1.1rem;
}
.dialog-header h2 { font: 500 clamp(1.45rem, 3vw, 2rem)/1.07 var(--serif); }
.gallery-control {
  min-height: 2.75rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #b8bcaf;
  padding: .4rem .8rem;
  cursor: pointer;
  font-weight: 700;
  font-size: .875rem;
}
.gallery-control:hover { background: #eadfc9; }
.gallery-frame { background: #22382e; color: var(--surface); }
.gallery-frame img { height: min(59vh, 38rem); object-fit: contain; }
.gallery-frame figcaption { padding: .45rem 1.1rem; font-size: .9rem; }
#gallery-count { font-size: .875rem; }
