:root{
  --ink: #6F4E37;
  --paper: #fbf4ee;
  --panel: #ffffff;
  --shadow: 0 12px 22px rgba(0,0,0,.10);
  --radius: 14px;
}

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

body{
  font-family: "Poor Richard", "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
}

/* HEADER */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px 60px;
  border-bottom: 1px solid rgba(111, 78, 55, 0.2);
}

.nav { display: flex; gap: 32px; }

.nav-link {
  text-decoration: none;
  font-size: 20px;
  color: var(--ink);
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  background-color: var(--ink);
  bottom: -4px;
  left: 0;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

.brand { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.brand-logo { height: 110px; width: auto; }

/* PAGE */
.page{
  padding: 34px 18px 60px;
  display: flex;
  justify-content: center;
}

.panel{
  width: min(980px, 94vw);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(111,78,55,.12);
  padding: 22px;
}

.panel-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(111,78,55,.14);
  margin-bottom: 18px;
}

.title{
  font-size: 34px;
  font-weight: normal;
}

.panel-actions{ display: flex; gap: 10px; }

/* BUTTONS */
.btn{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  font-size: 16px;
  cursor: pointer;
}

.btn:hover{ filter: brightness(0.95); }

.btn-outline{
  background: transparent;
  color: var(--ink);
}

/* EMPTY */
.empty{
  text-align: center;
  padding: 36px 12px;
}

.empty-title{
  font-size: 22px;
  margin-bottom: 6px;
}

.empty-desc{
  opacity: .9;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* GRID */
.grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* CARD */
.card{
  border: 1px solid rgba(111,78,55,.12);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
}

.cover{
  width: 90px;
  height: 130px;
  border-radius: 12px;
  border: 1px solid rgba(111,78,55,.15);
  overflow: hidden;
  background: #eee6de;
}

.cover img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* TEXT */
.meta{ min-width: 0; }

.book-title{
  font-size: 18px;
  margin-bottom: 4px;

  /* Better than -webkit-line-clamp (works everywhere) */
  line-height: 1.2;
  max-height: calc(1.2em * 2);
  overflow: hidden;
}

.book-author{
  font-size: 14px;
  opacity: .9;
  margin-bottom: 6px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Author link style (NOT blue/underlined) */
.author-link{
  color: inherit;
  text-decoration: none;
}
.author-link:hover{ text-decoration: underline; }

.small{
  font-size: 14px;
  opacity: .85;
  margin-bottom: 10px;
}

/* CARD ACTIONS */
.card-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions .btn{
  padding: 8px 12px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  .topbar{ padding: 22px 18px; }
}
