/* A odisseia do puto — tema preto, branco e verde, design focado em leitura */

:root {
  --bg: #0a0a0a;
  --bg-card: #111;
  --text: #e8e8e8;
  --text-muted: #999;
  --accent: #00cc66;
  --accent-soft: #00a050;
  --accent-bright: #33ff99;
  --accent-dim: #0d2818;
  --border: #00cc66;
  --border-soft: #1a3d2e;
  --reading-width: 65ch;
  --reading-line-height: 1.75;
}

/* ---- Fundo estático + fog ---- */
html {
  overflow-x: hidden;
}

body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  min-height: 100vh;
  overflow-x: hidden;
}

.fog-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fog-layer {
  position: absolute;
  inset: -20%;
  background: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    rgba(0, 60, 30, 0.25) 0%,
    rgba(0, 40, 20, 0.12) 40%,
    transparent 70%
  );
  opacity: 0.45;
  will-change: transform, opacity;
  transition: opacity 0.5s ease;
}

.fog-layer-2 {
  background: radial-gradient(
    ellipse 70% 80% at 80% 60%,
    rgba(0, 80, 40, 0.2) 0%,
    rgba(0, 30, 15, 0.08) 50%,
    transparent 75%
  );
}

.fog-layer-3 {
  background: radial-gradient(
    ellipse 60% 70% at 20% 70%,
    rgba(0, 50, 25, 0.18) 0%,
    transparent 60%
  );
}

.fog-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 100% 100% at 50% 50%,
    transparent 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
}

.site-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: 56px; /* espaço para navbar fixa */
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.site-wrap > nav,
.site-wrap > footer {
  align-self: stretch;
  width: 100%;
}
.site-wrap > hr {
  align-self: stretch;
}

a {
  color: var(--accent-bright) !important;
}
a:hover, a:focus {
  color: var(--accent) !important;
  text-decoration: underline !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
  color: var(--text) !important;
  border-bottom: 1px dotted var(--border-soft);
  padding-bottom: 0.25em;
}

/* Navbar — sempre fundo escuro, estilo 2003 */
.navbar-custom {
  background: var(--bg-card) !important;
  border-bottom: 2px solid var(--border) !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 3;
}
.navbar-custom .navbar-brand {
  color: var(--accent) !important;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 8px;
  padding-bottom: 8px;
}
.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus {
  color: var(--accent-bright) !important;
}
.navbar-custom .navbar-logo {
  height: 52px;
  width: auto;
  display: block;
  vertical-align: middle;
}
.navbar-custom .navbar-brand-text {
  font-size: 1.1em;
}
@media (max-width: 767px) {
  .navbar-custom .navbar-logo {
    height: 44px;
  }
}
.navbar-custom .nav li a {
  color: var(--text) !important;
}
.navbar-custom .nav li a:hover,
.navbar-custom .nav li a:focus {
  color: var(--accent) !important;
}

/* Seletor de idioma (PT / EN) no topo */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 15px 10px;
}
.lang-label {
  font-size: 0.75rem;
  color: var(--text-muted) !important;
  margin-right: 0.25rem;
}
.lang-btn {
  font-family: Verdana, Tahoma, "Trebuchet MS", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-soft);
  color: var(--text) !important;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.lang-btn:hover {
  border-color: var(--accent-soft);
  color: var(--accent-bright) !important;
}
.lang-btn.is-active {
  background: var(--accent) !important;
  color: var(--bg) !important;
  border-color: var(--accent);
}
.lang-btn:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

/* Mostrar/ocultar por idioma — só troca onde existe .has-en (evita header sumir quando não tem versão EN) */
.lang-en {
  display: none !important;
}
.site-lang-en .has-en .lang-pt {
  display: none !important;
}
.site-lang-en .has-en .lang-en {
  display: block !important;
}

.navbar-custom .navbar-toggle .icon-bar {
  background: var(--accent) !important;
}
@media (min-width: 768px) {
  .navbar-custom {
    background: var(--bg-card) !important;
    border-bottom: 2px solid var(--border) !important;
  }
  .navbar-custom .navbar-brand,
  .navbar-custom .nav li a {
    color: var(--text) !important;
  }
  .navbar-custom .navbar-brand:hover,
  .navbar-custom .nav li a:hover {
    color: var(--accent) !important;
  }
}
.navbar-custom.is-fixed {
  background-color: var(--bg-card) !important;
  border-bottom: 2px solid var(--border) !important;
}
.navbar-custom.is-fixed .navbar-brand,
.navbar-custom.is-fixed .nav li a {
  color: var(--text) !important;
}
.navbar-custom.is-fixed .navbar-brand:hover,
.navbar-custom.is-fixed .nav li a:hover {
  color: var(--accent) !important;
}

/* Conteúdo no meio da tela — largura máxima e centralizado */
.intro-header,
article.reading-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.intro-header .intro-header-overlay {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.intro-header .container,
article.reading-content .container {
  max-width: 720px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.reading-content .container {
  max-width: 720px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.intro-header .container .row,
article.reading-content .container .row {
  margin-left: 0;
  margin-right: 0;
}
.intro-header .container [class*="col-"],
article.reading-content .container [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0;
  margin-right: 0;
}
/* Home, Sobre e páginas — centralizado no meio da tela */
.site-wrap > .container,
.site-wrap > .page-main,
.container.page-main {
  max-width: 720px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 15px;
  padding-right: 15px;
  display: block;
  box-sizing: border-box;
  flex-shrink: 0;
  align-self: center; /* centraliza o bloco no flex (evita desalinhamento no Sobre) */
}
.site-wrap > .container .row,
.container.page-main .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.site-wrap > .container [class*="col-"],
.container.page-main [class*="col-"] {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.intro-header {
  align-self: stretch;
  width: 100%;
}
/* Conteúdo da página Sobre (e outras) com largura controlada */
.page-main .about-team,
.page-main .about-tags,
.page-main .about-subscription,
.page-main .about-footer {
  max-width: 100%;
}

@media (max-width: 767px) {
  .reading-content .container,
  article.reading-content .container,
  .intro-header .container,
  .site-wrap > .container,
  .container.page-main {
    max-width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Header das páginas e posts — próximo do conteúdo, faixa verde */
.intro-header {
  background: var(--bg) !important;
  background-image: none !important;
  border-bottom: 3px solid var(--border);
  margin-bottom: 1.25rem;
}
.intro-header .site-heading,
.intro-header .post-heading,
.intro-header .page-heading {
  padding: 4.5rem 0 1.5rem;
  color: var(--text) !important;
}
@media (min-width: 768px) {
  .intro-header .site-heading,
  .intro-header .post-heading,
  .intro-header .page-heading {
    padding: 5rem 0 1.75rem;
  }
}
.intro-header .site-heading h1,
.intro-header .page-heading h1,
.intro-header .post-heading h1 {
  color: var(--text) !important;
  font-size: 1.5rem !important;
  line-height: 1.3;
  max-width: 100%;
  word-wrap: break-word;
}
.intro-header .post-heading h1 {
  font-size: 1.45rem !important;
}
.intro-header .site-heading .subheading,
.intro-header .page-heading .subheading,
.intro-header .post-heading .subheading,
.intro-header .post-heading .meta {
  color: var(--text-muted) !important;
}
.intro-header .post-heading .subheading {
  font-size: 1rem !important;
  font-weight: 500;
  line-height: 1.4;
}
.intro-header .post-heading .meta {
  font-size: 0.875rem !important;
}
@media (min-width: 768px) {
  .intro-header .site-heading h1,
  .intro-header .page-heading h1 {
    font-size: 1.75rem !important;
  }
  .intro-header .post-heading h1 {
    font-size: 1.65rem !important;
  }
  .intro-header .post-heading .subheading {
    font-size: 1.05rem !important;
  }
}
.intro-header .post-heading .meta a {
  color: var(--accent) !important;
}
.intro-header-overlay {
  background: transparent !important;
}
hr.small {
  border-color: var(--accent) !important;
  max-width: 80px;
}

/* Conteúdo principal */
.container .row {
  background: var(--bg);
}

/* ---- Experiência de leitura: texto certinho em qualquer tela ---- */
.post-body {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}
.reading-content p,
article p,
.post-body p {
  max-width: 100%;
  line-height: var(--reading-line-height);
  margin-bottom: 1.25em;
  font-size: 1.0625rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

article h1, article h2, article h3, article h4,
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
  max-width: 100%;
  word-wrap: break-word;
}
.post-body h1:first-child, article h1:first-child { margin-top: 0; }
.post-body h1, article h1 { font-size: 1.375rem !important; }
.post-body h2, article h2 { font-size: 1.25rem !important; }
.post-body h3, article h3 { font-size: 1.125rem !important; }
.post-body h4, article h4 { font-size: 1.0625rem !important; }

article ul, article ol,
.post-body ul, .post-body ol {
  max-width: 100%;
  line-height: var(--reading-line-height);
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

article li, .post-body li {
  margin-bottom: 0.35em;
}

article blockquote, .post-body blockquote {
  max-width: 100%;
}

.post-body img,
.post-body figure img {
  max-width: 100%;
  height: auto;
  display: block;
}
.post-body figure,
.post-body .highlight {
  max-width: 100%;
  overflow-x: auto;
}
.share-nav {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

blockquote {
  color: var(--text-muted) !important;
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
}

/* Filtro por tags (início da lista de posts) */
.filter-tags {
  margin-bottom: 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.filter-tags-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.filter-tags-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tag {
  font-family: Verdana, Tahoma, "Trebuchet MS", sans-serif;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.filter-tag:hover {
  color: var(--text);
  border-color: var(--border-soft);
}

.filter-tag.is-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Lista de posts na home */
.post-preview {
  padding: 1rem 0;
  border-bottom: 1px dotted var(--border-soft);
}
.post-preview > a {
  color: var(--text) !important;
}
.post-preview > a:hover {
  color: var(--accent) !important;
  text-decoration: none !important;
}
.post-preview > a > .post-title {
  color: var(--text) !important;
}
.post-preview > .post-meta {
  color: var(--text-muted) !important;
}
.post-preview > .post-meta > a {
  color: var(--accent) !important;
}

/* Pager — botões estilo 2003 */
.pager li > a,
.pager li > span {
  background: var(--bg-card) !important;
  color: var(--accent) !important;
  border: 1px solid var(--border) !important;
}
.pager li > a:hover,
.pager li > a:focus {
  background: var(--accent) !important;
  color: var(--bg) !important;
  border-color: var(--accent) !important;
}
.pager .disabled > a,
.pager .disabled > span {
  color: var(--text-muted) !important;
  background: var(--bg-card) !important;
  border-color: var(--border-soft) !important;
}

/* Footer */
footer {
  border-top: 2px solid var(--border);
  background: var(--bg-card) !important;
  padding: 2rem 0;
}
footer .copyright,
footer .copyright a {
  color: var(--text-muted) !important;
}
footer .copyright a:hover {
  color: var(--accent) !important;
}
footer .list-inline a {
  color: var(--text-muted) !important;
}
footer .list-inline a:hover {
  color: var(--accent) !important;
}
footer .fa-circle {
  color: var(--border-soft) !important;
}
footer .fa-inverse {
  color: var(--bg) !important;
}

/* Share */
ul.share li a {
  color: var(--text-muted) !important;
}
ul.share li a:hover {
  color: var(--accent) !important;
}

/* Sobre */
.about-team {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}
.about-person {
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
}
.about-person h3 {
  color: var(--accent) !important;
  border: none;
  margin-top: 0;
}
.about-person .role {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.about-tags {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
}
.about-tags h3 {
  color: var(--accent) !important;
  border: none;
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.about-tags ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}
.about-tags li {
  margin-bottom: 0.25em;
}
.about-subscription {
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
}
.about-subscription h3 {
  color: var(--accent) !important;
  border: none;
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.about-subscription p {
  margin-bottom: 0.75em;
}
.about-footer {
  margin-top: 2rem;
  color: var(--text-muted);
}

/* Bloco de ad — televisão (criativo, com piada) */
.ad-tv {
  margin: 2rem 0;
  display: block;
  text-align: center;
  min-height: 280px;
}

.ad-tv-frame {
  display: inline-block;
  text-align: center;
  max-width: 100%;
  min-width: 0;
}

.ad-tv-screen {
  display: block;
  width: 100%;
  max-width: 300px;
  height: 250px;
  min-height: 200px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--bg-card) 0%, #0d1510 100%);
  border: 8px solid #222;
  border-radius: 8px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  box-sizing: border-box;
}

.ad-tv-screen::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  left: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  pointer-events: none;
}

.ad-tv-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  max-width: 90%;
  word-wrap: break-word;
}

.ad-tv-placeholder .ad-tv-label,
.ad-tv-placeholder .ad-tv-size {
  display: block;
}

.ad-tv-label {
  color: var(--accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.ad-tv-stand {
  display: block;
  width: 120px;
  height: 12px;
  margin: -2px auto 0;
  background: linear-gradient(180deg, #333 0%, #1a1a1a 100%);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.ad-tv-intro {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 1rem 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 0 0.5rem;
}

.ad-tv-joke {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.8;
  margin: 0.4rem 0 0;
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 0 0.25rem;
}

/* Ads injetadas pelo script (mesmo estilo) */
.ad-tv-injected {
  margin: 2rem 0;
}

/* HR */
hr {
  border-color: var(--border-soft) !important;
}

/* Blocos de código — tema escuro + responsivo (não quebrar em mobile) */
.highlight, .highlight pre, pre, .highlight .hll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.highlight pre, pre, .highlight .hll {
  background-color: #0d1117 !important;
  border: 1px solid var(--border-soft) !important;
  color: var(--text) !important;
  padding: 1rem !important;
  box-sizing: border-box;
}
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: #8b949e; font-style: italic; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr { color: var(--accent-bright); font-weight: bold; }
.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .s1 { color: #f0b849; }
.highlight .n, .highlight .na, .highlight .nb, .highlight .nc, .highlight .no, .highlight .ni, .highlight .ne, .highlight .nf, .highlight .nn, .highlight .nt, .highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: #79c0ff; }
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #a5d6ff; }
.highlight .o, .highlight .ow { color: var(--text-muted); }
.highlight .err { color: #f85149; }
.highlight .g, .highlight .gd, .highlight .ge, .highlight .gr, .highlight .gt { color: #f85149; }
.highlight .gi { color: var(--accent); }
.highlight .go, .highlight .gp, .highlight .gs, .highlight .gu { color: var(--text-muted); }
.highlight .sr, .highlight .ss { color: #7ee787; }
.highlight .bp { color: var(--text-muted); }
code { color: var(--accent-bright); background: var(--bg-card); padding: 0.2em 0.4em; border-radius: 2px; }

/* Selection */
::selection {
  background: var(--accent-soft);
  color: var(--bg);
}
::-moz-selection {
  background: var(--accent-soft);
  color: var(--bg);
}

/* ---- Responsividade: garantir que nada estoure em telas pequenas ---- */
@media (max-width: 767px) {
  .site-wrap {
    padding-top: 50px;
  }
  .intro-header .site-heading h1,
  .intro-header .page-heading h1,
  .intro-header .post-heading h1 {
    font-size: 1.35rem !important;
    word-wrap: break-word;
  }
  .intro-header .site-heading .subheading,
  .intro-header .page-heading .subheading,
  .intro-header .post-heading .subheading {
    font-size: 0.95rem !important;
  }
  .lang-switcher {
    padding: 10px 6px;
  }
  .lang-label {
    font-size: 0.7rem;
  }
  .lang-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }
  .filter-tags {
    padding-left: 0;
    padding-right: 0;
  }
  .filter-tags-buttons {
    gap: 0.35rem;
  }
  .filter-tag {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
  }
  .post-preview > a > .post-title {
    font-size: 1.15rem !important;
    word-wrap: break-word;
  }
  .post-body {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .post-body h1, article h1 { font-size: 1.25rem !important; }
  .post-body h2, article h2 { font-size: 1.15rem !important; }
  .ad-tv {
    margin: 1.5rem 0;
    min-height: 240px;
    padding: 0 0.5rem;
  }
  .ad-tv-screen {
    min-height: 180px;
  }
  .about-team {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .about-person,
  .about-tags,
  .about-subscription {
    padding: 1rem;
    min-width: 0;
  }
}

/* Imagens e tabelas não estouram o layout */
article img,
.reading-content img,
.post-preview img {
  max-width: 100%;
  height: auto;
}
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
