:root {
  color-scheme: light;
  --background: #fffaf8;
  --surface: #ffffff;
  --surface-muted: #f7efeb;
  --text: #2c2020;
  --muted: #776767;
  --primary: #b14f68;
  --primary-dark: #8d364f;
  --border: #eadbd6;
  --shadow: 0 14px 40px rgba(75, 42, 42, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

.hero {
  padding: 72px 24px 54px;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8), transparent 38%),
    linear-gradient(135deg, #f3c9d2, #edb9c5 46%, #dfa2b1);
}

.hero__content {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.98;
}

.hero__description {
  max-width: 640px;
  margin: 20px 0 0;
  color: #5d3f47;
  font-size: 1.06rem;
}

.container {
  width: min(1240px, calc(100% - 32px));
  margin: -24px auto 80px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.4fr auto;
  gap: 14px;
  align-items: end;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.toolbar label {
  display: grid;
  gap: 8px;
}

.toolbar label > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

select:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(177, 79, 104, 0.14);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--primary-dark);
}

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

.status-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.status-row p {
  margin: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.photo-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(72, 42, 42, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.photo-card__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.photo-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface-muted);
}

.photo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.photo-card:hover img {
  transform: scale(1.025);
}

.photo-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(35, 23, 23, 0.76);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.photo-card__body {
  display: grid;
  gap: 5px;
  padding: 14px 15px 16px;
}

.photo-card__event {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card__time {
  color: var(--muted);
  font-size: 0.84rem;
}

.error-panel,
.empty-state {
  padding: 42px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.error-panel {
  border-color: #e4a6a6;
  background: #fff5f5;
  color: #772d2d;
}

.error-panel h2,
.empty-state h2 {
  margin-top: 0;
}

.photo-dialog {
  width: min(1040px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: #151111;
  color: white;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
}

.photo-dialog::backdrop {
  background: rgba(21, 14, 14, 0.78);
  backdrop-filter: blur(7px);
}

.photo-dialog > img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  background: #0d0b0b;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: white;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 18px;
}

.dialog-info p {
  margin: 5px 0 0;
  color: #d6caca;
}

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

  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .hero {
    padding: 54px 18px 44px;
  }

  .container {
    width: min(100% - 20px, 1240px);
    margin-top: -18px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .photo-card {
    border-radius: 14px;
  }

  .photo-card__body {
    padding: 11px 12px 13px;
  }

  .dialog-info {
    align-items: stretch;
    flex-direction: column;
  }
}

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