@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/ibm-plex-sans/IBMPlexSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/ibm-plex-sans/IBMPlexSans-SemiBold.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f1f3f7;
  --ink: #181817;
  --muted: #606675;
  --line: #d9dde7;
  --accent: #3d59f5;
  --accent-strong: #2841d9;
  font-family:
    "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(61, 89, 245, 0.25);
  outline-offset: 3px;
}

.gallery-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.gallery-brand {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
}

.gallery-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-nav a,
.button-link,
.lightbox button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.gallery-nav a:hover,
.button-link:hover,
.lightbox button:hover {
  border-color: #c9d2e4;
  background: #f7f9fc;
}

.gallery-intro,
.collection-section,
.collection-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.gallery-intro {
  display: grid;
  gap: 10px;
  min-height: 22vh;
  align-content: center;
  padding: clamp(34px, 7vh, 56px) 28px;
}

.collection-hero {
  display: grid;
  gap: 8px;
  padding: 28px;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.08;
  font-weight: 600;
}

.gallery-intro p,
.collection-hero p,
.collection-meta,
.photo-count {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.collection-section {
  margin-top: 18px;
  padding: 18px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
}

.collection-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.collection-card:hover {
  border-color: #c9d2e4;
  background: #f7f9fc;
}

.collection-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-soft);
}

.collection-card-body {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.collection-card h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.photo-grid {
  columns: 3 260px;
  column-gap: 10px;
}

.photo-button {
  width: 100%;
  display: block;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: zoom-in;
}

.photo-button:hover {
  border-color: #c9d2e4;
}

.photo-button img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface-soft);
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
}

.lightbox-top,
.lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lightbox-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lightbox-stage {
  min-height: 0;
  display: grid;
  place-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(24, 24, 23, 0.14);
}

.lightbox-count {
  min-width: 5rem;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.gallery-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .gallery-shell {
    width: min(100% - 20px, 1120px);
    padding: 18px 0;
  }

  .gallery-header {
    display: grid;
  }

  .gallery-nav {
    align-items: stretch;
  }

  .gallery-nav a,
  .button-link {
    width: 100%;
  }

  .gallery-intro,
  .collection-hero {
    padding: 30px 18px;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
    line-height: 1.1;
  }

  .collection-section {
    padding: 16px;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .lightbox button {
    padding: 0 12px;
  }
}
