/* ==========================================================================
   canon-books — homepage styles
   ========================================================================== */

:root {
  /* Warmer brown/beige overrides on top of Lumen */
  --cb-bg:        oklch(97.4% 0.018 75);   /* warm beige page */
  --cb-card:      #ffffff;                  /* card surface (paper) */
  --cb-cream:     oklch(95.2% 0.025 78);    /* hero cream */
  --cb-brown:     oklch(48% 0.06 55);       /* primary brown ink */
  --cb-brown-2:   oklch(58% 0.07 55);       /* mid brown */
  --cb-brown-d:   oklch(36% 0.05 50);       /* deep brown for headings */
  --cb-tan:       oklch(78% 0.075 65);      /* button tan */
  --cb-tan-d:     oklch(62% 0.09 55);       /* button tan hover */
  --cb-line:      oklch(90% 0.012 70);
  --cb-line-2:    oklch(85% 0.015 70);
  --cb-meta:      oklch(58% 0.012 65);
  --cb-star:      #e9b949;
  --cb-star-empty: oklch(88% 0.02 80);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cb-bg);
  color: var(--cb-brown-d);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============== Header ============== */
.site-header {
  background: var(--cb-card);
  border-bottom: 1px solid var(--cb-line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in oklch, var(--cb-card), transparent 8%);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--cb-brown);
}

.brand-text { line-height: 1.15; }

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--cb-brown-d);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--cb-meta);
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cb-brown-d);
  transition: color 200ms;
}
.nav a:hover { color: var(--cb-tan-d); }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--cb-brown-d);
  transition: background 200ms;
}
.icon-btn:hover { background: var(--cb-cream); }

/* ============== Hero ============== */
.hero {
  position: relative;
  background:
    linear-gradient(180deg,
      oklch(96% 0.025 75) 0%,
      oklch(94% 0.03 70) 100%);
  overflow: hidden;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 32px 80px;
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: 380px;
}

.hero-copy { position: relative; z-index: 2; max-width: 540px; }

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--cb-brown-d);
  margin: 0 0 22px;
}
.hero h1 .accent { color: var(--cb-brown); font-weight: 600; }

.hero p {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--cb-brown-2);
  margin: 0 0 32px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--cb-tan);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px oklch(62% 0.09 55 / 0.25);
  transition: all 220ms var(--ease-out);
}
.btn-primary:hover {
  background: var(--cb-tan-d);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px oklch(62% 0.09 55 / 0.32);
}
.btn-primary svg { width: 14px; height: 14px; }

.hero-image {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 56%;
  background-image: url('https://images.unsplash.com/photo-1519682337058-a94d519337bc?w=1400&q=80');
  background-size: cover;
  background-position: center;
}
.hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--cb-bg) 0%,
    oklch(96% 0.025 75 / 0.7) 12%,
    transparent 35%);
}

/* ============== Page layout ============== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 64px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

/* ============== Section header ============== */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--cb-tan);
  margin-bottom: 28px;
  position: relative;
}
.section-head::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--cb-line);
  z-index: -1;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--cb-brown-d);
  margin: 0;
  letter-spacing: -0.01em;
}
.section-head .flame { font-size: 18px; }

/* ============== Article cards ============== */
.articles { display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--cb-card);
  border: 1px solid var(--cb-line);
  border-radius: 12px;
  padding: 22px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  transition: all 220ms var(--ease-out);
}
.card:hover {
  border-color: var(--cb-line-2);
  box-shadow: 0 4px 16px oklch(40% 0.04 60 / 0.06);
  transform: translateY(-1px);
}

.cover {
  width: 150px;
  height: 215px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.08),
    0 8px 20px rgba(60,40,20,0.12);
  position: relative;
}
.cover::after {
  content: '';
  position: absolute;
  left: 8%; top: 0; bottom: 0;
  width: 1px;
  background: rgba(0,0,0,0.08);
}

.card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tag {
  display: inline-block;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  background: oklch(94% 0.03 70);
  color: var(--cb-brown);
  border-radius: 4px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.card h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--cb-brown-d);
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}

.card .desc {
  font-size: 13px;
  line-height: 1.75;
  color: var(--cb-brown-2);
  margin: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.stars svg { width: 14px; height: 14px; }
.rating-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-brown-d);
  margin-left: 4px;
}

.date {
  font-size: 12.5px;
  color: var(--cb-meta);
  font-variant-numeric: tabular-nums;
}

.btn-read {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--cb-tan);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-brown);
  background: #fff;
  transition: all 200ms;
}
.btn-read:hover {
  background: var(--cb-tan);
  color: #fff;
}
.btn-read svg { width: 11px; height: 11px; }

/* ============== Load more ============== */
.load-more {
  margin-top: 4px;
  padding: 16px;
  background: var(--cb-card);
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cb-brown-d);
  transition: background 200ms;
  width: 100%;
}
.load-more:hover { background: var(--cb-cream); }
.load-more svg { width: 14px; height: 14px; }

/* ============== Sidebar ============== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 90px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--cb-card);
  border: 1px solid var(--cb-line);
  border-radius: 8px;
  padding: 4px 4px 4px 14px;
  height: 44px;
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13.5px;
  background: transparent;
  color: var(--cb-brown-d);
  font-family: inherit;
}
.search-box input::placeholder { color: oklch(72% 0.012 65); }
.search-box button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--cb-tan);
  color: #fff;
  border-radius: 6px;
  transition: background 200ms;
}
.search-box button:hover { background: var(--cb-tan-d); }
.search-box svg { width: 16px; height: 16px; }

.widget {
  background: var(--cb-card);
  border: 1px solid var(--cb-line);
  border-radius: 12px;
  padding: 22px 22px 14px;
}
.widget h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--cb-brown-d);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cb-line);
}

/* Categories */
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { border-bottom: 1px solid oklch(94% 0.012 70); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  font-size: 13px;
  color: var(--cb-brown-d);
  transition: color 180ms;
}
.cat-list a:hover { color: var(--cb-tan-d); }
.cat-list svg {
  width: 13px;
  height: 13px;
  color: var(--cb-meta);
}

/* Recommended books */
.rec-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.rec-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
}
.rec-cover {
  width: 56px;
  height: 80px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 4px rgba(60,40,20,0.18);
}
.rec-info { min-width: 0; }
.rec-info .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-brown-d);
  line-height: 1.4;
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rec-info .stars-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rec-info .stars svg { width: 11px; height: 11px; }
.rec-info .rating-num { font-size: 11.5px; }

.widget-more {
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--cb-brown-d);
  transition: all 200ms;
}
.widget-more:hover { background: var(--cb-cream); }

/* Profile */
.profile-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: oklch(92% 0.04 65);
  display: grid;
  place-items: center;
  color: var(--cb-brown);
  font-weight: 600;
}
.profile-row p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--cb-brown-2);
  margin: 0;
}
.btn-profile {
  display: block;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--cb-tan);
  color: var(--cb-brown);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: all 200ms;
  text-align: center;
}
.btn-profile:hover { background: var(--cb-tan); color: #fff; }

.profile-bio {
  font-size: 12px;
  line-height: 1.85;
  color: var(--cb-brown-2);
  margin: 0 0 12px;
}
.profile-bio:last-child { margin-bottom: 4px; }

/* ============== Features strip ============== */
.features {
  background: var(--cb-card);
  border-top: 1px solid var(--cb-line);
}
.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.feature {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
}
.feature-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--cb-tan-d);
}
.feature-icon svg { width: 28px; height: 28px; stroke-width: 1.5; }
.feature h4 {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--cb-brown-d);
  margin: 2px 0 6px;
}
.feature p {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--cb-brown-2);
  margin: 0;
}

/* ============== Footer ============== */
.footer {
  background: var(--cb-card);
  border-top: 1px solid var(--cb-line);
  padding: 28px 32px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.foot-nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.foot-nav a {
  font-size: 12.5px;
  color: var(--cb-brown-d);
  transition: color 180ms;
}
.foot-nav a:hover { color: var(--cb-tan-d); }
.copyright {
  font-size: 11.5px;
  color: var(--cb-meta);
  padding-top: 14px;
  border-top: 1px solid var(--cb-line);
}

/* ============== Responsive ============== */
@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { position: relative; width: 100%; height: 260px; margin-top: 24px; }
  .hero-image::before { display: none; }
  .features-inner { grid-template-columns: repeat(1, 1fr); }
  .nav { display: none; }
}
@media (max-width: 600px) {
  .card { grid-template-columns: 110px 1fr; gap: 16px; padding: 16px; }
  .cover { width: 110px; height: 158px; }
  .features-inner { grid-template-columns: 1fr; }
  .header-inner { padding: 12px 18px; }
  .page { padding: 36px 18px; }
  .hero-inner { padding: 48px 20px; }
  .hero h1 { font-size: 30px; }
}
