/* Yal Noolaham public catalogue: the same paper-and-ink palette as the library, with fonts every
   device already has (Nirmala UI on Windows, Tamil Sangam MN on Apple, Noto on Android). */
:root {
  --bg: #faf6ee;
  --surface: #fffdf8;
  --surface-2: #f0e9db;
  --text: #24211b;
  --muted: #6e6656;
  --border: #e2d8c4;
  --brand: #1f4d45;
  --brand-ink: #f6f1e6;
  --accent: #d79b33;
  --ok: #2e7d4f;
  --danger: #b03a2e;
  --font: "Noto Sans Tamil", "Nirmala UI", "Tamil Sangam MN", "Latha", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif Tamil", "Nirmala UI", "Tamil Sangam MN", Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161411;
    --surface: #1e1b17;
    --surface-2: #29251f;
    --text: #ece5d8;
    --muted: #a69d8c;
    --border: #38322a;
    --brand: #6fb3a4;
    --brand-ink: #10221e;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7; }
a { color: var(--brand); }
img { max-width: 100%; height: auto; }
[lang="en"] { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2 { font-family: var(--font-serif); line-height: 1.35; }
h1 span[lang="en"], h2 span[lang="en"] { font-weight: 400; color: var(--muted); font-size: .7em; margin-left: .3em; }
.muted { color: var(--muted); }
.small { font-size: .88em; }

/* header and footer */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto; padding: 16px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-text { display: inline-flex; flex-direction: column; gap: 3px; }
.brand-ta { font-family: var(--font-serif); font-weight: 600; font-size: 19px; line-height: 1.3; }
.brand-en { display: flex; justify-content: space-between; font-size: 10.5px; line-height: 1; color: var(--muted); letter-spacing: .32em; }
.site-nav { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--text); text-decoration: none; }
.site-nav a:not(.btn) span[lang="en"] { color: var(--muted); font-size: .85em; }
.site-footer { max-width: 1120px; margin: 64px auto 0; padding: 28px 20px 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: .92em; }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { margin: 40px 0; }
.section.narrow { max-width: 640px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* buttons, search, forms */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn span[lang="en"] { opacity: .8; font-size: .9em; }
.search { display: flex; gap: 8px; margin: 20px 0 8px; max-width: 640px; }
.search input { flex: 1; min-width: 0; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
.form { display: grid; gap: 16px; margin-top: 20px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form label span[lang="en"] { font-weight: 400; color: var(--muted); font-size: .9em; }
.form .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form button { justify-self: start; }
.notice { padding: 14px 18px; border-radius: 10px; margin: 16px 0; }
.notice-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid var(--ok); }
.notice-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border: 1px solid var(--danger); }

/* home */
.hero { padding: 48px 0 8px; max-width: 760px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); margin: 0 0 12px; }
.lead { font-size: 1.08em; margin: 0 0 10px; }
.join { padding: 28px; border-radius: 14px; background: var(--surface-2); }

/* the shelf */
.shelf { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 28px 22px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.book-card { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; }
.book-cover { aspect-ratio: 2 / 3; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 6px; }
.book-cover img { max-height: 100%; object-fit: contain; border-radius: 3px 6px 6px 3px; box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 6px 16px rgb(0 0 0 / .14); }
.book-card:hover .book-cover img, .book-card:hover .book-plain { transform: translateY(-3px); }
.book-cover img, .book-plain { transition: transform .18s ease; }
.book-plain {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 14% 12%; text-align: center;
  background: #1f4d45; color: #f6f1e6; border-radius: 3px 6px 6px 3px; border-left: 6px solid #163a34;
  box-shadow: inset 0 0 0 7px #1f4d45, inset 0 0 0 8px rgb(246 241 230 / .35), 0 6px 16px rgb(0 0 0 / .14);
  font-family: var(--font-serif); font-weight: 600; overflow: hidden;
}
.book-plain[data-lang="en"] { background: #7a4b22; border-left-color: #5a3617; box-shadow: inset 0 0 0 7px #7a4b22, inset 0 0 0 8px rgb(246 241 230 / .35), 0 6px 16px rgb(0 0 0 / .14); }
.book-title { font-family: var(--font-serif); font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.book-author { font-size: 13px; color: var(--muted); }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 32px 0; }
.empty { color: var(--muted); padding: 24px 0; }

/* one book */
.crumbs { margin: 18px 0; font-size: .9em; color: var(--muted); }
.crumbs a { color: var(--muted); }
.book { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: 40px; align-items: start; margin: 12px 0 40px; }
.book-art img { width: 100%; border-radius: 3px 6px 6px 3px; box-shadow: 0 2px 4px rgb(0 0 0 / .12), 0 14px 32px rgb(0 0 0 / .18); }
.book-plain-large { aspect-ratio: 2 / 3; font-size: 22px; }
.book-info h1 { font-size: clamp(26px, 4.5vw, 38px); margin: 0 0 4px; }
.title-alt { font-size: 1.1em; color: var(--muted); margin: 0; }
.author { font-size: 1.15em; margin: 6px 0 0; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.pill { padding: 3px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: .88em; color: var(--muted); }
.summary { margin: 0 0 12px; max-width: 64ch; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 2px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); text-decoration: none; font-size: .9em; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 8px; }

@media (max-width: 640px) {
  .book { grid-template-columns: 1fr; gap: 24px; }
  .book-art { max-width: 240px; margin: 0 auto; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
  .search { flex-direction: column; }
  .site-nav { gap: 6px 12px; }
}

/* Home: authors and the short "about" section */
.author-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.author-chips .tag { padding: 6px 14px; }
.about .features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 16px 0 20px; }
.feature { padding: 18px 20px; border-radius: 14px; background: var(--surface-2); }
.feature h3 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 1.12em; }
.feature h3 span { font-family: var(--font-sans); font-weight: 400; font-size: .8em; color: var(--muted); margin-left: 4px; }
.feature p { margin: 0 0 6px; }
.feature p[lang="en"] { color: var(--muted); font-size: .93em; }
.name-story { max-width: 760px; }
.name-story p { margin: 0 0 8px; }
.name-story p[lang="en"] { color: var(--muted); }
