/* ---------- Base / paleta de grises ---------- */
:root {
  --gray-0: #ffffff;
  --gray-50: #f7f7f7;
  --gray-100: #ededed;
  --gray-200: #dcdcdc;
  --gray-300: #bdbdbd;
  --gray-400: #9c9c9c;
  --gray-500: #7a7a7a;
  --gray-600: #5c5c5c;
  --gray-700: #414141;
  --gray-800: #2a2a2a;
  --gray-900: #171717;

  --bg: var(--gray-50);
  --text: var(--gray-800);
  --muted: var(--gray-500);
  --border: var(--gray-200);
  --surface: var(--gray-0);
  --accent: var(--gray-900);

  --max-width: 1080px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { color: var(--gray-900); margin: 0 0 0.5em; font-weight: 600; }

p { color: var(--text); }

a { color: var(--gray-700); text-decoration: none; }
a:hover { color: var(--gray-900); }

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

section { padding: 64px 0; }
section h2 {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 32px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(150%) blur(6px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand-logo { height: 34px; width: auto; }

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  font-size: 0.95rem;
  color: var(--gray-600);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--gray-900);
  border-bottom-color: var(--gray-400);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 88px 0 72px;
  background: linear-gradient(180deg, var(--gray-100), var(--bg));
  border-bottom: 1px solid var(--border);
}

.hero-mark {
  width: 179px;
  height: 84px;
  margin: 0 auto 24px;
  object-fit: contain;
}

.hero h1 {
  font-size: 2.4rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0;
}

/* ---------- About ---------- */
.about { text-align: center; }
.about p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
}

/* ---------- News ---------- */
.news { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--gray-0);
  color: var(--gray-600);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-btn:hover { border-color: var(--gray-400); }

.filter-btn.active {
  background: var(--gray-900);
  border-color: var(--gray-900);
  color: var(--gray-0);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--gray-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}

.news-card {
  cursor: pointer;
}

.news-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.news-card:focus-visible {
  outline: 2px solid var(--gray-500);
  outline-offset: 2px;
}

.news-thumb {
  aspect-ratio: 16 / 10;
  background: var(--gray-100);
  overflow: hidden;
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.news-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.news-tag {
  align-self: flex-start;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 3px 9px;
  border-radius: 999px;
}

.news-card h3 {
  font-size: 1.05rem;
  margin: 0;
}

.news-date {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.news-excerpt {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
  flex: 1;
}

.news-readmore {
  align-self: flex-start;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-top: 4px;
}

.news-card:hover .news-readmore { color: var(--gray-900); }

.news-empty {
  text-align: center;
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 24px 0;
}

#loadMoreBtn { display: block; margin: 32px auto 0; }

/* ---------- Página de artículo ---------- */
.wrap-narrow { max-width: 720px; }

.post-section { padding: 48px 0 72px; }

.post-back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 20px;
}

.post-back:hover { color: var(--gray-900); }

.post-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.post h1 {
  font-size: 1.8rem;
  margin: 10px 0 6px;
}

.article-content { margin-top: 16px; }
.article-content p {
  color: var(--text);
  margin: 0 0 16px;
}
.article-content p:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn-outline, .btn-solid {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-400);
  color: var(--gray-700);
}

.btn-outline:hover { border-color: var(--gray-900); color: var(--gray-900); }

.btn-solid {
  background: var(--gray-900);
  border: 1px solid var(--gray-900);
  color: var(--gray-0);
}

.btn-solid:hover { background: var(--gray-700); border-color: var(--gray-700); color: var(--gray-0); }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}

.footer-mark {
  width: 68px;
  height: 32px;
  margin: 0 auto 10px;
  opacity: 0.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gray-0);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }

  .site-nav.open { max-height: 260px; }

  .site-nav a {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
  }

  .hero h1 { font-size: 1.9rem; }
}
