body.seo-page {
  min-height: 100%;
  overflow: auto;
  line-height: 1.7;
}

html[data-theme="night"] body.essays-page {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 22%, rgba(113, 145, 119, 0.13), transparent 32%),
    radial-gradient(circle at 88% 72%, rgba(76, 108, 83, 0.15), transparent 36%),
    linear-gradient(155deg, #0e1816 0%, #101c18 48%, #15231c 100%);
}

html[data-theme="night"] body.essays-page::before,
html[data-theme="night"] body.essays-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

html[data-theme="night"] body.essays-page::before {
  background: url("assets/essays-night-spring.svg") center / cover no-repeat;
  opacity: 0.42;
  filter: saturate(0.72) blur(0.15px);
}

html[data-theme="night"] body.essays-page::after {
  background:
    linear-gradient(90deg, rgba(10, 18, 15, 0.04), transparent 18% 82%, rgba(10, 18, 15, 0.08)),
    radial-gradient(ellipse at center, transparent 42%, rgba(8, 15, 12, 0.16) 100%);
}

html[data-theme="night"] body.essays-page > .seo-topbar,
html[data-theme="night"] body.essays-page > .seo-container {
  position: relative;
  z-index: 1;
}

.seo-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(16px);
  background: rgba(251, 247, 238, 0.82);
}

.seo-home-link {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.5);
}

.seo-home-link:hover,
.seo-home-link:focus-visible {
  border-color: var(--stroke-strong);
  background: rgba(255, 255, 255, 0.78);
}

.seo-container {
  width: min(880px, calc(100% - 32px));
  margin: 34px auto 72px;
}

.seo-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 54px);
}

.seo-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.seo-breadcrumb [aria-current="page"] {
  min-width: 0;
  color: rgba(42, 35, 26, 0.72);
  overflow-wrap: anywhere;
}

.seo-breadcrumb a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.seo-breadcrumb a:hover,
.seo-breadcrumb a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--stroke-strong);
}

.seo-card h1 {
  margin: 0 0 18px;
  max-width: 760px;
  font-family: var(--font);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.seo-card h2 {
  margin: 38px 0 12px;
  font-size: 13px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.seo-lead {
  margin: 0 0 26px;
  color: rgba(42, 35, 26, 0.76);
  font-family: var(--font);
  font-size: clamp(20px, 3.5vw, 27px);
  line-height: 1.42;
}

.seo-card p {
  color: rgba(42, 35, 26, 0.78);
  font-size: 17px;
}

.seo-meta {
  display: grid;
  gap: 8px;
  margin: 24px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.seo-tale-image {
  width: min(100%, 680px);
  aspect-ratio: 16 / 9;
  margin: 22px auto 30px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(239, 235, 218, 0.42);
}

.seo-tale-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seo-article section p {
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.72;
}

.seo-card blockquote {
  margin: 16px 0;
  padding: 18px 20px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.46);
}

.seo-card blockquote p {
  margin: 0;
  font-family: var(--font);
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
}

.seo-card blockquote footer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.seo-pills,
.seo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.seo-pill,
.seo-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.seo-pill:hover,
.seo-pill:focus-visible {
  border-color: var(--stroke-strong);
  background: rgba(255, 255, 255, 0.8);
}

.seo-question {
  border-left: 3px solid var(--stroke-strong);
  padding-left: 16px;
  color: var(--ink) !important;
  font-style: italic;
}

.seo-cta {
  margin-top: 42px;
  padding: 24px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 15% 10%, rgba(190, 213, 181, 0.28), transparent 44%),
    rgba(255, 255, 255, 0.45);
}

.seo-cta h2 {
  margin-top: 0;
}

.seo-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  margin-top: 8px;
  padding: 12px 18px;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  text-decoration: none;
}

.seo-button:hover,
.seo-button:focus-visible {
  background: #fff;
}

.essay-section-label {
  margin: 0 0 10px;
  color: rgba(42, 35, 26, 0.58);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.essay-back-link {
  display: inline-flex;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 4px;
}

.essay-back-link:hover,
.essay-back-link:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  outline: none;
}

html[data-theme="night"] .essay-back-link {
  color: var(--night-text-primary);
}

html[data-theme="night"] .essays-index {
  border-color: rgba(190, 211, 178, 0.16);
  background:
    radial-gradient(circle at 88% 8%, rgba(120, 153, 125, 0.09), transparent 32%),
    linear-gradient(145deg, rgba(22, 37, 31, 0.94), rgba(19, 32, 27, 0.9));
}

html[data-theme="night"] .essays-index > h1 {
  color: var(--night-text-primary);
  text-shadow: 0 1px 20px rgba(241, 234, 216, 0.06);
}

html[data-theme="night"] .essays-index > .seo-lead {
  color: var(--night-text-reading);
}

html[data-theme="night"] .essays-index > .essay-section-label {
  color: var(--night-text-muted);
}

.essay-editorial-note {
  max-width: 620px;
  margin: 22px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--stroke);
  color: rgba(42, 35, 26, 0.72);
  font-family: var(--font);
  font-size: 19px;
}

html[data-theme="night"] .essays-index > .essay-editorial-note {
  border-left-color: rgba(199, 217, 180, 0.3);
  color: rgba(241, 234, 216, 0.75);
}

.essays-grid {
  display: grid;
  gap: 14px;
}

.essay-card,
.essay-empty {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(255, 255, 255, 0.42);
  isolation: isolate;
}

.essay-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0.58) 48%, rgba(255, 255, 255, 0.18) 100%),
    radial-gradient(circle at 86% 20%, rgba(164, 184, 134, 0.16), transparent 34%),
    radial-gradient(circle at 78% 88%, rgba(122, 151, 128, 0.14), transparent 42%),
    url("data:image/svg+xml,%3Csvg width='360' height='220' viewBox='0 0 360 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%235f7b5f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' opacity='.5'%3E%3Cpath d='M276 212 C282 160 294 112 320 62'/%3E%3Cpath d='M293 132 C314 126 328 114 337 98 C314 99 300 110 293 132Z' fill='%235f7b5f' opacity='.2'/%3E%3Cpath d='M285 166 C306 160 320 149 328 132 C306 134 292 145 285 166Z' fill='%235f7b5f' opacity='.18'/%3E%3Cpath d='M306 96 C326 91 339 80 346 65 C326 66 313 77 306 96Z' fill='%235f7b5f' opacity='.16'/%3E%3Cpath d='M54 48 C72 33 91 32 110 45' opacity='.28'/%3E%3Cpath d='M103 45 C119 32 136 34 151 45' opacity='.24'/%3E%3Cpath d='M16 206 C50 170 89 151 131 145 C91 175 54 195 16 206Z' fill='%235f7b5f' opacity='.08' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: center, right top, right bottom, right center;
  background-size: cover, 70% 80%, 72% 75%, min(360px, 72%) auto;
  opacity: 0.56;
  filter: saturate(0.82);
}

html[data-theme="night"] .essay-card,
html[data-theme="night"] .essay-empty {
  border-color: rgba(190, 211, 178, 0.17);
  background: rgba(22, 38, 31, 0.78);
}

html[data-theme="night"] .essay-card::before {
  background:
    linear-gradient(90deg, rgba(18, 31, 26, 0.97) 0%, rgba(19, 33, 27, 0.9) 54%, rgba(27, 47, 37, 0.58) 100%),
    radial-gradient(circle at 88% 18%, rgba(199, 217, 180, 0.1), transparent 30%),
    radial-gradient(circle at 82% 92%, rgba(216, 189, 117, 0.07), transparent 36%),
    url("assets/essays-night-spring.svg");
  background-repeat: no-repeat;
  background-position: center, right top, right bottom, right 42% center;
  background-size: cover, 68% 82%, 70% 76%, min(440px, 70%) auto;
  opacity: 0.7;
  filter: saturate(0.7);
}

html[data-theme="night"] .essay-card:nth-child(3n + 2)::before {
  background-position: center, right 8% top 4%, right bottom, right 16% center;
  opacity: 0.64;
}

html[data-theme="night"] .essay-card:nth-child(3n)::before {
  background-position: center, right top 10%, right 8% bottom, right -4% center;
  opacity: 0.62;
}

html[data-theme="night"] .essay-card p {
  color: rgba(241, 234, 216, 0.78);
}

html[data-theme="night"] .essay-kicker,
html[data-theme="night"] .essay-meta {
  color: var(--night-text-muted);
}

.essay-card:nth-child(3n + 2)::before {
  background-position: center, right 12% top 8%, right 2% bottom 4%, right 8% center;
  opacity: 0.5;
}

.essay-card:nth-child(3n)::before {
  background-position: center, right 4% top 12%, right 8% bottom 0, right -4% center;
  opacity: 0.48;
}

.essay-card > * {
  position: relative;
  z-index: 1;
}

.essay-kicker {
  margin-bottom: 8px;
  color: rgba(42, 35, 26, 0.58);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.essay-card h2 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-transform: none;
}

.essay-card h2 a {
  color: inherit;
  text-decoration: none;
}

.essay-card h2 a:hover,
.essay-card h2 a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.essay-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.essay-hero {
  display: block;
  width: 100%;
  height: auto;
  margin: 30px 0;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.essay-body p {
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.78;
}

.essay-sources {
  margin: 0;
  padding-left: 20px;
  color: rgba(42, 35, 26, 0.72);
  line-height: 1.65;
}

/* Leitura dos ensaios no modo Floresta Noturna. */
html[data-theme="night"] .essay-page > h1 {
  color: var(--night-text-primary);
}

html[data-theme="night"] .essay-page > .seo-lead {
  color: var(--night-text-primary);
}

html[data-theme="night"] .essay-page p,
html[data-theme="night"] .essay-page .essay-body p {
  color: var(--night-text-primary);
}

html[data-theme="night"] .essay-page .seo-meta,
html[data-theme="night"] .essay-page .essay-sources,
html[data-theme="night"] .essay-page .seo-breadcrumb {
  color: var(--night-text-primary);
}

html[data-theme="night"] .seo-breadcrumb [aria-current="page"] {
  color: var(--night-text-primary);
}

html[data-theme="night"] .essay-page .seo-question {
  border-left-color: var(--night-border-lit);
  color: var(--night-text-primary) !important;
}

html[data-theme="night"] .essay-page h2 {
  color: var(--night-text-primary);
}

@media (max-width: 720px) {
  .seo-container {
    width: min(100% - 20px, 880px);
    margin-top: 16px;
    margin-bottom: 44px;
  }

  .seo-card {
    padding: 22px 18px;
  }

  .seo-topbar {
    height: auto;
    min-height: 64px;
    gap: 12px;
  }

  .seo-home-link {
    padding: 8px 10px;
    font-size: 11px;
  }

  .seo-card p,
  .seo-article section p {
    font-size: 17px;
  }

  .seo-tale-image {
    margin: 18px auto 24px;
    border-radius: 14px;
  }

  .essay-body p {
    font-size: 18px;
  }

  .essay-card::before {
    background-position: center, right -18px top 4px, right -20px bottom -8px, right -28px center;
    background-size: cover, 76% 72%, 78% 70%, min(310px, 82%) auto;
    opacity: 0.42;
  }

  html[data-theme="night"] body.essays-page::before {
    background-position: 58% center;
    background-size: auto 100%;
    opacity: 0.24;
  }

  html[data-theme="night"] .essay-card::before,
  html[data-theme="night"] .essay-card:nth-child(3n + 2)::before,
  html[data-theme="night"] .essay-card:nth-child(3n)::before {
    background-position: center, right -12px top, right -18px bottom, right -72px center;
    background-size: cover, 72% 76%, 74% 72%, min(380px, 88%) auto;
    opacity: 0.48;
  }
}
