:root {
  --surface: #0b0f14;
  --surface-2: #131a22;
  --text: #e7edf3;
  --muted: #8fa0b3;
  --accent: #31D0F0;
  --line: #223140;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); line-height: 1.6; }
.wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap--wide { max-width: 1100px; }
a { color: var(--accent); }
.muted { color: var(--muted); }

.site-header { border-bottom: 1px solid var(--line); padding: 16px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.brand__tag { color: var(--accent); font-weight: 700; font-size: .95rem; padding-left: 10px; border-left: 1px solid var(--line); }
.site-footer { text-align: center; color: var(--muted); padding: 40px 20px; font-size: .85rem; }
.brand--foot { display: inline-flex; margin-bottom: 14px; }
.brand--foot img { height: 26px; width: auto; }

.page-title { font-size: 1.6rem; margin-bottom: 1.5rem; }
.post-date { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.post-card {
  display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; transition: transform .15s ease, border-color .15s ease;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--accent-line, rgba(49,208,240,.34)); }
.post-card__media { display: block; aspect-ratio: 16/9; background: var(--surface); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__media--empty img { object-fit: contain; padding: 22%; opacity: .5; }
.post-card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__body h2 { font-size: 1.15rem; margin: 0; line-height: 1.35; }
.post-card__body h2 a { color: var(--text); text-decoration: none; }
.post-card__body h2 a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }
.txtlink { color: var(--accent); text-decoration: none; font-weight: 600; font-size: .9rem; align-self: flex-start; }
.txtlink:hover { text-decoration: underline; }

.post h1 { font-size: 2rem; margin-bottom: .3rem; }
.post-body img, .post-body video { max-width: 100%; border-radius: 8px; margin: 1.2rem 0; }
.post-body h2 { margin-top: 2rem; }

.reactions { display: flex; gap: 10px; margin: 2.2rem 0; scroll-margin-top: 20px; }
.reactions form { margin: 0; }
.reaction-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 16px; border-radius: 100px; font-size: .95rem; cursor: pointer;
}
.reaction-btn:hover { border-color: var(--accent); }
.reaction-btn span { color: var(--muted); font-variant-numeric: tabular-nums; }

.comments { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.comments h2 { font-size: 1.3rem; margin-bottom: 1.2rem; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment__meta { margin: 0 0 4px; font-size: .85rem; color: var(--muted); }
.comment__body { margin: 0; }
.comment-form { margin-top: 1.8rem; display: flex; flex-direction: column; gap: 6px; }
.comment-form label { font-weight: 600; margin-top: 10px; }
.comment-form input[type=text], .comment-form textarea {
  width: 100%; padding: 10px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 6px; font: inherit; resize: vertical;
}
.comment-form .btn { align-self: flex-start; margin-top: 12px; }
/* Campo trampa: fuera de la vista para personas, pero presente en el DOM
   para que un bot que rellena todos los campos delate que no es humano. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Admin */
body.admin { background: var(--surface-2); }
.login-box { max-width: 340px; margin: 18vh auto; padding: 24px; }
.login-logo { height: 34px; width: auto; margin-bottom: 24px; }
.login-box input[type=password] { width: 100%; padding: 10px; margin: 8px 0 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 6px; }
.notice--err { background: #3a1a1a; border: 1px solid #7a2a2a; color: #ffb4b4; padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; }

.admin-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.admin-header__left { display: flex; align-items: center; gap: 18px; }
.admin-header__left h1 { font-size: 1.2rem; margin: 0; }
.btn { display: inline-block; background: var(--accent); color: #04222B; text-decoration: none; padding: 8px 14px; border-radius: 6px; font-weight: 600; border: none; cursor: pointer; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn--small { padding: 4px 10px; font-size: .85rem; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.tag { background: var(--line); padding: 2px 8px; border-radius: 100px; font-size: .8rem; }
.tag--ok { background: rgba(49,208,240,.13); color: var(--accent); }

#post-form label { display: block; margin: 18px 0 6px; font-weight: 600; }
#post-form input[type=text] { width: 100%; padding: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 6px; font-size: 1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.toolbar button { background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.editor { min-height: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.editor img, .editor video { max-width: 100%; border-radius: 6px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-weight: 400; }
.form-actions { margin-top: 24px; }

.admin-comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.admin-comments h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.admin-comments .comment { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.admin-comments .comment__meta { margin: 0; font-size: .85rem; color: var(--muted); }
.admin-comments .comment__body { margin: 0; }
.admin-comments form { margin: 0; }

/* ---------- cookies ---------- */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 480px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.75); color: var(--text);
}
.cookie p { font-size: .88rem; color: var(--text); opacity: .85; margin: 0 0 1rem; }
.cookie .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie .btns .btn { padding: .55em 1em; font-size: .86rem; }
