/* ============================================================
   Rede CNE News — Stylesheet v1.0
   ============================================================ */

:root {
  --primary: #c0392b;
  --primary-dark: #96281b;
  --primary-light: #e74c3c;
  --secondary: #2c3e50;
  --accent: #f39c12;
  --bg: #f5f6fa;
  --bg-white: #ffffff;
  --text: #222222;
  --text-muted: #666666;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,.14);
  --radius: 8px;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-article: 'Merriweather', Georgia, serif;
  --max-w: 1200px;
  --sidebar-w: 320px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-dark); }

/* ── Container ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.2rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: all .2s;
  text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }
.btn-success { background: #27ae60; color: #fff; border-color: #27ae60; }
.btn-danger { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-warning { background: var(--accent); color: #fff; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-telegram { background: #0088cc; color: #fff; }
.btn-twitter { background: #1DA1F2; color: #fff; }

/* ── Header ── */
.site-header {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  position: sticky; top: 0; z-index: 100;
}
.header-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0;
}
.logo {
  display: flex; align-items: center; gap: .5rem;
  color: #fff; font-weight: 700; font-size: 1.25rem;
  text-decoration: none;
}
.logo:hover { color: var(--accent); text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.tagline { font-size: .75rem; color: rgba(255,255,255,.6); display: block; margin-top: .1rem; }
.header-actions { display: flex; gap: .5rem; }

/* ── Nav ── */
.main-nav { border-top: 1px solid rgba(255,255,255,.1); }
.nav-list {
  display: flex; list-style: none; flex-wrap: wrap; gap: 0;
  padding: .25rem 0;
}
.nav-list li a {
  display: block; padding: .5rem .85rem;
  color: rgba(255,255,255,.85); font-size: .88rem;
  border-radius: 4px; transition: background .15s;
}
.nav-list li a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: .3rem; flex-direction: column; gap: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: .3s; }

/* ── Alerts ── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius);
  margin-bottom: 1rem; font-size: .9rem; border-left: 4px solid;
}
.alert-success { background: #d4edda; border-color: #28a745; color: #155724; }
.alert-error { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.alert-info { background: #cce5ff; border-color: #004085; color: #004085; }
.alert-warning { background: #fff3cd; border-color: #ffc107; color: #856404; }

/* ── Card ── */
.card {
  background: var(--bg-white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-body { padding: 1.25rem; }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.35; margin-bottom: .5rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }
.card-excerpt { font-size: .9rem; color: var(--text-muted); line-height: 1.5; }
.card-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--border); background: #fafafa; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ── Badge ── */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-primary { background: var(--primary); color: #fff; }
.badge-success { background: #27ae60; color: #fff; }
.badge-warning { background: var(--accent); color: #fff; }
.badge-danger { background: #e74c3c; color: #fff; }
.badge-secondary { background: var(--secondary); color: #fff; }
.badge-info { background: #3498db; color: #fff; }

/* ── Home Layout ── */
.home-layout { display: grid; grid-template-columns: 1fr var(--sidebar-w); gap: 2rem; padding: 2rem 0; }
.home-main { min-width: 0; }
.home-sidebar { min-width: 0; }

/* ── Featured Post ── */
.featured-post { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; box-shadow: var(--shadow); }
.featured-post .featured-img { width: 100%; height: 420px; object-fit: cover; }
.featured-post .featured-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 2rem 1.5rem 1.5rem;
}
.featured-post .featured-overlay .badge { margin-bottom: .5rem; }
.featured-post .featured-title { font-size: 1.6rem; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: .5rem; }
.featured-post .featured-title a { color: #fff; }
.featured-post .featured-meta { color: rgba(255,255,255,.75); font-size: .85rem; }

/* ── Posts Grid ── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.posts-list { display: flex; flex-direction: column; gap: 1rem; }

.post-item-h { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .2s; }
.post-item-h:hover { box-shadow: var(--shadow-hover); }
.post-item-h img { width: 120px; height: 100%; object-fit: cover; }
.post-item-h .post-body { padding: .75rem; }
.post-item-h .post-title { font-size: .95rem; font-weight: 600; line-height: 1.35; }
.post-item-h .post-title a { color: var(--text); }
.post-item-h .post-title a:hover { color: var(--primary); }
.post-item-h .post-meta { font-size: .78rem; color: var(--text-muted); margin-top: .4rem; }

/* ── Sidebar ── */
.sidebar-widget { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.5rem; }
.sidebar-widget h3 { font-size: 1rem; font-weight: 700; border-bottom: 3px solid var(--primary); padding-bottom: .5rem; margin-bottom: 1rem; }
.search-form { display: flex; gap: .5rem; }
.search-form input { flex: 1; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; }
.search-form button { padding: .5rem .9rem; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; }
.cat-list { list-style: none; }
.cat-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.cat-list li:last-child { border: none; }
.cat-list a { color: var(--text); display: flex; justify-content: space-between; }
.cat-list a:hover { color: var(--primary); text-decoration: none; }

/* ── Single Post ── */
.post-layout { display: grid; grid-template-columns: 1fr var(--sidebar-w); gap: 2rem; padding: 2rem 0; }
.post-article { min-width: 0; }
.post-header { margin-bottom: 1.5rem; }
.post-type { font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.post-title-main { font-family: var(--font-article); font-size: 2rem; line-height: 1.25; margin: .5rem 0; }
.post-subtitle { font-size: 1.1rem; color: var(--text-muted); font-style: italic; margin-bottom: 1rem; border-left: 4px solid var(--primary); padding-left: 1rem; }
.post-author-bar { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.author-name { font-weight: 600; font-size: .95rem; }
.author-name a { color: var(--text); }
.author-name a:hover { color: var(--primary); }
.post-date { font-size: .82rem; color: var(--text-muted); }
.post-hero { width: 100%; border-radius: var(--radius); margin-bottom: 1rem; max-height: 480px; object-fit: cover; }
.post-hero-caption { font-size: .82rem; color: var(--text-muted); text-align: center; margin-bottom: 1.5rem; }
.post-content { font-family: var(--font-article); font-size: 1.05rem; line-height: 1.85; }
.post-content p { margin-bottom: 1.25rem; }
.post-content h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; color: var(--secondary); }
.post-content h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.post-content blockquote { border-left: 4px solid var(--primary); padding: 1rem 1.5rem; margin: 1.5rem 0; background: #fafafa; font-style: italic; }
.post-content img { border-radius: var(--radius); margin: 1rem auto; }
.share-section { margin: 2rem 0; padding: 1.5rem; background: #f8f9fa; border-radius: var(--radius); }
.share-section h3 { font-size: 1rem; margin-bottom: .75rem; }
.share-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Breadcrumb ── */
.breadcrumb { padding: .75rem 0; font-size: .85rem; color: var(--text-muted); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }

/* ── Author Profile ── */
.author-profile-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; text-align: center; margin-bottom: 2rem; }
.author-profile-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; border: 4px solid var(--primary); }
.author-social { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.author-social a { padding: .3rem .75rem; border-radius: 20px; font-size: .82rem; background: var(--secondary); color: #fff; }
.authors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; padding: 2rem 0; }
.author-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; text-align: center; transition: box-shadow .2s; }
.author-card:hover { box-shadow: var(--shadow-hover); }
.author-card-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto .75rem; border: 3px solid var(--primary); }
.author-card-name { font-weight: 700; font-size: 1rem; }
.author-card-bio { font-size: .85rem; color: var(--text-muted); margin: .5rem 0; line-height: 1.5; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: .4rem; font-weight: 600; font-size: .9rem; }
.form-control {
  width: 100%; padding: .6rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .95rem; transition: border-color .2s;
  font-family: var(--font-body); background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
textarea.form-control { resize: vertical; min-height: 150px; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Auth Pages ── */
.auth-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 440px; }
.auth-box h1 { font-size: 1.5rem; margin-bottom: 1.5rem; text-align: center; color: var(--secondary); }
.auth-logo { text-align: center; font-size: 2.5rem; margin-bottom: .5rem; }

/* ── Admin Panel ── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--secondary); color: #fff; padding: 0; }
.admin-sidebar-brand { padding: 1.25rem; font-weight: 700; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-nav { list-style: none; padding: .5rem 0; }
.admin-nav li a { display: block; padding: .65rem 1.25rem; color: rgba(255,255,255,.8); font-size: .9rem; transition: background .15s; }
.admin-nav li a:hover, .admin-nav li a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.admin-nav .nav-section { padding: .75rem 1.25rem .25rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.4); }
.admin-content { background: var(--bg); padding: 1.5rem; overflow-y: auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.4rem; color: var(--secondary); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); border-left: 4px solid var(--primary); }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: .85rem; color: var(--text-muted); }

/* ── Table ── */
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--secondary); color: #fff; padding: .75rem 1rem; text-align: left; font-size: .85rem; white-space: nowrap; }
.data-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
.data-table tr:last-child td { border: none; }
.data-table tr:hover td { background: #f8f9fa; }

/* ── Pagination ── */
.pagination { display: flex; gap: .35rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: .4rem .8rem; border-radius: 4px; font-size: .88rem;
  border: 1px solid var(--border); background: #fff; color: var(--text);
}
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Related Posts ── */
.related-posts { margin: 2.5rem 0; }
.related-posts h3 { font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--primary); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

/* ── Section headings ── */
.section-title {
  font-size: 1.2rem; font-weight: 700; color: var(--secondary);
  padding-bottom: .5rem; border-bottom: 3px solid var(--primary); margin-bottom: 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
}

/* ── Contact ── */
.contact-wrap { max-width: 700px; margin: 2rem auto; }
.contact-wrap .card-body { padding: 2rem; }

/* ── 404 ── */
.page-404 { text-align: center; padding: 5rem 1rem; }
.page-404 h1 { font-size: 6rem; color: var(--primary); font-weight: 900; }
.page-404 p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Colunista panel ── */
.painel-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.painel-sidebar { background: var(--primary); color: #fff; }
.painel-sidebar-brand { padding: 1.25rem; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.2); }
.painel-nav { list-style: none; padding: .5rem 0; }
.painel-nav li a { display: block; padding: .65rem 1.25rem; color: rgba(255,255,255,.85); font-size: .9rem; }
.painel-nav li a:hover, .painel-nav li a.active { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.painel-content { background: var(--bg); padding: 1.5rem; }

/* ── Rich editor hint ── */
.editor-toolbar { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .5rem; }
.editor-toolbar button { padding: .3rem .6rem; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; font-size: .85rem; }
.editor-toolbar button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Utility ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.d-none { display: none !important; }
.views-count { font-size: .82rem; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .home-layout, .post-layout { grid-template-columns: 1fr; }
  .home-sidebar { order: -1; }
  .admin-layout, .painel-layout { grid-template-columns: 1fr; }
  .admin-sidebar, .painel-sidebar { display: none; }
  .featured-post .featured-img { height: 260px; }
  .featured-post .featured-title { font-size: 1.2rem; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-list { display: none; flex-direction: column; }
  .nav-list.open { display: flex; }
  .nav-toggle { display: flex; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-title-main { font-size: 1.4rem; }
  .authors-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .authors-grid { grid-template-columns: 1fr; }
}

/* ── Print ── */
@media print {
  .site-header, .site-footer, .home-sidebar, .share-section, .related-posts { display: none; }
  .post-layout { grid-template-columns: 1fr; }
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--secondary);
  color: rgba(255,255,255,.85);
  margin-top: 3rem;
  padding: 2.5rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}
.footer-col h3, .footer-col h4 {
  color: #fff;
  margin-bottom: .75rem;
  font-size: 1rem;
}
.footer-col p { font-size: .88rem; color: rgba(255,255,255,.65); line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col ul li { padding: .3rem 0; }
.footer-col ul li a { color: rgba(255,255,255,.65); font-size: .88rem; transition: color .15s; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }
.footer-col a { color: rgba(255,255,255,.65); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1rem 0;
  text-align: center;
  font-size: .82rem;
  color: rgba(255,255,255,.4);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}