:root {
  color-scheme: dark;
  --page-bg: #111;
  --panel-bg: rgba(24, 31, 41, 0.82);
  --panel-border: rgba(142, 171, 201, 0.16);
  --text-main: #edf3fb;
  --text-muted: #9daec2;
  --accent: #ff9a6b;
  --accent-soft: rgba(255, 154, 107, 0.16);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.32);
  --radius-lg: 1em;
  --radius-md: 0.75em;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(77, 121, 171, 0.1), transparent 30%),
    radial-gradient(circle at right 20% top 15%, rgba(255, 154, 107, 0.09), transparent 24%),
    radial-gradient(circle at left 10% bottom 12%, rgba(64, 145, 130, 0.08), transparent 22%);
  pointer-events: none;
}

.page {
  position: relative;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.15rem 0 4rem;
}

.hero {
  margin-bottom: 1.1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.1vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.intro {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.search-form {
  margin-top: 0.75rem;
}

.search-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.search-input,
.filter-field input,
.filter-field select {
  width: 100%;
  border: 1px solid rgba(142, 171, 201, 0.18);
  border-radius: 1em;
  background: rgba(10, 17, 26, 0.9);
  color: var(--text-main);
  padding: 0.78rem 1rem;
  font: inherit;
}

.filter-field input,
.filter-field select {
  border-radius: 0.8rem;
  padding-inline: 0.95rem;
}

.search-input::placeholder {
  color: #71839a;
}

.search-button {
  border: 1px solid rgba(142, 171, 201, 0.18);
  border-radius: 1em;
  background: linear-gradient(180deg, #2e1f1b 0%, #492a1f 100%);
  color: var(--text-main);
  padding: 0.78rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filters-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem 1rem;
  margin-top: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: rgba(8, 14, 23, 0.72);
}

.filters-top-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.filters-more {
  flex: 1 0 100%;
}

.filters-more:not([open]) {
  display: none;
}

.filters-more-summary {
  display: none;
}

.filters-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid rgba(142, 171, 201, 0.18);
  border-radius: 1em;
  background: rgba(10, 17, 26, 0.9);
  cursor: pointer;
  padding: 0.55rem 0.9rem;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
}

.filters-more-toggle::after {
  content: "+";
  color: var(--accent);
}

.filters-more-toggle[aria-expanded="true"]::after {
  content: "-";
}

.filters-more-label-open {
  display: none;
}

.filters-more-toggle[aria-expanded="true"] .filters-more-label-closed {
  display: none;
}

.filters-more-toggle[aria-expanded="true"] .filters-more-label-open {
  display: inline;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.85rem 0 0;
}

.filter-field {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-field-wide {
  grid-column: span 2;
}

.primary-filter-group legend {
  margin-bottom: 0.35rem;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.primary-filter-group {
  flex: 1 1 auto;
  min-width: 0;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-chip {
  position: relative;
  display: inline-flex;
}

.checkbox-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.4rem;
  border: 1px solid rgba(142, 171, 201, 0.18);
  border-radius: 1em;
  background: rgba(10, 17, 26, 0.9);
  color: var(--text-muted);
  padding: 0.55rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.checkbox-chip input:checked + span {
  border-color: rgba(255, 154, 107, 0.34);
  background: linear-gradient(180deg, rgba(46, 31, 27, 0.92) 0%, rgba(73, 42, 31, 0.92) 100%);
  color: var(--text-main);
}

.checkbox-chip input:focus-visible + span {
  outline: 3px solid rgba(255, 154, 107, 0.28);
  outline-offset: 2px;
}

.checkbox-chip:hover span {
  transform: translateY(-1px);
}

.filter-field span {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-summary {
  margin: 0.85rem 0 0;
  max-width: 58rem;
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.45;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.gallery-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.show-more-button {
  border: 1px solid rgba(142, 171, 201, 0.18);
  border-radius: 1em;
  background: linear-gradient(180deg, #2e1f1b 0%, #492a1f 100%);
  color: var(--text-main);
  padding: 0.85rem 1.4rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(19, 34, 53, 0.08);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.show-more-button:hover,
.show-more-button:focus-visible,
.filters-more-toggle:hover,
.filters-more-toggle:focus-visible,
.search-button:hover,
.search-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.show-more-button:focus-visible {
  outline: 3px solid rgba(184, 75, 42, 0.35);
  outline-offset: 2px;
}

.search-input:focus-visible,
.filter-field input:focus-visible,
.filter-field select:focus-visible,
.filters-more-toggle:focus-visible,
.search-button:focus-visible {
  outline: 3px solid rgba(255, 154, 107, 0.28);
  outline-offset: 2px;
}

.show-more-button[hidden] {
  display: none;
}

.card {
  overflow: hidden;
  border: 1px solid rgba(142, 171, 201, 0.14);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 35, 0.9);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  transform: translateY(12px);
  opacity: 0;
  animation: rise 500ms ease forwards;
}

.card-link {
  display: block;
  height: 100%;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #172333;
}

.card-body {
  padding: 1rem;
}

.card-date {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.card-description {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-link:hover .card-title,
.card-link:focus-visible .card-title {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.card-link:focus-visible {
  outline: 3px solid rgba(184, 75, 42, 0.45);
  outline-offset: -3px;
}

.photo-modal {
  position: relative;
  width: min(1100px, calc(100% - 1rem));
  max-height: calc(100vh - 1rem);
  padding: 0;
  border: 0;
  border-radius: 1em;
  overflow: hidden;
  background: rgba(11, 17, 27, 0.98);
  box-shadow: 0 34px 84px rgba(0, 0, 0, 0.52);
}

.photo-modal::backdrop {
  background: rgba(11, 19, 31, 0.72);
  backdrop-filter: blur(6px);
}

.modal-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 0;
  max-height: calc(100vh - 1rem);
}

.modal-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.modal-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 1rem);
  object-fit: contain;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 5rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.modal-close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 1px solid rgba(142, 171, 201, 0.18);
  border-radius: 1em;
  background: rgba(17, 27, 40, 0.94);
  color: var(--text-main);
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.modal-date {
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.3rem);
  line-height: 1.08;
}

.modal-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.modal-metadata {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.85rem;
  margin: 0;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(142, 171, 201, 0.14);
}

.modal-metadata dt {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-metadata dd {
  margin: 0;
  color: var(--text-main);
  line-height: 1.5;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.download-button {
  border: 1px solid rgba(142, 171, 201, 0.18);
  border-radius: 1em;
  background: linear-gradient(180deg, #2e1f1b 0%, #492a1f 100%);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.download-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 1rem, 1180px);
    padding-top: 0.75rem;
  }

  .hero {
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .filters-panel {
    display: block;
    padding: 0.7rem;
  }

  .filters-top-row {
    flex-direction: column;
    gap: 0.7rem;
  }

  .filters-more-toggle {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .filters-more {
    margin-top: 0.7rem;
  }

  .filters-more:not([open]) {
    margin-top: 0;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
  }

  .search-row,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-field-wide {
    grid-column: span 1;
  }

  .photo-modal {
    width: calc(100% - 0.5rem);
    border-radius: 1em;
  }

  .modal-shell {
    grid-template-columns: 1fr;
  }

  .modal-media {
    min-height: 32vh;
  }

  .modal-body {
    padding-top: 1.5rem;
  }

  .modal-image {
    max-width: 100%;
    max-height: 42vh;
  }

  .modal-close-button {
    top: 0.75rem;
    right: 0.75rem;
  }
}

@media (max-width: 440px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}