:root {
  --verde: #073a2f;
  --verde-claro: #0d5c4a;
  --fondo: #faf9f6;
  --texto: #222;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--fondo);
  color: var(--texto);
}

.blog-header {
  background: var(--verde);
  color: white;
  padding: 40px 20px;
  text-align: center;
}

.blog-header h1 { margin: 10px 0 4px; font-size: 2rem; }
.blog-header p { margin: 0; opacity: 0.85; }

.blog-logo-link {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
}
.blog-logo-link:hover { opacity: 1; }

.blog-grid {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.blog-empty { text-align: center; color: #777; grid-column: 1 / -1; }

.blog-card {
  display: block;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.10); }

.blog-card-img { width: 100%; height: 180px; object-fit: cover; }
.blog-card-body { padding: 18px; }
.blog-card-body h2 { margin: 0 0 8px; font-size: 1.2rem; color: var(--verde); }
.blog-card-body p { margin: 0 0 10px; color: #555; font-size: 0.95rem; }

.blog-date { font-size: 0.8rem; color: #888; }

.blog-post {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 20px 60px;
}
.blog-post-img { width: 100%; border-radius: 12px; margin-bottom: 24px; max-height: 420px; object-fit: cover; }
.blog-post h1 { color: var(--verde); margin-bottom: 8px; }
.blog-post-content { margin-top: 24px; line-height: 1.75; font-size: 1.05rem; }
.blog-post-content h2 { color: var(--verde); margin-top: 32px; }
.blog-post-content img { max-width: 100%; border-radius: 8px; }
.blog-post-content a { color: var(--verde-claro); }

/* Admin */
.admin-wrap { max-width: 800px; margin: 30px auto; padding: 0 20px 60px; }
.btn-primario {
  background: var(--verde); color: white; border: none;
  padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 0.95rem;
}
.btn-primario:hover { background: var(--verde-claro); }

.admin-item {
  display: flex; justify-content: space-between; align-items: center;
  background: white; padding: 14px 18px; border-radius: 10px; margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.estado { margin-left: 10px; font-size: 0.75rem; padding: 3px 8px; border-radius: 20px; }
.estado.pub { background: #dff3e8; color: #0d5c4a; }
.estado.draft { background: #f3e8d8; color: #8a5b1e; }

.admin-item-actions button {
  margin-left: 8px; border: 1px solid #ddd; background: white;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
.btn-borrar { color: #b03030; }

.admin-editor { margin-top: 30px; background: white; padding: 24px; border-radius: 12px; }
.admin-editor label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: #444; }
.admin-editor input[type=text], .admin-editor textarea {
  width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #ddd; border-radius: 8px;
  font-family: inherit; font-size: 0.95rem;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.imagen-nombre { display: block; margin-top: 6px; font-size: 0.85rem; color: #666; }
.imagen-preview { display: block; margin-top: 10px; max-width: 220px; border-radius: 8px; }
.admin-actions { display: flex; gap: 10px; margin-top: 10px; }
.admin-actions button[type=button] {
  background: #eee; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer;
}
