/*
Theme Name: Levi Sap Nei Thang
Theme URI: https://levisapneithang.com
Author: Custom Theme
Author URI: https://levisapneithang.com
Description: A warm, elegant author website theme for Levi Sap Nei Thang — featuring cream tones, golden accents, and serif typography.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: levi-sap-theme
Tags: author, books, elegant, serif, one-page
*/

/* ===========================
   CSS VARIABLES & RESET
   =========================== */
:root {
  --cream:       #f5f0e8;
  --cream-light: #faf7f2;
  --cream-mid:   #ede8de;
  --gold:        #b8892a;
  --gold-dark:   #9a7020;
  --gold-light:  #d4a843;
  --charcoal:    #1e1c18;
  --dark-text:   #2d2a24;
  --mid-text:    #6b6358;
  --light-text:  #9c9186;
  --white:       #ffffff;
  --card-bg:     #ffffff;
  --border:      #e2dbd0;
  --shadow:      rgba(30, 28, 24, 0.08);
  --shadow-md:   rgba(30, 28, 24, 0.15);

  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body:    'Lato', 'Helvetica Neue', sans-serif;
  --font-accent:  'Cormorant Garamond', 'Georgia', serif;

  --nav-height: 70px;
  --section-pad: 100px;
  --container: 1200px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 50px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream-light);
  color: var(--dark-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--charcoal);
}

.section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 12px;
}

.gold-text { color: var(--gold); }

/* ===========================
   LAYOUT HELPERS
   =========================== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

.section {
  padding: var(--section-pad) 0;
}

.section--alt { background-color: var(--cream); }

/* ===========================
   NAVIGATION
   =========================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background-color: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.site-nav.scrolled {
  border-color: var(--border);
  box-shadow: 0 2px 20px var(--shadow);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: 0.01em;
}

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--mid-text);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  transform-origin: left;
}

.nav-links a:hover { color: var(--charcoal); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  transition: 0.3s;
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  background-color: var(--cream-light);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(184,137,42,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 80px;
  align-items: center;
  width: 100%;
}

.hero-content { max-width: 560px; }

.hero-roles {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-roles span { opacity: 0.5; }

.hero-title {
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-title .first { color: var(--charcoal); display: block; }
.hero-title .last  { color: var(--gold); display: block; }

.hero-tagline {
  font-size: 1.05rem;
  color: var(--mid-text);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 420px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-image-wrap {
  position: relative;
}

.hero-photo-circle {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream-mid);
  box-shadow: 0 20px 60px rgba(184,137,42,0.15), 0 4px 20px var(--shadow-md);
  border: 6px solid var(--white);
  position: relative;
  flex-shrink: 0;
}

.hero-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cream-mid), var(--cream));
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--gold);
  opacity: 0.4;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--light-text);
  font-size: 0.75rem;
  animation: bounce 2s infinite;
}

.hero-scroll-hint svg {
  width: 16px;
  height: 16px;
  stroke: var(--gold);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(184,137,42,0.35);
}

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

.btn-outline:hover {
  background: var(--charcoal);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
  padding: 10px 20px;
  font-size: 0.82rem;
}

.btn-ghost:hover {
  background: var(--gold);
  color: var(--white);
}

/* ===========================
   ABOUT SECTION
   =========================== */
.about-section {
  background-color: var(--cream);
}

.about-header {
  text-align: center;
  margin-bottom: 64px;
}

.about-title {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
}

.about-title em {
  font-style: italic;
  color: var(--gold);
}

.about-body {
  max-width: 680px;
  margin: 28px auto 0;
  text-align: center;
  font-size: 1.05rem;
  color: var(--mid-text);
  line-height: 1.8;
}

.about-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.pillar-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s, transform 0.3s;
}

.pillar-card:hover {
  box-shadow: 0 12px 40px var(--shadow-md);
  transform: translateY(-4px);
}

.pillar-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: rgba(184,137,42,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.pillar-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pillar-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.pillar-card p {
  font-size: 0.9rem;
  color: var(--mid-text);
  line-height: 1.65;
}

/* ===========================
   BOOKS SECTION
   =========================== */
.books-section {
  background-color: var(--cream-light);
}

.books-header {
  text-align: center;
  margin-bottom: 72px;
}

.books-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700;
}

.books-list {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.book-item {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 72px;
  align-items: center;
}

.book-item:nth-child(even) {
  grid-template-columns: 1fr 700px !important;
  direction: rtl;
}

.book-item:nth-child(even) > * {
  direction: ltr;
}

.book-cover-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 8px 32px var(--shadow), 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.book-cover-wrap img {
  max-height: 320px;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.18));
  transition: transform 0.4s ease;
}

.book-cover-wrap:hover img {
  transform: scale(1.03) rotate(-1deg);
}

.book-cover-placeholder {
  width: 180px;
  height: 260px;
  background: linear-gradient(160deg, var(--book-color, #b8892a) 0%, color-mix(in srgb, var(--book-color, #b8892a) 70%, #000) 100%);
  border-radius: 4px 10px 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.95);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  padding: 24px 16px;
  line-height: 1.4;
  position: relative;
  box-shadow:
    inset -5px 0 12px rgba(0,0,0,0.25),
    inset 2px 0 6px rgba(255,255,255,0.08),
    6px 6px 20px rgba(0,0,0,0.25);
  letter-spacing: 0.01em;
}

.book-cover-placeholder::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 4px 10px 0 0;
}

.book-cover-placeholder::after {
  content: '';
  position: absolute;
  bottom: 28px;
  left: 16px; right: 16px;
  height: 1px;
  background: rgba(255,255,255,0.25);
}

.book-cover-placeholder span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.book-info {}

.book-title {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 6px;
}

.book-subtitle {
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
  display: block;
}

.book-divider {
  width: 48px;
  height: 2px;
  background: var(--gold);
  border: none;
  margin: 20px 0;
}

.book-description {
  font-size: 1rem;
  color: var(--mid-text);
  line-height: 1.75;
  margin-bottom: 28px;
}

.book-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===========================
   CONTACT SECTION
   =========================== */
.contact-section {
  background-color: var(--cream);
  text-align: center;
}

.contact-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-subtitle {
  max-width: 480px;
  margin: 0 auto 40px;
  color: var(--mid-text);
  font-size: 1rem;
  line-height: 1.7;
}

.contact-btn-wrap {
  display: flex;
  justify-content: center;
}

.contact-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  background: var(--cream-light);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--charcoal);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--light-text);
}

/* ===========================
   MOBILE NAV
   =========================== */
@media (max-width: 768px) {
  :root { --section-pad: 60px; }

  .container { padding: 0 20px; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--cream-light);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 20px var(--shadow);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }

  .nav-links a:last-child { border-bottom: none; }
  .nav-toggle { display: flex; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-image-wrap { order: -1; }

  .hero-photo-circle {
    width: 240px;
    height: 240px;
    margin: 0 auto;
  }

  .hero-actions { justify-content: center; }
  .hero-roles { justify-content: center; }
  .hero-tagline { margin: 0 auto 40px; }

  .about-pillars { grid-template-columns: 1fr; }

  .book-item,
  .book-item:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 32px;
  }

  .book-cover-wrap { max-width: 280px; margin: 0 auto; }

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* ===========================
   ADMIN BOOK UPLOAD (plugin styles)
   =========================== */
.levi-books-admin-wrap { max-width: 800px; margin: 20px auto; }
.levi-books-admin-wrap h1 { font-size: 1.8rem; margin-bottom: 20px; color: #1e1c18; }

/* ===========================
   FIX: Hide stray page-builder
   shortcode text that may leak
   through from previous theme
   =========================== */
.entry-content br + br { display: none; }

/* Hide WPBakery wrapper divs if plugin is gone but divs remain */
.vc_row:empty,
.vc_column:empty,
.wpb_wrapper:empty { display: none; }

/* Ensure body text inside pages doesn't show raw shortcode remnants */
.entry-content p:empty { display: none; }

/* ===========================
   NAV LOGO: text by default,
   image only if custom logo set
   =========================== */
.nav-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* Remove old theme's crown icon if it persists */
.site-nav .custom-logo-link img {
  height: 40px;
  width: auto;
}

/* ===========================
   HOMEPAGE OVERRIDE
   Force correct body background
   on front page
   =========================== */
.home body,
body.home {
  background-color: var(--cream-light);
}

/* ===========================
   WP ADMIN BAR OFFSET
   =========================== */
.admin-bar .site-nav {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .site-nav { top: 46px; }
}

/* ===========================
   BOOK CARDS — clickable
   =========================== */
.book-cover-wrap {
  display: block;          /* make <a> block */
  text-decoration: none;
  cursor: pointer;
}

.book-title a {
  color: var(--charcoal);
  text-decoration: none;
  transition: color 0.2s;
}
.book-title a:hover { color: var(--gold); }

/* book-cover-placeholder defined above in main section */

.books-empty {
  text-align: center;
  color: var(--mid-text);
  padding: 40px 0;
}

/* ===========================
   SINGLE BOOK PAGE
   =========================== */
.single-book-page {
  padding-top: var(--nav-height);
}

/* Breadcrumb */
.book-breadcrumb {
  padding: 20px 0;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.2s, color 0.2s;
}
.breadcrumb-link:hover { color: var(--gold-dark); gap: 10px; }
.breadcrumb-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Hero band */
.book-hero-band {
  background: var(--cream-light);
  padding: 60px 0 72px;
}

.book-hero-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 72px;
  align-items: flex-start;
}

/* Book cover on single page */
.book-single-cover-wrap {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 8px 40px var(--shadow-md), 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.book-single-cover-img {
  max-height: 380px;
  width: auto;
  margin: 0 auto;
  display: block;
  border-radius: 4px;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.2));
  transition: transform 0.4s ease;
}
.book-single-cover-wrap:hover .book-single-cover-img {
  transform: scale(1.03) rotate(-1deg);
}

/* Book info on single page */
.book-single-info { padding-top: 8px; }

.book-single-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 10px 0 8px;
  color: var(--charcoal);
}

.book-single-subtitle {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.book-single-excerpt {
  font-size: 1.05rem;
  color: var(--mid-text);
  line-height: 1.8;
  margin-bottom: 8px;
}

.book-single-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.book-single-actions .btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* About This Book body section */
.book-body-section {
  background: var(--cream);
  padding: 64px 0;
}

.book-body-inner {
  max-width: 720px;
  margin: 0 auto;
}

.book-body-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.book-body-content {
  font-size: 1.05rem;
  color: var(--mid-text);
  line-height: 1.85;
}
.book-body-content p { margin-bottom: 1.2em; }
.book-body-content p:last-child { margin-bottom: 0; }

/* Other books grid */
.other-books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.other-book-card {
  display: block;
  text-decoration: none;
  color: var(--charcoal);
  transition: transform 0.3s;
}
.other-book-card:hover { transform: translateY(-6px); }

.other-book-cover {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 20px var(--shadow);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.other-book-cover img {
  max-height: 200px;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.other-book-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.other-book-sub {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
}

/* ===========================
   RESPONSIVE — SINGLE BOOK
   =========================== */
@media (max-width: 900px) {
  .book-hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .book-single-cover-wrap {
    position: static;
    max-width: 320px;
    margin: 0 auto;
  }
  .book-hero-band { padding: 40px 0 52px; }
}

@media (max-width: 640px) {
  .other-books-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .book-hero-band   { padding: 28px 0 40px; }
  .book-body-section{ padding: 40px 0; }
  .book-single-title { font-size: 1.8rem; }
  .book-single-cover-wrap { max-width: 240px; padding: 20px; }
  .book-single-cover-img  { max-height: 280px; }
}

@media (max-width: 400px) {
  .other-books-grid { grid-template-columns: 1fr; }
}

/* ===========================
   RESPONSIVE — BOOK LIST (homepage)
   =========================== */
@media (max-width: 860px) {
  .book-item,
  .book-item:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 28px;
    text-align: center;
  }
  .book-cover-wrap  { max-width: 260px; margin: 0 auto; }
  .book-cover-wrap img { margin: 0 auto; }
  .book-actions     { justify-content: center; }
  .book-divider     { margin: 16px auto; }
}

/* ===========================
   PLACEHOLDER — author name
   at bottom like a real cover
   =========================== */
.book-cover-placeholder {
  /* Override flex to column for title+author layout */
  flex-direction: column;
  gap: 8px;
}

.book-cover-placeholder span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Make the book-cover-wrap background transparent
   so the coloured placeholder is the visual, not the white box */
.book-cover-wrap:has(.book-cover-placeholder) {
  background: transparent;
  box-shadow: none;
  padding: 8px;
}
