/* Blog público + backoffice (complementa styles.css en páginas de blog) */

:root {
  --admin-border: rgba(0, 0, 0, 0.09);
  --admin-danger: #c92a2a;
}

.blog-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.blog-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 16px 52px;
  background: rgba(245, 244, 240, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--admin-border);
}

.blog-nav-logo {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
}

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

.blog-nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 22px;
}

.blog-nav-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
}

.blog-nav-links a:hover,
.blog-nav-links a.active {
  color: var(--text);
}

.blog-nav-cta {
  background: var(--text) !important;
  color: #fff !important;
  padding: 9px 20px;
  border-radius: 100px;
  font-weight: 500 !important;
}

.blog-nav-cta:hover {
  background: var(--accent-dark) !important;
  color: #fff !important;
}

.blog-header {
  background: linear-gradient(180deg, var(--surface2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 32px;
}

.blog-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 52px;
  position: relative;
}

.blog-header-inner::after {
  content: '';
  display: block;
  margin-top: 20px;
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.blog-header-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 12px;
}

.blog-header-desc {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 48ch;
  margin: 0;
}

.blog-list-wrap {
  flex: 1;
  padding: 28px 52px 80px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.blog-empty {
  color: var(--muted);
  font-size: 16px;
  max-width: 48ch;
}

.blog-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  width: 100%;
  align-items: stretch;
}

@media (min-width: 600px) {
  .blog-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .blog-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

.blog-cards > li {
  display: flex;
  min-width: 0;
}

.blog-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  background: var(--surface);
  border: 1.5px solid var(--admin-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0, 196, 154, 0.22);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border-radius: inherit;
}

.blog-card-thumb {
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  overflow: hidden;
}

.blog-card-thumb--placeholder {
  background: linear-gradient(
    135deg,
    rgba(0, 196, 154, 0.12) 0%,
    var(--surface2) 45%,
    rgba(85, 51, 255, 0.06) 100%
  );
}

.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 22px;
  min-height: 0;
}

.blog-card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--text);
}

.blog-card-excerpt {
  flex: 1;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-author {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.blog-card-date {
  font-size: 12px;
  color: var(--accent-dark);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-footer {
  padding: 28px 52px;
  border-top: 1.5px solid var(--admin-border);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

.blog-footer a {
  color: var(--accent-dark);
  font-weight: 500;
}

/* Artículo */
.article-wrap {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 52px 80px;
  width: 100%;
}

.article-cover {
  margin: -32px -52px 28px;
  aspect-ratio: 16 / 9;
  max-height: min(380px, 52vh);
  background: var(--surface2);
  overflow: hidden;
  border-radius: 0 0 20px 20px;
  border: 1.5px solid var(--admin-border);
  border-top: none;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-header .section-label {
  margin-bottom: 12px;
}

.article-header .section-label a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.article-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 16px;
}

.article-excerpt {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 40px;
  font-size: 13px;
  color: var(--muted);
}

.article-author {
  font-weight: 500;
  color: var(--text);
}

.article-byline-sep {
  opacity: 0.45;
  user-select: none;
}

.article-byline .article-meta {
  margin-bottom: 0;
}

.article-meta {
  display: inline;
  font-size: 13px;
  color: var(--muted);
}

.prose {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 26px;
  margin-top: 2em;
  margin-bottom: 0.5em;
  letter-spacing: -0.5px;
}

.prose h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin-top: 1.5em;
}

.prose p {
  color: var(--muted);
}

.prose a {
  color: var(--accent-dark);
  font-weight: 500;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  color: var(--muted);
}

.prose li {
  margin-bottom: 0.35em;
}

.prose pre {
  background: var(--surface2);
  border: 1.5px solid var(--admin-border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}

.prose code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 6px;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.2em;
  margin: 1.2em 0;
  color: var(--muted);
  font-style: italic;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.prose figure {
  margin: 1.5em 0;
}

.prose figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 0.5em;
  line-height: 1.5;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
  font-size: 15px;
}

.prose th,
.prose td {
  border: 1.5px solid var(--admin-border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface2);
  font-weight: 600;
  color: var(--text);
}

.prose caption {
  caption-side: bottom;
  font-size: 13px;
  color: var(--muted);
  margin-top: 0.5em;
}

.prose .article-section {
  margin: 2em 0;
  padding: 1.25em 1.35em;
  border: 1.5px solid var(--admin-border);
  border-radius: 14px;
  background: var(--surface);
}

.prose .article-section > h2:first-child,
.prose .article-section > h3:first-child {
  margin-top: 0;
}

.prose .article-callout {
  margin: 1.5em 0;
  padding: 1.1em 1.25em;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(76, 111, 255, 0.06);
}

.prose .article-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
  margin: 1.5em 0;
}

@media (max-width: 640px) {
  .prose .article-two-col {
    grid-template-columns: 1fr;
  }
}

.prose .article-lead {
  font-size: 1.08em;
  line-height: 1.75;
}

.article-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1.5px solid var(--admin-border);
}

.article-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-dark);
  text-decoration: none;
}

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

@media (max-width: 768px) {
  .blog-nav,
  .blog-header-inner,
  .blog-list-wrap,
  .article-wrap,
  .blog-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .article-cover {
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -24px;
    border-radius: 0 0 14px 14px;
  }
}

/* ——— Admin ——— */
.admin-body {
  margin: 0;
  min-height: 100vh;
  background: #f0efeb;
  font-family: 'DM Sans', sans-serif;
  color: #0c0c10;
}

.admin-login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1.5px solid var(--admin-border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
}

.admin-login-brand {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 26px;
  margin-bottom: 8px;
}

.admin-login-brand span {
  color: #00c49a;
}

.admin-login-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 8px;
}

.admin-login-hint {
  font-size: 14px;
  color: #6e6e80;
  margin-bottom: 24px;
}

.admin-login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
}

.admin-login-footer a {
  color: #009a78;
}

.admin-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

.admin-alert-error {
  background: #ffe8e8;
  color: #c92a2a;
  border: 1px solid #ffc9c9;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6e6e80;
  margin-top: 12px;
}

.admin-label:first-of-type {
  margin-top: 0;
}

.admin-input,
.admin-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #f5f4f0;
  border: 1.5px solid var(--admin-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #0c0c10;
}

.admin-input:focus,
.admin-textarea:focus {
  outline: none;
  border-color: #00c49a;
}

.admin-textarea-short {
  min-height: 72px;
  resize: vertical;
}

.admin-textarea-body {
  font-family: ui-monospace, 'DM Sans', monospace;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

.admin-tinymce-fallback {
  min-height: 420px;
  resize: vertical;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.admin-hint {
  font-size: 12px;
  color: #6e6e80;
  margin-top: 6px;
  line-height: 1.45;
}

.admin-hint code {
  font-size: 11px;
  background: #eeecea;
  padding: 2px 6px;
  border-radius: 4px;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.admin-btn-primary {
  background: #00c49a;
  color: #fff;
  margin-top: 20px;
}

.admin-btn-primary:hover {
  background: #009a78;
}

.admin-btn-ghost {
  background: transparent;
  color: #6e6e80;
  border: 1.5px solid var(--admin-border);
}

.admin-btn-ghost:hover {
  color: #0c0c10;
  border-color: #0c0c10;
}

.admin-btn-text {
  background: none;
  border: none;
  color: #009a78;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}

.admin-btn-text:hover {
  text-decoration: underline;
}

.admin-btn-danger {
  color: var(--admin-danger) !important;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1.5px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-topbar-brand {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: #0c0c10;
}

.admin-topbar-brand span {
  color: #00c49a;
}

.admin-topbar-brand em {
  font-style: normal;
  font-weight: 600;
  font-size: 13px;
  color: #6e6e80;
  margin-left: 6px;
}

.admin-topbar-back {
  font-weight: 600;
  font-size: 15px;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-user {
  font-size: 13px;
  color: #6e6e80;
}

.admin-link {
  font-size: 14px;
  color: #009a78;
  font-weight: 500;
  text-decoration: none;
}

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

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

.admin-main-wide {
  max-width: 900px;
}

.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.admin-page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.5px;
}

.admin-empty {
  color: #6e6e80;
  font-size: 15px;
}

.admin-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1.5px solid var(--admin-border);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6e6e80;
  font-weight: 700;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-code {
  font-size: 12px;
  background: #f5f4f0;
  padding: 4px 8px;
  border-radius: 6px;
}

.admin-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}

.admin-badge-live {
  background: #d8faf2;
  color: #009a78;
}

.admin-badge-draft {
  background: #eeecea;
  color: #6e6e80;
}

.admin-table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.admin-inline-form {
  display: inline;
  margin: 0;
}

.admin-post-form {
  background: #fff;
  border: 1.5px solid var(--admin-border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.admin-field {
  margin-bottom: 22px;
}

.admin-field-row {
  margin-bottom: 8px;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
  color: #0c0c10;
}

.admin-check input {
  width: 18px;
  height: 18px;
  accent-color: #00c49a;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.admin-form-actions .admin-btn-primary {
  margin-top: 0;
}

.admin-check-spaced {
  margin-top: 12px;
}

.admin-cover-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.admin-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.admin-file-label {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.admin-cover-preview {
  margin-top: 16px;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--admin-border);
  background: #f5f4f0;
}

.admin-cover-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

.admin-body-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.admin-btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.admin-hint-inline {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.admin-table-author {
  font-size: 13px;
  color: #6e6e80;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table-thumb {
  width: 56px;
  vertical-align: middle;
}

.admin-table-thumb img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  display: block;
}

.admin-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #eeecea;
  color: #c0c0cc;
  font-size: 14px;
}
