/*
Theme Name: BookHaven
Theme URI: https://example.com/bookhaven
Author: BookHaven
Author URI: https://example.com
Description: A clean, professional WordPress theme for an indie bookstore blog and marketplace. Features a homepage with social widgets, a banner with overlay, a marketplace intro, a dynamic blog grid, and a marketplace search.
Version: 1.4.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bookhaven
Tags: blog, e-commerce, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --bh-bg: #faf7f2;
  --bh-surface: #ffffff;
  --bh-ink: #1f1b16;
  --bh-ink-soft: #57514a;
  --bh-accent: #8a3a2a;
  --bh-accent-hover: #6f2d20;
  --bh-line: #e7e0d5;
  --bh-muted: #8a8275;
  --bh-radius: 6px;
  --bh-shadow: 0 6px 24px rgba(31, 27, 22, 0.08);
  --bh-max: 1200px;
  --bh-font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --bh-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--bh-font-sans);
  background: var(--bh-bg);
  color: var(--bh-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bh-accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--bh-accent-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--bh-font-serif);
  color: var(--bh-ink);
  margin: 0 0 .5em;
  line-height: 1.2;
  font-weight: 600;
}

.bh-container {
  max-width: var(--bh-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Section 1: Header / Title + Social ---------- */
.bh-site-header {
  background: var(--bh-surface);
  border-bottom: 1px solid var(--bh-line);
  padding: 28px 0;
}
.bh-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.bh-site-branding { display: flex; flex-direction: column; }
.bh-site-title {
  font-family: var(--bh-font-serif);
  font-size: 2rem;
  margin: 0;
  letter-spacing: -0.5px;
}
.bh-site-title a { color: var(--bh-ink); }
.bh-site-description {
  margin: 4px 0 0;
  color: var(--bh-ink-soft);
  font-size: .95rem;
}
.bh-social {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bh-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bh-bg);
  color: var(--bh-ink);
  border: 1px solid var(--bh-line);
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
.bh-social a:hover {
  background: var(--bh-accent);
  color: #fff;
  transform: translateY(-2px);
}
.bh-social svg { width: 18px; height: 18px; }

/* Primary nav (optional menu) */
.bh-primary-nav {
  border-top: 1px solid var(--bh-line);
  background: var(--bh-surface);
}
.bh-primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 0;
  padding: 14px 0;
  list-style: none;
}
.bh-primary-nav a {
  color: var(--bh-ink);
  font-weight: 500;
  font-size: .95rem;
}
.bh-primary-nav a:hover { color: var(--bh-accent); }

/* ---------- Section 2: Banner ---------- */
.bh-banner {
  position: relative;
  height: clamp(360px, 55vh, 560px);
  overflow: hidden;
  background: #2a221b;
}
.bh-banner-image {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}
.bh-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,15,10,.25) 0%, rgba(20,15,10,.65) 100%);
}
.bh-banner-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: #fff;
}
.bh-banner-tagline {
  font-family: var(--bh-font-serif);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  color: #fff;
  max-width: 760px;
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.bh-banner-sub {
  margin-top: 16px;
  font-size: 1.05rem;
  color: rgba(255,255,255,.85);
  max-width: 600px;
}

/* ---------- Section 3: Intro ---------- */
.bh-intro {
  padding: 72px 0;
  text-align: center;
}
.bh-intro-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: .8rem;
  color: var(--bh-accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.bh-intro h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 16px;
}
.bh-intro p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--bh-ink-soft);
  font-size: 1.075rem;
}

/* ---------- Section 4: Blog Grid ---------- */
.bh-blog {
  padding: 24px 0 80px;
}
.bh-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.bh-section-head h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 0;
}
.bh-section-head a {
  font-weight: 500;
  font-size: .95rem;
}
.bh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.bh-card {
  background: var(--bh-surface);
  border: 1px solid var(--bh-line);
  border-radius: var(--bh-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.bh-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--bh-shadow);
}
.bh-card-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bh-line);
}
.bh-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.bh-card:hover .bh-card-thumb img { transform: scale(1.04); }
.bh-card-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #d8cfbf, #b8a98f);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--bh-font-serif); font-size: 1.25rem;
}
.bh-card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.bh-card-meta {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--bh-muted);
  margin-bottom: 10px;
}
.bh-card-title {
  font-family: var(--bh-font-serif);
  font-size: 1.25rem;
  margin: 0 0 10px;
  line-height: 1.3;
}
.bh-card-title a { color: var(--bh-ink); }
.bh-card-title a:hover { color: var(--bh-accent); }
.bh-card-excerpt {
  color: var(--bh-ink-soft);
  font-size: .95rem;
  margin: 0 0 16px;
  flex: 1;
}
.bh-card-link {
  font-weight: 600;
  font-size: .9rem;
  align-self: flex-start;
}
.bh-card-link::after { content: " \2192"; }

.bh-no-posts {
  text-align: center;
  padding: 40px;
  color: var(--bh-muted);
  border: 1px dashed var(--bh-line);
  border-radius: var(--bh-radius);
}

/* ---------- Section 5: Marketplace CTA ---------- */
.bh-market {
  background: var(--bh-ink);
  color: #f4ece0;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.bh-market::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(138,58,42,.25), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(138,58,42,.15), transparent 50%);
  pointer-events: none;
}
.bh-market-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.bh-market h2 {
  color: #fff;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  margin-bottom: 12px;
}
.bh-market p {
  color: rgba(255,255,255,.8);
  font-size: 1.05rem;
  margin: 0 0 32px;
}
.bh-search-form {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
  max-width: 540px;
  margin: 0 auto 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.bh-search-form input[type="search"] {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 12px 20px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--bh-ink);
  outline: none;
  min-width: 0;
}
.bh-search-form button {
  border: 0;
  background: var(--bh-accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s ease;
  font-family: inherit;
}
.bh-search-form button:hover { background: var(--bh-accent-hover); }

.bh-signup-note {
  margin: 12px 0 24px;
  font-size: .85rem;
  color: rgba(255,255,255,.65);
}

.bh-signup-form + .bh-search-form {
  margin-top: 18px;
}

.bh-cta-button {
  display: inline-block;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  padding: 14px 36px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: all .25s ease;
}
.bh-cta-button:hover {
  background: #fff;
  color: var(--bh-ink);
  border-color: #fff;
}

/* ---------- Section 6: About ---------- */
.bh-about {
  padding: 80px 0;
  background: var(--bh-surface);
  border-top: 1px solid var(--bh-line);
}
.bh-about-grid {
  display: grid;
  gap: 56px;
  align-items: center;
}
.bh-about-grid.has-image {
  grid-template-columns: 1.1fr 1fr;
}
.bh-about-grid.text-only {
  grid-template-columns: 1fr;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.bh-about h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 16px;
}
.bh-about-text {
  color: var(--bh-ink-soft);
  font-size: 1.05rem;
}
.bh-about-text p { margin: 0 0 1em; }
.bh-about-text p:last-child { margin-bottom: 0; }
.bh-about-link {
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
  font-size: .95rem;
}
.bh-about-media {
  border-radius: var(--bh-radius);
  overflow: hidden;
  box-shadow: var(--bh-shadow);
}
.bh-about-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}
@media (max-width: 768px) {
  .bh-about { padding: 64px 0; }
  .bh-about-grid.has-image {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .bh-about-media img { aspect-ratio: 16 / 10; }
}

/* ---------- Footer ---------- */
.bh-site-footer {
  background: var(--bh-surface);
  border-top: 1px solid var(--bh-line);
  padding: 36px 0;
  text-align: center;
  color: var(--bh-muted);
  font-size: .9rem;
}
.bh-site-footer a { color: var(--bh-ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .bh-header-inner { flex-direction: column; align-items: flex-start; }
  .bh-social { width: 100%; justify-content: flex-start; }
  .bh-intro { padding: 56px 0; }
  .bh-market { padding: 64px 0; }
  .bh-search-form { flex-direction: column; padding: 12px; border-radius: 14px; }
  .bh-search-form button { border-radius: 10px; padding: 14px; }
}
