/* LastStand — Old-School Library Theme */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;600;700&family=Literata:opsz,wght@7..72,400;7..72,700&display=swap');

:root{
  --bg:#2b2118; --bg-soft:#3a2c22; --ink:#231a13; --muted:#7e6a58;
  --brand:#8c6b3e; --brand-2:#6b4f2c; --paper:#f7f1e1; --white:#fffaf1;
  --shadow: 0 14px 36px rgba(23,14,8,.28);
}

html,body{background:var(--paper)!important;color:var(--ink)!important;margin:0;padding:0}
body{font-family:"Literata",Georgia,serif;letter-spacing:.01em}
h1,h2,h3, .prose h1, .prose h2, .prose h3{font-family:"EB Garamond","Garamond",serif!important;letter-spacing:.4px}
a{color:var(--brand)!important}
hr{border-color:#e3d9c5}
.header, .site-header{background:var(--bg)!important;color:#f4efe5!important;border-bottom:2px solid rgba(255,255,255,.08)!important}
.hero, .masthead{
  background-image: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,0));
  background-size:3px 3px,100% 100%;background-color:var(--bg);color:#f4efe5;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.btn, .button, button{
  background:linear-gradient(180deg,#b69057,#8c6b3e)!important;color:#1e140c!important;
  border:1px solid rgba(0,0,0,.25)!important;border-radius:.6rem!important;
}
.card, .panel, .prose :where(blockquote, pre, code){background:#fffaf1!important;border:1px solid #e3d9c5!important;box-shadow:var(--shadow)!important;border-radius:12px!important}
.site-footer, footer{background:#231a13!important;color:#e3d9c5!important;border-top:1px solid rgba(0,0,0,.2)!important}
.section p:first-of-type::first-letter{font-family:"EB Garamond",serif;font-size:2.5rem;line-height:.9;padding-right:.06em;float:left;color:var(--brand-2)}
/* Print */
@media print{ .no-print{ display:none!important } }
/* AI Widget */
.aiw{position:fixed;right:1rem;bottom:1rem;z-index:1000}
.aiw-btn{background:linear-gradient(180deg,#b69057,#8c6b3e);color:#1e140c;border:1px solid rgba(0,0,0,.2);padding:.75rem 1rem;border-radius:999px;box-shadow:var(--shadow)}
.aiw-panel{position:fixed;right:1rem;bottom:4.25rem;width:min(380px,92vw);background:var(--white);border:1px solid #e3d9c5;border-radius:1rem;box-shadow:0 18px 40px rgba(0,0,0,.28);display:flex;flex-direction:column;max-height:min(70vh, 640px);overflow:hidden}
.aiw-head{background:var(--bg-soft);color:#f4efe5;padding:.75rem 1rem;font-weight:700;border-bottom:1px solid rgba(255,255,255,.1)}
.aiw-log{padding:1rem;overflow:auto;flex:1}
.aiw-msg{margin:.4rem 0;padding:.6rem .8rem;border-radius:.75rem;border:1px solid #e3d9c5;background:#fffaf1}
.aiw-msg.me{background:#f6efe0;border-color:#e0d4bc}
.aiw-form{display:flex;gap:.5rem;border-top:1px solid #e3d9c5;padding:.6rem}
.aiw-form input{flex:1;border-radius:.6rem;padding:.6rem .7rem;border:1px solid #e3d9c5;background:#fffaf1}
.aiw-gear{position:absolute; top:.4rem; right:.6rem; background:transparent; border:0; font-size:1.1rem; cursor:pointer}
.aiw-settings{position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:1200; display:none}
.aiw-settings-dlg{position:absolute; inset:auto 0 0 0; margin:auto; top:10vh; width:min(640px, 92vw); background:var(--white); border:1px solid #e3d9c5; border-radius:1rem; box-shadow:0 24px 64px rgba(0,0,0,.35); padding:0}
.aiw-settings-head{display:flex; justify-content:space-between; align-items:center; padding:1rem 1.25rem; background:var(--bg-soft); color:#f4efe5; border-top-left-radius:1rem; border-top-right-radius:1rem}
.aiw-settings-body{padding:1rem 1.25rem; color:var(--ink)}
.aiw-settings-foot{display:flex; gap:.75rem; justify-content:flex-end; padding:1rem 1.25rem; border-top:1px solid #e3d9c5}
.aiw-x{background:transparent; border:0; color:#fff; font-size:1.5rem; cursor:pointer}
.aiw-row{display:flex; align-items:center; gap:1rem; margin:.75rem 0}
.aiw-row select, .aiw-row input{flex:1}
.small{font-size:.9rem}
.muted{color:#7e6a58}


/* Books hero background */
.hero, .masthead {
  background-image:
    radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px),
    url('../img/hero-books.svg');
  background-size: 3px 3px, 1400px auto;
  background-position: 0 0, center;
  background-repeat: repeat, no-repeat;
  min-height: 48vh;
  display: grid;
  align-items: end;
  padding: 2.5rem 1.25rem;
}

/* --- Readability pass (v20251029b) --- */
body{ color:#1d1712 !important; line-height:1.7 !important; font-size:18px }
.prose p, p{ color:#2a211a !important }
.prose h1, h1{ color:#1b120c !important; line-height:1.22 !important; font-weight:700 }
.prose h2, h2{ color:#2a1a10 !important; line-height:1.28 !important; font-weight:700 }

/* Header / nav contrast */
.header, .site-header{ background:linear-gradient(180deg, #2b2118, #241b13) !important }
nav a, .nav a, .site-header a{ color:#fff4d6 !important; text-shadow:0 1px 0 rgba(0,0,0,.4) }
nav a:hover, .nav a:hover{ color:#ffffff !important; text-decoration:underline }

/* Hero readability: add overlay & text shadow */
.hero, .masthead{
  position:relative;
  color:#fff8e8 !important;
}
.hero::before, .masthead::before{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.25) 50%, rgba(0,0,0,.15));
  pointer-events:none;
}
.hero .hero-inner, .masthead .hero-inner{ position:relative; z-index:1; max-width:1100px; margin-inline:auto }
.hero h1, .masthead h1{ color:#fff7e0 !important; text-shadow:0 2px 4px rgba(0,0,0,.5) }
.hero p, .masthead p{ color:#fcefd2 !important; text-shadow:0 1px 2px rgba(0,0,0,.45) }

/* Buttons: ensure legible text */
.btn, .button, button{
  font-weight:700;
  box-shadow: 0 6px 20px rgba(0,0,0,.25) !important;
}

/* Overlay default hidden (prevents click block) */
.aiw-settings{ display:none }
