:root {
  --bg: #f6f7fb;
  --text: #202430;
  --muted: #5e6577;
  --link: #0a66cc;
  --gepac-bg: #efe6ff;
  --aeal-bg: #ffeedc;
  --card-border: #dbe0ea;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f3f1ec;
  min-height: 100vh;
  color: var(--text);
}

.site-header {
  padding: 14px 20px 12px;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
  background: #fff;
  position: relative;
}
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #8f63d9 0%, #e78a35 100%);
}
.brand-head {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 6px;
  width: 100%;
  text-align: center;
}
.brand-head a {
  display: inline-flex;
  justify-content: center;
}
.gepac-logo {
  height: 44px;
  width: auto;
  display: block;
  margin: 0 auto;
}
.brand-tag {
  text-align: center;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: #00a39b;
  margin: 0 auto 4px;
}
.site-header h1 {
  margin: 2px 0 8px;
  font-size: 2.08rem;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: .01em;
  line-height: 1.18;
}
.site-header p { margin: 0; color: var(--muted); font-size: .95rem; }
.brand-strip {
  margin: 12px auto 0;
  width: 100%;
  max-width: 860px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00a39b 0%, #8f63d9 45%, #e78a35 100%);
}
.top-nav { margin-top: 12px; }
.top-sections {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.nav-link {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  border: 1px solid rgba(0,0,0,.08);
}
.nav-link:hover { filter: brightness(0.98); }
.nav-link.active-nav { box-shadow: inset 0 0 0 2px rgba(255,255,255,.8); }

.nav-all { background: #6b7385; }
.nav-gepac { background: #8360c8; }
.nav-aeal { background: #de8b4a; }
.nav-history { background: #e8ebf2; color: #202430; }
.nav-search { background: #2b3245; }

.layout {
  max-width: 1320px;
  margin: 20px auto;
  padding: 0 16px 24px;
  display: grid;
  gap: 24px;
}

.home-layout section {
  background: #fff;
  border: 1px solid #e3e0d8;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(20, 28, 45, 0.04);
}

section h2 {
  margin: 2px 0 14px;
  font-size: 1.28rem;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
}

#featured-home { margin-bottom: 16px; }
.featured-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(20, 28, 45, 0.08);
}
.featured-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 10px;
}
.featured-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.25;
  font-family: Georgia, "Times New Roman", serif;
}
.featured-card p {
  margin: 0 0 10px;
  line-height: 1.6;
  font-size: 1.02rem;
}

.news-list {
  display: grid;
  gap: 14px;
}

.home-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

.left-sidebar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 12px;
}

.module {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(20, 28, 45, 0.04);
}
.module h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.mini-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}
.mini-list a {
  color: #2b3245;
  text-decoration: none;
  font-size: .92rem;
}
.mini-list a:hover { text-decoration: underline; }

.status-box {
  font-size: .9rem;
  color: #384055;
  line-height: 1.4;
}
.status-ok { color: #146c2e; font-weight: 700; }
.status-warn { color: #9a5a00; font-weight: 700; }

.ad-slot {
  display: none !important;
}

.news-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(20, 28, 45, 0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.news-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 28, 45, 0.08);
}
.news-card.gepac,
.featured-card.gepac {
  background: var(--gepac-bg);
  border-left: 8px solid #8f63d9;
}
.news-card.aeal,
.featured-card.aeal {
  background: var(--aeal-bg);
  border-left: 8px solid #e78a35;
}

.thumb {
  width: 190px;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08);
}

.news-card > div,
.featured-card > div {
  display: flex;
  flex-direction: column;
}

.news-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  line-height: 1.34;
  font-family: Georgia, "Times New Roman", serif;
}
.news-card p {
  margin: 0 0 10px;
  color: #384055;
  font-size: 1rem;
  line-height: 1.6;
}
.read-more {
  color: #fff;
  background: #1f5fbf;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 8px;
}
.read-more:hover { filter: brightness(1.05); text-decoration: none; }

.card-footer {
  margin-top: 10px;
  color: #5e6577;
  font-size: .82rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meta {
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.read-time {
  font-size: .74rem;
  font-weight: 700;
  color: #3f4860;
  background: #edf1f9;
  border: 1px solid #d7deea;
  border-radius: 999px;
  padding: 2px 8px;
}
.editorial-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  margin-right: 6px;
  vertical-align: middle;
}
.pill-gepac {
  background: #e6dafc;
  color: #4a2d87;
  border: 1px solid #cbb6f3;
}
.pill-aeal {
  background: #ffe4cb;
  color: #7a3f0d;
  border: 1px solid #f2bf92;
}

.age-bottom {
  margin-top: auto;
  padding-top: 10px;
  align-self: flex-end;
  text-align: right;
  font-size: .82rem;
  font-weight: 700;
  color: #2b3245;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-group {
  margin: 6px 0 10px;
}
.filter-title {
  font-size: .86rem;
  color: #5b6478;
  font-weight: 700;
  margin: 0 0 8px;
}
.filter-btn {
  border: 1px solid #cfd6e4;
  background: white;
  color: #222;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.year-btn {
  background: #fff;
  border: 1px solid #cfd6e4;
  border-radius: 999px;
  min-height: 34px;
  padding: 5px 10px;
  font-size: .82rem;
  font-weight: 800;
}
.year-btn.active {
  border-color: #202430;
  box-shadow: inset 0 0 0 2px rgba(32,36,48,.15);
}
.month-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.month-btn {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .9rem;
}
.month-btn.active {
  border-color: #202430;
  box-shadow: inset 0 0 0 2px rgba(32,36,48,.15);
}

.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.search-form input {
  flex: 1;
  min-width: 220px;
  border: 1px solid #cfd6e4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .95rem;
}
.filter-btn.active {
  outline: 2px solid #202430;
}
.filter-btn.gepac-btn {
  background: #efe6ff;
  border-color: #8f63d9;
}
.filter-btn.aeal-btn {
  background: #ffeedc;
  border-color: #e78a35;
}

.month-block {
  margin-bottom: 18px;
}
.month-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: #2b3245;
  border-left: 4px solid #202430;
  padding-left: 8px;
}

@media (max-width: 1050px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
  /* En móvil primero noticias, luego sidebar */
  .home-layout > section {
    order: 1;
  }
  .home-layout > .left-sidebar {
    order: 2;
  }
  .left-sidebar {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
  .featured-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .news-card {
    grid-template-columns: 1fr;
  }
  .thumb {
    width: 100%;
    height: 200px;
  }
  .left-sidebar {
    grid-template-columns: 1fr;
  }
  .top-sections {
    gap: 6px;
  }
  .nav-link {
    padding: 7px 10px;
    font-size: .85rem;
  }
  .ad-slot {
    min-height: 120px;
  }
}

.empty {
  color: var(--muted);
  font-style: italic;
  padding: 8px;
}

.bottom-back-wrap {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.bottom-back {
  font-weight: 700;
}
