/*  Minimal, elegante, y accesible.  */
/*  Tipografía del sistema + dark por defecto, respeta prefers-color-scheme  */

:root{
  --bg: #0b1020;
  --surface: #111935;
  --border: #1b2542;
  --text: #eaf1ff;
  --muted: #a8b3cf;
  --brand1: #7dd3fc;
  --brand2: #34d399;
  --accent: #3dd6ad;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 10px 22px rgba(0,0,0,.25);
}

@media (prefers-color-scheme: light) {
  :root{
    --bg: #f7f9fc;
    --surface: #ffffff;
    --border: #e7ecf4;
    --text: #0e1321;
    --muted: #5a6783;
    --brand1: #2563eb;
    --brand2: #14b8a6;
    --accent: #0ea5a4;
    --danger: #e11d48;
    --shadow: 0 6px 18px rgba(0,0,0,.08);
  }
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font: 500 16px/1.55 system-ui,-apple-system,Segoe UI,Inter,Roboto,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: .2px;
}

/* Layout
------------------------------------------ */
.container{max-width: 1040px; margin: 0 auto; padding: 20px}

.site-header{
  position: sticky; top:0; z-index: 20;
  backdrop-filter: saturate(140%) blur(8px);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:16px}

.brand{
  text-decoration:none; display:inline-flex; align-items:center; gap:10px;
}
.brand-mark{
  font-weight: 900; letter-spacing:.2px; font-size: 20px;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav a{
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
}
.nav a:hover{ background: color-mix(in oklab, var(--surface) 80%, transparent); color: var(--text) }

/* Footer */
.site-footer{border-top: 1px solid var(--border); margin-top: 40px}
.site-footer p{color: var(--muted); margin: 16px 0}

/* Typography */
.page-title{margin: 10px 0 14px; font-size: 28px; letter-spacing:.3px}
.post-title{margin: 6px 0 14px; font-size: 32px; line-height:1.15}

/* Grid & Cards
------------------------------------------ */
.grid{
  display:grid; gap:16px;
  grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
}
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover{ transform: translateY(-2px); box-shadow: 0 14px 26px rgba(0,0,0,.28) }

.card-media{display:block; aspect-ratio: 16/9; background: #0a0f22}
.card-media img{width:100%; height:100%; object-fit:cover; display:block}
.card-placeholder{height:100%; display:flex; align-items:center; justify-content:center; color:#32406a; font-weight:800; letter-spacing:.2px}

.card-body{padding:14px}
.card-title{margin:0 0 6px; font-size:18px}
.card-title a{color:inherit; text-decoration:none}
.card-title a:hover{ text-decoration: underline }
.card-excerpt{margin:0; color: var(--muted)}
.card-meta{margin-top:10px; color:var(--muted); font-size:13px}

/* Post
------------------------------------------ */
.post-hero{
  width:100%; max-height: 460px; object-fit:cover;
  border-radius: 16px; border:1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 10px 0 18px;
}
.sep{border:0; height:1px; background: var(--border); margin: 20px 0}

.prose { color: var(--text) }
.prose p{margin: .6rem 0 1rem}
.prose img{max-width:100%; border-radius: 10px}
.prose a{color: var(--brand1); text-decoration: underline}
.sources ul{margin:.4rem 0 0; padding-left: 18px}

/* Forms & Table
------------------------------------------ */
.form input,.form textarea{
  width:100%; padding:12px 12px;
  background: var(--surface);
  color: var(--text);
  border:1px solid var(--border); border-radius:12px;
}
.form textarea{resize: vertical}
.form label{display:block; margin: 8px 0}
.form-actions{display:flex; gap:10px; margin-top: 8px}
.form-grid{display:grid; gap:12px}

.btn{
  background: linear-gradient(90deg, var(--brand2), var(--brand1));
  color:#061621; border:0; padding:10px 14px; border-radius:12px;
  font-weight:800; cursor:pointer;
}
.btn:hover{ filter: saturate(110%) brightness(1.02) }
.btn-quiet{
  background: transparent; color: var(--muted); border:1px solid var(--border);
}
.btn-quiet:hover{ color: var(--text); background: color-mix(in oklab, var(--surface) 90%, transparent) }

.table-wrap{overflow:auto; background: var(--surface); border:1px solid var(--border); border-radius:12px}
.table{width:100%; border-collapse: collapse; min-width: 720px}
.table th,.table td{padding:10px 12px; border-bottom:1px solid var(--border); text-align:left}
.row-actions .link{margin-right:10px}
.link{background:none;border:0;color:var(--brand1);cursor:pointer;text-decoration:underline}
.link.danger{color: var(--danger)}

/* Feedback */
.flash-wrap{margin:10px 0 6px}
.flash{margin:0; padding:10px 12px; border:1px solid var(--border); border-radius:12px; background: color-mix(in oklab, var(--surface) 85%, transparent)}
