/* MunicipiosAR.com — Theme CSS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }

:root {
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --header-bg: #0f172a;
  --nav-bg: #1e293b;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6 }
a { color: inherit; text-decoration: none }
img { display: block; max-width: 100%; height: auto }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem }

/* ── TOPBAR ──────────────────────────────── */
.topbar-strip { background: #111827; color: #9ca3af; font-size: .78rem; padding: .35rem 0 }
.topbar-inner { display: flex; justify-content: space-between; align-items: center }
.topbar-links { display: flex; gap: 1rem }
.topbar-links a { color: #9ca3af; transition: color .15s }
.topbar-links a:hover { color: #fff }

/* ── HEADER ──────────────────────────────── */
.site-header { background: var(--header-bg); padding: .75rem 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3) }
.header-inner { display: flex; align-items: center; gap: 1rem }
.site-logo { font-size: 1.4rem; font-weight: 900; color: #fff; letter-spacing: -.5px; flex: 0 0 auto }
.header-search { display: flex; flex: 1; max-width: 400px; margin-left: auto }
.header-search input { flex: 1; padding: .45rem .85rem; border-radius: 6px 0 0 6px; border: none; background: #1e293b; color: #fff; font-size: .875rem }
.header-search input::placeholder { color: #64748b }
.header-search input:focus { outline: none; background: #334155 }
.header-search button { background: var(--primary); color: #fff; border: none; padding: .45rem .85rem; border-radius: 0 6px 6px 0; cursor: pointer; font-size: .875rem }
.burger { display: none; background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; margin-left: .5rem }

/* ── NAV ──────────────────────────────────── */
.site-nav { background: var(--nav-bg); border-bottom: 1px solid #334155; position: sticky; top: 56px; z-index: 90 }
.nav-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 0 }
.nav-item > a { display: block; padding: .65rem 1rem; color: #cbd5e1; font-size: .85rem; font-weight: 600; transition: color .15s, background .15s; white-space: nowrap }
.nav-item > a:hover, .nav-item.open > a { color: #fff; background: rgba(255,255,255,.08) }
.arrow { font-size: .6rem; margin-left: .2rem }

/* Dropdown mega-menu */
.has-dropdown { position: relative }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--border); border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 1rem; min-width: 600px; max-width: 800px; display: none; flex-wrap: wrap; gap: 1rem; z-index: 200 }
.nav-item.open .dropdown { display: flex }
.dropdown-col { min-width: 140px }
.dropdown-zona { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: .4rem; border-bottom: 1px solid var(--border); margin-bottom: .4rem }
.dropdown a { display: block; font-size: .82rem; padding: .2rem 0; color: var(--text) }
.dropdown a:hover { color: var(--primary) }

/* ── TICKER ──────────────────────────────── */
.ticker-wrap { background: var(--primary); color: #fff; display: flex; align-items: center; overflow: hidden; height: 36px }
.ticker-label { flex-shrink: 0; background: #1e40af; padding: 0 .85rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; height: 100%; display: flex; align-items: center; white-space: nowrap }
.ticker-track { flex: 1; overflow: hidden; position: relative }
.ticker-items { display: flex; gap: 0; animation: ticker-scroll 40s linear infinite; white-space: nowrap; width: max-content }
.ticker-items:hover { animation-play-state: paused }
.ticker-items a { color: #fff; font-size: .82rem; padding: 0 1rem; display: inline-block }
.ticker-items a:hover { text-decoration: underline }
.ticker-sep { color: rgba(255,255,255,.4); padding: 0 .25rem }
@keyframes ticker-scroll { 0% { transform: translateX(0) } 100% { transform: translateX(-50%) } }

/* ── MAIN CONTENT ─────────────────────────── */
.main-content { padding: 1.5rem 0 3rem }

/* ── HERO GRID ───────────────────────────── */
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 2rem }
.hero-main { display: block; border-radius: 10px; overflow: hidden; position: relative; background: #0f172a; min-height: 360px }
.hero-main img { width: 100%; height: 360px; object-fit: cover; opacity: .75 }
.hero-main-body { position: absolute; bottom: 0; left: 0; right: 0; padding: 1.5rem; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%) }
.hero-main-body h2 { color: #fff; font-size: 1.35rem; line-height: 1.3; margin-top: .4rem }
.hero-main-body p { color: #cbd5e1; font-size: .875rem; margin-top: .4rem }
.hero-main:hover img { opacity: .65 }
.hero-sidebar { display: flex; flex-direction: column; gap: .75rem }
.hero-card { display: flex; gap: .6rem; background: var(--surface); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); transition: box-shadow .15s }
.hero-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08) }
.hero-card img { width: 80px; height: 80px; object-fit: cover; flex-shrink: 0 }
.hero-card-body { padding: .5rem; flex: 1 }
.hero-card-body h3 { font-size: .82rem; font-weight: 700; line-height: 1.35; color: var(--text) }

/* ── NOTAS GRID ──────────────────────────── */
.notas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem }
.nota-card { background: var(--surface); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); display: flex; flex-direction: column; transition: box-shadow .15s }
.nota-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px) }
.nota-card img { width: 100%; height: 160px; object-fit: cover }
.nota-card-body { padding: .85rem; flex: 1; display: flex; flex-direction: column; gap: .3rem }
.nota-card-body h3 { font-size: .875rem; font-weight: 700; line-height: 1.35; color: var(--text) }
.nota-card-body p { font-size: .78rem; color: var(--muted); flex: 1 }
.nota-foot { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: auto }
.nota-time { font-size: .72rem; color: var(--muted) }

/* ── TAGS ──────────────────────────────────── */
.nota-tag { display: inline-block; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em }
.nota-tag-sm { font-size: .65rem; padding: .1rem .4rem }

/* ── SECTIONS ─────────────────────────────── */
.section { margin-bottom: 2.5rem }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem }
.section-title { font-size: 1.1rem; font-weight: 800; color: var(--text) }

/* ── PROVINCIAS GRID ─────────────────────── */
.provincias-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem }
.prov-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .85rem; text-align: center; transition: box-shadow .15s, border-color .15s }
.prov-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--primary) }
.prov-nombre { font-size: .85rem; font-weight: 700; color: var(--text) }
.prov-count { font-size: .72rem; color: var(--muted); margin-top: .2rem }

/* ── ARTICLE ──────────────────────────────── */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start }
.article-main { min-width: 0 }
.article-title { font-size: 1.75rem; font-weight: 800; line-height: 1.25; margin: .5rem 0 }
.article-lead { font-size: 1.1rem; color: var(--muted); line-height: 1.5; margin-bottom: 1rem; font-style: italic }
.article-meta { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center }
.article-meta strong { color: var(--text) }
.article-source { color: var(--primary); font-weight: 600 }
.article-figure { margin: 1.25rem 0; border-radius: 8px; overflow: hidden }
.article-figure img { width: 100%; max-height: 480px; object-fit: cover }
.article-body { line-height: 1.8; font-size: .975rem }
.article-body p { margin-bottom: 1rem }
.article-body h2, .article-body h3 { font-weight: 700; margin: 1.5rem 0 .5rem; color: var(--text) }
.article-body h2 { font-size: 1.25rem }
.article-body h3 { font-size: 1.05rem }
.article-body ul, .article-body ol { margin: .75rem 0 .75rem 1.5rem }
.article-body li { margin-bottom: .35rem }
.article-body blockquote { border-left: 3px solid var(--primary); padding: .75rem 1rem; background: #f1f5f9; margin: 1rem 0; font-style: italic; border-radius: 0 6px 6px 0 }
.article-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border) }
.tag { background: #f1f5f9; color: var(--muted); padding: .25rem .65rem; border-radius: 20px; font-size: .78rem; border: 1px solid var(--border); transition: background .15s }
.tag:hover { background: #e2e8f0; color: var(--text) }

/* ── SIDEBAR ──────────────────────────────── */
.article-sidebar { position: sticky; top: 120px }
.sidebar-block { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem }
.sidebar-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .75rem }
.sidebar-nota { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border) }
.sidebar-nota:last-child { border-bottom: none }
.sidebar-nota img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0 }
.sidebar-nota-title { font-size: .8rem; font-weight: 600; line-height: 1.3; color: var(--text) }
.sidebar-nota:hover .sidebar-nota-title { color: var(--primary) }
.sidebar-nota-time { font-size: .7rem; color: var(--muted); margin-top: .2rem }

/* ── BREADCRUMB ──────────────────────────── */
.breadcrumb { font-size: .78rem; color: var(--muted); margin-bottom: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem }
.breadcrumb a { color: var(--muted) }
.breadcrumb a:hover { color: var(--primary) }
.bc-sep { color: #cbd5e1 }

/* ── MUNICIPIO PAGE ───────────────────────── */
.municipio-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border) }
.municipio-header h1 { font-size: 1.75rem; font-weight: 800 }
.municipio-desc { color: var(--muted); margin: .5rem 0 }
.municipio-meta { display: flex; gap: 1.5rem; font-size: .85rem; color: var(--muted); flex-wrap: wrap }
.municipio-meta strong { color: var(--text) }
.municipio-meta a { color: var(--primary) }

/* ── PAGINATION ───────────────────────────── */
.paginacion { display: flex; gap: .35rem; margin-top: 1.5rem; flex-wrap: wrap }
.pag-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; font-size: .8rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--muted) }
.pag-btn:hover { border-color: var(--primary); color: var(--primary) }
.pag-btn.active { background: var(--primary); color: #fff; border-color: var(--primary) }

/* ── MISC ─────────────────────────────────── */
.empty-msg { text-align: center; color: var(--muted); padding: 3rem 0 }

/* ── FOOTER ───────────────────────────────── */
.site-footer { background: #0f172a; color: #94a3b8; padding: 2.5rem 0 0 }
.footer-inner { display: flex; gap: 3rem; flex-wrap: wrap; padding-bottom: 2rem }
.footer-brand { flex: 1; min-width: 200px }
.footer-logo { font-size: 1.2rem; font-weight: 900; color: #fff; display: block; margin-bottom: .75rem }
.footer-brand p { font-size: .85rem; line-height: 1.6; margin-bottom: .35rem }
.footer-brand a { color: #60a5fa }
.footer-links { display: flex; flex-direction: column; gap: .4rem; font-size: .85rem }
.footer-links a { color: #94a3b8 }
.footer-links a:hover { color: #fff }
.footer-bottom { border-top: 1px solid #1e293b; padding: 1rem 0; font-size: .78rem; color: #475569 }

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 1024px) {
  .notas-grid { grid-template-columns: repeat(3, 1fr) }
  .provincias-grid { grid-template-columns: repeat(4, 1fr) }
}
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr }
  .hero-sidebar { display: none }
  .notas-grid { grid-template-columns: repeat(2, 1fr) }
  .provincias-grid { grid-template-columns: repeat(3, 1fr) }
  .article-layout { grid-template-columns: 1fr }
  .article-sidebar { display: none }
  .site-nav { display: none }
  .site-nav.open { display: block }
  .nav-menu { flex-direction: column }
  .dropdown { position: static; box-shadow: none; min-width: unset; padding: .5rem 1rem; border: none; border-radius: 0 }
  .burger { display: block }
  .topbar-strip { display: none }
}
@media (max-width: 480px) {
  .notas-grid { grid-template-columns: 1fr }
  .provincias-grid { grid-template-columns: repeat(2, 1fr) }
  .article-title { font-size: 1.35rem }
}
