/* ═══════════════════════════════════════════════════════════════
   Tanacross Learners' Dictionary — shared stylesheet
   tld.css
   ═══════════════════════════════════════════════════════════════ */

/* ── FONTS ─────────────────────────────────────────────────────── */
/* Loaded via <link> in each page head — Playfair Display + Source Serif 4 */

/* ── VARIABLES ─────────────────────────────────────────────────── */
:root {
  --ink:        #1a1208;
  --ink-soft:   #4a3c28;
  --ink-faint:  #8a7660;
  --paper:      #f5f0e8;
  --paper-mid:  #ede5d4;
  --paper-dark: #d8cdb8;
  --rust:       #9b3a1a;
  --rust-dim:   #c4673e;
  --gold:       #b8860b;
  --green:      #2d6435;
  --green-dim:  #4a8a56;
  --border:     #c8b898;
  --shadow:     rgba(26,18,8,0.12);
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
nav, h1, h2, h3, h4, h5, h6, ul, ol, dl, figure, blockquote, pre, table {
  margin: 0;
  padding: 0;
}

/* ── BASE ───────────────────────────────────────────────────────── */
body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; }
strong { font-weight: 600; }

/* ── STICKY TOP WRAPPER ─────────────────────────────────────────── */
#sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── HEADER ─────────────────────────────────────────────────────── */
header {
  background: var(--ink);
  color: var(--paper);
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 2px 12px var(--shadow);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
}
.site-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.site-title a { color: inherit; text-decoration: none; }
.site-title a:hover { text-decoration: underline; }
.site-subtitle {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--paper-dark);
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

/* ── BREADCRUMB ─────────────────────────────────────────────────── */
nav.breadcrumb {
  background: var(--paper-mid);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 2rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}
nav.breadcrumb .inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
nav.breadcrumb a { color: var(--rust-dim); text-decoration: none; }
nav.breadcrumb a:hover { text-decoration: underline; }
nav.breadcrumb .sep { opacity: 0.4; }
 

/* ── PAGE NAV (About / Tanacross Index / etc.) ──────────────────── */
.page-nav {
  background: var(--paper-mid);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.page-nav::-webkit-scrollbar { display: none; }
.page-nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  padding: 0 1rem;
}
.page-nav-inner a {
  display: block;
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.page-nav-inner a:hover { color: var(--rust); }
.page-nav-inner a.active {
  color: var(--rust);
  border-bottom-color: var(--rust);
  font-weight: 600;
}

/* ── ALPHA NAV (A–Z / Tanacross letter bar) ─────────────────────── */
.alpha-nav {
  background: var(--paper-mid);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.alpha-nav::-webkit-scrollbar { display: none; }
.alpha-nav-inner {
  display: flex;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  flex-wrap: wrap;
}
.alpha-btn {
  background: none;
  border: none;
  padding: 0.55rem 0.5rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.alpha-btn:hover { color: var(--rust); }
.alpha-btn.active {
  color: var(--rust);
  border-bottom-color: var(--rust);
}

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
  background: var(--paper-mid);
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
  line-height: 1.6;
  text-align: center;
}

/* ── AUDIO BUTTON ───────────────────────────────────────────────── */
.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--rust-dim);
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  vertical-align: middle;
}
.audio-btn:hover, .audio-btn.playing {
  background: var(--rust);
  color: white;
  border-color: var(--rust);
}
.audio-btn svg { width: 9px; height: 9px; }

/* ═══════════════════════════════════════════════════════════════
   DICTIONARY PAGES (index.html, tanacross.html)
   ═══════════════════════════════════════════════════════════════ */

/* ── SEARCH ─────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
}
.search-bar svg { flex-shrink: 0; opacity: 0.5; }
#searchInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--paper);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  line-height: 1.4;
}
#searchInput::placeholder { color: rgba(245,240,232,0.4); font-style: italic; }
#clearBtn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(245,240,232,0.5);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.2rem;
  display: none;
}
#clearBtn:hover { color: var(--paper); }

/* ── DICTIONARY MAIN ────────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
#statusBar {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-style: italic;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
#loading {
  text-align: center;
  padding: 4rem 1rem;
  font-style: italic;
  color: var(--ink-faint);
}
#noResults {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ── LETTER SECTIONS ────────────────────────────────────────────── */
.letter-section { margin-bottom: 1rem; }
.letter-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--rust);
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* ── ENTRY ──────────────────────────────────────────────────────── */
.entry {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--paper-dark);
}
.entry:last-child { border-bottom: none; }
.entry-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hw {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.hw-qualifier {
  font-size: 0.88rem;
  color: var(--ink-faint);
  font-style: italic;
}
.comment {
  font-style: italic;
  font-size: 0.88rem;
  color: #7a6040;
  margin: 0.3rem 0 0.1rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--gold);
}
.form {
  margin: 0.35rem 0 0.1rem 1.2rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
}
.tc {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rust);
  letter-spacing: 0.01em;
}
.de { font-style: italic; color: var(--ink-soft); font-size: 0.9rem; }
.de-also { font-size: 0.8rem; color: var(--ink-faint); }
.de-also::before { content: ' (also '; }
.de-also::after  { content: ')'; }
.example {
  margin: 0.25rem 0 0.1rem 1.5rem;
  font-size: 0.88rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ex { color: var(--green); }
.eg { color: var(--green-dim); font-style: italic; }
.paradigm-wrap { margin: 0.4rem 0 0.2rem 1.2rem; }
.paradigm-caption {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-faint);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.paradigm-table { border-collapse: collapse; font-size: 0.88rem; }
.paradigm-table td {
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  color: var(--rust);
  font-weight: 600;
}
.cross-refs {
  margin: 0.25rem 0 0 1.2rem;
  font-size: 0.83rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
}
.ref-item { display: flex; align-items: center; gap: 0.25rem; }
.ref-type { font-variant: small-caps; font-size: 0.78rem; color: var(--ink-faint); }
.ref-target { color: var(--rust-dim); text-decoration: none; }
.ref-target:hover { text-decoration: underline; }
.scientific { font-style: italic; font-size: 0.82rem; color: var(--ink-faint); margin-left: 1.2rem; }
.literal-note { font-size: 0.82rem; color: var(--ink-faint); margin-left: 1.2rem; font-style: italic; }
.literal-note::before { content: 'lit. '; font-style: normal; font-variant: small-caps; }
mark { background: #ffe066; color: inherit; border-radius: 2px; padding: 0 1px; }

/* Tanacross index backref */
.backref {
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: right;
  align-self: center;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT PAGES (about, writing, user-guide, grammar)
   ═══════════════════════════════════════════════════════════════ */

.content-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}
.content-main h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.2;
}
.page-intro {
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.content-main h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--rust);
  margin: 2.2rem 0 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.content-main h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.8rem 0 0.5rem;
}
.content-main h4 {
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink-soft);
  margin: 1.4rem 0 0.4rem;
}

.content-main p { margin: 1.2rem 0; }
.def { font-variant: small-caps; font-size: 0.95em; }
.highlight { color: var(--rust); font-weight: 600; }
.note {
  background: var(--paper-mid);
  border-left: 3px solid var(--gold);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
  border-radius: 0 4px 4px 0;
}
blockquote {
  margin: 1rem 0 1rem 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  color: var(--ink-soft);
  font-style: italic;
}
.toc {
  background: var(--paper-mid);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  font-size: 0.9rem;
}
.toc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.toc ol { padding-left: 1.2rem; margin: 0; }
.toc li { padding: 0.15rem 0; }
.toc a { color: var(--rust-dim); }
.data-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.92rem;
}
.data-table th {
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
}
.data-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  vertical-align: top;
}
.data-table tr:nth-child(even) td { background: var(--paper-mid); }
.data-table td:first-child {
  font-weight: 600;
  color: var(--rust);
  text-align: center;
  min-width: 3rem;
}
.content-main .paradigm-table { margin: 0.8rem auto; font-size: 0.92rem; }
.content-main .paradigm-table td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  color: var(--rust);
  font-weight: 600;
}
.content-main .paradigm-table caption {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
  caption-side: top;
  text-align: left;
}
.ref-list { list-style: none; padding: 0; }
.ref-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--paper-dark);
  font-size: 0.92rem;
  padding-left: 1.5rem;
  text-indent: -1.5rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 1.2rem 1rem 0.8rem; }
  main, .content-main { padding: 1.2rem 1rem 3rem; }
  nav.breadcrumb, .page-nav { padding-left: 0; padding-right: 0; }
  .form { margin-left: 0.5rem; }
  .example { margin-left: 0.8rem; }
  .cross-refs, .paradigm-wrap { margin-left: 0.5rem; }
  .entry { grid-template-columns: 1fr; }
  .backref { grid-column: 1; text-align: left; margin-top: 0.15rem; }
}

/* --- IMAGES --- */
.align-right {
  float: right; /* Moves image to the right */
  margin-left: 20px; /* Creates space between text and image */
  margin-bottom: 10px; /* Creates space below image */
  max-width: 300px; /* Optional: controls image size */
}

