/* =========================================================
   Portfólio Robson Assis — estilos globais
   Edite as variáveis abaixo para mudar cores, fontes etc.
   ========================================================= */

:root {
  color-scheme: light dark;
  --accent-light: hsl(0 100% 46%);
  --accent-dark: hsl(164 100% 46%);
  --accent: light-dark(var(--accent-light), var(--accent-dark));
  --bg: light-dark(#ffffff, #0c0c0d);
  --fg: light-dark(hsl(0 0% 12%), hsl(0 0% 96%));
  --muted: light-dark(hsl(0 0% 42%), hsl(0 0% 62%));
  --line: light-dark(hsl(0 0% 88%), hsl(0 0% 22%));
  --card: light-dark(#111113, #171719);
  --card-fg: #ffffff;
  --radius: 22px;
  --measure: 68ch;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.fluid { font-size: clamp(2rem, 1.2rem + 4vw, 3.6rem); line-height: 1.05; letter-spacing: -0.04em; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--fg); color: var(--bg);
  padding: 0.5rem 1rem; z-index: 20; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Barra superior / redes sociais ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1240px; margin-inline: auto; padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}
.topbar .brand {
  font-weight: 700; letter-spacing: -0.03em; text-decoration: none; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.topbar .brand:hover { color: var(--accent); }
.socials { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--fg); transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.socials a:hover, .socials a:focus-visible { background: var(--accent); color: #fff; transform: translateY(-2px); }
.socials svg { width: 20px; height: 20px; }

/* ---------- Home ---------- */
.home-main { max-width: 1240px; margin-inline: auto; padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem; }

/* Home com rolagem livre e grade de cards quadrados.
   A grade aceita quantas linhas forem necessárias (ex.: 5 linhas x 4 cards). */
body.home { min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
body.home .topbar { flex: 0 0 auto; padding-block: 0.75rem; }
body.home .home-main { width: 100%; padding-bottom: 3rem; }
body.home .site-footer { margin-top: 0; }

.hero { text-align: center; display: grid; justify-items: center; gap: 0.5rem; padding-block: clamp(1rem, 3vw, 2.5rem); }
.hero img.avatar {
  width: clamp(100px, 12vw, 150px);
  height: clamp(100px, 12vw, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.hero h1 { margin: 0; font-weight: 800; font-size: clamp(1.9rem, 1.2rem + 3vw, 3.2rem); line-height: 1.05; letter-spacing: -0.04em; }
.hero p { margin: 0; max-width: 62ch; color: var(--muted); font-size: clamp(0.9rem, 0.82rem + 0.25vw, 1rem); line-height: 1.45; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  margin-top: clamp(1.25rem, 3vw, 2rem);
}
.card {
  position: relative; display: flex; align-items: flex-end;
  width: 100%; aspect-ratio: 1 / 1; min-height: 0;
  padding: 1rem 1.15rem; border-radius: var(--radius); color: var(--card-fg);
  background-color: var(--card); background-image: var(--bg-img);
  background-size: cover; background-position: center;
  text-decoration: none; overflow: hidden; isolation: isolate;
  transition: transform 0.25s cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 0.25s;
}
/* véu escuro para o texto continuar legível */
.card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 0.8) 0%, rgb(0 0 0 / 0.3) 60%, rgb(0 0 0 / 0.05) 100%);
  transition: opacity 0.35s;
}
.card > * { position: relative; z-index: 1; }
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.6); }
.card:hover::after, .card:focus-visible::after { opacity: 0.7; }
.card .card-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; font-size: clamp(0.85rem, 0.75rem + 0.5vw, 1.2rem); text-shadow: 0 1px 12px rgb(0 0 0 / 0.6); }
.card .card-desc { display: block; font-weight: 400; text-transform: none; letter-spacing: -0.01em; font-size: clamp(0.7rem, 0.65rem + 0.2vw, 0.82rem); opacity: 0.82; margin-top: 0.25rem; }

/* Responsividade da grade da home; páginas internas não são alteradas. */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
}

/* ---------- Páginas de conteúdo ---------- */
.container {
  max-width: 1240px; margin-inline: auto; padding: 0 clamp(1rem, 4vw, 2.5rem) 2rem;
  display: grid; gap: clamp(1rem, 3vw, 4rem); grid-template-columns: minmax(0, 1fr);
}
.container > header,
.container > main,
.container > footer { grid-column: 1; min-width: 0; }

article { max-width: var(--measure); }

.page-header { padding-block: clamp(2rem, 8vw, 5rem) clamp(1.5rem, 4vw, 3rem); max-width: var(--measure); }
.page-header h1 { margin: 0 0 1.25rem; font-weight: 800; }
.eyebrow {
  display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); font-weight: 600; margin-bottom: 1rem; text-decoration: none;
}
.author { display: flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; color: var(--muted); }
.author img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.intro { font-size: 1.15em; color: var(--fg); }
article section { scroll-margin-top: 5rem; }
article h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); letter-spacing: -0.03em; margin-top: 2.5rem; }
article h3 { font-size: 1.1rem; letter-spacing: -0.02em; margin-top: 1.75rem; }
article p { margin-block: 0 1.1em; overflow-wrap: break-word; }
article ul { padding-left: 1.1rem; }
article li { margin-bottom: 0.4rem; }

.figure { margin: 1.75rem 0; }
.figure .box {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.25rem;
  color: var(--muted); font-size: 0.9rem; background: light-dark(hsl(0 0% 98%), hsl(0 0% 10%));
}

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 2rem; font-size: 0.85rem; color: var(--muted); }
.site-footer a { color: var(--accent); text-decoration: none; }

/* ---------- Sumário (table of contents) ---------- */
table-of-contents { display: block; font-size: 0.875rem; }
table-of-contents nav > h2 {
  margin: 0 0 0.5rem; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
table-of-contents ol { margin: 0; padding-left: 1rem; list-style: none; }
table-of-contents nav > ol { padding-left: 0; }
table-of-contents a {
  display: block; padding-block: 0.3rem; text-decoration: none; color: var(--muted);
  transition: color 0.26s cubic-bezier(0.215, 0.61, 0.355, 1);
  border-left: 2px solid transparent; padding-left: 0.75rem; margin-left: -0.75rem;
}
table-of-contents a:hover, table-of-contents a:focus-visible { color: var(--fg); }
table-of-contents a.is-active,
table-of-contents a:target-current { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
table-of-contents .back-to-top {
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
  text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.1em;
}
table-of-contents .back-to-top a { display: inline-flex; align-items: center; gap: 0.35rem; border: 0; margin: 0; padding-left: 0; }
table-of-contents .back-to-top svg { width: 14px; height: 14px; }

/* Mobile: sumário vira um bloco recolhível no topo */
.toc-wrapper { border: 1px solid var(--line); border-radius: 14px; padding: 0.75rem 1rem; margin-bottom: 2rem; }
.toc-wrapper > summary {
  cursor: pointer; list-style: none; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); font-weight: 600;
}
.toc-wrapper > summary::-webkit-details-marker { display: none; }
.toc-wrapper > summary::after { content: ' +'; }
.toc-wrapper[open] > summary::after { content: ' –'; }
.toc-wrapper[open] { padding-bottom: 1rem; }
.toc-wrapper table-of-contents { margin-top: 0.75rem; }
.toc-wrapper table-of-contents nav > h2,
.toc-wrapper .back-to-top { display: none; }

/* Desktop: sumário fixo à direita */
@media (min-width: 1024px) {
  .container { grid-template-columns: minmax(0, 1fr) 16rem; }
  .container > header,
  .container > main,
  .container > footer { grid-column: 1; }
  .toc-wrapper {
    grid-column: 2; grid-row: 1 / span 3; position: sticky; align-self: start; top: 4rem;
    border: 0; padding: 0; margin: 0;
  }
  .toc-wrapper > summary { display: none; }
  .toc-wrapper table-of-contents nav > h2 { display: block; }
  .toc-wrapper .back-to-top { display: block; }
  .page-header { padding-top: clamp(3rem, 10vw, 6rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ---------- Ajustes para telas pequenas ---------- */
@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding-block: 1rem 0.5rem; }
  .topbar .brand { font-size: 0.9rem; white-space: nowrap; }
  .socials { justify-content: flex-start; margin-left: -0.35rem; }
  .socials a { width: 36px; height: 36px; }
  .socials svg { width: 18px; height: 18px; }
}
blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem 0.5rem 1.5rem;
  border-left: 5px solid #007bff; /* Blue accent color */
  background-color: #f8f9fa; /* Subtle gray background */
  font-style: italic;
  color: #495057;
}

figcaption {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
  font-size: 0.9rem;
  color: #6c757d;
}
/* ---------- Banner de galeria (páginas internas) ---------- */
.banner-galeria { margin: 1.5rem 0 2rem; }
.banner-galeria__btn {
  display: block; position: relative; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 14px; overflow: hidden; background: #0b0b0c; line-height: 0;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); transition: transform .2s ease, box-shadow .2s ease;
}
.banner-galeria__btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgb(0 0 0 / 0.26); }
.banner-galeria__btn:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.banner-galeria__btn img { width: 100%; height: clamp(140px, 28vw, 260px); object-fit: cover; display: block; }
.banner-galeria__badge {
  position: absolute; right: .7rem; bottom: .7rem; display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .6rem; border-radius: 999px; font: 600 .78rem/1 system-ui, sans-serif;
  color: #fff; background: rgb(0 0 0 / 0.62); backdrop-filter: blur(4px);
}
.banner-galeria__titulo { margin-top: .5rem; font-size: .88rem; opacity: .75; line-height: 1.4; }

/* ---------- Lightbox / carrossel ---------- */
body.lightbox-aberto { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 999; display: none;
  align-items: center; justify-content: center; gap: .5rem;
  background: rgb(8 8 10 / 0.92); padding: clamp(.75rem, 3vw, 2rem);
}
.lightbox.is-open { display: flex; }
.lightbox__frame {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: .6rem;
  width: min(92vw, var(--img-w, 92vw));
  max-width: 92vw;
}
.lightbox__img {
  display: block; width: 100%; height: auto;
  max-height: 82vh; object-fit: contain;
  border-radius: 10px; background: #111;
}
.lightbox.is-loading .lightbox__img { opacity: .35; }
.lightbox__cap { color: #f2f2f2; font-size: .9rem; text-align: center; max-width: 60ch; }
.lightbox__nav, .lightbox__close {
  border: 0; background: rgb(255 255 255 / 0.12); color: #fff; cursor: pointer;
  border-radius: 999px; display: grid; place-items: center; transition: background .2s ease;
}
.lightbox__nav { width: 46px; height: 46px; font-size: 2rem; line-height: 1; flex: 0 0 auto; }
.lightbox__nav:hover, .lightbox__close:hover { background: rgb(255 255 255 / 0.25); }
.lightbox__close { position: absolute; top: 1rem; right: 1rem; width: 42px; height: 42px; font-size: 1.6rem; }
.lightbox__counter {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  color: #ddd; font-size: .82rem; letter-spacing: .04em;
}
@media (max-width: 600px) {
  .lightbox { gap: .25rem; padding: .5rem; }
  .lightbox__nav { position: absolute; bottom: 2.6rem; width: 42px; height: 42px; }
  .lightbox__nav--prev { left: .6rem; }
  .lightbox__nav--next { right: .6rem; }
  .lightbox__frame { width: 100%; }
  .lightbox__img { max-height: 72vh; }
}

/* Filtros por tags da homepage */
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin: -0.25rem 0 clamp(1.25rem, 3vw, 2rem);
}
.portfolio-filter {
  appearance: none;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1;
  padding: 0.62rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.portfolio-filter:hover,
.portfolio-filter:focus-visible {
  transform: translateY(-1px);
  border-color: currentColor;
}
.portfolio-filter[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.card[hidden] { display: none !important; }

@media (max-width: 520px) {
  .portfolio-filters { justify-content: flex-start; }
  .portfolio-filter { font-size: 0.78rem; }
}
