/* Book Memories - styles
   Colours are set once here, so they're easy to change. */

:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --text: #2b2420;
  --muted: #6f6359;
  --accent: #7a3b2e;
  --accent-text: #ffffff;
  --border: #e4d9cc;
  --soft: #f1e4d3;
  --error: #b3261e;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1916;
    --surface: #2a2420;
    --text: #f2ebe3;
    --muted: #b5a89b;
    --accent: #e0957f;
    --accent-text: #1d1916;
    --border: #463c35;
    --soft: #382f29;
    --error: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
}

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; margin-top: 1.5rem; }
h3 { font-size: 1.1rem; }

.muted { color: var(--muted); font-size: 0.9em; }
.error { color: var(--error); }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: bold; text-decoration: none; color: var(--text); font-size: 1.1rem; }
#nav { display: flex; gap: 1rem; align-items: center; font-size: 0.95rem; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 16px 4rem;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary { background: transparent; color: var(--accent); }
.linkish {
  background: none; border: none; padding: 0;
  color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

/* ---- library page ---- */
.hero {
  background: var(--soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.hero p { margin: 0; }

.search { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.search input { flex: 1; min-width: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s;
}
.card:hover { transform: translateY(-3px); }
.card .cover { width: 100%; border-radius: 0; }
.card-body { padding: 0.75rem; }
.card h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.card .snippet { font-size: 0.85rem; font-style: italic; margin: 0.4rem 0; }
.card .by { font-size: 0.85rem; }

.author { color: var(--muted); margin: 0; }
.by { color: var(--muted); }

/* ---- covers ---- */
.cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}
.cover-blank {
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; text-align: center; color: var(--muted);
}
.preview { max-width: 180px; margin-top: 0.75rem; }

/* ---- one suggestion ---- */
.detail {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.why {
  margin: 0.75rem 0 0.25rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: pre-line;
  font-size: 1.05rem;
}

/* ---- forms ---- */
.form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; }
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.9rem;
  background: var(--surface);
}
legend { font-weight: bold; padding: 0 0.4rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; }
input, textarea {
  font: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  width: 100%;
}
input[type="file"] { padding: 0.4rem; }
.row { display: flex; gap: 0.5rem; }
.row input { flex: 1; min-width: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* ---- review + my suggestions ---- */
.review-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
details { margin-top: 1.5rem; }
summary { cursor: pointer; font-weight: bold; }

.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.big-link { font-size: 1.3rem; }
.mine-item { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--soft);
}
.badge-approved { background: #d8ecd6; color: #1f4d1c; }
.badge-rejected { background: #f3d6d3; color: #6b1a14; }

.thanks { text-align: center; padding: 2rem 0; }

/* ---- small screens (phones) ---- */
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .detail { grid-template-columns: 1fr; }
  .detail-cover { max-width: 220px; }
  .two-col { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .review-item { grid-template-columns: 80px 1fr; }
}
