/* Articles CSS - Proyecto Erebos v2.1 */

:root {
  --article-bg: rgba(17, 24, 36, 0.46);
  --article-border: rgba(255, 255, 255, 0.06);
  --article-text: #f2efe6;
  --article-accent: #d6b36a;
  --article-meta: #8a8a8a;
}

/* Main articles list container */
.articles-list {
  display: grid;
  gap: clamp(22px, 3vw, 32px);
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  opacity: 1;
  transition: opacity 0.55s ease;
}

.articles-list.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Individual article card */
.article-card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 32px);
  border-radius: calc(var(--radius, 18px) + 6px);
  background: var(--article-bg);
  border: 1px solid var(--article-border);
  box-shadow: var(--shadowSoft, 0 10px 30px rgba(0, 0, 0, 0.35));
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  margin: 0;
}

.article-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 240px at 15% 10%, rgba(214, 179, 106, 0.10), transparent 55%),
    radial-gradient(500px 220px at 90% 20%, rgba(120, 170, 255, 0.08), transparent 60%);
  opacity: 0.7;
  z-index: 0;
}

.article-card:hover {
  border-color: rgba(214, 179, 106, 0.25);
  box-shadow: 0 14px 34px rgba(214, 179, 106, 0.08), 0 14px 34px rgba(0, 0, 0, 0.30);
  transform: translateY(-2px);
}

/* Article title */
.article-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--article-accent);
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

/* Article metadata (date, category) */
.article-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  color: var(--article-meta);
  flex-wrap: wrap;
}

.article-meta time {
  color: var(--article-meta);
}

.article-category {
  display: inline-block;
  background: rgba(214, 179, 106, 0.12);
  border: 1px solid rgba(214, 179, 106, 0.25);
  padding: 4px 12px;
  border-radius: 4px;
  color: var(--article-accent);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Article excerpt (preview) */
.article-excerpt {
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.article-excerpt p {
  margin: 0 0 12px 0;
  padding: 0;
  color: var(--article-text);
  line-height: 1.7;
  font-size: 0.95rem;
}

.article-excerpt p:last-child {
  margin-bottom: 0;
}

/* Toggle button (Read more/Read less) */
.article-toggle {
  align-self: flex-start;
  background: rgba(214, 179, 106, 0.15);
  border: 1px solid rgba(214, 179, 106, 0.35);
  color: var(--article-accent);
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}

.article-toggle:hover {
  background: rgba(214, 179, 106, 0.25);
  border-color: rgba(214, 179, 106, 0.55);
  transform: translateX(4px);
}

.article-toggle:active {
  transform: translateX(2px);
}

/* Full article content (hidden by default) */
.article-content {
  position: relative;
  z-index: 1;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.5s ease, margin 0.5s ease;
}

.article-content:not([hidden]) {
  display: block;
}

.article-content[hidden] {
  display: block;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.article-card .article-content:not([hidden]) {
  max-height: 12000px;
  opacity: 1;
  margin-bottom: 16px;
}

/* Article body (full content) */
.article-body {
  color: var(--article-text);
  line-height: 1.8;
  font-size: 0.95rem;
}

.article-body p {
  margin: 0 0 16px 0;
  padding: 0;
  line-height: 1.8;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 500;
  margin: 28px 0 16px 0;
  color: var(--article-accent);
  line-height: 1.3;
}

.article-body h3:first-child {
  margin-top: 0;
}

.article-body h4 {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 500;
  margin: 20px 0 12px 0;
  color: rgba(214, 179, 106, 0.85);
  line-height: 1.3;
}

.article-body em {
  color: rgba(214, 179, 106, 0.9);
  font-style: italic;
}

.article-body strong {
  color: var(--article-accent);
  font-weight: 600;
}

.article-body a,
.article-excerpt a {
  color: var(--article-accent);
  text-decoration: underline;
  text-decoration-color: rgba(214, 179, 106, 0.45);
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-body a:hover,
.article-excerpt a:hover {
  color: #f2d38a;
  text-decoration-color: rgba(242, 211, 138, 0.9);
}

/* Responsive design */
@media (max-width: 768px) {
  .articles-list {
    padding: 1.5rem 1rem;
    gap: 18px;
  }

  .article-card {
    padding: 20px;
  }

  .article-title {
    font-size: 1.1rem;
  }

  .article-meta {
    gap: 10px;
    font-size: 0.85rem;
  }

  .article-body {
    font-size: 0.9rem;
  }

  .article-body h3 {
    font-size: 1.1rem;
    margin: 22px 0 14px 0;
  }

  .article-body h4 {
    font-size: 1rem;
    margin: 16px 0 10px 0;
  }
}

@media (max-width: 480px) {
  .articles-list {
    padding: 1rem 0.75rem;
  }

  .article-card {
    padding: 16px;
    gap: 12px;
  }

  .article-title {
    font-size: 1rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 8px;
  }

  .article-excerpt p {
    font-size: 0.9rem;
  }

  .article-body {
    font-size: 0.85rem;
  }

  .article-body h3 {
    font-size: 0.95rem;
  }

  .article-body h4 {
    font-size: 0.9rem;
  }
}

/* Light theme support */
[data-theme="light"] {
  --article-bg: rgba(240, 240, 240, 0.6);
  --article-border: rgba(0, 0, 0, 0.1);
  --article-text: #333333;
  --article-meta: #666666;
}

[data-theme="light"] .article-card {
  background: var(--article-bg);
  border-color: var(--article-border);
}

[data-theme="light"] .article-card:hover {
  border-color: rgba(214, 179, 106, 0.4);
}

[data-theme="light"] .article-excerpt p,
[data-theme="light"] .article-body {
  color: var(--article-text);
}
