/* ============================================================
   Seekho Learn — "The Study Journal" identity
   Warm editorial study-journal: cream paper, amber accents,
   serif display + clean sans body. No external assets.
   ============================================================ */

:root {
  --paper: #faf6ec;          /* cream paper */
  --paper-deep: #f3ecda;     /* deeper cream for washes */
  --card: #fffdf6;           /* card paper */
  --ink: #292524;            /* warm near-black */
  --ink-soft: #44403c;       /* soft ink */
  --muted: #78716c;          /* warm grey */
  --amber: #f59e0b;          /* brand amber */
  --amber-deep: #b45309;     /* readable amber for text/links */
  --amber-wash: #fef3c7;     /* pale amber highlight */
  --rule: #e5dcc3;           /* hairline rules */
  --rule-strong: #d6c9a3;
  --serif: Georgia, "Times New Roman", "Nimbus Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(rgba(180, 83, 9, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  line-height: 1.8;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--amber-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(180, 83, 9, 0.35); }
a:hover { color: #92400e; text-decoration-color: #92400e; }

img, svg { max-width: 100%; height: auto; }

::selection { background: var(--amber-wash); }

/* ================= Header (index / info / 404) ================= */
.site-header {
  background: var(--paper);
  border-bottom: 3px double var(--rule-strong);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; display: block; flex: none; }
.site-name {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1;
}
.site-name .dot { color: var(--amber); }
a.site-name:hover { color: var(--amber-deep); }
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--amber-deep); border-bottom-color: var(--amber); }
.site-nav a.active { color: var(--amber-deep); border-bottom-color: var(--amber); }

/* ================= Article-page header (bare <header>) ================= */
header:not(.site-header) {
  background: var(--paper);
  border-bottom: 3px double var(--rule-strong);
  padding: 1rem 1.5rem 0.9rem;
  max-width: 960px;
  margin: 0 auto;
}
header:not(.site-header) .site-name { font-size: 1.4rem; }
header:not(.site-header) .site-name a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
header:not(.site-header) .site-name a:hover { color: var(--amber-deep); }
header:not(.site-header) .brand-logo { width: 32px; height: 32px; }
header:not(.site-header) nav { margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; }
header:not(.site-header) nav a {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}
header:not(.site-header) nav a:hover { color: var(--amber-deep); }

/* ================= Homepage masthead ================= */
.masthead {
  text-align: center;
  padding: 3.75rem 0 2.75rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.masthead::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  background: var(--amber);
  margin: 1.75rem auto 0;
}
.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 1rem;
}
.masthead h1 {
  font-family: var(--serif);
  font-size: 3.4rem;
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.masthead .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.masthead .intro { max-width: 620px; margin: 0 auto; color: var(--ink-soft); font-size: 1.02rem; }

/* ================= Sections ================= */
.section { padding: 2.75rem 0 3rem; }
.section-title {
  font-family: var(--serif);
  font-size: 1.9rem;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}
.section-title::after { content: ""; flex: 1; border-top: 1px solid var(--rule-strong); transform: translateY(-0.4rem); }
.section-sub { color: var(--muted); margin-bottom: 2rem; font-style: italic; font-family: var(--serif); font-size: 1.05rem; }

/* ================= Notebook entries (homepage article list) ================= */
.article-grid { counter-reset: note; display: block; }
.card {
  counter-increment: note;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 1.4rem;
  padding: 1.6rem 0.5rem 1.6rem 0;
  border-top: 1px solid var(--rule);
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, rgba(180, 83, 9, 0.07) 31px 32px);
  position: relative;
}
.card:last-child { border-bottom: 1px solid var(--rule); }
.card::before {
  content: counter(note, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--amber);
  line-height: 1.2;
  grid-row: span 3;
  padding-top: 0.15rem;
}
.card h3 {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.35;
  margin-bottom: 0.45rem;
  font-weight: 700;
}
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--amber-deep); }
.card p { color: var(--ink-soft); font-size: 0.98rem; max-width: 56ch; }
.card .read-more {
  margin-top: 0.7rem;
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-deep);
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 2px;
}
.card .read-more:hover { color: #92400e; border-bottom-color: #92400e; }
/* Editor's pick: first entry gets a featured treatment */
.card:first-child {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.75rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 18px rgba(120, 72, 20, 0.08);
}
.card:first-child::after {
  content: "Editor's pick";
  position: absolute;
  top: -0.8rem;
  right: 1.25rem;
  background: var(--amber);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 3px;
}
.card:first-child h3 { font-size: 1.7rem; }

/* ================= Article reading experience ================= */
main > article, article:not(.card) {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
}
/* Chapter masthead */
article:not(.card) > h1:first-of-type, main > article > h1:first-of-type {
  font-family: var(--serif);
  font-size: 2.7rem;
  line-height: 1.18;
  letter-spacing: 0.005em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
article > h1:first-of-type::before, main > article > h1:first-of-type::before {
  content: "Study notes";
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 1rem;
}
article > h1:first-of-type::after, main > article > h1:first-of-type::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  background: var(--amber);
  margin-top: 1.25rem;
}
p.meta {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0;
  margin-bottom: 2rem;
}
article p, main > article p { margin-bottom: 1.35rem; font-size: 1.08rem; color: #33302b; }
/* Drop cap on the intro paragraph */
article > p.meta + p::first-letter, main > article > p.meta + p::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  font-weight: 700;
  float: left;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  color: var(--amber-deep);
}
/* Section headings */
article h2, main > article h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--amber);
  display: inline-block;
}
/* Sub-headings (also used for FAQ questions) */
article:not(.card) h3, main > article h3 {
  font-family: var(--serif);
  font-size: 1.28rem;
  margin: 2rem 0 0.7rem;
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.45;
}
article:not(.card) h3::before, main > article h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 0.55em;
  height: 0.55em;
  background: var(--amber);
  transform: rotate(45deg);
}
/* FAQ section divider */
article h2:last-of-type, main > article h2:last-of-type { display: block; text-align: center; border-bottom: none; }
article h2:last-of-type::before, main > article h2:last-of-type::before,
article h2:last-of-type::after, main > article h2:last-of-type::after {
  content: "";
  display: inline-block;
  width: 4rem;
  border-top: 1px solid var(--rule-strong);
  margin: 0 1rem;
  vertical-align: middle;
}
/* Lists — notebook style */
article ul, article ol, main > article ul, main > article ol { margin: 0 0 1.5rem 0.25rem; padding-left: 1.4rem; }
article li, main > article li { margin-bottom: 0.7rem; font-size: 1.05rem; color: #33302b; }
article ul li::marker, main > article ul li::marker { color: var(--amber-deep); font-size: 1.1em; }
article ol li::marker, main > article ol li::marker { color: var(--amber-deep); font-family: var(--serif); font-weight: 700; }
article li strong, main > article li strong { color: var(--ink); }
article p strong, main > article p strong { color: var(--ink); }
/* Featured image — pasted illustration */
article figure, main > article figure {
  margin: 2.25rem auto;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 0.9rem;
  box-shadow: 0 10px 26px rgba(120, 72, 20, 0.12);
  border-radius: 3px;
  max-width: 100%;
}
article figure img, main > article figure img { display: block; width: 100%; border-radius: 2px; }
/* Author note — ruled index card */
.bio {
  margin: 2.75rem 0 1rem;
  padding: 1.4rem 1.5rem 1.1rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  background:
    repeating-linear-gradient(to bottom, var(--card) 0 27px, rgba(180, 83, 9, 0.09) 27px 28px);
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif);
  font-style: italic;
  line-height: 28px;
}

/* ================= Prose (info pages) ================= */
.prose { max-width: 780px; }
.prose h1 { font-family: var(--serif); font-size: 2.2rem; line-height: 1.25; margin-bottom: 0.75rem; }
.prose h2 { font-family: var(--serif); font-size: 1.55rem; margin: 2.25rem 0 0.8rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--amber); display: inline-block; }
.prose h3 { font-family: var(--serif); font-size: 1.2rem; margin: 1.6rem 0 0.6rem; }
.prose p { margin-bottom: 1.2rem; color: #33302b; }
.prose ul, .prose ol { margin: 0 0 1.4rem 0.25rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.6rem; }
.prose ul li::marker { color: var(--amber-deep); }
.prose ol li::marker { color: var(--amber-deep); font-family: var(--serif); font-weight: 700; }
.prose blockquote {
  border-left: 4px solid var(--amber);
  background: var(--amber-wash);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
}

/* ================= Page hero (inner pages) ================= */
.page-hero {
  border-bottom: 3px double var(--rule-strong);
  padding: 2.75rem 0 2.25rem;
  text-align: center;
}
.page-hero h1 { font-family: var(--serif); font-size: 2.5rem; line-height: 1.2; margin-bottom: 0.5rem; }
.page-hero h1::after { content: ""; display: block; width: 3.5rem; height: 4px; background: var(--amber); margin: 1rem auto 0; }
.page-hero p { color: var(--ink-soft); max-width: 640px; margin: 0 auto; font-family: var(--serif); font-style: italic; font-size: 1.1rem; }

/* ================= Contact form ================= */
.contact-form { max-width: 600px; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.4rem; font-size: 0.9rem; letter-spacing: 0.04em; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font: inherit;
  color: var(--ink);
  background: var(--card);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--amber); border-color: var(--amber); background: #fff; }
.btn {
  display: inline-block;
  background: var(--amber-deep);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.8rem;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.btn:hover { background: #92400e; }

/* ================= Footer ================= */
.site-footer, footer:not(.site-footer) {
  background: var(--ink);
  color: #d6cdb8;
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
  font-size: 0.92rem;
  border-top: 4px solid var(--amber);
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
footer:not(.site-footer) { text-align: center; }
footer:not(.site-footer) p { margin-bottom: 0.75rem; }
.footer-nav, footer:not(.site-footer) nav { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
.footer-nav a, footer:not(.site-footer) nav a { color: #f5edd8; text-decoration: none; font-size: 0.85rem; letter-spacing: 0.06em; }
.footer-nav a:hover, footer:not(.site-footer) nav a:hover { color: var(--amber); }

/* ================= 404 ================= */
.error-wrap { text-align: center; padding: 4.5rem 1.5rem 5.5rem; }
.error-wrap .error-logo { width: 96px; height: 96px; margin-bottom: 1.25rem; }
.error-code { font-family: var(--serif); font-size: 5rem; font-weight: 700; color: var(--amber-deep); line-height: 1; margin-bottom: 0.5rem; }
.error-wrap h1 { font-family: var(--serif); font-size: 1.9rem; margin-bottom: 0.75rem; }
.error-wrap p { color: var(--muted); max-width: 430px; margin: 0 auto 1.75rem; font-family: var(--serif); font-style: italic; }
.btn-home {
  display: inline-block;
  background: var(--amber-deep);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.8rem 1.9rem;
  border-radius: var(--radius);
  text-decoration: none;
}
.btn-home:hover { background: #92400e; color: #fff; text-decoration: none; }

/* ================= Auto-generated Table of Contents ================= */
.toc {
  margin: 0 0 2.25rem;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.5rem 1.1rem;
  box-shadow: 0 4px 14px rgba(120, 72, 20, 0.06);
}
.toc .toc-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.55rem;
  color: var(--ink);
}
.toc .toc-title::before {
  content: "\2630\00a0";
  color: var(--amber-deep);
}
.toc ol { margin: 0; padding-left: 1.35rem; }
.toc ol li { margin-bottom: 0.35rem; font-size: 0.97rem; color: var(--ink-soft); }
.toc ol li::marker { color: var(--amber-deep); font-family: var(--serif); font-weight: 700; }
.toc a { text-decoration: none; color: var(--ink-soft); }
.toc a:hover { color: var(--amber-deep); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; }
article h2, main > article h2 { scroll-margin-top: 1.25rem; }

/* ================= Responsive ================= */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead { padding: 2.5rem 0 2rem; }
  .masthead h1 { font-size: 2.5rem; }
  .masthead .tagline { font-size: 1.15rem; }
  article:not(.card) > h1:first-of-type, main > article > h1:first-of-type { font-size: 1.9rem; }
  .card { grid-template-columns: 3.2rem 1fr; gap: 0 1rem; }
  .card::before { font-size: 1.5rem; }
  .card h3 { font-size: 1.2rem; }
  .card:first-child h3 { font-size: 1.4rem; }
  .page-hero h1 { font-size: 1.9rem; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
  .prose h1 { font-size: 1.75rem; }
}

/* Prevent off-canvas drawer / any stray element from causing horizontal scroll on mobile */
html{overflow-x:clip}
/* ===== Mobile drawer navigation (added 2026-10-02) ===== */
.nav-toggle,.drawer,.drawer-overlay{display:none}
@media (max-width:860px){
header nav{display:none!important}
.nav-toggle{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:44px;height:44px;margin-left:auto;padding:0;background:transparent;border:2px solid #b45309;border-radius:10px;cursor:pointer;flex:0 0 auto;-webkit-tap-highlight-color:transparent}
.nav-toggle span{display:block;width:20px;height:2px;background:#b45309;border-radius:2px}
header:not(.site-header){display:flex;align-items:center;gap:12px}
header:not(.site-header) .site-name{flex:1 1 auto;margin:0}
.drawer-overlay{display:block;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:190;opacity:0;pointer-events:none;transition:opacity .25s ease}
.drawer{display:flex;flex-direction:column;position:fixed;top:0;right:0;bottom:0;width:min(320px,86vw);background:#faf6ec;color:#44403a;z-index:200;transform:translateX(105%);transition:transform .28s ease;box-shadow:-10px 0 32px rgba(0,0,0,.28);overflow-y:auto;-webkit-overflow-scrolling:touch}
body.drawer-open{overflow:hidden}
body.drawer-open .drawer{transform:translateX(0)}
body.drawer-open .drawer-overlay{opacity:1;pointer-events:auto}
.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 12px 12px 16px;border-bottom:1px solid #e7dcc3}
.drawer-head a{color:inherit!important;text-decoration:none}
.drawer-close{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;background:transparent;border:1px solid #e7dcc3;border-radius:10px;color:#44403a;font-size:26px;line-height:1;cursor:pointer;flex:0 0 auto}
.drawer-nav{display:flex;flex-direction:column;gap:4px;padding:12px}
.drawer-nav .drawer-link{display:flex;align-items:center;min-height:48px;padding:10px 14px;border-radius:10px;color:#44403a;text-decoration:none;font-weight:600;font-size:1.02rem;line-height:1.35}
.drawer-nav .drawer-link:hover,.drawer-nav .drawer-link:focus-visible{background:#f3ecda;color:#92400e;text-decoration:none}

}

/* Compact sticky header on scroll - mobile (added 2026-10-02) */
@media (max-width:860px){
.site-header{transition:padding .22s ease,box-shadow .22s ease}
.site-header.scrolled{padding-top:8px!important;padding-bottom:8px!important;box-shadow:0 2px 14px rgba(0,0,0,.14)}
.site-header.scrolled img{max-height:30px!important;width:auto}
.site-header.scrolled .site-name{font-size:1.05rem!important}
}
