/* =========================================================
   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, 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; }
}

/* ---------- 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 (à direita) ---------- */
.mdd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

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

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

@media (min-width: 1024px) {
  .mdd-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    order: 2; /* fica à direita mesmo se vier antes do conteúdo no HTML */
  }
}

.mdd-side__bloco {
  background: #fff;
  border: 1px solid var(--mdd-rule);
  border-radius: 16px;
  padding: 1.2rem 1.2rem 0.9rem;
}

.mdd-side__titulo {
  margin: 0 0 0.8rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--mdd-rule);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--mdd-ink);
}

/* categorias */
.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.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--mdd-text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.mdd-side__lista .ico {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f6ecd0;
  color: var(--mdd-accent);
  font-size: 0.85rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.mdd-side__lista .n {
  margin-left: auto;
  min-width: 28px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--mdd-surface);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mdd-muted);
}

.mdd-side__lista a:hover,
.mdd-side__lista a:focus-visible { background: #fbf4e0; color: var(--mdd-ink); }
.mdd-side__lista a:hover .ico { background: var(--mdd-accent); color: #fff; }

.mdd-side__lista a[aria-current="page"] {
  background: #f6ecd0;
  color: var(--mdd-accent-dark);
  font-weight: 600;
}
.mdd-side__lista a[aria-current="page"] .ico { background: var(--mdd-accent); color: #fff; }

/* publicados agora */
.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: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0;
  text-decoration: none;
  color: var(--mdd-ink);
}

.mdd-side__recentes img {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
  background: #f7edcf;
}

.mdd-side__recentes .txt { min-width: 0; }

.mdd-side__recentes .cat {
  display: block;
  margin-bottom: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mdd-accent);
}

.mdd-side__recentes .tit {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.mdd-side__recentes a:hover .tit {
  color: var(--mdd-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* chamada para orações */
.mdd-side__cta {
  display: block;
  padding: 1.35rem 1.25rem;
  border-radius: 16px;
  background: #1f3566;
  color: #e9e1cc;
  text-decoration: none;
}
.mdd-side__cta strong {
  display: block;
  margin-bottom: 0.4rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.22rem;
  line-height: 1.25;
  color: #fff;
}
.mdd-side__cta span { display: block; font-size: 0.85rem; line-height: 1.5; opacity: 0.85; }
.mdd-side__cta em {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: var(--mdd-gold);
  color: #1c1a15;
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s ease;
}
.mdd-side__cta:hover em { background: #e2c25a; }

.mdd-side a:focus-visible { outline: 2px solid var(--mdd-accent); outline-offset: 2px; }
