/* =========================================================
   Firebrand Librarian — shared styles
   Brand red: #9e3232 (spread across headers, links, accents).
   Self-contained; the only assets are the logo + banner in /images.
   ========================================================= */

:root {
  --bg:     #faf6ef;   /* warm paper                  */
  --card:   #fffdf9;   /* brighter panel              */
  --ink:    #241d18;   /* warm near-black text        */
  --muted:  #6f6358;   /* secondary text              */
  --rule:   #e8ddcd;   /* hairline borders            */
  --red:    #9e3232;   /* BRAND red — headers / links */
  --red-d:  #7e2727;   /* darker red (hover)          */
  --red-hi: #b8514a;   /* lighter red (gradients)     */
  --maxw:   760px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
  font-optical-sizing: auto;
}

/* skip link */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: .6rem 1rem; border-radius: 0 0 .4rem 0; z-index: 50;
}
.skip:focus { left: 0; }

/* thin brand bar at the very top */
body::before {
  content: ""; display: block; height: 5px;
  background: linear-gradient(90deg, var(--red), var(--red-d));
}

/* ===================== BANNER ===================== */
.banner {
  display: block; width: 100%; line-height: 0;
  border-bottom: 1px solid var(--rule);
}
.banner img {
  width: 100%; height: 210px;
  object-fit: cover; object-position: center 64%;
  display: block;
}

/* ===================== HEADER ===================== */
.site-header {
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.6rem 1.5rem 1.1rem;
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 1rem 1.5rem;
}
.brand { display: flex; flex-direction: column; gap: .3rem; }
.logo { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--ink); }

.logo-img {
  flex: 0 0 auto; width: 58px; height: 58px;
  border-radius: 50%;
  box-shadow: 0 2px 9px rgba(36,29,24,.18);
}

.wordmark {
  display: flex; flex-direction: column; line-height: .98;
  font-family: "Fraunces", Georgia, serif;
}
.word-fire { font-weight: 900; font-size: 1.7rem; letter-spacing: -.01em; color: var(--red); }
.word-lib  { font-weight: 600; font-size: 1.7rem; letter-spacing: -.01em; }
.tagline { margin: 0; font-style: italic; color: var(--muted); font-size: .98rem; }

/* primary nav */
.site-nav {
  display: flex; flex-wrap: wrap; gap: .2rem 1.2rem;
  font-family: "Fraunces", Georgia, serif;
}
.site-nav a {
  text-decoration: none; color: var(--ink); font-weight: 500;
  padding: .15rem 0; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--red); }
.site-nav a.active { color: var(--red); border-bottom-color: var(--red); }

/* secondary nav (course materials) */
.subnav {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.subnav a {
  font-family: "Fraunces", Georgia, serif; font-size: .92rem;
  text-decoration: none; color: var(--muted);
  padding: .3rem .8rem; border: 1px solid var(--rule);
  border-radius: 2rem; background: var(--card); transition: all .15s;
}
.subnav a:hover { color: var(--red); border-color: var(--red); }
.subnav a.active { color: #fff; background: var(--red); border-color: var(--red); }

.header-rule { max-width: var(--maxw); margin: 1.1rem auto 0; padding: 0 1.5rem; }
.header-rule hr { border: none; border-top: 1px solid var(--rule); margin: 0; }

/* ===================== MAIN ===================== */
main {
  max-width: var(--maxw); margin: 0 auto; padding: 2.2rem 1.5rem 1rem;
  animation: rise .5s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 900;
  font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.05;
  letter-spacing: -.02em; margin: 0 0 1.1rem;
}
h1 .accent { color: var(--red); }

/* section headers carry the brand color on otherwise plain pages */
h2 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: 1.5rem; letter-spacing: -.01em; color: var(--red);
  margin: 2.4rem 0 .6rem; padding-bottom: .3rem;
  border-bottom: 2px solid var(--rule);
}
h3 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: 1.15rem; margin: 1.6rem 0 .4rem; color: var(--red-d);
}

p { margin: 0 0 1.1rem; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red-d); }

.lede { font-size: 1.28rem; line-height: 1.6; }
.intro-flag {
  display: inline-block; font-family: "Fraunces", Georgia, serif;
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); margin-bottom: .6rem;
}

ul { padding-left: 1.2rem; }
li { margin: .35rem 0; }
li > strong { color: var(--ink); }

.resources li { margin: .5rem 0; }
.resources .desc { color: var(--muted); }

/* social pills */
.social { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem .9rem; }
.social li { margin: 0; }
.social a {
  display: inline-block; font-family: "Fraunces", Georgia, serif; text-decoration: none;
  padding: .4rem 1rem; border: 1px solid var(--rule); border-radius: 2rem;
  background: var(--card); color: var(--ink); transition: all .15s;
}
.social a:hover { border-color: var(--red); color: var(--red); transform: translateY(-1px); }

/* quotes / citations */
blockquote {
  margin: .6rem 0 1.2rem; padding: .2rem 0 .2rem 1.1rem;
  border-left: 3px solid var(--red); color: #3d352d; font-style: italic;
}
.cite { display: block; font-style: normal; margin-top: .4rem; }
.note { color: var(--muted); font-size: .98rem; }
.jump { font-family: "Fraunces", Georgia, serif; margin: 0 0 1.6rem; }
.entry { margin: 0 0 1.4rem; }
.entry strong.label { display: block; color: var(--red-d); }

/* document links / buttons */
.doc-list { list-style: none; padding: 0; margin: .4rem 0 1.6rem; }
.doc-list li { margin: .5rem 0; }
.doc-list a, .doc-file a {
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1.1rem; background: var(--card);
  border: 1px solid var(--rule); border-radius: .6rem;
  text-decoration: none; color: var(--ink); transition: all .15s;
}
.doc-list a:hover, .doc-file a:hover {
  border-color: var(--red); transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(36,29,24,.06);
}
.doc-file { margin: .6rem 0; }
.doc-list .ic, .doc-file .ic {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: .35rem; background: linear-gradient(160deg, var(--red-hi), var(--red));
  color: #fff; font-family: "Fraunces", serif; font-size: .62rem; font-weight: 700;
}
.doc-list .doc-name, .doc-file .doc-name { font-family: "Fraunces", Georgia, serif; font-weight: 500; }

.cv-embed {
  width: 100%; height: 80vh; min-height: 520px;
  border: 1px solid var(--rule); border-radius: .6rem; background: var(--card);
}

.callout {
  background: var(--card); border: 1px solid var(--rule);
  border-left: 4px solid var(--red); border-radius: .5rem;
  padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: 1rem;
}
.callout strong { color: var(--red-d); }

/* blog index */
.post-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.post-list li { margin: 0; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.post-list li:first-child { padding-top: .5rem; }
.post-list h2 { border: none; margin: 0 0 .2rem; padding: 0; font-size: 1.5rem; font-weight: 600; color: var(--ink); }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--red); }
.post-date {
  font-family: "Fraunces", Georgia, serif; font-size: .85rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem;
}
.post-excerpt { margin: .3rem 0 .6rem; color: #3d352d; }
.readmore { font-family: "Fraunces", Georgia, serif; font-weight: 500; text-decoration: none; }
.readmore::after { content: " \2192"; }

/* single post */
.post-body { margin-top: .4rem; }
.post-body p { margin: 0 0 1.1rem; }
.backlink { display: inline-block; margin-top: 2rem; font-family: "Fraunces", Georgia, serif; text-decoration: none; }
.backlink::before { content: "\2190 "; }

/* ===================== FOOTER ===================== */
.site-footer {
  max-width: var(--maxw); margin: 3rem auto 0;
  padding: 1.6rem 1.5rem 2.6rem; border-top: 1px solid var(--rule); font-size: .95rem;
}
.foot-links, .foot-social {
  display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-bottom: .7rem;
  font-family: "Fraunces", Georgia, serif;
}
.foot-links a, .foot-social a { text-decoration: none; color: var(--muted); }
.foot-links a:hover, .foot-social a:hover { color: var(--red); }
.foot-note { color: var(--muted); margin: .6rem 0 0; font-size: .88rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 620px) {
  body { font-size: 1.06rem; }
  .banner img { height: 150px; }
  .site-header { padding-top: 1.3rem; align-items: flex-start; }
  .site-nav { width: 100%; gap: .1rem .9rem; }
  .word-fire, .word-lib { font-size: 1.5rem; }
  .logo-img { width: 50px; height: 50px; }
  .cv-embed { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  * { transition: none !important; }
}
