*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #f0f0f0;
  overflow: hidden;
  background-color: #e8e2d9;
}

/* Papel de parede — cor bege da arte + imagem por breakpoint */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #e8e2d9;
  background-image: url("../img/backgroung.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

@media (max-width: 768px) {
  .wallpaper {
    background-image: url("../img/backgroundmobile.png");
    background-position: center top;
  }
}

.page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
}

.icons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.icon-link--text {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.icon-link:hover,
.icon-link:focus-visible {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Modais — centralizados na tela */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(92vw, 42rem);
  max-height: 85vh;
  max-height: 85dvh;
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background: rgba(18, 18, 18, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e8e8e8;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.modal__header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.modal__subtitle {
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f0f0f0;
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.modal__body {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  max-height: calc(85vh - 3.5rem);
  max-height: calc(85dvh - 3.5rem);
  line-height: 1.65;
  font-size: 0.95rem;
}

.modal__body p + p {
  margin-top: 1rem;
}

.modal__link {
  color: #9ec5ff;
  word-break: break-all;
}

.modal__link:hover {
  color: #c5dcff;
}

/* Galeria de thumbnails */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.gallery__thumb {
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.35rem;
  background: none;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  line-height: 0;
}

.gallery__thumb:hover,
.gallery__thumb:focus-visible {
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.04);
  outline: none;
}

.gallery__thumb img {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
}

/* Litany */
.litany {
  border-left: 3px solid rgba(255, 255, 255, 0.25);
  padding-left: 1rem;
  font-style: italic;
  color: #d0d0d0;
}

.litany + .litany {
  margin-top: 1.5rem;
}

/* Lightbox — centralizado, com painel e botão fechar visível */
.lightbox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(96vw, 56rem);
  max-height: 92vh;
  max-height: 92dvh;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox__panel {
  position: relative;
  padding: 2.75rem 3rem 2.5rem;
  border-radius: 0.75rem;
  background: rgba(18, 18, 18, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}

.lightbox__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.lightbox__img {
  display: block;
  width: 100%;
  max-height: calc(88vh - 4.5rem);
  max-height: calc(88dvh - 4.5rem);
  object-fit: contain;
  border-radius: 0.35rem;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.35);
}

.lightbox__nav--prev {
  left: 0.5rem;
}

.lightbox__nav--next {
  right: 0.5rem;
}

.lightbox__nav[hidden] {
  display: none;
}

.lightbox__counter {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.lightbox__counter[hidden] {
  display: none;
}

@media (max-width: 480px) {
  .icons {
    gap: 0.45rem;
  }

  .icon-link {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.9rem;
  }

  .icon-link--text {
    font-size: 0.62rem;
  }

  .gallery__thumb img {
    width: 4.5rem;
    height: 4.5rem;
  }

  .modal__body {
    padding: 1rem 1.1rem 1.25rem;
    font-size: 0.9rem;
  }

  .lightbox__panel {
    padding: 2.75rem 2.25rem 2rem;
  }

  .lightbox__nav {
    width: 2rem;
    height: 2rem;
    font-size: 0.95rem;
  }
}
