/* =========================================================
   Lia — Portfólio · estilo editorial minimalista
   ========================================================= */

:root {
  --black: #000000;
  --white: #ffffff;
  --grey: #888888;
  --grey-line: #333333;
  --accent: #c0392b;
  --sidebar-w: clamp(220px, 22vw, 320px);
  --gutter: 3px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* =========================================================
   LAYOUT
   ========================================================= */

.layout {
  display: flex;
  min-height: 100svh;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: var(--sidebar-w);
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vh, 48px) clamp(20px, 2.5vw, 36px);
  background: var(--black);
  border-right: 1px solid var(--grey-line);
}

.sidebar__brand {
  margin-bottom: clamp(36px, 6vh, 64px);
}

.sidebar__name {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.sidebar__role {
  margin-top: 10px;
  font-size: clamp(0.65rem, 0.85vw, 0.78rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
  line-height: 1.5;
}

/* ----- Navigation ----- */

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.nav-group__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 12px;
  transition: color 0.2s;
}

.nav-group__toggle:hover { color: var(--grey); }

.nav-group__chevron {
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}

.nav-group:not(.is-open) .nav-group__chevron {
  transform: rotate(-90deg);
}

.nav-group:not(.is-open) .nav-group__list {
  display: none;
}

.nav-group__list,
.nav-flat {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 18px;
}

.nav-flat { padding-left: 0; }

.nav-link {
  display: inline-block;
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  padding: 2px 0;
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover { color: var(--grey); }

.nav-link.is-active {
  color: var(--accent);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
}

/* Mobile menu button */
.sidebar__menu-btn {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 60;
  width: 36px;
  height: 36px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--black);
  border: 1px solid var(--grey-line);
}

.sidebar__menu-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.25s var(--ease), opacity 0.25s;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100svh;
  background: var(--black);
}

.view {
  min-height: 100svh;
  padding: var(--gutter);
}

.view--text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 8vh, 80px);
}

/* =========================================================
   GALLERY — masonry via columns
   ========================================================= */

.gallery {
  column-count: 2;
  column-gap: var(--gutter);
}

@media (min-width: 700px) {
  .gallery { column-count: 2; }
}

@media (min-width: 1100px) {
  .gallery { column-count: 2; }
}

.gallery__item {
  break-inside: avoid;
  margin-bottom: var(--gutter);
  overflow: hidden;
}

.gallery__btn {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  line-height: normal;
}

.gallery__item img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.gallery__overlay {
  display: block;
  background: var(--black);
}

.gallery__caption {
  display: block;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.45;
  padding: 10px 12px 12px;
}

@media (min-width: 901px) {
  .gallery__btn {
    display: grid;
  }

  .gallery__btn > img,
  .gallery__btn > .gallery__overlay {
    grid-area: 1 / 1;
  }

  .gallery__overlay {
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
  }

  .gallery__caption {
    padding: 20px 24px;
    text-align: center;
  }

  .gallery__btn:hover img,
  .gallery__btn:focus-visible img,
  .gallery__btn.is-hovered img {
    filter: brightness(0.55);
  }

  .gallery__btn:hover .gallery__overlay,
  .gallery__btn:focus-visible .gallery__overlay,
  .gallery__btn.is-hovered .gallery__overlay {
    opacity: 1;
  }
}

.gallery--video .gallery__item {
  break-inside: avoid;
}

.gallery__item--video video {
  width: 100%;
  height: auto;
  background: #111;
}

/* =========================================================
   CONTACT
   ========================================================= */

.about {
  max-width: 480px;
  text-align: left;
}

.about.about--wide {
  max-width: 720px;
}

.about__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 28px;
}

.about__photo figcaption {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  padding: 8px 2px 0;
  line-height: 1.4;
}

.about h2 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.about p {
  font-size: 0.9rem;
  color: var(--grey);
  letter-spacing: 0.04em;
  line-height: 1.7;
  margin-bottom: 20px;
}

.about__link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.about__link:hover { opacity: 0.7; }

.about__social {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about__social a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.2s;
}

.about__social a:hover { color: var(--accent); }

/* =========================================================
   LIGHTBOX
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  padding: 20px;
}

.lightbox[hidden] { display: none; }

.lightbox__figure {
  max-width: min(92vw, 1400px);
  max-height: 92vh;
}

.lightbox__img {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  font-size: 1.6rem;
  color: var(--white);
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 12px;
  z-index: 2;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover { opacity: 1; }

.lightbox__close {
  top: 12px;
  right: 16px;
  font-size: 2rem;
}

.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
    box-shadow: none;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
  }

  .sidebar__menu-btn { display: flex; }

  .main { margin-left: 0; }

  .view { padding-top: 60px; }
}

@media (max-width: 520px) {
  .gallery { column-count: 1; }
  .about__photos { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
