.images-page {
  max-width: none !important;
  padding: 28px 0 72px !important;
}

.images-gallery-body {
  background: #11140f;
  color: #f7f6f0;
}

.image-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.image-backdrop::before,
.image-backdrop::after {
  position: absolute;
  content: "";
  inset: -18px;
}

.image-backdrop::before {
  background: url("assets/IMG_9515.JPG") center 38% / cover no-repeat;
  filter: blur(12px) brightness(0.58) saturate(0.8);
  transform: scale(1.04);
}

.image-backdrop::after {
  background: linear-gradient(180deg, rgba(12, 16, 12, 0.26), rgba(12, 16, 12, 0.66));
}

#all-contents.images-page {
  color: #f7f6f0;
}

#all-contents.images-page nav {
  margin-right: clamp(16px, 3vw, 44px);
  margin-left: clamp(16px, 3vw, 44px);
  margin-bottom: clamp(48px, 8vw, 96px);
  border-color: rgba(255, 255, 255, 0.28);
}

#all-contents.images-page nav h1,
#all-contents.images-page .nav-li a {
  color: #11140f;
}

#all-contents.images-page .nav-li a:hover,
#all-contents.images-page .nav-li a[aria-current="page"] {
  background: #11140f;
  color: #f7f6f0;
}

#all-contents.images-page main {
  display: block;
  min-height: 0;
}

.images-heading {
  max-width: 820px;
  margin: 0 clamp(16px, 3vw, 44px) clamp(40px, 7vw, 76px);
}

.images-eyebrow,
.image-info > span,
.images-count,
.viewer-index {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.images-eyebrow {
  margin: 0 0 24px;
}

.images-eyebrow span {
  padding: 0 8px;
  color: var(--coral);
}

.images-heading h2 {
  margin: 0;
  color: #f7f6f0;
  font-size: clamp(4rem, 12vw, 9.5rem);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.09em;
}

.images-heading h2 span {
  color: #d1d5ca;
}

.images-heading > p:last-child {
  max-width: 440px;
  margin: 26px 0 0;
  color: #e0e2da;
  font-size: 1rem;
  line-height: 1.6;
}

.images-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 44px);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.image-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(340px, 100%);
}

.image-search svg,
.view-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.image-search input,
.image-sort select {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: #f7f6f0;
  font: inherit;
}

.image-search input {
  width: 100%;
  outline: none;
}

.image-search:focus-within {
  color: #f4c96b;
}

.image-search input::placeholder {
  color: #d1d5ca;
  opacity: 0.8;
}

.image-tool-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.image-sort select {
  max-width: 150px;
  padding: 0 4px;
  font-size: 0.82rem;
  cursor: pointer;
}

.image-sort option {
  background: #171b16;
  color: #f7f6f0;
}

.view-toggle,
.viewer-close,
.viewer-actions button,
.viewer-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(17, 20, 15, 0.28);
  color: #f7f6f0;
  font: 700 0.72rem "DM Mono", monospace;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.view-toggle:hover,
.view-toggle:focus-visible,
.viewer-close:hover,
.viewer-close:focus-visible,
.viewer-actions button:hover,
.viewer-actions button:focus-visible,
.viewer-download:hover,
.viewer-download:focus-visible {
  border-color: #f7f6f0;
  background: #f7f6f0;
  color: #11140f;
  outline: none;
}

.images-count {
  margin: 18px clamp(16px, 3vw, 44px);
  color: #e0e2da;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 20px);
}

.image-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: #f7f6f0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.image-card[hidden] {
  display: none;
}

.image-card:hover,
.image-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 5px 5px 0 #f4c96b;
}

.image-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e7e5df;
  color: #fff;
  cursor: zoom-in;
  text-align: left;
}

.image-open img {
  display: block;
  width: 100%;
  height: clamp(140px, 15vw, 210px);
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.image-open:hover img,
.image-open:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

.image-open:focus-visible {
  outline: 3px solid #f4c96b;
  outline-offset: -3px;
}

.image-open-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
  font: 700 0.65rem "DM Mono", monospace;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.image-open:hover .image-open-hint,
.image-open:focus-visible .image-open-hint {
  opacity: 1;
  transform: translateY(0);
}

.image-open-hint span {
  color: #a76d00;
  font-size: 1rem;
}

.image-info {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 10px;
  padding: 14px 16px;
}

.image-info > span {
  color: var(--muted);
}

.image-info h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.image-info p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.image-grid.is-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.image-grid.is-list .image-card {
  display: grid;
  grid-template-columns: minmax(120px, 240px) 1fr;
  align-items: center;
}

.image-grid.is-list .image-open img {
  height: 100%;
  min-height: 120px;
  aspect-ratio: auto;
}

.image-grid.is-list .image-open-hint {
  right: 8px;
  bottom: 8px;
  padding: 6px 8px;
}

.images-empty {
  margin: 36px clamp(16px, 3vw, 44px);
  color: #e0e2da;
}

.image-viewer {
  width: min(1040px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.image-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.image-viewer::backdrop {
  background: rgba(10, 12, 10, 0.86);
  backdrop-filter: blur(5px);
}

.viewer-topbar,
.viewer-footer,
.viewer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-index {
  margin: 0;
  color: var(--muted);
}

.viewer-close span {
  font: 1.2rem Arial, sans-serif;
}

.viewer-image {
  display: block;
  width: 100%;
  max-height: min(68vh, 760px);
  object-fit: contain;
  background: #e7e5df;
}

.viewer-footer h2 {
  margin: 0;
  font-size: 1rem;
}

.viewer-description {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.viewer-download {
  text-decoration: none;
}

.viewer-actions button {
  width: 40px;
  padding: 0;
  font: 1.1rem Arial, sans-serif;
}

.images-page .spark {
  width: 4px;
  height: 4px;
  background: #ffe59a;
  box-shadow: 0 0 8px #ffd66e, 0 0 18px rgba(255, 196, 76, 0.9);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 780px) {
  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #all-contents.images-page nav {
    margin-bottom: 52px;
  }
}

@media (max-width: 520px) {
  .images-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .image-search {
    width: 100%;
  }

  .image-tool-actions {
    justify-content: space-between;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .image-open img {
    height: clamp(190px, 58vw, 280px);
  }

  .image-grid.is-list .image-card {
    grid-template-columns: minmax(100px, 38%) 1fr;
  }

  .image-info {
    padding: 12px;
  }

  .image-info > span {
    font-size: 0.62rem;
  }

  .image-viewer {
    padding: 12px;
  }

  .viewer-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .viewer-description {
    flex: auto;
  }

  .viewer-actions {
    width: 100%;
  }

  .viewer-download {
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .images-page .spark {
    display: none;
  }

  .image-card,
  .image-open img,
  .image-open-hint {
    transition: none;
  }
}
