/* Reset e base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: #fff;
  color: #000;
  transition: background-color 0.4s ease, color 0.4s ease;
  line-height: 1.6;
  padding-top: 2rem;
}

.dark-mode {
  background-color: #111;
  color: #f1f1f1;
}

/* Remover outline padrão e ajustar foco */
a,
button,
.theme-switch {
  outline: none;
}

a:focus,
button:focus,
.theme-switch:focus {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

/* Animação ao carregar */
.fade-in {
  animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Header */
header {
  position: relative;
  padding: 1rem;
  text-align: center;
}

.header-wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
}

.subtitle {
  font-weight: 400;
  margin-top: 0.2rem;
}

/* Botão dark-mode */
.theme-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px;
  background: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

.dark-mode .theme-switch {
  justify-content: flex-end;
}

.theme-switch::before {
  content: "";
  width: 14px;
  height: 14px;
  background-color: currentColor;
  border-radius: 50%;
  transition: all 0.3s ease;
}

/* Container principal */
.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Imagem de perfil */
.profile-pic {
  width: 120px;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
}

/* Biografia */
.bio {
  text-align: justify;
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
}

.bio p {
  text-indent: 1.5em;
  margin-bottom: 1rem;
}

/* Links */
.links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.links a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  position: relative;
}

.links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 1px;
  width: 100%;
  background-color: currentColor;
  transition: transform 0.3s ease;
  transform: scaleX(0);
  transform-origin: right;
}

.links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Título da galeria */
h2 {
  text-align: center;
  margin-top: 3rem;
  font-size: 1.8rem;
  font-weight: 900;
}

/* Galeria principal */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Série de obras */
.series-block {
  margin-bottom: 3rem;
  text-align: center;
}

/* Título da série */
.series-title {
  font-weight: 400;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Grid de imagens de cada série */
.series-grid {
  display: flex;
  flex-wrap: wrap;          /* permite quebrar linha */
  justify-content: center;   /* centraliza horizontalmente */
  gap: 1rem;                 /* espaço entre imagens */
  margin: 0 auto;
}

.series-grid img {
  width: 220px;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.series-grid img:hover {
  transform: scale(1.02);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.modal-content {
  max-width: 90%;
  max-height: 80%;
  border-radius: 4px;
}

.modal-caption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-color);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  padding: 0 1rem;
}

.modal-close,
.modal-prev,
.modal-next {
  position: absolute;
  color: currentColor;
  background-color: transparent !important;
  border: none !important;
  padding: 0;
  margin: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.modal-close {
  top: 1rem;
  right: 1rem;
  font-size: 2.2rem;
}

.modal-prev,
.modal-next {
  top: 50%;
  transform: translateY(-50%);
}

.modal-prev { left: 1rem; }
.modal-next { right: 1rem; }

.modal-close:hover,
.modal-prev:hover,
.modal-next:hover {
  opacity: 1;
}

.modal button svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-close:hover svg,
.modal-prev:hover svg,
.modal-next:hover svg {
  opacity: 0.7;
  transform: scale(1.1);
}

body.dark-mode .modal button svg {
  stroke: #f1f1f1;
}

body:not(.dark-mode) .modal button svg {
  stroke: #000;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  font-size: 0.9rem;
}

.footer-link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--hover-color);
}

/* Responsivo */
@media (max-width: 600px) {
  .series-grid img {
    width: calc(50% - 0.5rem);
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .bio {
    text-align: left;
    padding: 0 1rem;
  }

  .bio p {
    text-indent: 0;
    line-height: 1.5;
  }
}
