/* ============================================
   SPRAWLJOURNEY — style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

/* ── VARIABLES ── */
:root {
  --bg:        #0a0c10;
  --surface:   #111318;
  --border:    #1f2330;
  --accent:    #4f8ef7;
  --accent2:   #7c3aed;
  --text:      #e2e8f0;
  --muted:     #6b7280;
  --tag-bg:    #1a1f2e;
  --radius:    10px;
  --max:       1100px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

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

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.site-logo span {
  color: var(--accent);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}
nav ul li a {
  display: block;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
nav ul li a:hover,
nav ul li a.active {
  color: var(--text);
  background: var(--tag-bg);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ── HERO ── */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 760px;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 580px;
  line-height: 1.75;
}

/* ── MAIN LAYOUT ── */
.main-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* ── SECTION TITLES ── */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ── ARTICLE CARDS ── */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.article-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: none;
  cursor: pointer;
}
.article-card:first-child {
  padding-top: 0;
}
.article-card:hover .article-title {
  color: var(--accent);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--accent);
}
.tag.dev    { color: #34d399; }
.tag.gestion { color: #f59e0b; }
.tag.ia     { color: #c084fc; }
.tag.datos  { color: #38bdf8; }

.article-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.article-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.article-excerpt {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.author-name {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.article-thumb {
  width: 90px;
  height: 70px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  align-self: start;
  margin-top: 4px;
}

/* ── FEATURED (primera noticia grande) ── */
.article-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  cursor: pointer;
}
.article-featured:hover .article-title { color: var(--accent); }

.article-featured .article-title {
  font-size: 1.55rem;
  margin-bottom: 0.6rem;
}
.article-featured .article-excerpt {
  -webkit-line-clamp: 3;
}
.article-featured .article-thumb {
  width: 100%;
  height: 140px;
  font-size: 3rem;
}

/* ── SIDEBAR ── */
.sidebar {}

.sidebar-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-block .section-title {
  margin-bottom: 1rem;
}

.topic-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.topic-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.topic-list li a:hover {
  background: var(--tag-bg);
  color: var(--text);
}
.topic-count {
  font-size: 0.75rem;
  background: var(--tag-bg);
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
}

.about-block p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ── BUSCADOR ── */
.search-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}
#search-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.75rem 1.1rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.15);
}
#search-box::placeholder { color: var(--muted); }

/* ── ARTÍCULO INDIVIDUAL ── */
.article-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.article-page .article-meta { margin-bottom: 1rem; }
.article-page h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.article-page .author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.author-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.author-info strong { display: block; font-size: 0.9rem; }
.author-info span { font-size: 0.8rem; color: var(--muted); }

.article-body {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #c8d3e0;
}
.article-body h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.article-body li { margin-bottom: 0.4rem; }
.article-body code {
  background: var(--tag-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent);
}
.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: #a5b4fc;
  font-size: 0.88rem;
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  font-style: italic;
  margin: 1.5rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
footer strong { color: var(--text); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  nav ul {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
  }
  nav ul.open { display: flex; }
  nav ul li a { padding: 0.75rem 1rem; }

  .main-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .article-featured {
    grid-template-columns: 1fr;
  }
  .article-featured .article-thumb { display: none; }
  .article-card {
    grid-template-columns: 1fr;
  }
  .article-thumb { display: none; }
  .sidebar { order: -1; }
}

/* ── HIDDEN (search filter) ── */
.hidden { display: none !important; }
