/* ============================================================================
   Wapiti Smith — Journal theme
   Extends the visual language of the site's placeholder index.html:
   vintage broadsheet, warm paper, iron-gall ink, oxblood accents.
   Palette & type are lifted verbatim from index.html; the component styles
   below (nav, forms, cards, badges, prose) are built in the same idiom.
   ========================================================================== */

:root {
  --paper:        #f1ead9;
  --paper-warm:   #ece3cc;
  --ink:          #1c1610;
  --ink-soft:     #3a2f24;
  --rule:         #6b5740;
  --oxblood:      #6b1e1e;
  --sage:         #4a5d3a;
  --shadow:       rgba(28, 22, 16, 0.12);
  --rule-soft:    rgba(107, 87, 64, 0.35);
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Paper grain — the two fixed texture layers from the landing page. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(107, 87, 64, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(107, 30, 30, 0.05), transparent 55%),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(28, 22, 16, 0.05) 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0 0.06 0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.frame {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column;
  padding: 2rem 2rem 2rem; max-width: 860px; margin: 0 auto;
}
.content { flex: 1; padding: 2.5rem 0; }
a { color: var(--oxblood); }

/* ------- Masthead / nav ---------------------------------------------------- */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  font-family: 'IM Fell English SC', 'Cormorant Garamond', serif;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
}
.masthead a { color: var(--ink-soft); text-decoration: none; }
.masthead .brand { color: var(--ink); font-size: 0.95rem; letter-spacing: 0.14em; }
.masthead .brand em { font-style: italic; color: var(--oxblood); }
.masthead nav { display: flex; gap: 1.25rem; align-items: baseline; flex-wrap: wrap; }
.masthead nav a { position: relative; padding-bottom: 2px; transition: color .2s; }
.masthead nav a:hover { color: var(--oxblood); }
.masthead nav a.active { color: var(--oxblood); border-bottom: 1px solid var(--oxblood); }

/* ------- Page headings ----------------------------------------------------- */
.page-head { text-align: center; margin: 1rem 0 2.2rem; }
.page-head h1 {
  font-family: 'IM Fell English', 'Cormorant Garamond', serif; font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.02; letter-spacing: -0.01em;
}
.page-head h1 em { font-style: italic; color: var(--oxblood); }
.page-head .sub {
  font-style: italic; color: var(--ink-soft);
  font-size: clamp(1rem, 2.4vw, 1.25rem); margin-top: .5rem;
}
.kicker {
  font-family: 'IM Fell English SC', serif; text-transform: uppercase;
  letter-spacing: 0.2em; font-size: 0.72rem; color: var(--oxblood);
  display: block; margin-bottom: .5rem;
}

/* dot rule divider from the landing page */
.dot-rule { display: flex; align-items: center; justify-content: center; gap: .65rem; margin: 1.1rem 0 1.6rem; }
.dot-rule .line { width: 80px; height: 1px; background: var(--rule); }
.dot-rule .diamond { width: 6px; height: 6px; background: var(--oxblood); transform: rotate(45deg); }

/* ------- Buttons ----------------------------------------------------------- */
.btn {
  font-family: 'IM Fell English SC', serif; text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 0.8rem; cursor: pointer;
  display: inline-block; padding: 0.6rem 1.3rem; text-decoration: none;
  color: var(--ink); background: var(--paper-warm);
  border: 1px solid var(--rule); transition: all .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary { background: var(--oxblood); color: var(--paper); border-color: var(--oxblood); }
.btn-primary:hover { background: #561818; border-color: #561818; color: var(--paper); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.7rem; }
.btn-danger { color: var(--oxblood); border-color: var(--rule-soft); }
.btn-danger:hover { background: var(--oxblood); color: var(--paper); border-color: var(--oxblood); }
.btn-row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }

/* ------- Forms ------------------------------------------------------------- */
.form-card {
  max-width: 30rem; margin: 0 auto; padding: 2rem;
  border: 1px solid var(--rule); background: var(--paper-warm); position: relative;
  box-shadow: 0 1px 0 var(--shadow);
}
.field { margin-bottom: 1.15rem; }
.field label {
  display: block; font-family: 'IM Fell English SC', serif; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 0.72rem; color: var(--ink-soft); margin-bottom: .4rem;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 0.6rem 0.7rem; font-size: 1rem;
  font-family: 'Cormorant Garamond', Georgia, serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 0;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--oxblood); box-shadow: 0 0 0 2px rgba(107,30,30,0.12);
}
.field .hint { font-size: 0.82rem; color: var(--ink-soft); font-style: italic; margin-top: .3rem; }
.field-inline { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.radio {
  display: flex; gap: .5rem; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--rule-soft); padding: .6rem .8rem; background: var(--paper); flex: 1; min-width: 8rem;
}
.radio input { width: auto; margin-top: .2rem; }
.radio .r-title { font-family: 'IM Fell English SC', serif; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
.radio .r-desc { display: block; font-size: .82rem; color: var(--ink-soft); font-style: italic; }
.radio:has(input:checked) { border-color: var(--oxblood); background: #f6efe0; }

/* ------- Flash & errors ---------------------------------------------------- */
.flash, .errors {
  max-width: 40rem; margin: 0 auto 1.5rem; padding: .8rem 1rem;
  border: 1px solid var(--rule); background: var(--paper-warm);
  font-style: italic; text-align: center;
}
.flash.ok { border-color: var(--sage); }
.flash.error, .errors { border-color: var(--oxblood); color: var(--ink); }
.errors ul { list-style: none; }
.errors li::before { content: "· "; color: var(--oxblood); }

/* ------- Note cards -------------------------------------------------------- */
.notes-list { list-style: none; display: flex; flex-direction: column; gap: 1.3rem; }
.note-card {
  padding: 1.4rem 1.5rem; border: 1px solid var(--rule); background: var(--paper-warm);
  box-shadow: 0 1px 0 var(--shadow); position: relative;
}
.note-card h3 { font-family: 'IM Fell English', serif; font-weight: 400; font-size: 1.5rem; line-height: 1.1; margin-bottom: .3rem; }
.note-card h3 a { color: var(--ink); text-decoration: none; }
.note-card h3 a:hover { color: var(--oxblood); }
.note-card .meta { font-family: 'IM Fell English SC', serif; text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; color: var(--ink-soft); margin-bottom: .6rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.note-card .excerpt { color: var(--ink-soft); line-height: 1.5; }
.note-card .card-actions { margin-top: 1rem; }

/* corner ticks, echoing the landing-page notice block */
.ticked::before, .ticked::after { content: ""; position: absolute; width: 12px; height: 12px; border: 1px solid var(--rule); }
.ticked::before { top: -6px; left: -6px; border-right: none; border-bottom: none; background: var(--paper); }
.ticked::after  { bottom: -6px; right: -6px; border-left: none; border-top: none; background: var(--paper); }

/* ------- Visibility badges ------------------------------------------------- */
.badge {
  font-family: 'IM Fell English SC', serif; text-transform: uppercase; letter-spacing: .16em;
  font-size: .62rem; padding: .18rem .5rem; border: 1px solid currentColor; white-space: nowrap;
}
.badge-public  { color: var(--oxblood); }
.badge-private { color: var(--sage); }
.badge-draft   { color: var(--rule); }

/* ------- Article / rendered prose ----------------------------------------- */
.article { max-width: 42rem; margin: 0 auto; }
.article .article-head { text-align: center; margin-bottom: 2rem; }
.article .article-head h1 { font-family: 'IM Fell English', serif; font-weight: 400; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.05; }
.article .article-head .subtitle { font-style: italic; color: var(--ink-soft); font-size: clamp(1.15rem, 2.6vw, 1.55rem); line-height: 1.35; margin-top: .55rem; }
.article .byline { font-family: 'IM Fell English SC', serif; text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--ink-soft); margin-top: .7rem; }
.note-card .card-subtitle { font-style: italic; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.3; margin: -.05rem 0 .5rem; }
.prose { font-size: 1.15rem; line-height: 1.7; color: var(--ink); }
.prose p { margin: 0 0 1.1rem; }
.prose h1, .prose h2, .prose h3 { font-family: 'IM Fell English', serif; font-weight: 400; line-height: 1.15; margin: 1.8rem 0 .7rem; }
.prose h2 { font-size: 1.7rem; } .prose h3 { font-size: 1.35rem; }
.prose a { color: var(--oxblood); }
.prose blockquote { border-left: 2px solid var(--oxblood); padding-left: 1.1rem; margin: 1.2rem 0; font-style: italic; color: var(--ink-soft); }
.prose code { background: var(--paper-warm); padding: .1rem .35rem; font-size: .9em; border: 1px solid var(--rule-soft); }
.prose pre { background: var(--paper-warm); border: 1px solid var(--rule); padding: 1rem; overflow-x: auto; margin: 1.2rem 0; }
.prose pre code { border: none; background: none; padding: 0; }
.prose ul, .prose ol { margin: 0 0 1.1rem 1.4rem; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--rule); }
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 2rem 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.4rem 0; font-size: 1rem; }
.prose th, .prose td { border: 1px solid var(--rule); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.prose thead th { background: var(--paper-warm); font-family: 'IM Fell English SC', serif; font-weight: 400; letter-spacing: .04em; }
.prose del { color: var(--ink-soft); }
.prose li { margin: .2rem 0; }

/* ------- Empty state ------------------------------------------------------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); font-style: italic; }

/* ------- Profile ----------------------------------------------------------- */
.profile-head { text-align: center; margin-bottom: 2rem; }
.profile-head .bio { max-width: 100ch; margin: .8rem auto 0; font-style: italic; color: var(--ink-soft); }

/* ------- Notice (reused from landing) -------------------------------------- */
.notice {
  margin: 2rem auto; max-width: 44rem; padding: 2rem 1.5rem; border: 1px solid var(--rule);
  background: var(--paper-warm); box-shadow: 0 1px 0 var(--shadow); text-align: center; position: relative;
}
.notice .label { font-family: 'IM Fell English SC', serif; font-size: .74rem; letter-spacing: .22em; color: var(--oxblood); text-transform: uppercase; margin-bottom: .8rem; display: block; }
.notice p { font-size: 1.1rem; line-height: 1.55; color: var(--ink-soft); max-width: 50ch; margin: 0 auto; }

/* ------- Footer ------------------------------------------------------------ */
footer.site-footer {
  margin-top: auto; text-align: center; border-top: 1px solid var(--rule);
  padding: 1.2rem 0 .3rem; font-family: 'IM Fell English SC', serif; font-size: .74rem;
  letter-spacing: .18em; color: var(--ink-soft); text-transform: uppercase;
}
footer.site-footer a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
footer.site-footer a:hover { color: var(--oxblood); border-color: var(--oxblood); }
footer.site-footer .stamp { display: block; margin-top: .55rem; font-style: italic; text-transform: none; letter-spacing: .08em; color: var(--rule); font-size: .78rem; font-family: 'Cormorant Garamond', serif; }

/* ------- Utility ----------------------------------------------------------- */
.center { text-align: center; }
.mt-2 { margin-top: 2rem; } .mt-1 { margin-top: 1rem; }
.muted { color: var(--ink-soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.3rem; }

@media (max-width: 560px) {
  .frame { padding: 1.2rem 1.1rem; }
  .masthead { flex-direction: column; gap: .5rem; align-items: center; text-align: center; }
  .field-inline { flex-direction: column; }
}
