:root{
  --bg:#faf8f4;
  --ink:#1f1c18;
  --muted:#6f675c;
  --accent:#9a5b34;
  --accent-soft:#c98a5e;
  --line:#e7e0d6;
  --card:#fffdf9;
  --sidebar-w:300px;
  --content-max:760px;
}
:root[data-theme="dark"]{
  --bg:#16140f;
  --ink:#ece6dc;
  --muted:#9a9183;
  --accent:#d99b6c;
  --accent-soft:#c98a5e;
  --line:#2e2a22;
  --card:#1e1b15;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:17px/1.7 Georgia,'Iowan Old Style','Palatino Linotype',serif;
  transition:background .2s ease,color .2s ease;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto;border-radius:6px}

/* ---- Layout ---- */
.layout{display:flex;align-items:flex-start;max-width:1180px;margin:0 auto}
.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  padding:42px 34px;
  position:sticky;
  top:0;
  align-self:flex-start;
  text-align:center;
}
.content{
  flex:1 1 auto;
  min-width:0;
  max-width:var(--content-max);
  padding:46px 40px;
  border-left:1px solid var(--line);
  min-height:100vh;
}

/* ---- Theme toggle ---- */
.theme-toggle{
  position:absolute;top:18px;right:18px;
  width:38px;height:38px;border-radius:50%;
  border:1px solid var(--line);background:var(--card);
  color:var(--ink);cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;
  transition:background .2s,border-color .2s,color .2s;
}
.theme-toggle:hover{border-color:var(--accent);color:var(--accent)}
.theme-toggle .icon-moon{display:none}
:root[data-theme="dark"] .theme-toggle .icon-sun{display:none}
:root[data-theme="dark"] .theme-toggle .icon-moon{display:inline}

/* ---- Sidebar ---- */
.brand{display:block;margin:0 auto 20px}
.brand:hover{text-decoration:none}
.brand-logo{
  width:170px;height:170px;border-radius:50%;display:block;margin:0 auto;
  background:var(--card);
  box-shadow:0 4px 22px rgba(0,0,0,.14);
}
.side-tagline{color:var(--muted);font-style:italic;font-size:1.08rem;
  line-height:1.5;margin:0 0 24px}
.side-nav{display:flex;flex-direction:column;gap:7px;margin-bottom:30px;
  font-family:system-ui,sans-serif}
.side-nav a{color:var(--ink);font-size:1.02rem;font-weight:600}
.side-nav a:hover{color:var(--accent)}
.recent h3{font-family:system-ui,sans-serif;font-size:.8rem;letter-spacing:.08em;
  text-transform:lowercase;color:var(--muted);font-weight:600;
  margin:0 0 12px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.recent ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:9px;text-align:left}
.recent a{font-size:.95rem;line-height:1.35;color:var(--ink)}
.recent a:hover{color:var(--accent)}

/* ---- Post list ---- */
.post-list{display:flex;flex-direction:column;gap:22px}
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;
  transition:transform .12s ease,box-shadow .12s ease}
.card:hover{transform:translateY(-2px);box-shadow:0 6px 22px rgba(0,0,0,.1)}
.card-link{display:block;padding:22px 24px;color:inherit}
.card-link:hover{text-decoration:none}
.card time{font-family:system-ui,sans-serif;font-size:.8rem;letter-spacing:.05em;
  text-transform:uppercase;color:var(--accent-soft)}
.card h2{margin:.25em 0 .35em;font-size:1.5rem;line-height:1.2}
.card p{margin:0 0 .6em;color:var(--muted)}
.readmore{font-family:system-ui,sans-serif;font-size:.85rem;color:var(--accent);font-weight:600}

/* ---- Post ---- */
.post{padding:0}
.post-head{margin-bottom:28px;padding-bottom:18px;border-bottom:1px solid var(--line)}
.post-head time{font-family:system-ui,sans-serif;font-size:.82rem;letter-spacing:.05em;
  text-transform:uppercase;color:var(--accent-soft)}
.post-head h1{font-size:2.2rem;line-height:1.15;margin:.2em 0 0}
.post-body{font-size:1.08rem}
.post-body p{margin:0 0 1.2em}
.post-body figure{margin:1.8em 0;text-align:center}
.post-body img{box-shadow:0 2px 14px rgba(0,0,0,.12)}
.post-body blockquote{margin:1.5em 0;padding:.4em 1.2em;border-left:3px solid var(--accent-soft);
  color:var(--muted);font-style:italic}
.post-body h2,.post-body h3{line-height:1.3;margin:1.6em 0 .5em}
.post-body strong{font-weight:700}
/* Dark mode: más contraste para títulos y negritas */
:root[data-theme="dark"] .post-head h1,
:root[data-theme="dark"] .post-body h2,
:root[data-theme="dark"] .post-body h3,
:root[data-theme="dark"] .card h2{color:#fff}
:root[data-theme="dark"] .post-body strong{color:#fff;font-weight:700}
:root[data-theme="dark"] .post-body blockquote strong{color:var(--accent)}
.post-body code{font-family:ui-monospace,monospace;font-size:.92em;
  background:var(--line);padding:.1em .35em;border-radius:4px}
.post-body ul,.post-body ol{padding-left:1.4em}

/* Tablas */
.table-wrap{overflow-x:auto;margin:1.6em 0}
.post-body table{border-collapse:collapse;width:100%;font-size:.96rem;
  font-family:system-ui,sans-serif}
.post-body th,.post-body td{padding:8px 12px;text-align:left;
  border-bottom:1px solid var(--line)}
.post-body thead th{border-bottom:2px solid var(--accent-soft);
  color:var(--accent);font-weight:700;white-space:nowrap}
.post-body tbody tr:hover{background:var(--card)}

/* Vídeos embebidos (responsive 16:9) */
.video{position:relative;width:100%;padding-bottom:56.25%;margin:1.8em 0;
  border-radius:8px;overflow:hidden;box-shadow:0 2px 14px rgba(0,0,0,.12)}
.video iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

/* ---- Post nav ---- */
.post-nav{display:flex;justify-content:space-between;gap:16px;margin:40px 0 0;
  padding-top:22px;border-top:1px solid var(--line);font-family:system-ui,sans-serif;font-size:.9rem}
.post-nav a{max-width:46%}
.post-nav .next{text-align:right;margin-left:auto}

/* ---- Archive ---- */
.page-title{font-size:2rem;margin:0 0 10px}
.year{font-size:1.3rem;color:var(--accent);margin:32px 0 8px;border-bottom:1px solid var(--line);padding-bottom:6px}
.archive-list{list-style:none;padding:0;margin:0}
.archive-list li{display:flex;gap:14px;padding:7px 0;align-items:baseline}
.archive-list time{font-family:ui-monospace,monospace;font-size:.85rem;color:var(--muted);min-width:46px}

/* ---- Footer ---- */
.site-footer{border-top:1px solid var(--line);background:var(--card)}
.foot-wrap{max-width:1180px;margin:0 auto;padding:24px 40px}
.site-footer p{margin:.2em 0;font-size:.9rem}
.muted{color:var(--muted);font-family:system-ui,sans-serif;font-size:.85rem}

/* ---- Responsive ---- */
@media (max-width:820px){
  .layout{flex-direction:column}
  .sidebar{width:100%;flex-basis:auto;position:static;
    padding:28px 24px 18px;border-bottom:1px solid var(--line)}
  .side-tagline{margin-bottom:18px}
  .side-nav{flex-direction:row;justify-content:center;gap:20px;margin-bottom:22px}
  .recent{display:none}
  .content{max-width:100%;border-left:none;padding:28px 24px;min-height:0}
  .post-head h1{font-size:1.7rem}
  .foot-wrap{padding:20px 24px}
  .theme-toggle{top:14px;right:14px}
}
