:root{
  --bg:#f7f9fc;
  --text:#1f2a44;
  --muted:#6b7a90;
  --brand:#1e88e5;
  --brand-700:#1565c0;
  --card:#ffffff;
  --shadow:0 8px 24px rgba(0,0,0,.08);
  --shadow-sm:0 4px 12px rgba(0,0,0,.06);
  --ring: rgba(30,136,229,.25);
  --radius:14px;
}

/* ===== Base ===== */
*{ box-sizing:border-box }
html,body{ margin:0; padding:0 }
body{
  font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
}

/* ===== Header ===== */
.site-header{
  background:#fff;
  border-bottom:1px solid #e6ecf5;
  position:sticky; top:0; z-index:50;
}
.site-header .wrap{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  max-width:1100px; margin:0 auto; padding:12px 16px;
}
.brand{ display:flex; align-items:center; gap:10px; color:var(--text); text-decoration:none }
.brand .logo{ font-size:22px }
.btn-menu{
  width:40px; height:36px; border:0; background:transparent;
  display:flex; flex-direction:column; justify-content:center; gap:5px; cursor:pointer;
}
.btn-menu span{ height:3px; background:var(--text); border-radius:2px; display:block }

/* ===== Nav ===== */
.site-nav{ background:#fff; border-bottom:1px solid #e6ecf5 }
.site-nav ul{
  list-style:none; margin:0 auto; max-width:1100px; padding:0 16px;
  display:flex; gap:18px; align-items:center; flex-wrap:wrap;
}
.site-nav a{ display:block; padding:12px 0; color:var(--muted); text-decoration:none; font-weight:600 }
.site-nav a:hover{ color:var(--brand) }

/* Mobile: menu recolhido */
@media (max-width:840px){
  .site-nav{ display:none }
  .site-nav.open{ display:block }
  .site-nav ul{ flex-direction:column; align-items:flex-start }
}

/* ===== Hero (base) ===== */
.hero{
  min-height:44vh; display:grid; place-items:center; text-align:center; color:#fff;
  background:linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,.35)), #000;
  background-image:linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,.35)), var(--hero);
  background-size:cover; background-position:center;
}
.hero-inner{ max-width:900px; padding:40px 16px }
.hero h1{ margin:0 0 10px; font-size:clamp(24px,5vw,40px) }
.hero p{ margin:0 0 18px; color:#eaf2ff }

/* ===== Hero Rotator (versão nova baseada em <img>) ===== */
.hero.has-rotator{ position:relative; overflow:hidden; background:none; }

.hero .hero-gradient{
  position:absolute; inset:0;
  background:linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,.35));
  z-index:2; pointer-events:none;
}

.hero img.hero-img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; object-position:center;
  transition:opacity .65s ease; z-index:1; display:block; background:#000;
  will-change: opacity;
}
.hero .hero-img.a { opacity:1; }   /* visível */
.hero .hero-img.b { opacity:0; }   /* camada de fade */

.hero .hero-inner{ position:relative; z-index:3 }

/* ===== Layout ===== */
.container{ max-width:1100px; margin:24px auto; padding:0 16px }
.section h2{ margin:0 0 10px; font-size:clamp(20px,4vw,28px) }
.section p{ color:var(--muted) }

/* ===== Cards (genéricos) ===== */
.cards{ display:grid; grid-template-columns:repeat(12,1fr); gap:18px }
.card{
  grid-column:span 12;
  background:var(--card); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); overflow:hidden; border:1px solid #e9eff7;
  transition:transform .18s ease, box-shadow .18s ease;
}
.card:hover{ transform:translateY(-3px); box-shadow:var(--shadow) }
.card img{ width:100%; height:200px; object-fit:cover; display:block }
.card-body{ padding:16px }
.card h3{ margin:0 0 8px }

@media (min-width:680px){ .card{ grid-column:span 6 } }
@media (min-width:980px){ .card{ grid-column:span 4 } }

/* ===== Buttons ===== */
.btn{
  display:inline-block; padding:10px 14px; border-radius:10px;
  background:#e9f2fe; color:var(--brand); text-decoration:none; font-weight:700;
  border:1px solid #dbe9fd; box-shadow:var(--shadow-sm); transition:transform .15s, background .15s;
}
.btn:hover{ background:#dbe9fd; transform:translateY(-1px); text-decoration:none }
.btn:focus-visible{ outline:2px solid var(--brand); outline-offset:2px }
.btn-primary{ background:var(--brand); color:#fff; border-color:transparent }
.btn-primary:hover{ background:var(--brand-700) }
.btn.danger{ background:#fee; color:#b00; border-color:#fdd }

/* ===== Form ===== */
.form{
  display:grid; gap:16px; max-width:900px; margin:0 auto;
}
.form label{ display:grid; gap:6px; font-weight:600; color:var(--muted) }
.form input,.form textarea,.form select{
  padding:10px 12px; border:1px solid #d7deea; border-radius:10px; background:#fff; outline:none; font:inherit;
}
.form input:focus,.form textarea:focus,.form select:focus{
  border-color:var(--brand); box-shadow:0 0 0 4px var(--ring);
}

/* Utilitários de grid para forms 2-em-2 no desktop */
.grid{ display:grid; gap:16px }
.grid-2{ grid-template-columns:1fr 1fr }
.grid-2 > *{ min-width:0 }
@media (max-width:840px){
  .grid-2{ grid-template-columns:1fr }
  .form{ max-width:100% }
}

/* ===== Footer ===== */
.site-footer{ margin-top:32px; background:#fff; border-top:1px solid #e6ecf5 }
.site-footer .wrap{ max-width:1100px; margin:0 auto; padding:16px }
.site-footer p{ margin:0 0 6px }

/* ===== Utilitários ===== */
.only-mobile{ display:none !important }
.only-desktop{ display:block !important }
@media (max-width:840px){
  .only-mobile{ display:block !important }
  .only-desktop{ display:none !important }
}

/* Mostra o hambúrguer só em telas pequenas (esconde no desktop) */
@media (min-width:840px){
  .btn-menu{ display:none }
}

/* Pílula (login/minha área) */
.pill{
  display:inline-block; padding:8px 14px; border-radius:9999px;
  background:#e9f2fe; color:#var(--brand); text-decoration:none; font-weight:700;
}
.pill:hover{ background:#dbe9fd }

/* ===== Dashboard ===== */
.dashboard .dash-top{
  display:flex; gap:10px; justify-content:flex-end; margin-bottom:12px;
}
.mini.action{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:12px; background:#eef3ff;
  color:var(--brand); text-decoration:none; font-weight:700;
}
.mini.action svg{ width:18px; height:18px }
.mini.action:hover{ background:#dbe9fd }
.mini.action.danger{ background:#ffe9e9; color:#c62828 }
.mini.action.danger:hover{ background:#ffd9d9 }

.dash-grid{
  display:grid; grid-template-columns:repeat(2, minmax(260px,1fr));
  gap:20px; align-items:stretch;
}
@media (max-width:780px){
  .dash-grid{ grid-template-columns:1fr }
}
.dash-card{
  display:block; text-decoration:none; color:var(--text);
  background:var(--card); border-radius:16px; padding:24px;
  box-shadow:var(--shadow); text-align:center;
  transition:transform .15s ease, box-shadow .15s ease;
}
.dash-card:hover{ transform:translateY(-2px); box-shadow:0 12px 30px rgba(0,0,0,.12) }
.dash-card .ico{ display:grid; place-items:center; margin-bottom:10px }
.dash-card .ico svg{ width:44px; height:44px; color:var(--brand) }
.dash-card h3{ margin:6px 0 8px }
.dash-card p{ margin:0; color:var(--muted) }

/* ===== Badges ===== */
.badge{
  display:inline-block; padding:.1rem .45rem; font-size:.75rem; font-weight:700;
  border-radius:999px; background:#e9f2fe; color:#1565c0; vertical-align:middle;
}
.badge.ok{ background:#e8fff1; color:#087443 }
.badge.warn{ background:#fff4e5; color:#b26a00 }

/* ===== Busca + Paginação ===== */
.searchbar{ display:flex; gap:8px; align-items:center; flex-wrap:wrap }
.pager{ display:flex; gap:6px; justify-content:center }
.pager .btn.active{ background:var(--brand); color:#fff }

/* ===== Grid de notícias (home e admin/listar) ===== */
.news-grid{ display:grid; grid-template-columns:repeat(12,1fr); gap:18px }
.news-card{
  grid-column:span 12; background:#fff; border-radius:var(--radius);
  box-shadow:var(--shadow-sm); overflow:hidden; display:flex; flex-direction:column;
  border:1px solid #e9eff7;
}
.news-card .thumb{ width:100%; height:160px; background-size:cover; background-position:center }
.news-card .meta{ display:flex; justify-content:space-between; align-items:center; padding:10px 14px 0 14px }
.news-card h3{ margin:6px 14px 2px; font-size:1.05rem; line-height:1.25 }
.news-card .resume{ margin:0 14px 10px; color:var(--muted); font-size:.92rem }
.news-card .card-actions{ display:flex; gap:8px; align-items:center; padding:12px 14px 16px }

@media (min-width:680px){
  .news-card{ grid-column:span 6 }
  .news-card .thumb{ height:180px }
}
@media (min-width:980px){
  .news-card{ grid-column:span 4 }
  .news-card .thumb{ height:180px }
}

/* ===== Ajustes específicos de listar ===== */
.list-header{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap }
.searchbar input[type=search]{ min-width:260px }
.searchbar .total{ margin-left:6px }

/* ===== CKEditor mínimo ===== */
.ck.ck-editor__editable_inline{ min-height:280px }

/* ===== Acessibilidade: reduzir movimento ===== */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    scroll-behavior:auto !important;
  }
}

/* status do link/slug */
.input-ok  { border-color:#2e7d32 !important; box-shadow:0 0 0 4px rgba(46,125,50,.15) !important; }
.input-bad { border-color:#c62828 !important; box-shadow:0 0 0 4px rgba(198,40,40,.15) !important; }
.msg-ok    { color:#087443; font-weight:700; }
.msg-bad   { color:#c62828; font-weight:700; }