@font-face {
  font-family: "Lugrasimo";
  src: url("../fonts/Lugrasimo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rosarivo";
  src: url("../fonts/Rosarivo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rosarivo";
  src: url("../fonts/Rosarivo-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --couro: #262626;
  --hortela: #b8e000;
  --pinho: #0d3b2e;
  --marca: #1e7a3c; /* verde do logotipo Família Corso */
  --fuoco: #e30613;
  --marmore: #f0f0f0;
  --ink: #1a1a1a;
  --ink-soft: #5a5a5a;
  --cream: #f7f5f0;
  --line: rgba(13, 59, 46, 0.14);
  --font-display: "Lugrasimo", "Palatino Linotype", Georgia, serif;
  --font-body: "Rosarivo", "Palatino Linotype", Georgia, serif;
  --max: 1120px;
  --page-pad: 1rem;
  --page-pad-banner: 1rem; /* banner mantém padding original no mobile/tablet */
  --header-h: 5.75rem;
  --space-section: clamp(5rem, 8vw, 7.5rem);
  --space-block: clamp(1.5rem, 3vw, 2.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  font-size: 110%; /* +10% em todo o site (rem) */
  background: var(--pinho);
}
/* Compensa o header sticky ao navegar por âncoras (#historia, #galeria…) */
#inicio,
#historia,
#blog,
#galeria,
#arvore {
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-style: italic;
  line-height: 1.65;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(184, 224, 0, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(227, 6, 19, 0.06), transparent 45%),
    linear-gradient(180deg, var(--cream) 0%, #ebe6dc 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
  width: 100%;
}

/* Evita palavra solitária no fim da linha (órfãs tipográficas) */
h1, h2, h3, h4, h5, h6,
p, li,
.historia-title,
.historia-title span,
.section-kicker,
.section-head p,
.hero p,
.post-item h3,
.post-item p,
.empty-note,
.site-footer p {
  text-wrap: pretty;
}
h1, h2, h3, h4,
.historia-title,
.hero h1 {
  text-wrap: balance;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pinho); }
a:hover { color: var(--fuoco); }

.tricolor {
  height: 4px;
  background: linear-gradient(90deg, var(--pinho) 0 33.33%, #fff 33.33% 66.66%, var(--fuoco) 66.66% 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  isolation: isolate;
  overflow: visible;
  border-bottom: 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  /* Mantém tipografia do header no tamanho original (compensa o +10% do html) */
  font-size: 90.909%;
}
.site-header-bg,
.site-header-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.site-header-bg {
  z-index: 0;
  background: url("../img/header-italy-flag.webp") center / cover no-repeat;
  filter: saturate(1.05) contrast(1.05);
}
.site-header-veil {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(13, 59, 46, 0.78) 0%, rgba(38, 38, 38, 0.62) 45%, rgba(227, 6, 19, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.42));
}
.site-header-inner {
  position: relative;
  z-index: 2;
  width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0.85rem 0;
}
.brand {
  text-decoration: none;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.brand-logo {
  width: auto;
  height: 2.805em; /* +10% sobre 2.55; em relativo ao header compensado */
  max-width: none;
  object-fit: contain;
  display: block;
}
.site-nav {
  display: flex;
  gap: 0.45em;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.35em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.site-nav a {
  text-decoration: none;
  color: #f7f5f0;
  font-style: italic;
  font-size: 1.02em;
  letter-spacing: -0.02em;
  position: relative;
  padding: 0.55em 1em;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav a::after { display: none; }
.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--pinho);
}
.nav-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1em;
  padding: 0.45em 0.9em;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.flash {
  width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
  margin: 1.5rem auto 0;
  padding: 1rem 1.15rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.flash-toast {
  position: fixed;
  top: calc(var(--header-h) + 0.45rem);
  right: max(0.7rem, env(safe-area-inset-right));
  z-index: 90;
  width: max-content;
  max-width: min(17.5rem, calc(100vw - 1.4rem));
  margin: 0;
  padding: 0.48rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.3;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(13, 59, 46, 0.16);
  pointer-events: none;
  animation: toast-in 0.35s ease both;
}
.flash-toast.is-hiding {
  animation: toast-out 0.28s ease forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-6px); }
}
.flash-success { border-color: #9dceb5; background: #eef8f2; color: var(--pinho); }
.flash-error { border-color: #e2b4b4; background: #fdf1f1; color: #9b2c2c; }

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--couro);
  background:
    linear-gradient(120deg, rgba(13, 59, 46, 0.24) 0%, rgba(255, 255, 255, 0.92) 42%, rgba(227, 6, 19, 0.20) 100%),
    radial-gradient(circle at 78% 35%, rgba(184, 224, 0, 0.24), transparent 40%),
    radial-gradient(circle at 12% 80%, rgba(13, 59, 46, 0.17), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f7f5f0 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 40px,
      rgba(13, 59, 46, 0.043) 40px,
      rgba(13, 59, 46, 0.043) 41px
    );
  pointer-events: none;
}
.hero::after {
  content: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - (var(--page-pad-banner) * 2)));
  margin: -70px auto 0;
  padding: clamp(5rem, 11vh, 8rem) 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: rise 0.9s ease both;
}
.hero-brand {
  width: min(315px, 51vw);
  height: auto;
  margin: 0 auto 2.1rem;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.28));
  animation: fadeIn 1.1s ease 0.15s both;
}
.hero h1 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1.85rem, 4.2vw, 3.25rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 1.75rem;
  max-width: none;
  white-space: nowrap;
  color: var(--pinho);
}
.hero p {
  margin: -20px 0 3rem;
  max-width: none;
  font-size: clamp(0.95rem, 2.1vw, 1.3rem);
  color: var(--ink-soft);
  line-height: 1.75;
  white-space: nowrap;
}
.hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.15rem;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 52rem;
}
.hero-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--marca);
  color: #fff;
  border-color: var(--marca);
}
.btn-primary:hover { background: #176433; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--pinho);
  border-color: rgba(13, 59, 46, 0.35);
}
.btn-ghost:hover { background: rgba(13, 59, 46, 0.06); color: var(--pinho); }
.hero .btn-ghost {
  color: var(--pinho);
  border-color: rgba(13, 59, 46, 0.35);
}
.hero .btn-ghost:hover {
  background: rgba(13, 59, 46, 0.06);
  color: var(--pinho);
}
.btn-fuoco {
  background: var(--fuoco);
  color: #fff;
  border-color: var(--fuoco);
}
.btn-fuoco:hover { color: #fff; filter: brightness(1.05); }

.section {
  width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: var(--space-section) 0;
}
.section-head {
  margin-bottom: clamp(2.25rem, 4vw, 3.25rem);
  max-width: none;
}
.section-kicker {
  display: inline-block;
  font-style: italic;
  color: var(--fuoco);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.85rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
  color: var(--pinho);
  margin: 0 0 0.85rem;
  line-height: 1.43;
}
.section-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* História */
.historia {
  position: relative;
  background:
    linear-gradient(180deg, rgba(240, 240, 240, 0.65), rgba(247, 245, 240, 0.9)),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(13, 59, 46, 0.02) 3px, rgba(13, 59, 46, 0.02) 4px);
  border-block: 0;
}
.historia-wrap {
  width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: var(--space-section) 0;
}
.historia-title {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.historia-title .it,
.historia-title .sub {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.2vw, 3.64rem);
  letter-spacing: -0.04em;
  line-height: 1.43;
}
.historia-title .it {
  font-style: normal;
  color: var(--pinho);
}
.historia-title .sub {
  margin-top: 0;
  font-style: italic;
  color: var(--fuoco);
}
.historia-body p {
  margin: 0 0 1.75rem;
  color: var(--couro);
  font-size: 1.12rem;
  text-align: justify;
  hyphens: auto;
  line-height: 1.8;
}
.historia-body p:last-child { margin-bottom: 0; }

/* Blog */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.75rem, 3vw, 2.5rem);
}
.post-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.post-item:hover { color: inherit; }
.post-cover {
  aspect-ratio: 1920 / 1080;
  overflow: hidden;
  background: #ebe6dc;
  margin-bottom: 1.15rem;
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s ease;
}
.post-item:hover .post-cover img { transform: scale(1.04); }
.post-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 0.55rem;
}
.post-item h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.65rem;
  color: var(--pinho);
  line-height: 1.43;
}
.post-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}
.post-item.is-hidden { display: none; }
.posts-actions {
  margin-top: 2.5rem;
  text-align: center;
}
.empty-note {
  padding: 2rem 0;
  color: var(--ink-soft);
}

/* Post single */
.post-page { padding-bottom: 0; }
.post-hero-title {
  width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
  margin: clamp(2.75rem, 5vw, 4rem) auto 2.85rem;
}
.post-hero-title .meta {
  color: var(--ink-soft);
  margin: 0 0 1.35rem;
  font-size: 0.95rem;
}
.post-hero-title h1 {
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.04em;
  color: var(--pinho);
  margin: 0;
  line-height: 1.43;
}
.post-excerpt {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 2.1vw, 1.22rem);
  line-height: 1.65;
}
.post-cover-full {
  float: left;
  width: 50%;
  margin: 0 1.75rem 1.1rem 0;
  aspect-ratio: 1920 / 1080;
  overflow: hidden;
  background: #ebe6dc;
}
.post-cover-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  cursor: zoom-in;
}
.post-flow {
  width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
  overflow: hidden;
}
.post-body {
  width: auto;
  margin: 0;
  font-size: 1.12rem;
  color: var(--couro);
  line-height: 1.8;
  font-style: normal;
  text-align: left;
}
.post-body p { margin: 0 0 1.15rem; }
.post-body ul,
.post-body ol {
  margin: 0 0 1.15rem;
  padding-left: 1.5rem;
}
.post-body li { margin: 0.25rem 0; }
.post-body img {
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}
.post-cover-full img.is-zoomable,
.post-body img.is-zoomable {
  cursor: zoom-in;
}
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font-family: var(--font-display);
  font-style: normal;
  color: var(--pinho);
  letter-spacing: -0.03em;
  margin: 2.25rem 0 0.85rem;
}
.post-body a { color: var(--fuoco); }
.post-body blockquote {
  margin: 1.5rem 0;
  padding: 0.35rem 0 0.35rem 1.1rem;
  border-left: 3px solid var(--marca);
  color: var(--ink-soft);
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.post-body th,
.post-body td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  vertical-align: top;
}
.post-body strong, .post-body b { font-weight: 700; font-style: normal; }
.post-body em, .post-body i { font-style: italic; }
.post-body u { text-decoration: underline; }
.post-body s, .post-body strike { text-decoration: line-through; }

.post-back {
  width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
  margin: 4.5rem auto 3rem;
}

/* Galeria */
.gallery-section {
  background: var(--cream);
  color: var(--ink);
}
.gallery-section .section-head h2 { color: var(--pinho); }
.gallery-section .section-head p { color: var(--ink-soft); }
.gallery-section .section { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: 0.85rem;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  background: #e8e4dc;
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.55s ease forwards;
  border: 0;
  padding: 0;
}
.gallery-item:nth-child(4n+1) { grid-row: span 2; }
.gallery-item:nth-child(5n+2) { grid-column: span 2; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: saturate(0.95);
}
.gallery-item:hover img {
  transform: scale(1.05);
  filter: saturate(1.05);
}
.gallery-actions {
  margin-top: 2.5rem;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
}
.gallery-actions .btn {
  box-sizing: border-box;
  min-width: 15.75rem;
}
.gallery-actions .btn[hidden] {
  display: none !important;
}
.gallery-item.is-hidden { display: none; }

/* Árvore */
.arvore-section {
  background:
    linear-gradient(180deg, rgba(13, 59, 46, 0.04), transparent),
    var(--cream);
}
.tree-embed-frame {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fffaf2;
  box-shadow: 0 12px 40px rgba(31, 42, 36, 0.08);
  min-height: 560px;
}
.tree-embed-iframe {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  min-height: 560px;
  border: 0;
  background: transparent;
  touch-action: none;
}

.site-footer {
  background: #ebe6dc;
  color: var(--ink);
  text-align: center;
  padding: clamp(3rem, 6vw, 4.25rem) 1rem;
  margin: 0;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid var(--line);
}
.footer-logo-link {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}
.footer-logo-link:hover .footer-logo {
  opacity: 0.88;
}
.footer-logo {
  margin: 0 auto 1.25rem;
  height: 3rem;
  width: auto;
  display: block;
}
.site-footer p { margin: 0 0 0.75rem; line-height: 1.6; }
.footer-meta { opacity: 0.72; font-size: 0.9rem; margin: 0.75rem 0 0; }
.footer-admin {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(38, 38, 38, 0.32);
  text-decoration: none;
}
.footer-admin:hover {
  color: var(--pinho);
}

.back-to-top {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 60;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top-dome {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 999px;
  background: var(--marca);
  color: #fff;
  border: 1px solid var(--marca);
  font-size: 1.35rem;
  font-style: normal;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(13, 59, 46, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}
.back-to-top:hover .back-to-top-dome {
  background: #176433;
  border-color: #176433;
  transform: translateY(-2px);
  color: #fff;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 10, 10, 0.88);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 3.25rem 0.75rem 1.25rem;
  gap: 0.75rem 0.5rem;
  touch-action: pan-y;
}
.lightbox[hidden] { display: none !important; }
.lightbox-stage {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  max-width: min(960px, 100%);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}
.lightbox-caption {
  max-width: 42rem;
  text-align: center;
  color: #f7f5f0;
}
.lightbox-caption[hidden] { display: none !important; }
.lightbox-caption strong {
  display: block;
  font-family: var(--font-display);
  font-style: normal;
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}
.lightbox-caption strong:empty { display: none; }
.lightbox-caption span {
  display: block;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(247, 245, 240, 0.82);
}
.lightbox-caption span:empty { display: none; }
.lightbox-nav {
  grid-row: 1;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 0.15rem;
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}
.lightbox-nav[hidden] { display: none !important; }
.lightbox-prev { grid-column: 1; }
.lightbox-next { grid-column: 3; }
.lightbox-download {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  z-index: 2;
  text-decoration: none;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1024px) {
  :root {
    --page-pad: 2rem; /* dobro do padding horizontal em smartphone/tablet */
  }
  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .post-page article {
    display: flex;
    flex-direction: column;
  }
  .post-flow {
    display: contents;
  }
  .post-cover-full {
    float: none;
    width: 100%;
    margin: 0 auto 0;
    order: -1;
  }
  .post-hero-title {
    margin-top: 1.75rem;
  }
  .post-body {
    width: min(var(--max), calc(100% - (var(--page-pad) * 2)));
    margin: 0 auto;
  }
}

@media (max-width: 960px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
  }
  .gallery-item:nth-child(4n+1) { grid-row: span 1; }
  .gallery-item:nth-child(5n+2) { grid-column: span 1; }
}
@media (max-width: 720px) {
  .flash-toast {
    top: calc(var(--header-h) + 0.35rem);
    right: max(0.5rem, env(safe-area-inset-right));
    max-width: min(15rem, calc(100vw - 1rem));
    padding: 0.4rem 0.65rem;
    font-size: 0.72rem;
  }
  .nav-toggle { display: inline-flex; position: relative; z-index: 3; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 50;
    background: rgba(13, 59, 46, 0.96);
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    gap: 0.35rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.06);
  }
  .site-nav a:hover,
  .site-nav a.is-active {
    border-color: rgba(255, 255, 255, 0.55);
  }
  .posts-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 4.25rem 0 5rem; margin: -55px auto 0; }
  .hero-brand {
    width: min(311px, 60vw);
    margin-bottom: 2rem;
  }
  .hero h1 {
    font-size: clamp(1.45rem, 6.2vw, 2.4rem);
    margin-bottom: calc(1.5rem - 20px);
  }
  .hero p {
    font-size: clamp(0.82rem, 3.4vw, 1.05rem);
    margin-top: 0;
    margin-bottom: 2.75rem;
  }
  .lightbox {
    grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem;
    padding: 3rem 0.4rem 1rem;
  }
  .lightbox-nav {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.6rem;
  }
  .lightbox-stage img { max-height: 58vh; }
  .historia-title .it,
  .historia-title .sub {
    font-size: clamp(2rem, 4vw, 2.8rem);
  }
  .historia-body p {
    font-size: 0.94rem;
  }
  .tree-embed-frame { min-height: 360px; }
  .tree-embed-iframe { min-height: 360px; height: 52.5vh; }
  .brand {
    padding: 16px;
  }
  .brand-logo { height: 2.42em; }
}
