/* =========================================================
   site-shell.css — Cabeçalho, barra de categorias, busca e
   rodapé unificados do site Mensagens de Deus.
   Namespace .mdd-* para não conflitar com nenhum CSS antigo.
   ========================================================= */

:root {
  --mdd-bg: #fffdf7;
  --mdd-surface: #fbf6e9;
  --mdd-ink: #2e2b27;
  --mdd-text: #403e3b;
  --mdd-muted: #7a7266;
  --mdd-accent: #b8860b;
  --mdd-accent-dark: #8a6408;
  --mdd-gold: #d4af37;
  --mdd-rule: #f0e6c0;
}

/* ---------- cabeçalho ---------- */
.mdd-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 253, 245, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--mdd-rule);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* linha 1: logo + busca */
.mdd-header__topo {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1.2rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

.mdd-header__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.mdd-header__logo img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 100%;
}

.mdd-header__busca-btn {
  border: 1px solid var(--mdd-rule);
  background: #fff;
  border-radius: 100px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--mdd-muted);
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.mdd-header__busca-btn:hover,
.mdd-header__busca-btn:focus-visible {
  border-color: var(--mdd-gold);
  color: var(--mdd-accent);
}

.mdd-header__busca-btn svg { width: 18px; height: 18px; }

/* linha 2: barra de categorias */
.mdd-header__barra {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.2rem 0.5rem;
  box-sizing: border-box;
}

.mdd-header__nav {
  display: flex;
  gap: 0.2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0.15rem 0;
}

.mdd-header__nav::-webkit-scrollbar { display: none; }

.mdd-header__nav a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--mdd-muted);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.mdd-header__nav a:hover,
.mdd-header__nav a:focus-visible {
  background: rgba(184, 134, 11, 0.1);
  color: var(--mdd-accent-dark);
}

.mdd-header__nav a[aria-current="page"] {
  background: rgba(184, 134, 11, 0.13);
  color: var(--mdd-accent-dark);
  box-shadow: inset 0 -2px 0 var(--mdd-gold);
}

/* setas de rolagem */
.mdd-header__seta {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 1px solid var(--mdd-rule);
  border-radius: 100px;
  background: #fff;
  color: var(--mdd-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 3;
  box-shadow: 0 2px 10px rgba(46, 43, 39, 0.14);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mdd-header__seta:hover { border-color: var(--mdd-gold); background: var(--mdd-surface); }
.mdd-header__seta svg { width: 15px; height: 15px; }
.mdd-header__seta--esq { left: 0.35rem; }
.mdd-header__seta--dir { right: 0.35rem; }

/* escondidas por padrão; o JS mostra quando há para onde rolar.
   Se o CSS ou o JS falharem, elas simplesmente não aparecem. */
.mdd-header__seta[hidden] { display: none; }

/* degradê indicando conteúdo cortado */
.mdd-header__barra::before,
.mdd-header__barra::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0.5rem;
  width: 52px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 2;
}

.mdd-header__barra::before {
  left: 1.2rem;
  background: linear-gradient(90deg, rgba(255, 253, 245, 0.98), rgba(255, 253, 245, 0));
}

.mdd-header__barra::after {
  right: 1.2rem;
  background: linear-gradient(270deg, rgba(255, 253, 245, 0.98), rgba(255, 253, 245, 0));
}

.mdd-header__barra.tem-esq::before,
.mdd-header__barra.tem-dir::after { opacity: 1; }

.mdd-header__barra.tem-esq .mdd-header__nav { padding-left: 2rem; }
.mdd-header__barra.tem-dir .mdd-header__nav { padding-right: 2rem; }

@media (max-width: 640px) {
  .mdd-header__topo { padding: 0.6rem 0.9rem 0.45rem; }
  .mdd-header__barra { padding: 0 0.9rem 0.45rem; }
  .mdd-header__barra::before { left: 0.9rem; }
  .mdd-header__barra::after { right: 0.9rem; }
  .mdd-header__logo img { height: 30px; }
  .mdd-header__nav a { font-size: 0.83rem; padding: 0.38rem 0.6rem; }
  .mdd-header__seta { width: 27px; height: 27px; }
}

/* ---------- modal de busca ---------- */
.mdd-busca {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 16, 8, 0.45);
  padding: 4vh 1rem;
  align-items: flex-start;
  justify-content: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.mdd-busca.aberto { display: flex; }

.mdd-busca__caixa {
  width: 100%;
  max-width: 600px;
  max-height: 86vh;
  background: #fffdf5;
  border: 1px solid var(--mdd-rule);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mdd-busca__topo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--mdd-rule);
}

.mdd-busca__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  outline: none;
  color: var(--mdd-ink);
  font-family: inherit;
}

.mdd-busca__fechar {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--mdd-muted);
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

.mdd-busca__resultados {
  overflow-y: auto;
  padding: 0.6rem;
}

.mdd-busca__item {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--mdd-ink);
}

.mdd-busca__item:hover { background: rgba(184, 134, 11, 0.08); }

.mdd-busca__item .cat {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mdd-accent);
  margin-bottom: 0.15rem;
}

.mdd-busca__item .titulo { font-weight: 600; font-size: 0.98rem; }

.mdd-busca__vazio {
  padding: 1.4rem;
  text-align: center;
  color: var(--mdd-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- rodapé ---------- */
.mdd-footer {
  border-top: 1px solid var(--mdd-rule);
  margin-top: 4rem;
  padding: 2.4rem 1.5rem 3rem;
  background: var(--mdd-surface);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.mdd-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.mdd-footer__marca {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.mdd-footer__marca img { display: block; height: 32px; width: auto; }

.mdd-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.mdd-footer__links a {
  color: var(--mdd-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.mdd-footer__links a:hover { color: var(--mdd-accent); }

.mdd-footer__cats {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding-top: 1.2rem;
  margin-top: 0.4rem;
  border-top: 1px solid var(--mdd-rule);
}

.mdd-footer__cats a {
  color: var(--mdd-muted);
  text-decoration: none;
  font-size: 0.83rem;
}

.mdd-footer__cats a:hover { color: var(--mdd-accent); }

.mdd-footer__copy {
  width: 100%;
  font-size: 0.78rem;
  color: var(--mdd-muted);
  margin: 0;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--mdd-rule);
  line-height: 1.6;
}

/* ---------- link de acessibilidade ---------- */
.mdd-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--mdd-accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10000;
  text-decoration: none;
}

.mdd-skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- harmonização geral ---------- */
body.mdd-body {
  background: var(--mdd-bg);
  color: var(--mdd-text);
}

/* =========================================================
   ADIÇÕES — barra centralizada, ticker, placeholders, sidebar
   ========================================================= */

/* ---------- barra de categorias centralizada no desktop ---------- */
.mdd-header__nav { justify-content: flex-start; }

@media (min-width: 861px) {
  .mdd-header__nav {
    justify-content: center;
    gap: 0.35rem;
  }
  /* quando há overflow o JS marca .rolavel e volta ao alinhamento à esquerda */
  .mdd-header__nav.rolavel { justify-content: flex-start; }
  .mdd-header__nav a { font-size: 0.92rem; padding: 0.45rem 0.95rem; }
}

/* ---------- ticker de últimos artigos ---------- */
.mdd-ticker {
  position: relative;
  display: flex;
  align-items: stretch;
  background: linear-gradient(180deg, #fffdf5, #fbf6e9);
  border-bottom: 1px solid var(--mdd-rule);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  overflow: hidden;
  min-height: 40px;
}

.mdd-ticker[hidden] { display: none; }

.mdd-ticker__rotulo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0 0.9rem;
  background: linear-gradient(135deg, var(--mdd-gold), var(--mdd-accent-dark));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

.mdd-ticker__pulso {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.75);
  animation: mdd-pulso 1.8s infinite;
}

@keyframes mdd-pulso {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
  70%  { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.mdd-ticker__janela {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 42px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 42px), transparent);
}

.mdd-ticker__trilha {
  display: flex;
  align-items: center;
  width: max-content;
  animation: mdd-desliza var(--mdd-ticker-dur, 90s) linear infinite;
  will-change: transform;
}

.mdd-ticker:hover .mdd-ticker__trilha,
.mdd-ticker:focus-within .mdd-ticker__trilha { animation-play-state: paused; }

@keyframes mdd-desliza {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.mdd-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.2rem;
  margin-right: 1.6rem;
  color: var(--mdd-text);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.mdd-ticker__item:hover,
.mdd-ticker__item:focus-visible { color: var(--mdd-accent-dark); text-decoration: underline; }

.mdd-ticker__item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mdd-gold);
  flex-shrink: 0;
}

.mdd-ticker__item .cat {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mdd-accent);
}

@media (prefers-reduced-motion: reduce) {
  .mdd-ticker__trilha { animation: none; }
  .mdd-ticker__janela { overflow-x: auto; }
}

@media (max-width: 640px) {
  .mdd-ticker__rotulo { font-size: 0.65rem; padding: 0 0.65rem; letter-spacing: 0.05em; }
  .mdd-ticker__rotulo .txt { display: none; }
  .mdd-ticker__item { font-size: 0.8rem; margin-right: 1.2rem; }
}

/* ---------- placeholder para cards sem imagem ---------- */
.mdd-thumb-ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.55), transparent 60%),
    linear-gradient(135deg, #f7edcf 0%, #efe0b4 45%, #e8d7a4 100%);
  overflow: hidden;
  flex-shrink: 0;
}

.mdd-thumb-ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(184,134,11,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184,134,11,.07) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .55;
}

.mdd-thumb-ph svg {
  width: 44%;
  max-width: 130px;
  height: auto;
  color: rgba(184, 134, 11, 0.42);
  position: relative;
  z-index: 1;
}

.mdd-thumb-ph__cat {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 2;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(120, 88, 8, 0.72);
}

/* garante proporção estável também nas imagens reais dos cards */
.card-thumb { background: #f7edcf; }

/* ---------- layout com barra lateral ---------- */
.mdd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .mdd-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 2.4rem; }
}

.mdd-side {
  display: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

@media (min-width: 1024px) {
  .mdd-side {
    display: block;
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 124px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding-right: 4px;
  }
}

.mdd-side__bloco { margin-bottom: 1.5rem; }

.mdd-side__titulo {
  margin: 0 0 0.7rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mdd-accent);
}

.mdd-side__lista { list-style: none; margin: 0; padding: 0; }
.mdd-side__lista li { margin: 0 0 2px; }

.mdd-side__lista a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mdd-text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mdd-side__lista a:hover,
.mdd-side__lista a:focus-visible {
  background: rgba(184, 134, 11, 0.1);
  color: var(--mdd-accent-dark);
  transform: translateX(2px);
}

.mdd-side__lista a[aria-current="page"] {
  background: rgba(184, 134, 11, 0.15);
  color: var(--mdd-accent-dark);
  box-shadow: inset 3px 0 0 var(--mdd-gold);
}

.mdd-side__lista .ico {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.18);
  color: var(--mdd-accent-dark);
  font-size: 0.78rem;
}

.mdd-side__lista .n {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mdd-muted);
}

.mdd-side__recentes { list-style: none; margin: 0; padding: 0; }

.mdd-side__recentes li { border-top: 1px solid var(--mdd-rule); }
.mdd-side__recentes li:first-child { border-top: 0; }

.mdd-side__recentes a {
  display: block;
  padding: 0.6rem 0.1rem;
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--mdd-text);
  text-decoration: none;
}

.mdd-side__recentes a:hover { color: var(--mdd-accent-dark); }
.mdd-side__recentes .cat {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mdd-accent);
  margin-bottom: 2px;
}

.mdd-side__cta {
  display: block;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(160deg, #fffdf5, #f6ecd2);
  border: 1px solid var(--mdd-rule);
  text-decoration: none;
  color: var(--mdd-text);
}

.mdd-side__cta strong { display: block; color: var(--mdd-ink); margin-bottom: 4px; font-size: 0.95rem; }
.mdd-side__cta span { font-size: 0.82rem; color: var(--mdd-muted); line-height: 1.45; }
