/* Human After All — Sistema Blog/Intranet
   Paleta coherente con la landing: fondo oscuro, blanco, acento amarillo/dorado */

:root {
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1c1c1c;
  --surface: #1e1e1e;
  --surface2: #252525;
  --border: #2e2e2e;
  --text: #e8e6e0;
  --text-muted: #7a7a7a;
  --accent: #c9a84c;
  --accent-light: #e5c76b;
  --accent-dim: rgba(201,168,76,0.15);
  --danger: #c0392b;
  --success: #27ae60;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Typography ── */
h1,h2,h3,h4 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
p { color: var(--text); }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-light); }
strong { color: var(--accent-light); }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Navbar ── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: .85rem 0;
}
.navbar .inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
}
.navbar .brand { display: flex; align-items: center; gap: .75rem; }
.navbar .brand span { font-family: 'Playfair Display', serif; font-size: 1.15rem; color: var(--accent); }
.navbar .brand small { color: var(--text-muted); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: .9rem; letter-spacing: .03em; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.4rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #0d0d0d; }
.btn-primary:hover { background: var(--accent-light); color: #0d0d0d; }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-dim); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-sm { padding: .4rem 1rem; font-size: .82rem; }
.btn-success { background: var(--success); color: #fff; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.card-hover { transition: border-color .2s, transform .2s; }
.card-hover:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .4rem; letter-spacing: .04em; text-transform: uppercase; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; background: var(--bg3); border: 1.5px solid var(--border);
  color: var(--text); padding: .7rem 1rem; border-radius: var(--radius);
  font-size: .95rem; font-family: inherit; transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Tags ── */
.tag {
  display: inline-block; padding: .2rem .7rem; border-radius: 99px;
  font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(201,168,76,.3);
}
.tag-status-published { background: rgba(39,174,96,.15); color: #27ae60; border-color: rgba(39,174,96,.3); }
.tag-status-draft { background: rgba(122,122,122,.15); color: var(--text-muted); border-color: var(--border); }
.tag-status-selected { background: rgba(39,174,96,.2); color: #2ecc71; border-color: rgba(46,204,113,.3); }
.tag-status-reviewed { background: rgba(52,152,219,.15); color: #3498db; border-color: rgba(52,152,219,.3); }

/* ── Alerts ── */
.alert { padding: .9rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem; }
.alert-error { background: rgba(192,57,43,.15); border: 1px solid rgba(192,57,43,.4); color: #e74c3c; }
.alert-success { background: rgba(39,174,96,.15); border: 1px solid rgba(39,174,96,.4); color: #2ecc71; }
.alert-info { background: rgba(52,152,219,.12); border: 1px solid rgba(52,152,219,.3); color: #5dade2; }

/* ── Page hero ── */
.page-hero {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.page-hero h1 { margin-bottom: .5rem; }
.page-hero p { color: var(--text-muted); }

/* ── Footer ── */
footer {
  margin-top: 5rem; padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--text-muted); font-size: .85rem;
}
footer a { color: var(--accent); }

/* ── Utilities ── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .85rem; }
.text-center { text-align: center; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── Post content rendering ── */
.post-body { line-height: 1.85; }
.post-body h2 { margin: 2rem 0 .75rem; color: var(--accent-light); }
.post-body h3 { margin: 1.5rem 0 .5rem; }
.post-body p { margin-bottom: 1.1rem; }
.post-body ul, .post-body ol { margin: .75rem 0 1rem 1.5rem; }
.post-body li { margin-bottom: .4rem; }
.post-body blockquote {
  border-left: 3px solid var(--accent); padding: .75rem 1.25rem;
  margin: 1.5rem 0; background: var(--surface2); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted); font-style: italic;
}
.post-body code {
  background: var(--bg3); padding: .15rem .45rem; border-radius: 4px;
  font-family: 'Fira Code', monospace; font-size: .88rem; color: var(--accent-light);
}
.post-body pre { background: var(--bg3); padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; margin: 1.5rem 0; }
.post-body pre code { background: none; padding: 0; }

/* ── Pagination ── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.pagination a, .pagination span {
  padding: .5rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: .9rem; color: var(--text-muted);
  transition: all .2s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Blog grid ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1.75rem; }
.post-card .meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.post-card .post-title { font-family: 'Playfair Display', serif; font-size: 1.25rem; margin: .5rem 0; line-height: 1.3; }
.post-card .excerpt { color: var(--text-muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .card-footer { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }

/* ── Author badge ── */
.author-badge { display: flex; align-items: center; gap: .6rem; }
.author-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.author-avatar-sm { width: 28px; height: 28px; }
.author-initials {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--accent);
}

/* ── Comments ── */
.comments-list { display: flex; flex-direction: column; gap: 1.25rem; }
.comment-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: .6rem; }
.comment-author { font-weight: 600; font-size: .95rem; }
.comment-date { font-size: .8rem; color: var(--text-muted); }
.comment-body { color: var(--text); font-size: .95rem; }

/* ── Suggestions ── */
.suggestion-card { display: flex; gap: 1rem; }
.vote-box { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 52px; }
.vote-count { font-size: 1.4rem; font-weight: 700; color: var(--accent); line-height: 1; }
.vote-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.vote-btn { background: var(--accent-dim); border: 1px solid rgba(201,168,76,.3); color: var(--accent); border-radius: var(--radius); padding: .3rem .5rem; cursor: pointer; transition: all .2s; font-size: .85rem; }
.vote-btn:hover { background: var(--accent); color: #0d0d0d; }
.vote-btn:disabled { opacity: .4; cursor: default; }

/* ── Admin sidebar ── */
.admin-layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--bg2); border-right: 1px solid var(--border); padding: 1.5rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-logo { padding: 0 1.25rem 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.sidebar-logo .brand { font-family: 'Playfair Display', serif; color: var(--accent); font-size: 1rem; }
.sidebar-logo .subbrand { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.25rem; color: var(--text-muted); font-size: .9rem;
  transition: all .2s; border-left: 3px solid transparent;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
  color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim);
}
.sidebar-nav .section-label {
  padding: 1rem 1.25rem .4rem; font-size: .7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .1em;
}
.admin-content { padding: 2.5rem; overflow-y: auto; }

/* ── Admin table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; padding: .75rem 1rem; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--border); font-weight: 600; }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.table-actions { display: flex; gap: .5rem; }

/* ── Editor toolbar ── */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem; background: var(--bg3); border: 1.5px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; }
.editor-toolbar button { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: .35rem .65rem; border-radius: 5px; cursor: pointer; font-size: .85rem; transition: all .2s; }
.editor-toolbar button:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
#post-content { border-radius: 0 0 var(--radius) var(--radius) !important; }

/* ── Stats cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; text-transform: uppercase; letter-spacing: .06em; }

/* ── Login ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 60% 40%, rgba(201,168,76,.08) 0%, transparent 60%), var(--bg); }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 400px; }
.login-box .logo-area { text-align: center; margin-bottom: 2rem; }
.login-box h2 { font-size: 1.5rem; text-align: center; margin-bottom: .3rem; }
.login-box p { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .blog-grid { grid-template-columns: 1fr; }
}
