:root {
  --paper: #eadcc6;
  --paper-2: #e2d0b4;
  --ink: #2b241c;
  --ink-soft: #c9d2c4;
  --sepia: #d7b56a;
  --line: #3e6a62;
  --clay: #1e4636;
  --muted: #b7c3b4;
  --card: rgba(20, 36, 30, 0.72);
  --ground: #101612;
  --moss: #1a3328;
  --water: #3e7388;
  --lantern: #f0d48a;
  --linen: #f3e6cf;
  --mist: #efe6d4;
  --display: "Cormorant Garamond", "Palatino Linotype", Palatino, serif;
  --body: "Source Serif 4", "Iowan Old Style", Palatino, serif;
  --page: 70rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--mist);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  background: var(--ground);
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(16, 22, 18, 0.2), rgba(8, 12, 10, 0.78) 72%),
    linear-gradient(180deg, rgba(12, 22, 18, 0.55), rgba(8, 14, 12, 0.82)),
    url("../assets/feira-mesa.jpg") center 42% / cover no-repeat;
  z-index: 0;
}

body > *:not(.home-bar) { position: relative; z-index: 1; }

body > .home-bar {
  position: sticky;
  top: 0;
  z-index: 8;
  background: linear-gradient(rgba(10, 16, 13, 0.98), rgba(10, 16, 13, 0.94));
}

dialog.sobre,
dialog.peca-mais,
dialog.foto-grande {
  position: fixed;
  z-index: 40;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  margin: 0;
  max-width: calc(100vw - 1.5rem);
  max-height: min(86vh, 42rem);
}

.lupa {
  position: absolute;
  z-index: 3;
  right: 0.5rem;
  bottom: 0.5rem;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1.5px solid #f3d48a;
  border-radius: 50%;
  background: rgba(12, 16, 13, 0.78);
  color: #f3d48a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.lupa svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

dialog.foto-grande:not([open]),
dialog.foto-grande:not(.is-aberta) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

dialog.foto-grande.is-aberta[open] {
  display: flex !important;
  visibility: visible;
  pointer-events: auto;
  flex-direction: column;
}

.foto-palco {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 2.4rem 0.6rem 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  display: grid;
  place-items: center;
}

.foto-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.45rem 0.8rem 0.7rem;
}

.foto-zoom button {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1.5px solid #f3d48a;
  border-radius: 50%;
  background: rgba(12, 16, 13, 0.55);
  color: #f3e6cf;
  font-size: 1.25rem;
  line-height: 1;
}

.foto-zoom input[type="range"] {
  width: min(16rem, 52vw);
  accent-color: #e2b15a;
  cursor: pointer;
}

.foto-fechar {
  position: absolute;
  z-index: 6;
  pointer-events: auto;
  top: 0.45rem;
  right: 0.45rem;
  min-height: 2.1rem;
  padding: 0.15rem 0.75rem;
  border: 1px solid rgba(240, 212, 138, 0.55);
  border-radius: 999px;
  background: rgba(18, 14, 12, 0.9);
  color: #f3e6cf;
  font-family: Cinzel, serif;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a, button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

.direitos {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 177, 90, 0.28);
  text-align: center;
  color: color-mix(in srgb, var(--mist) 74%, #e2b15a);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  line-height: 1.45;
}

footer.rodape-direitos {
  margin-top: 2.4rem;
  padding: 1.15rem 1rem 1.5rem;
  background: #0b100e;
  border-top: 3px solid #e2b15a;
}

footer.rodape-direitos .direitos {
  margin: 0;
  padding-top: 0;
  border-top: 0;
}

.wrap {
  width: min(calc(100% - 2rem), var(--page));
  margin-inline: auto;
}

.site-header { padding: 1rem 0 0; }

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--mist);
}

.brand img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
}

.brand-name {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 1rem;
  line-height: 1.05;
}

.brand-name small {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia);
  font-weight: 400;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
  padding: 0.7rem 0 0.8rem;
  border-bottom: 1px solid color-mix(in srgb, var(--water) 55%, transparent);
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--ink-soft);
}

.nav a[aria-current="page"] {
  color: var(--lantern);
  box-shadow: inset 0 -1px 0 var(--water);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  margin: 0.35rem 0 0.8rem;
  font-size: clamp(2.7rem, 12vw, 5.4rem);
}

h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(2rem, 7vw, 3.1rem);
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}

.kicker {
  margin: 0;
  color: var(--sepia);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.lede, .prose p, .chapter p { color: var(--ink-soft); }

.lede { font-size: 1.2rem; max-width: 38rem; }

.hero { padding: 1.6rem 0 2rem; }

.estado {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0.85rem 0 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--mist);
}

.estado span { color: var(--muted); }

.actions, .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border: 1px solid var(--water);
  background: var(--moss);
  color: var(--linen);
}

.btn:hover,
.btn:focus-visible {
  background: var(--water);
  border-color: var(--lantern);
  color: var(--linen);
}

.btn.quiet {
  background: transparent;
  color: var(--mist);
  border-color: color-mix(in srgb, var(--lantern) 55%, var(--water));
}

.draw {
  width: min(9rem, 42vw);
  color: var(--lantern);
  margin: 1.2rem 0 0.4rem;
}

.photo {
  margin: 1rem 0 0;
  background: var(--paper-2);
}

.photo img { width: 100%; object-fit: cover; }
.photo figcaption {
  padding: 0.55rem 0.1rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.chapter {
  padding: 2.4rem 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, var(--paper));
}

.chapter .exordio {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.45rem, 4vw, 2rem);
  color: var(--mist);
  line-height: 1.2;
  max-width: 22ch;
}

.grid-2, .rights, .formats, .diary {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 35%, transparent);
  padding: 1rem 1rem 1.15rem;
}

.rights div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}

.rights strong { font-weight: 600; }

.cycle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.35rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.cycle li {
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  font-size: 0.92rem;
}

.note { color: var(--muted); font-size: 0.95rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.4rem;
  color: var(--ink-soft);
  display: grid;
  gap: 0.85rem;
  font-size: 0.95rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}

.foot-links a { color: var(--clay); }

@media (min-width: 800px) {
  .hero-grid,
  .split,
  .grid-2 {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    align-items: end;
  }

  .split { align-items: start; }
  .formats { grid-template-columns: 1fr 1fr; }
  .diary { grid-template-columns: 1.2fr 0.8fr; }
  .chapter { padding: 3.2rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
