:root {
  --gallery-accent: #ef6c57;
  --gallery-sidebar: 250px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #000;
  color: #aaa;
  font: 400 1rem/1.7 "Quicksand", system-ui, sans-serif;
}
a { color: #fff; text-decoration: none; }
a:hover { color: var(--gallery-accent); }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gallery-accent); outline-offset: 5px; }
button { font: inherit; }
[hidden] { display: none !important; }
body.has-open-dialog { overflow: hidden; }
.skip-link {
  position: fixed;
  inset: 1rem auto auto 1rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: #fff;
  color: #000;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 1rem 1.25rem;
  background: #000;
}
.site-logo { color: #fff; font-size: 1.25rem; font-weight: 700; text-transform: uppercase; }
.desktop-navigation { display: none; }
.fallback-navigation { padding: 0 1.25rem; }
body:has(.fallback-navigation) .menu-toggle { display: none; }
.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.icon-button:hover { color: var(--gallery-accent); }
.navigation-links, .social-links { margin: 1.5rem 0; padding: 0; list-style: none; }
.navigation-links a { display: inline-block; padding: .35rem 0; text-transform: uppercase; }
.navigation-links a[aria-current="page"] { color: var(--gallery-accent); }
.social-links { display: flex; flex-wrap: wrap; gap: .25rem; }
.social-links a { display: inline-grid; min-width: 44px; min-height: 44px; place-items: center; }
.made-by { margin: 1.5rem 0; }
.heart { color: #e25555; }
.about { margin-top: 1.5rem; font-size: .95rem; }
.about p { margin-top: .5rem; }
.navigation-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(320px, calc(100% - 1.5rem));
  height: 100%;
  height: 100dvh;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: #fff;
  color: #212529;
}
dialog::backdrop { background: rgb(0 0 0 / .8); }
.navigation-panel { min-height: 100%; padding: 1.25rem; }
.navigation-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.navigation-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 700; text-transform: uppercase; }
.navigation-dialog a { color: #212529; }
.navigation-dialog a:hover { color: var(--gallery-accent); }
.main-content { min-width: 0; padding-bottom: 2rem; }
.photos { padding: 0 .75rem; }
.photo-item { display: block; position: relative; overflow: hidden; background: #111; }
.photo-item img { display: block; width: 100%; height: 200px; object-fit: cover; transition: transform .25s ease; }
.photo-item:hover img { transform: scale(1.025); }
.photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
  background: rgb(0 0 0 / .55);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.photo-item:hover .photo-overlay, .photo-item:focus-visible .photo-overlay { opacity: 1; }
.photo-overlay h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .25rem; overflow-wrap: anywhere; }
.photo-overlay > span { font-size: .8rem; text-transform: uppercase; }
.photo-overlay .icon-search { font-size: 1.4rem; }
.album-item .photo-overlay {
  justify-content: flex-end;
  background: linear-gradient(transparent 30%, rgb(0 0 0 / .75));
  opacity: 1;
}
.album-heading { max-width: 850px; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; text-align: center; }
.album-heading > a { font-size: .9rem; }
.album-heading h1 { color: #fff; margin: 1rem 0 .25rem; font-size: clamp(1.5rem, 4vw, 2.5rem); overflow-wrap: anywhere; }
.photo-count { margin: 0; font-size: .9rem; }
.album-description { margin: 1rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.gallery-message { margin: 0 auto; max-width: 650px; padding: 3rem 1rem; text-align: center; }
.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(0 0 0 / .95);
  color: #fff;
}
.viewer-panel { min-height: 100%; display: flex; flex-direction: column; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 1rem; }
.viewer-toolbar p { margin: 0; font-size: .9rem; }
.viewer-stage { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; flex: 1; gap: .25rem; }
.viewer-stage figure { margin: 0; text-align: center; min-width: 0; }
.viewer-stage img { display: block; margin: 0 auto; max-width: 100%; max-height: calc(100dvh - 180px); width: auto; height: auto; object-fit: contain; touch-action: pan-y; }
.viewer-stage figcaption { padding: 1rem; font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.viewer-previous, .viewer-next { font-size: 3rem; }
.icon-button:disabled { opacity: .3; cursor: default; }
.viewer-error { margin: 0; padding: 1rem; text-align: center; }
.viewer-error a { text-decoration: underline; }
@media (min-width: 576px) {
  .photo-item img { height: 300px; }
  .viewer-stage { grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 1rem; }
}
@media (min-width: 992px) {
  .header-bar {
    display: block;
    position: fixed;
    inset: 0 0 0 auto;
    width: var(--gallery-sidebar);
    height: 100dvh;
    overflow-y: auto;
    text-align: right;
  }
  .desktop-navigation { display: block; }
  .menu-toggle, .fallback-navigation { display: none; }
  .social-links { justify-content: flex-end; }
  .main-content { margin-right: var(--gallery-sidebar); padding-top: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
