/* ==========================================================================
   RS Eletrônica — Site inteiro (cabeçalho com menu, rodapé, acessibilidade)
   Carregado em todas as páginas que usam os componentes de inc/rs-componentes.php
   (páginas, blog, categorias, busca, 404). Depende de rs-eletronica.css.
   ========================================================================== */

/* ---------- Acessibilidade ---------- */
.rs-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.rs-skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--rs-accent); color: #05131f; font-weight: 700; padding: 10px 16px;
  border-radius: var(--rs-radius); text-decoration: none; transition: top .15s ease;
}
.rs-skip:focus { top: 12px; }

.rs-landing a:focus-visible,
.rs-landing button:focus-visible,
.rs-landing summary:focus-visible {
  outline: 2px solid var(--rs-accent); outline-offset: 3px; border-radius: 2px;
}

/* ---------- Cabeçalho + menu ---------- */
.rs-site-header .rs-header-inner { gap: 20px; }
.rs-nav { display: flex; align-items: center; gap: 22px; }
.rs-nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.rs-nav-list > li { position: relative; }
.rs-nav-list a,
.rs-sub-toggle {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px;
  color: var(--rs-text-muted); font: inherit; font-size: 14.5px; text-decoration: none;
  background: none; border: 0; border-radius: var(--rs-radius); cursor: pointer;
}
.rs-nav-list a:hover,
.rs-sub-toggle:hover,
.rs-nav-list .is-current > a,
.rs-nav-list .is-current > .rs-sub-toggle { color: var(--rs-accent); }
.rs-nav-list [aria-current="page"] { color: var(--rs-accent); font-weight: 600; }
.rs-sub-toggle::after {
  content: ""; width: 6px; height: 6px; margin-left: 8px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease;
}
.rs-has-sub.is-open > .rs-sub-toggle::after { transform: rotate(-135deg); margin-top: 3px; }

.rs-sub {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 230px; margin: 0; padding: 8px; list-style: none;
  background: var(--rs-bg-card); border: 1px solid var(--rs-border); border-radius: var(--rs-radius);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}
.rs-sub a { display: flex; width: 100%; }
.rs-has-sub.is-open > .rs-sub { display: block; }
@media (hover: hover) and (min-width: 1081px) {
  .rs-has-sub:hover > .rs-sub,
  .rs-has-sub:focus-within > .rs-sub { display: block; }
}

.rs-nav-toggle {
  display: none; width: 46px; height: 46px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid var(--rs-border); border-radius: var(--rs-radius);
  align-items: center; justify-content: center;
}
.rs-nav-toggle-bars,
.rs-nav-toggle-bars::before,
.rs-nav-toggle-bars::after {
  display: block; width: 20px; height: 2px; background: var(--rs-text); border-radius: 2px;
  transition: transform .18s ease, background .18s ease;
}
.rs-nav-toggle-bars { position: relative; }
.rs-nav-toggle-bars::before,
.rs-nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.rs-nav-toggle-bars::before { top: -6px; }
.rs-nav-toggle-bars::after { top: 6px; }
.rs-nav-toggle[aria-expanded="true"] .rs-nav-toggle-bars { background: transparent; }
.rs-nav-toggle[aria-expanded="true"] .rs-nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.rs-nav-toggle[aria-expanded="true"] .rs-nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .rs-nav-toggle { display: inline-flex; }
  /* Sem JS o menu continua visível e utilizável; com JS (.rs-js) ele vira painel. */
  .rs-js .rs-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 55;
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px 24px 24px; background: #0b0f16; /* opaco (Fase 7B: rgba(...,0.98) deixava o hero visível atrás dos itens) */
    border-bottom: 1px solid var(--rs-border); max-height: calc(100vh - 80px); overflow-y: auto;
  }
  .rs-js .rs-nav.is-open { display: flex; }
  .rs-nav { flex-wrap: wrap; }
  .rs-nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .rs-nav-list a, .rs-sub-toggle { width: 100%; min-height: 48px; padding: 12px 4px; justify-content: space-between; font-size: 16px; border-bottom: 1px solid var(--rs-border); border-radius: 0; }
  .rs-sub { position: static; min-width: 0; padding: 0 0 0 14px; background: transparent; border: 0; box-shadow: none; }
  .rs-nav-cta { width: 100%; min-height: 48px; margin-top: 8px; }
}

/* Alvos de toque de pelo menos 44px (logo e ícones do rodapé). */
.rs-site-header .rs-logo { min-height: 44px; justify-content: center; }
.rs-site-footer .rs-footer-links { gap: 0 22px; }
.rs-site-footer .rs-footer-links a { display: inline-flex; align-items: center; min-height: 36px; }
@media (max-width: 900px) { .rs-site-footer .rs-footer-links a { min-height: 44px; } }
.rs-site-footer .rs-footer-social a { width: 44px; height: 44px; }

/* Rodapé: marca | links | WhatsApp em uma linha; os links quebram dentro da própria coluna. */
.rs-site-footer .rs-footer-top { display: grid; grid-template-columns: auto 1fr auto; gap: 20px 40px; align-items: center; }
.rs-site-footer .rs-footer-links { justify-content: flex-end; }
@media (max-width: 900px) {
  .rs-site-footer .rs-footer-top { grid-template-columns: 1fr; }
  .rs-site-footer .rs-footer-links { justify-content: flex-start; }
}

/* Serviço relacionado no CTA dos artigos */
.rs-cta-serv { margin: 22px 0 0; font-size: 14.5px; color: var(--rs-text-muted); }
.rs-cta-serv a { color: var(--rs-accent); font-weight: 600; }

/* Breadcrumb: links com área de toque adequada */
.rs-breadcrumb a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 2px; }

/* Áreas de toque de links soltos (404, sumário dos artigos) */
.rs-404-links a { display: inline-block; padding: 10px 0; }
.rs-article-toc a { display: inline-block; padding: 5px 0; }
