/* Base visual compartilhada pelo índice e pelas publicações do Blog. */

:where(html.page-blog) {
  --blog-bg: #f3f7ff;
  --blog-bg-strong: #eaf1ff;
  --blog-panel: rgba(255, 255, 255, 0.82);
  --blog-panel-strong: rgba(255, 255, 255, 0.96);
  --blog-text: #0f172a;
  --blog-heading: #07111f;
  --blog-muted: #526175;
  --blog-soft: #718096;
  --blog-border: rgba(148, 163, 184, 0.22);
  --blog-border-strong: rgba(5, 107, 246, 0.2);
  --blog-primary: #056bf6;
  --blog-primary-strong: #075fd6;
  --blog-cyan: #1bc7fb;
  --blog-violet: #8b5cf6;
  --blog-success: #16a34a;
  --blog-shadow: 0 24px 60px rgba(15, 23, 42, 0.11);
  --blog-shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.075);
  --blog-radius: 30px;
  color-scheme: light;
  scroll-behavior: smooth;
}

:where(html.page-blog.dark) {
  --blog-bg: #020202;
  --blog-bg-strong: #05080d;
  --blog-panel: rgba(4, 8, 14, 0.92);
  --blog-panel-strong: rgba(6, 11, 19, 0.97);
  --blog-text: #e5eefc;
  --blog-heading: #f8fafc;
  --blog-muted: #c0ccdc;
  --blog-soft: #91a0b5;
  --blog-border: rgba(96, 165, 250, 0.1);
  --blog-border-strong: rgba(56, 189, 248, 0.18);
  --blog-primary: #60a5fa;
  --blog-primary-strong: #93c5fd;
  --blog-cyan: #67e8f9;
  --blog-success: #4ade80;
  --blog-shadow: 0 28px 70px rgba(0, 2, 6, 0.62);
  --blog-shadow-soft: 0 18px 38px rgba(0, 2, 6, 0.48);
  color-scheme: dark;
}

:where(html.page-blog),
:where(html.page-blog) body {
  min-height: 100%;
}

:where(html.page-blog) *,
:where(html.page-blog) *::before,
:where(html.page-blog) *::after {
  box-sizing: border-box;
}

:where(html.page-blog) body {
  position: relative;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--blog-text);
  background:
    radial-gradient(circle at 12% 4%, rgba(5, 107, 246, 0.16), transparent 25%),
    radial-gradient(circle at 88% 12%, rgba(27, 199, 251, 0.15), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, var(--blog-bg) 38%, #f7faff 100%);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:where(html.page-blog.dark) body {
  background: #020202;
}

:where(html.page-blog) body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(5, 107, 246, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5, 107, 246, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 78%);
}

:where(html.page-blog.dark) body::before {
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.025) 1px, transparent 1px);
  opacity: 0.5;
}

:where(html.page-blog) img {
  max-width: 100%;
}

:where(html.page-blog) button,
:where(html.page-blog) input {
  font: inherit;
}

:where(html.page-blog) a {
  color: inherit;
}

:where(html.page-blog) [hidden] {
  display: none !important;
}

:where(html.page-blog) ::selection {
  color: #ffffff;
  background: rgba(5, 107, 246, 0.82);
}

:where(html.page-blog) .skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #ffffff;
  background: var(--blog-primary-strong);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

:where(html.page-blog) .skip-link:focus {
  transform: translateY(0);
}

:where(html.page-blog) :focus-visible {
  outline: 3px solid rgba(5, 107, 246, 0.38);
  outline-offset: 4px;
}

:where(html.page-blog.dark) :focus-visible {
  outline-color: rgba(103, 232, 249, 0.48);
}

:where(html.page-blog) .blog-navbar {
  position: sticky;
  z-index: 1000;
  top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1220px, calc(100% - 24px));
  min-height: 80px;
  margin: 16px auto 0;
  padding: 8px 12px 8px 18px;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  background: var(--blog-panel);
  box-shadow: var(--blog-shadow-soft);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

:where(html.page-blog) .blog-logo {
  position: relative;
  display: block;
  width: 122px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 14px;
  background: url("/img/logo_light.png") no-repeat 50% 50% / contain;
  text-decoration: none;
}

:where(html.page-blog.dark) .blog-logo {
  background-image: url("/img/logo.png");
}

:where(html.page-blog) .blog-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

:where(html.page-blog) .blog-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--blog-text);
  font-size: 0.91rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 200ms ease,
    background-color 200ms ease,
    transform 200ms ease;
}

:where(html.page-blog) .blog-menu a:hover {
  color: var(--blog-primary-strong);
  background: rgba(5, 107, 246, 0.08);
  transform: translateY(-1px);
}

:where(html.page-blog) .blog-menu a.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #056bf6, #1bc7fb);
  box-shadow: 0 10px 22px rgba(5, 107, 246, 0.2);
}

:where(html.page-blog) .blog-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

:where(html.page-blog) .blog-theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 92px;
  height: 44px;
  padding: 0 13px;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  color: var(--blog-text);
  background: var(--blog-panel-strong);
  box-shadow: 0 9px 20px rgba(15, 23, 42, 0.07);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

:where(html.page-blog) .blog-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--blog-border-strong);
}

:where(html.page-blog) .blog-theme-toggle__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 36px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #056bf6, #1bc7fb);
  box-shadow: 0 10px 20px rgba(5, 107, 246, 0.26);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

:where(html.page-blog) .blog-theme-toggle.mode-dark .blog-theme-toggle__thumb {
  transform: translateX(46px);
}

:where(html.page-blog) .blog-theme-toggle i {
  position: relative;
  z-index: 1;
  width: 16px;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.72;
}

:where(html.page-blog) .blog-theme-toggle.mode-light .fa-sun,
:where(html.page-blog) .blog-theme-toggle.mode-dark .fa-moon {
  color: #ffffff;
  opacity: 1;
}

:where(html.page-blog) .blog-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  color: var(--blog-text);
  background: var(--blog-panel-strong);
  cursor: pointer;
}

:where(html.page-blog) .blog-menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 200ms ease,
    opacity 200ms ease;
}

:where(html.page-blog) .blog-menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

:where(html.page-blog) .blog-menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

:where(html.page-blog) .blog-menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

:where(html.page-blog) .blog-shell,
:where(html.page-blog) .article-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
}

:where(html.page-blog) .blog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 9px 14px;
  border: 1px solid rgba(5, 107, 246, 0.14);
  border-radius: 999px;
  color: var(--blog-primary-strong);
  background: rgba(5, 107, 246, 0.08);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

:where(html.page-blog.dark) .blog-eyebrow {
  border-color: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  background: rgba(5, 107, 246, 0.12);
}

:where(html.page-blog) .author-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

:where(html.page-blog) .author-meta__avatar {
  display: block;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 2px solid var(--blog-panel-strong);
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--blog-border);
}

:where(html.page-blog) .author-meta__copy {
  min-width: 0;
}

:where(html.page-blog) .author-meta__copy strong,
:where(html.page-blog) .author-meta__copy span {
  display: block;
}

:where(html.page-blog) .author-meta__copy strong {
  overflow: hidden;
  color: var(--blog-heading);
  font-size: 0.88rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(html.page-blog) .author-meta__copy span {
  margin-top: 3px;
  color: var(--blog-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}

:where(html.page-blog) .blog-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 24px auto 0;
  padding: 26px 0 max(26px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--blog-border);
  color: var(--blog-soft);
  text-align: center;
}

:where(html.page-blog) .blog-footer p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.65;
}

:where(html.page-blog) .reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0) scale(0.99);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

:where(html.page-blog) .reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (max-width: 1040px) {
  :where(html.page-blog) .blog-navbar {
    border-radius: 24px;
  }

  :where(html.page-blog) .blog-menu-button {
    display: block;
  }

  :where(html.page-blog) .blog-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--blog-border);
    border-radius: 24px;
    background: var(--blog-panel-strong);
    box-shadow: var(--blog-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.99);
    transform-origin: top center;
    transition:
      opacity 180ms ease,
      visibility 180ms ease,
      transform 180ms ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  :where(html.page-blog) .blog-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  :where(html.page-blog) .blog-menu a {
    width: 100%;
    min-height: 48px;
    border-radius: 15px;
  }
}

@media (max-width: 560px) {
  :where(html.page-blog) .blog-navbar {
    top: 10px;
    width: calc(100% - 20px);
    min-height: 70px;
    margin-top: 10px;
    padding: 7px 8px 7px 13px;
  }

  :where(html.page-blog) .blog-logo {
    width: 98px;
    height: 50px;
  }

  :where(html.page-blog) .blog-nav-actions {
    gap: 7px;
  }

  :where(html.page-blog) .blog-theme-toggle {
    width: 84px;
    height: 42px;
    padding: 0 11px;
  }

  :where(html.page-blog) .blog-theme-toggle__thumb {
    width: 34px;
    height: 32px;
  }

  :where(html.page-blog) .blog-theme-toggle.mode-dark .blog-theme-toggle__thumb {
    transform: translateX(42px);
  }

  :where(html.page-blog) .blog-shell,
  :where(html.page-blog) .article-shell,
  :where(html.page-blog) .blog-footer {
    width: calc(100% - 20px);
  }

  :where(html.page-blog) .blog-footer p {
    font-size: 0.76rem;
  }
}

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

  :where(html.page-blog) *,
  :where(html.page-blog) *::before,
  :where(html.page-blog) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  :where(html.page-blog) .reveal,
  :where(html.page-blog) .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
  }
}
