/* === Variables === */
:root {
  --primary: #1a1a2e;
  --accent: #e94560;
  --bg: #f8f9fa;
  --text: #1a1a2e;
  --text-light: #6c757d;
  --white: #ffffff;
  --border: #dee2e6;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.14);
  --radius: 8px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

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

/* === Header === */
header {
  background: var(--primary);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.site-logo span {
  color: var(--accent);
}

/* Desktop nav */
.main-nav {
  display: none;
  gap: 1.5rem;
  align-items: center;
  list-style: none;
}

.main-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  transition: color 0.2s;
  white-space: nowrap;
}

.main-nav a:hover { color: var(--accent); }

/* Mobile hamburger (CSS-only) */
.hamburger-toggle { display: none; }
.hamburger-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger-label span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.3s;
}

.mobile-nav {
  display: none;
  background: var(--primary);
  padding: 0 1rem 1rem;
}

.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.hamburger-toggle:checked ~ .mobile-nav { display: block; }
.hamburger-toggle:checked ~ .header-inner .hamburger-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-toggle:checked ~ .header-inner .hamburger-label span:nth-child(2) { opacity: 0; }
.hamburger-toggle:checked ~ .header-inner .hamburger-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 768px) {
  .main-nav { display: flex; }
  .hamburger-label { display: none; }
}

/* === Hero Section === */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 2.5rem;
  background: #111;
}

.hero-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  opacity: 0.75;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.2) 100%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  color: var(--white);
}

.hero-category {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.hero-title {
  font-size: 1.4rem;
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-summary {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-link {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.hero-link:hover { background: #c73752; transform: translateY(-1px); }

@media (min-width: 768px) {
  .hero-image { height: 420px; }
  .hero-content { padding: 2rem 2.5rem; }
  .hero-title { font-size: 2rem; }
  .hero-summary { font-size: 1rem; }
}

@media (min-width: 1024px) {
  .hero-image { height: 500px; }
  .hero-title { font-size: 2.4rem; max-width: 70%; }
  .hero-summary { max-width: 60%; }
}

/* === Section Title === */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}

/* === Article Grid === */
.articles-section {
  padding-bottom: 3rem;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === Article Card === */
.article-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.article-card a { display: flex; flex-direction: column; flex: 1; }

.card-image-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.article-card:hover .card-image { transform: scale(1.04); }

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  display: inline-block;
  background: #f0f0f5;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  align-self: flex-start;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card-summary {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: auto;
}

.card-meta .dot { color: var(--border); }

/* === Ver Más Button === */
.load-more-wrap {
  text-align: center;
  padding: 1.5rem 0 3rem;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-load-more:hover:not(:disabled) { background: #c73752; transform: translateY(-1px); }
.btn-load-more:disabled { opacity: 0.6; cursor: default; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-load-more.loading .spinner { display: block; }
.btn-load-more.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* === Article Detail === */
.article-detail {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }

.article-hero-img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.article-detail h1 {
  font-size: 1.8rem;
  line-height: 1.3;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.article-meta .meta-category {
  background: var(--accent);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.article-meta a { color: var(--accent); }

.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #2d2d2d;
}

.article-body p { margin-bottom: 1.25rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-size: 0.875rem;
  margin-top: 2rem;
}

.back-link:hover { text-decoration: underline; }

/* === Category Page === */
.category-page {
  padding: 2rem 0 4rem;
}

.category-page h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.category-page .subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* === 404 Page === */
.not-found {
  text-align: center;
  padding: 5rem 1rem;
}

.not-found h1 {
  font-size: 5rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.not-found h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 0.5rem;
}

.not-found p { color: var(--text-light); margin-bottom: 1.5rem; }

.btn-home {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-home:hover { background: #c73752; }

/* === Footer === */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.75);
  padding: 3rem 1rem 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer-col h3 {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.footer-col p { font-size: 0.875rem; line-height: 1.6; }

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col ul a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--accent); }

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  max-width: 1200px;
  margin: 0 auto;
}
