@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&display=swap");

:root {
  color-scheme: dark;
  --bg: #041a3a;
  --bg-deep: #02102a;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --ink: #ffffff;
  --muted: #a9c4df;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #31b8f0;
  --accent-strong: #009ce0;
  --warm: #ffad25;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(49, 184, 240, 0.32), transparent 32vw),
    radial-gradient(circle at 96% 52%, rgba(255, 173, 37, 0.16), transparent 28vw),
    linear-gradient(145deg, var(--bg-deep) 0%, var(--bg) 42%, #082f68 100%);
  color: var(--ink);
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(2, 16, 42, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand img {
  display: block;
  width: min(300px, 58vw);
  height: auto;
}

.return-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(255, 173, 37, 0.7);
  border-radius: 999px;
  background: var(--warm);
  color: #071733;
  padding: 0 18px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.return-link:hover {
  background: #ffc158;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: clamp(34px, 7vw, 90px) clamp(18px, 5vw, 64px) clamp(26px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 16px;
  border: 1px solid rgba(49, 184, 240, 0.56);
  border-radius: 999px;
  background: rgba(49, 184, 240, 0.12);
  color: #dff6ff;
  padding: 8px 13px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 960px;
  font-size: clamp(2.6rem, 6vw, 6.4rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0 7px 30px rgba(0, 0, 0, 0.34);
}

.counter {
  display: grid;
  min-width: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}

.counter span {
  font-size: 2rem;
  font-weight: 800;
}

.counter small {
  color: #dff6ff;
  font-weight: 700;
  text-transform: uppercase;
}

main {
  padding: 22px clamp(18px, 5vw, 64px) 56px;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  color: #071733;
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus,
.icon-button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.18);
}

.status {
  margin: 22px 0;
  color: var(--muted);
}

.status:empty {
  display: none;
}

.load-sentinel {
  min-height: 1px;
}

.load-sentinel.is-loading::after {
  content: "Carregando mais fotos...";
  display: block;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}

.gallery {
  column-count: 6;
  column-gap: 8px;
  line-height: 0;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  cursor: zoom-in;
  break-inside: avoid;
  transform: translateZ(0);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 240ms ease, filter 240ms ease;
}

.photo-card:hover img,
.photo-card:focus-visible img {
  filter: saturate(1.04) contrast(1.03);
  transform: scale(1.035);
}

.photo-card span {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(31, 37, 35, 0.72);
  color: #fff;
  padding: 7px 9px;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
  line-height: 1.2;
}

.photo-card:hover span,
.photo-card:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  width: min(94vw, 1280px);
  max-width: 1280px;
  height: min(92vh, 900px);
  max-height: 900px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #111614;
  color: #fff;
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(8, 10, 9, 0.78);
}

.lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  margin: 0;
}

.lightbox img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.lightbox figcaption {
  display: none;
}

.icon-button {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  cursor: pointer;
}

.close-button {
  top: 14px;
  right: 14px;
}

.nav-button {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}

.prev-button {
  left: 14px;
}

.next-button {
  right: 14px;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .return-link {
    width: 100%;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .counter {
    justify-self: start;
  }

  .gallery {
    column-count: 2;
    column-gap: 6px;
  }

  .photo-card {
    margin-bottom: 6px;
  }

  .lightbox {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .lightbox figcaption {
    padding: 12px 48px;
  }
}

@media (min-width: 721px) and (max-width: 1040px) {
  .gallery {
    column-count: 3;
  }
}

@media (min-width: 1041px) and (max-width: 1440px) {
  .gallery {
    column-count: 4;
  }
}

@media (min-width: 1800px) {
  .gallery {
    column-count: 7;
  }
}
