:root,
[data-theme="light"] {
  --ink: #1a1f26;
  --muted: #5c6570;
  --line: #dde3ea;
  --white: #ffffff;
  --paper: #f6f8fa;
  --surface: #eef1f5;
  --green: #1a7f37;
  --yellow: #9a6700;
  --blue: #0969da;
  --accent-glow: rgba(9, 105, 218, 0.12);
  --max: 1000px;
  --content: 680px;
}

[data-theme="dark"] {
  --ink: #e8eaed;
  --muted: #9aa0a6;
  --line: #1a1a1a;
  --white: #000000;
  --paper: #0a0a0a;
  --surface: #0a0a0a;
  --green: #3fb950;
  --yellow: #d4a72c;
  --blue: #58a6ff;
  --accent-glow: rgba(88, 166, 255, 0.12);
}

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

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  overflow-x: hidden;
  background: var(--white);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(9, 105, 218, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(26, 127, 55, 0.04), transparent);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] body {
  background-image: none;
}

a { color: inherit; text-decoration: none; }

img, video, iframe {
  max-width: 100%;
}

/* Logo + marca */
.brand {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px 10px;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  animation: logo-spin 12s linear infinite;
}

@keyframes logo-spin {
  0%, 88% { transform: rotate(0deg); }
  92% { transform: rotate(8deg); }
  96% { transform: rotate(-6deg); }
  100% { transform: rotate(0deg); }
}

.brand-brazil {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--blue), var(--green));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brasil 5s linear infinite;
}

@keyframes brasil {
  to { background-position: 300% center; }
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.site-head__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-head__side {
  position: absolute;
  top: 12px;
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.site-head__center {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 0 76px;
  box-sizing: border-box;
}

.site-head__title {
  justify-content: center;
}

/* Tema + idioma sempre compactos no header */
.site-head__side .lang button {
  min-height: 20px;
  min-width: 24px;
  padding: 3px 6px;
  font-size: 8px;
}

.site-head__side .theme-toggle {
  min-width: 0;
  min-height: 0;
  padding: 2px;
  flex-shrink: 0;
}

.site-head__side .theme-toggle__track {
  width: 32px;
  height: 18px;
}

.site-head__side .theme-toggle__thumb {
  width: 12px;
  height: 12px;
  top: 2px;
  left: 2px;
}

.site-head__side .theme-toggle.is-light .theme-toggle__thumb {
  transform: translateX(14px);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  width: 100%;
  margin-top: 10px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.menu a { color: var(--muted); transition: color 0.2s; }
.menu a:hover, .menu a.is-active { color: var(--ink); }

.nav-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-fx {
  font-size: 10px;
  font-weight: 600;
  color: #f85149;
  animation: live-pulse 2s ease-in-out infinite;
}

.live-fx::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: #f85149;
  vertical-align: middle;
  animation: live-dot 1.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes live-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

.nav-donate {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(90deg, var(--green), var(--yellow), var(--blue)) border-box;
  animation: donate-glow 3s ease-in-out infinite;
}

@keyframes donate-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.06); }
}

.lang {
  display: flex;
  justify-content: center;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1px;
  width: fit-content;
}

.lang--side {
  margin: 0;
}

.lang button {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
  padding: 3px 7px;
  min-height: 20px;
  min-width: 26px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.lang button.is-active {
  background: var(--blue);
  color: #fff;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 2px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover {
  border-color: var(--blue);
  box-shadow: 0 0 12px var(--accent-glow);
}

.theme-toggle__track {
  display: block;
  width: 36px;
  height: 20px;
  border-radius: 8px;
  background: var(--surface);
  position: relative;
}

.theme-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 6px;
  background: var(--blue);
  transition: transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle.is-light .theme-toggle__thumb {
  transform: translateX(16px);
  background: var(--yellow);
}

.theme-toggle__icon {
  font-size: 7px;
  line-height: 1;
  position: absolute;
}

.theme-toggle__icon--sun { opacity: 0; }
.theme-toggle__icon--moon { opacity: 1; }
.theme-toggle.is-light .theme-toggle__icon--sun { opacity: 1; }
.theme-toggle.is-light .theme-toggle__icon--moon { opacity: 0; }

/* Páginas internas */
.page {
  flex: 1;
  max-width: var(--content);
  margin: 0 auto;
  width: 100%;
  padding: 32px 20px 48px;
}

.page--news {
  max-width: 760px;
}

.page--projetos {
  max-width: 640px;
}

.projetos-block {
  margin-top: 8px;
}

.projetos-block__text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 14px;
}

.projetos-block__status {
  margin-top: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}

.page--article {
  max-width: 720px;
}

.page--article .article-back {
  margin-bottom: 16px;
}


.foot,
.site-foot {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  background: var(--white);
  margin-top: auto;
}

.article-back {
  font-size: 11px;
  margin-bottom: 20px;
}

.article-back a {
  color: var(--muted);
}

.article-back a:hover { color: var(--ink); }

.donate-card__hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.donate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pix-qr-panel {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.pix-qr {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  width: min(220px, 100%);
  height: auto;
}

.hidden {
  display: none !important;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-lead {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

/* Confetti */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Notícias lista */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-card {
  --news-thumb-w: 300px;
  --news-thumb-h: 200px;
  position: relative;
  display: grid;
  grid-template-columns: var(--news-thumb-w) 1fr;
  gap: 0 20px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: visible;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.news-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.news-card:has(.share-menu.is-open) {
  z-index: 5;
}

.news-card__media {
  display: block;
  width: var(--news-thumb-w);
  height: var(--news-thumb-h);
  min-height: var(--news-thumb-h);
  max-height: var(--news-thumb-h);
  flex-shrink: 0;
  align-self: start;
  background: var(--paper);
  overflow: hidden;
  border-radius: 7px 0 0 7px;
  position: relative;
}

.news-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.news-card:hover .news-card__media img {
  transform: scale(1.04);
}

.news-card__media--empty {
  width: var(--news-thumb-w);
  height: var(--news-thumb-h);
  min-height: var(--news-thumb-h);
  max-height: var(--news-thumb-h);
  background: linear-gradient(145deg, var(--paper) 0%, var(--line) 100%);
  border-radius: 7px 0 0 7px;
}

.news-card__body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: center;
}

.news-card__date {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.news-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__title a:hover {
  color: var(--green);
}

.news-card__excerpt {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.news-card__read {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 14px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.news-card__read:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.news-card__share {
  margin-left: auto;
}

@media (max-width: 640px) {
  .news-card {
    --news-thumb-w: 100%;
    --news-thumb-h: 200px;
    grid-template-columns: 1fr;
  }

  .news-card__media,
  .news-card__media--empty {
    border-radius: 7px 7px 0 0;
  }

  .news-card__media,
  .news-card__media--empty {
    width: 100%;
    height: var(--news-thumb-h);
    min-height: var(--news-thumb-h);
    max-height: var(--news-thumb-h);
  }

  .news-card__body {
    padding: 14px 16px 16px;
  }

  .news-card__share {
    margin-left: 0;
  }
}

/* Share */
.share-wrap { position: relative; display: inline-block; }

.share-btn {
  border: 1px solid var(--line);
  background: var(--white);
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
}

.share-btn:hover { color: var(--ink); border-color: var(--blue); }

.share-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 20;
  display: none;
  flex-direction: column;
  padding: 4px 0;
}

.share-menu.is-open { display: flex; }

.share-menu a,
.share-menu button {
  border: none;
  background: none;
  font: inherit;
  font-size: 11px;
  text-align: left;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--ink);
}

.share-menu a:hover,
.share-menu button:hover { background: var(--paper); }

/* Artigo — barra interna: logo, leitura, data, compartilhar */
.article-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}

.article-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink);
  flex-shrink: 0;
}

.article-topbar__brand:hover {
  color: var(--green);
}

.article-topbar__brand img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.article-topbar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: 1;
  min-width: 0;
}

.article-topbar__read,
.article-topbar__date {
  white-space: nowrap;
}

.article-topbar__date::before {
  content: '·';
  margin-right: 8px;
  opacity: 0.5;
}

.article-topbar__share {
  flex-shrink: 0;
  margin-left: auto;
}

.article-topbar__share .share-wrap {
  display: inline-block;
}

@media (max-width: 480px) {
  .article-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .article-topbar__share {
    margin-left: 0;
    width: 100%;
  }
  .article-topbar__date::before {
    display: none;
  }
  .article-topbar__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

.article-title {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.article-figure {
  margin: 0 0 20px;
  width: 100%;
  height: clamp(180px, 42vw, 360px);
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.article-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.article-lead {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.article-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
}

.article-body h2 {
  font-size: 1.1rem;
  margin: 1.5em 0 0.5em;
}

.article-body p { margin-bottom: 1em; }

.article-body a { text-decoration: underline; color: var(--blue); }

.article-body code {
  font-size: 0.9em;
  background: var(--paper);
  padding: 2px 5px;
  border-radius: 3px;
}

.article-body .md-figure,
.md-figure {
  margin: 1.25em 0;
  width: 100%;
  height: clamp(200px, 45vw, 400px);
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.article-body .md-figure img,
.md-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.article-body pre {
  background: var(--paper);
  padding: 14px;
  overflow-x: auto;
  margin: 1em 0;
  border-radius: 4px;
  font-size: 12px;
}

.article-body .twitter-tweet {
  margin: 1.25em auto;
  max-width: 100%;
}

.article-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.views-count { color: var(--muted); }

/* Doações */
.donate-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--white);
  transition: border-color 0.3s, background 0.3s;
}

.donate-card.is-paid {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.12);
  animation: donate-thanks 0.5s ease;
}

@keyframes donate-thanks {
  0% { transform: scale(1); }
  40% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

.donate-card__title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.pix-box {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: var(--paper);
  padding: 12px;
  border-radius: 4px;
  word-break: break-all;
  margin: 10px 0;
}

.btn {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: var(--white);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.btn:hover { opacity: 0.9; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

/* Sobre mim (ex-Contato) */
.contact-page {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.contact-photo-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 24px;
}

.contact-photo-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--yellow), var(--blue), var(--green));
  background-size: 300% 300%;
  animation: contact-ring-spin 6s linear infinite;
  z-index: 0;
}

.contact-photo-wrap.is-loaded .contact-photo {
  opacity: 1;
  transform: scale(1);
}

.contact-photo-wrap.is-missing .contact-photo {
  opacity: 0;
}

.contact-photo-wrap.is-missing::after {
  content: '?';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
  z-index: 1;
}

.contact-photo {
  position: relative;
  z-index: 1;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--paper);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease, transform 0.5s ease;
  animation: contact-photo-float 4s ease-in-out infinite;
}

@keyframes contact-ring-spin {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes contact-photo-float {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02) translateY(-6px); }
}

.contact-quips {
  margin-bottom: 24px;
}

.contact-msg {
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 12px;
  font-weight: 500;
}

.contact-sub {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 16px;
  margin-bottom: 28px;
}

.social {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social a {
  border: 1px solid var(--line);
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
}

.social a:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Home layout */
.home-layout {
  flex: 1;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: min(58vh, 480px);
}

.home-visual {
  position: relative;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.home-visual__slides { position: absolute; inset: 0; }

.home-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2.2s ease;
}

.home-slide img { width: 100%; height: 100%; object-fit: cover; }

.home-slide.is-active { opacity: 1; z-index: 1; }

.home-slide.is-leaving { opacity: 0; transition: opacity 2.2s ease; }

.home-visual__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 2;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--blue));
  transition: width 0.15s linear;
}

.home-copy {
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
}

.home-copy.is-text-in .home-copy__tag,
.home-copy.is-text-in .home-copy__phrase,
.home-copy.is-text-in .home-copy__sub,
.home-copy.is-text-in .home-copy__hint {
  opacity: 1;
  transform: translateY(0);
}

.home-copy__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 10px;
  color: var(--muted);
}

.home-copy__tag {
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.home-copy__phrase {
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.65s ease 0.05s, transform 0.65s ease 0.05s;
}

.home-copy__sub {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.65s ease 0.1s, transform 0.65s ease 0.1s;
}

.home-copy__hint {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.65s ease 0.14s, transform 0.65s ease 0.14s;
}

.home-copy__hint a {
  color: var(--blue);
  text-decoration: none;
}

.home-copy__hint a:hover {
  text-decoration: underline;
}

.home-copy__ctrl {
  margin-top: 22px;
  display: flex;
  gap: 16px;
  font-size: 11px;
}

.home-copy__ctrl button {
  border: none;
  background: none;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.home-thumbs {
  margin-top: 20px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.home-thumb {
  width: 44px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.45;
}

.home-thumb img { width: 100%; height: 100%; object-fit: cover; }

.home-thumb.is-active { opacity: 1; border-color: var(--green); }

/* Home recent news */
.home-recent {
  flex: 1;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--line);
}

.home-recent__head {
  margin-bottom: 20px;
}

.home-recent__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}

.home-recent__lead {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  max-width: 48ch;
}

.home-recent__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.home-recent__item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.home-recent__item:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.home-recent__media {
  display: block;
  width: 96px;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  flex-shrink: 0;
  align-self: start;
  background: var(--paper);
  overflow: hidden;
}

.home-recent__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-recent__media--empty {
  background: linear-gradient(145deg, var(--paper) 0%, var(--line) 100%);
}

.home-recent__body {
  padding: 10px 12px 10px 0;
  min-width: 0;
}

.home-recent__date {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.home-recent__item-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-recent__item-title a:hover {
  color: var(--green);
}

.home-recent__excerpt {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-recent__empty {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  padding: 16px 0;
}

.home-recent__more {
  display: inline-block;
  margin-top: 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  transition: color 0.2s;
}

.home-recent__more:hover {
  color: var(--green);
}

/* News search */
.news-page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 8px;
}

.news-page__head .page-title {
  margin-bottom: 0;
}

.news-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-search__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.25s, transform 0.2s;
}

.news-search__toggle:hover,
.news-search.is-open .news-search__toggle {
  border-color: var(--blue);
  color: var(--ink);
  box-shadow: 0 0 16px var(--accent-glow);
}

.news-search__icon {
  font-size: 14px;
  transition: transform 0.3s ease;
}

.news-search.is-open .news-search__icon {
  transform: rotate(90deg) scale(1.1);
}

.news-search__panel {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-width 0.35s ease, opacity 0.25s ease;
}

.news-search.is-open .news-search__panel {
  max-width: 240px;
  opacity: 1;
  pointer-events: auto;
}

.news-search__input {
  width: 200px;
  border: 1px solid var(--line);
  background: var(--white);
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 20px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.news-search__input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.news-search__clear {
  border: none;
  background: var(--paper);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}

.news-search__clear:hover {
  color: var(--ink);
  background: var(--line);
}

.news-search__hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px;
}

@media (max-width: 1000px) {
  .home-recent {
    padding: 24px 16px 36px;
  }

  .home-recent__list {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .menu {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
  }
}

@media (max-width: 640px) {
  .site-head__inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "center"
      "side"
      "menu";
    gap: 6px;
    align-items: center;
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  }

  .site-head__center {
    grid-area: center;
    padding: 0;
    width: 100%;
    gap: 4px;
  }

  .site-head__side {
    position: static;
    grid-area: side;
    justify-content: center;
    width: 100%;
  }

  .menu {
    grid-area: menu;
    margin-top: 0;
    padding: 6px 4px 0;
    font-size: 11px;
    gap: 6px 12px;
    border-top: 1px solid var(--line);
  }

  .brand {
    gap: 6px;
  }

  .brand-brazil {
    letter-spacing: 0.12em;
    text-indent: 0.12em;
    font-size: clamp(0.72rem, 3.6vw, 0.9rem);
  }

  .logo-mark {
    width: 24px;
    height: 24px;
  }

  .news-page__head {
    flex-direction: column;
    align-items: stretch;
  }

  .news-page__head .page-title {
    width: 100%;
  }

  .news-search {
    width: 100%;
    justify-content: flex-end;
  }

  .news-search.is-open .news-search__panel {
    max-width: min(220px, calc(100vw - 48px));
  }

  .news-search__input {
    width: min(180px, calc(100vw - 100px));
  }
}

@media (max-width: 760px) {
  .home-layout {
    grid-template-columns: 1fr;
    grid-template-rows: min(40vh, 280px) auto;
    min-height: auto;
  }

  .home-visual { border-right: none; border-bottom: 1px solid var(--line); }
  .home-copy { padding: 20px 16px 24px; }
  .home-recent__list { grid-template-columns: 1fr; }
  .home-recent { padding: 22px 16px 32px; }

  .menu {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .home-copy__ctrl button {
    min-height: 44px;
    padding: 8px 4px;
  }

  .news-search__toggle,
  .news-search__clear {
    min-height: 44px;
    min-width: 44px;
  }

  .share-btn {
    min-height: 44px;
    padding: 10px 14px;
  }

  .social {
    flex-direction: column;
    align-items: stretch;
  }

  .social a {
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .donate-actions .btn {
    min-height: 44px;
    flex: 1 1 auto;
  }

  .foot,
  .site-foot {
    padding: 16px;
    font-size: 11px;
    line-height: 1.5;
  }
}

@media (max-width: 480px) {
  .site-head__inner {
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  }

  .menu { font-size: 11px; gap: 6px 14px; }
  .page { padding: 24px max(14px, env(safe-area-inset-right, 0px)) 40px max(14px, env(safe-area-inset-left, 0px)); }
  .share-menu { left: 0; right: auto; max-width: calc(100vw - 24px); }
  .home-recent__item { grid-template-columns: 72px 1fr; }
  .home-recent__media { width: 72px; height: 54px; }
  .home-copy__phrase { font-size: 1.15rem; }
  .home-thumbs { gap: 4px; }
  .home-thumb { width: 40px; height: 28px; }
  .contact-photo-wrap { width: 140px; height: 140px; }
  .contact-photo { width: 132px; height: 132px; }
  .contact-msg { font-size: 0.95rem; }
  .article-body img { max-width: 100%; height: auto; }
  .article-body pre {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 360px) {
  .site-head__side .lang button {
    min-width: 22px;
    padding: 2px 5px;
    font-size: 7px;
  }

  .site-head__side .theme-toggle__track {
    width: 28px;
    height: 16px;
  }

  .site-head__side .theme-toggle__thumb {
    width: 10px;
    height: 10px;
  }

  .site-head__side .theme-toggle.is-light .theme-toggle__thumb {
    transform: translateX(12px);
  }
}

/* source-guard overlay */
body.sg-lock {
  overflow: hidden;
}

#sec-source-guard {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

#sec-source-guard.is-on {
  opacity: 1;
  pointer-events: auto;
}

#sec-source-guard.is-closing {
  opacity: 0;
  pointer-events: none;
}

#sec-source-guard .sg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

#sec-source-guard .sg-box {
  position: relative;
  max-width: 400px;
  width: 100%;
  text-align: center;
  padding: 32px 28px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: 13px/1.55 Inter, system-ui, sans-serif;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  animation: sg-pop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

#sec-source-guard.is-closing .sg-box {
  animation: sg-out 0.28s ease forwards;
}

@keyframes sg-pop {
  0% { opacity: 0; transform: scale(0.88) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes sg-out {
  to { opacity: 0; transform: scale(0.94) translateY(8px); }
}

#sec-source-guard .sg-icon {
  font-size: 2.4rem;
  margin: 0 0 12px;
  animation: sg-wiggle 0.6s ease 0.15s 2;
}

@keyframes sg-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

#sec-source-guard .sg-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--blue);
}

#sec-source-guard .sg-msg {
  margin: 0 0 22px;
  color: var(--muted);
}

#sec-source-guard .sg-close {
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#sec-source-guard .sg-close:hover {
  background: var(--accent-glow);
}
