/* FiscalBot — Novedades tributarias (isla PHP). Tokens copiados de global.css
   + chrome (Header/Footer) replicado del sitio Astro + estilos de la página
   (adaptados al tema claro del sitio nuevo). */

/* ---------- Tokens (global.css) ---------- */
:root {
  --ink: #1a1a2e;
  --text: #344054;
  --muted: #667085;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --dark: #202123;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --border: #e6e8ec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(16, 24, 40, .06);
  --shadow-hover: 0 12px 34px rgba(16, 24, 40, .1);
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 750; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 650; font-size: .98rem; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary, .btn--primary { background: var(--accent); color: #fff; }
.btn-primary:hover, .btn--primary:hover { background: var(--accent-dark); box-shadow: var(--shadow-hover); color: #fff; }

/* ---------- Header (idéntico a Header.astro) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-logo { display: block; height: 34px; width: 34px; }
.brand-name { font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; }
.header-right { display: flex; align-items: center; gap: 10px; }

.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.main-nav a, .dd-toggle {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: 8px 13px; border-radius: 8px; color: var(--ink);
  font-weight: 600; font-size: .93rem; background: none; border: none; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.main-nav a:hover, .dd-toggle:hover { background: var(--bg-soft); text-decoration: none; }
.caret { font-size: .7em; opacity: .7; }

.has-dropdown { position: relative; }
.dropdown {
  list-style: none; margin: 8px 0 0; padding: 8px;
  position: absolute; top: 100%; right: 0; left: auto; min-width: 240px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown,
.has-dropdown.open > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li { display: block; }
.dropdown a { display: block; width: 100%; padding: 10px 12px; border-radius: 8px; font-weight: 550; }

/* gtranslate: selector integrado y bonito */
.gtranslate_wrapper { display: inline-flex; align-items: center; }
.gtranslate_wrapper select, .gtranslate_wrapper .gt_selector {
  -webkit-appearance: none; appearance: none;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 30px 8px 12px; margin: 0;
  font-family: inherit; font-size: .88rem; font-weight: 600; color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer; line-height: 1.2; box-shadow: none; outline: none;
}
.gtranslate_wrapper select:hover, .gtranslate_wrapper .gt_selector:hover { background-color: var(--bg-soft); border-color: #cdd3dd; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; order: 3; }
  .header-right {
    order: 4; flex-basis: 100%;
    position: fixed; inset: 66px 0 auto 0; background: #fff;
    flex-direction: column; align-items: stretch; gap: 0;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height .25s ease; padding: 0;
  }
  .header-right.open { max-height: 85vh; overflow: auto; padding: 8px; }
  .main-nav { width: 100%; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav > ul > li > a, .dd-toggle { width: 100%; }
  .dd-toggle { justify-content: space-between; }
  .dd-toggle .caret { transition: transform .2s; }
  .has-dropdown.open .caret { transform: rotate(180deg); }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; min-width: 0; padding-left: 14px; margin: 0;
  }
  /* especificidad > `.main-nav ul` (que lleva display:flex) para poder ocultarlo */
  .main-nav ul.dropdown { display: none; }
  .has-dropdown.open > ul.dropdown { display: block; }
  .gtranslate_wrapper { padding: 10px 13px; }
}

/* ---------- Footer (idéntico a Footer.astro) ---------- */
.site-footer { background: var(--dark); color: #e6e7e9; margin-top: 90px; position: relative; }
.footer-wave { position: absolute; top: 0; left: 0; width: 100%; line-height: 0; transform: translateY(-99%); pointer-events: none; }
.footer-wave svg { display: block; width: 100%; height: 70px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; padding-top: 56px; padding-bottom: 40px; }
.footer-brand { max-width: 320px; }
.footer-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.footer-logo img { height: 44px; width: 44px; display: block; }
.footer-logo span { font-weight: 800; font-size: 1.2rem; }
.footer-logo:hover { text-decoration: none; }
.tagline { margin: 14px 0 6px; color: #c3c5c9; }
.gov-note { font-size: .82rem; color: #8b8e94; margin: 0; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 { color: #fff; font-size: .95rem; margin: 0 0 14px; }
.footer-col a { display: block; color: #b9bbc0; font-size: .92rem; padding: 4px 0; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: .85rem; color: #8b8e94; }
@media (max-width: 640px) { .footer-cols { gap: 40px; } }

/* ---------- Página de Novedades (tema claro) ---------- */
.news-container {
  max-width: var(--maxw);
  margin: 2.5rem auto;
  padding: 0 20px;
  color: var(--text);
}
.news-header { margin-bottom: 2rem; }
.news-header h1 { color: var(--ink); margin-bottom: 1rem; }

/* Tabs de fuente */
.news-source-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
.source-tab {
  padding: 1rem 2rem; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .3s;
  display: flex; align-items: center; gap: .5rem; font-weight: 600;
}
.source-tab:hover { color: var(--accent); text-decoration: none; }
.source-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.source-tab i { font-size: 1.1rem; }

/* Relevancia (BOE) */
.relevance-legend {
  display: inline-flex; align-items: center; gap: .3rem; margin-left: .5rem;
  font-size: .85rem; color: var(--muted); background: #fff8e6;
  padding: .25rem .75rem; border-radius: 4px;
}
.relevance-legend i { color: #eab308; font-size: .75rem; }
.boe-relevance-filter { display: flex; gap: .5rem; margin-bottom: 1rem; }
.boe-relevance-filter .filter-option {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem;
  border-radius: 20px; font-size: .9rem; text-decoration: none; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--border); transition: all .3s;
}
.boe-relevance-filter .filter-option:hover { color: var(--ink); background: #eef0f4; text-decoration: none; }
.boe-relevance-filter .filter-option.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.boe-relevance-filter .filter-option.active i.fa-star { color: #ffd700; }
.news-item-relevant, .article-relevant { border-left: 3px solid #eab308; }
.news-relevant-tag {
  display: inline-flex; align-items: center; gap: .3rem; background: #fff8e6;
  color: #a16207; padding: .2rem .6rem; border-radius: 4px; font-size: .8rem; font-weight: 600;
}
.news-relevant-tag i { font-size: .7rem; color: #eab308; }

.news-intro { font-size: 1.1rem; margin-bottom: 1.5rem; line-height: 1.6; color: var(--text); }

.news-disclaimer {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; display: flex; align-items: flex-start;
  gap: 1rem; font-size: .9rem; margin-bottom: 2rem;
}
.news-disclaimer i { color: var(--accent); font-size: 1.5rem; margin-top: .2rem; }
.news-disclaimer a { color: var(--accent); }

.news-content-wrapper { display: flex; gap: 2rem; }
.news-sidebar { width: 300px; flex-shrink: 0; }
.news-search, .news-subscribe, .news-archives {
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.news-search h3, .news-subscribe h3, .news-archives h3 {
  margin-top: 0; margin-bottom: 1rem; font-size: 1.15rem; color: var(--ink);
}
.news-search-form { display: flex; flex-direction: column; gap: .5rem; }
.news-search-form input {
  padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); font-family: inherit;
}
.news-search-form input:focus { outline: none; border-color: var(--accent); background: #fff; }
.search-button {
  padding: .75rem; border: none; border-radius: var(--radius-sm); background: var(--accent);
  color: #fff; cursor: pointer; transition: background .3s; display: flex; align-items: center;
  justify-content: center; gap: .5rem; text-decoration: none; font-family: inherit; font-weight: 600;
}
.search-button:hover { background: var(--accent-dark); text-decoration: none; }
.news-subscribe p { color: var(--muted); font-size: .92rem; }
.update-info { font-size: .88rem; color: var(--text); line-height: 1.9; margin-top: .75rem; }
.update-info i { color: var(--accent); }

/* Archivos */
.show-all-news {
  display: flex; align-items: center; gap: .5rem; padding: .5rem 0; margin-bottom: .75rem;
  color: var(--muted); text-decoration: none; font-size: .9rem; transition: color .3s;
  border-bottom: 1px solid var(--border);
}
.show-all-news:hover, .show-all-news.active { color: var(--accent); }
.show-all-news i { font-size: .85rem; }
.archives-years-list { list-style: none; padding: 0; margin: 0; }
.archive-year-item { margin-bottom: .5rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.archive-year-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.year-header { display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .5rem 0; transition: color .3s; }
.year-header:hover { color: var(--accent); }
.year-toggle { width: 20px; transition: transform .3s; }
.archive-year-item.active .year-toggle { transform: rotate(90deg); }
.year-name { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.year-count { color: var(--muted); font-size: .9rem; }
.months-list { list-style: none; padding: 0; margin: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.archive-year-item.active .months-list { max-height: 1200px; }
.months-list li {
  padding: .4rem 0 .4rem 1.5rem; border-left: 2px solid var(--border);
  margin-left: .5rem; display: flex; flex-direction: column; gap: .25rem;
}
.months-list li > a:first-child {
  color: var(--text); text-decoration: none; display: flex; justify-content: space-between;
  transition: color .3s; font-size: .95rem;
}
.months-list li > a:first-child:hover { color: var(--accent); }
.months-list .count { color: var(--muted); }
.summary-link { display: inline-block; font-size: .8rem; margin-top: .25rem; color: var(--accent); }
.summary-link:hover { color: var(--accent-dark); }

/* Contenido principal */
.news-content { flex: 1; min-width: 0; }
.news-item {
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.news-title { margin-top: 0; margin-bottom: .5rem; font-size: 1.25rem; }
.news-title a { color: var(--ink); text-decoration: none; transition: color .3s; }
.news-title a:hover { color: var(--accent); }
.news-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }
.news-excerpt { line-height: 1.6; margin-bottom: 1.5rem; color: var(--text); }
.news-excerpt :is(h3, h4) { color: var(--ink); }
.news-actions { display: flex; justify-content: flex-end; }
.read-more { color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.read-more:hover { color: var(--accent-dark); }

.news-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.prev-page, .next-page {
  background: var(--accent); color: #fff; padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  text-decoration: none; display: flex; align-items: center; gap: .5rem; transition: background .3s; font-weight: 600;
}
.prev-page:hover, .next-page:hover { background: var(--accent-dark); text-decoration: none; }
.page-info { color: var(--muted); }

/* Resumen mensual */
.monthly-summary {
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 2rem;
}
.summary-header { margin-bottom: 1.5rem; }
.summary-header h1 { color: var(--ink); margin-top: .5rem; }
.summary-date { color: var(--muted); font-size: .9rem; margin: 0; }
.summary-content { line-height: 1.7; margin-bottom: 2rem; color: var(--text); }
.summary-content :is(h3, h4) { color: var(--ink); margin-top: 1.4rem; }
.summary-footer { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); padding-top: 1.5rem; margin-top: 2rem; }
.view-all-button { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.view-all-button:hover { text-decoration: underline; }

/* Vista individual */
.single-news-article {
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 2rem;
}
.single-news-header { margin-bottom: 2rem; }
.single-news-header h1 { color: var(--ink); margin: 1rem 0; font-size: 1.8rem; line-height: 1.3; }
.back-to-news { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); text-decoration: none; font-size: .9rem; transition: color .3s; }
.back-to-news:hover { color: var(--accent); }
.single-news-content { line-height: 1.8; margin-bottom: 2rem; font-size: 1.05rem; color: var(--text); }
.single-news-content :is(h3, h4) { color: var(--ink); }
.single-news-footer { border-top: 1px solid var(--border); padding-top: 1.5rem; margin-top: 2rem; }
.source-notice {
  display: flex; align-items: flex-start; gap: .75rem; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1.5rem;
}
.source-notice i { color: var(--accent); font-size: 1.2rem; margin-top: .1rem; }
.source-notice p { margin: 0; font-size: .9rem; color: var(--muted); }
.source-link { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.1rem; border-radius: var(--radius-sm); font-size: .95rem; }

.no-news {
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 2rem; text-align: center;
}
.no-news p { color: var(--text); }

.news-content-wrapper.single-view { display: block; }
.news-content-wrapper.single-view .news-content { max-width: 900px; margin: 0 auto; }

/* Navegación entre noticias */
.news-navigation { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.nav-prev, .nav-next {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  padding: 1rem 1.5rem; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); transition: all .3s; flex: 1; max-width: 48%;
}
.nav-next { align-items: flex-end; text-align: right; }
.nav-prev:hover, .nav-next:hover { background: var(--accent); color: #fff; text-decoration: none; border-color: var(--accent); }
.nav-prev.disabled, .nav-next.disabled { visibility: hidden; }
.nav-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.nav-prev:hover .nav-label, .nav-next:hover .nav-label { color: rgba(255,255,255,.85); }
.nav-title { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.nav-prev i, .nav-next i { font-size: 1.2rem; color: var(--accent); }
.nav-prev:hover i, .nav-next:hover i { color: #fff; }

/* Resultados de búsqueda */
.search-results-info {
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.search-results-info h2 { margin: 0; color: var(--ink); font-size: 1.3rem; }
.search-results-info p { margin: 0; font-size: .9rem; color: var(--muted); }
.clear-search { display: inline-flex; align-items: center; gap: .5rem; color: var(--accent); text-decoration: none; font-size: .9rem; margin-top: .5rem; align-self: flex-start; }
.clear-search:hover { text-decoration: underline; }

/* Banner App Radar Normativo */
.app-banner-section--inline { padding: 0; margin: 1.5rem 0; }
.app-banner-container { max-width: 1000px; margin: 0 auto; }
.app-banner-content {
  display: flex; align-items: center; gap: 2rem; padding: 2rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
}
.app-banner-icon img { width: 90px; height: 90px; border-radius: 20px; flex-shrink: 0; box-shadow: var(--shadow); }
.app-banner-text { flex: 1; }
.app-banner-text h3 { margin: 0 0 .5rem 0; font-size: 1.35rem; color: var(--ink); }
.app-banner-text p { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--muted); }
.app-banner-btn { flex-shrink: 0; transition: transform .2s ease, opacity .2s ease; }
.app-banner-btn:hover { transform: scale(1.05); opacity: .9; }
.google-play-badge { height: 50px; width: auto; display: block; }

/* BOE movido a la app */
.boe-moved { display: flex; justify-content: center; align-items: center; padding: 48px 20px; }
.boe-moved__card {
  max-width: 640px; width: 100%; text-align: center; background: #fff;
  border: 1px solid var(--border); border-radius: 20px; padding: 48px 40px; box-shadow: var(--shadow);
}
.boe-moved__icon {
  width: 88px; height: 88px; margin: 0 auto 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 38px; box-shadow: var(--shadow-hover);
}
.boe-moved__title { font-size: 2rem; line-height: 1.2; margin: 0 0 18px; color: var(--ink); font-weight: 800; }
.boe-moved__lead { font-size: 1.12rem; line-height: 1.7; color: var(--muted); margin: 0 0 32px; }
.boe-moved__lead strong { color: var(--ink); font-weight: 600; }
.boe-moved__cta { display: inline-block; transition: transform .15s ease; }
.boe-moved__cta:hover { transform: translateY(-2px); }
.boe-moved__cta img { height: 56px; width: auto; }
.boe-moved__back { margin: 32px 0 0; font-size: .98rem; color: var(--muted); }
.boe-moved__back a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.boe-moved__back a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .news-content-wrapper { flex-direction: column; }
  .news-sidebar { width: 100%; order: 1; }
  .news-content { order: 2; }
  .news-navigation { flex-direction: column; }
  .nav-prev, .nav-next { max-width: 100%; }
  .nav-next { align-items: flex-start; text-align: left; }
  .news-source-tabs { overflow: hidden; }
  .source-tab { padding: .75rem 1rem; font-size: .9rem; flex: 1; justify-content: center; }
  .relevance-legend { display: block; margin-left: 0; margin-top: .5rem; }
  .news-header h1 { font-size: 1.4rem; }
  .single-news-header h1 { font-size: 1.4rem; }
  .app-banner-content { flex-direction: column; text-align: center; gap: 1.5rem; padding: 1.5rem; }
  .boe-moved__title { font-size: 1.55rem; }
}

/* Evitar scroll horizontal por elementos que sobresalen */
html, body { overflow-x: clip; }
