/* ---- Local Font ---- */
@font-face {
  font-family: 'School Rules Letters';
  src: url('./assets/assets/fonts/School_Rules_Letters.ttf') format('truetype'),
       url('./assets/assets/fonts/School Rules Letters.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---- CSS Variables ---- */
:root {
  --bg: #faf6f0;
  --surface: rgba(255,255,255,0.78);
  --text: #18212b;
  --muted: #5a6775;
  --brand1: #f07f22;
  --brand2: #1f87c9;
  --button: #f07f22;
  --buttonText: #ffffff;
  --ring: rgba(240,127,34,0.25);
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
  --radius: 18px;
  --container: 1120px;
  --font-heading: 'Fraunces', serif;
  --font-logo: 'Luckiest Guy', cursive;
  --font-handwritten: 'School Rules Letters', cursive;
  --font-body: 'Fraunces', serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }

/* ---- Container ---- */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}
.brand {
  text-decoration: none;
  font-family: var(--font-logo);
  font-weight: 400;
  letter-spacing: 0.6px;
  font-size: 28px;
}
.brand-kale { color: var(--brand1); }
.brand-tate { color: var(--brand1); margin-left: 8px; }

.nav-group {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav {
  display: flex;
  gap: 26px;
  align-items: center;
}
.nav a {
  text-decoration: none;
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  opacity: 0.82;
  transition: opacity 0.2s ease, color 0.2s ease;
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand1);
  border-radius: 2px;
  transition: width 0.25s ease;
}
.nav a:hover { opacity: 1; color: var(--brand1); }
.nav a:hover::after { width: 100%; }

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.search-btn:hover { opacity: 1; }
.search-btn svg { width: 20px; height: 20px; }

/* ---- Hamburger ---- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 101;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('./assets/no_cotent_hero_background.webp');
  background-size: cover;
  background-position: center;
}
.hero-inner {
  position: relative;
  z-index: 1;
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 20px 0 30px;
}
.hero-characters {
  max-height: 240px;
  width: auto;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.18));
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: -30px;
}

.hero-left {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-book {
  width: 100%;
  max-width: 236px;
  height: auto;
  border-radius: 10px;
  filter: drop-shadow(0 16px 32px rgba(0,0,0,0.22));
  transform: perspective(800px) rotateY(16deg);
  transition: transform 0.3s ease;
}
.hero-book:hover {
  transform: perspective(800px) rotateY(4deg) scale(1.04);
}

.hero-content {
  flex: 0 1 auto;
  padding: 0 16px;
}
.hero-content h1 {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.4px;
  color: #3E3F72;
}
.hero-sub {
  margin: 0 0 28px;
  font-family: var(--font-handwritten);
  font-size: 26px;
  color: var(--brand1);
  font-weight: normal;
  letter-spacing: 0.5px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---- Buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 14px 28px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.button:active { transform: translateY(1px); }

.button.primary {
  background: var(--button);
  color: var(--buttonText);
  box-shadow: 0 10px 22px var(--ring);
}
.button.primary:hover {
  background: #e06f12;
  box-shadow: 0 12px 28px var(--ring);
  transform: translateY(-1px);
}

.button.small {
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  background: var(--button);
  color: var(--buttonText);
  box-shadow: 0 6px 16px var(--ring);
}
.button.small:hover {
  background: #e06f12;
  transform: translateY(-1px);
}

/* ---- About the Author ---- */
.section {
  padding: 52px 0;
}
.section h2 {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.3px;
  color: #3E3F72;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.about-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}
.author {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
}
.about-text p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.about-text p:last-child { margin-bottom: 0; }

/* ---- Books Grid ---- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  align-items: start;
}
.book {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.book img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: rgba(255,255,255,0.6);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.book img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
}

.book.featured {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.book.featured img {
  border-radius: 14px;
}
.book-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ---- Social Links ---- */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand1);
  text-decoration: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  transition: opacity 0.2s ease;
  margin-top: 12px;
}
.social-link:hover {
  opacity: 0.75;
}
.social-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.footer-social {
  margin-top: 8px;
}
.footer-social .social-link {
  font-size: 14px;
  margin-top: 0;
}

/* ---- Footer ---- */
.footer {
  padding: 28px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.55);
}
.footer-inner {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner p { margin: 0; }

/* ---- Responsive: tablet ---- */
@media (max-width: 980px) {
  .hero-inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding: 28px 0 0;
    min-height: auto;
    gap: 16px;
  }
  .hero-left { order: 1; width: 100%; }
  .hero-book { max-width: 200px; transform: none; }
  .hero-content { order: 2; width: 100%; padding: 0 8px 20px; }
  .hero-content h1 { font-size: 26px; }
  .hero-actions { justify-content: center; }
  .hero-characters { display: none; }
  .hero-sub { display: none; }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-card {
    grid-template-columns: 1fr;
  }
  .author { max-width: 200px; margin: 0 auto; }

  .hamburger { display: flex; }
  .nav-group {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 20px 24px;
    flex-direction: column;
    gap: 16px;
  }
  .nav-group.open { display: flex; }
  .nav-group .nav {
    flex-direction: column;
    gap: 16px;
  }
  .nav-group .nav a { font-size: 17px; }
}

/* ---- Book Link (index page) ---- */
.book-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 0 8px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb a:hover {
  color: var(--brand1);
}
.breadcrumb-sep {
  opacity: 0.4;
  font-weight: 300;
}
.breadcrumb [aria-current="page"] {
  color: var(--brand1);
  font-weight: 600;
}

/* ---- Book Detail Grid ---- */
.book-detail-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  align-items: start;
  padding: 32px 0 24px;
}

/* ---- Book Detail Cover ---- */
.book-detail-cover {
  position: sticky;
  top: 100px;
}
.book-detail-cover img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 6px 16px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.6);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.book-detail-cover img:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 28px 60px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.12);
}

/* ---- Book Detail Info ---- */
.book-detail-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.book-detail-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.4px;
  color: #3E3F72;
}

.book-detail-author {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  color: var(--muted);
}
.book-detail-author strong {
  color: var(--text);
  font-weight: 700;
}

/* ---- Rating Stars ---- */
.book-detail-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}
.book-detail-rating .stars {
  display: flex;
  gap: 2px;
  color: var(--brand1);
}
.book-detail-rating .stars svg {
  width: 20px;
  height: 20px;
  fill: var(--brand1);
  stroke: none;
}
.book-detail-rating .rating-count {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
}

/* ---- Price ---- */
.book-detail-price {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 32px;
  color: var(--text);
}
.book-detail-price .price-secondary {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}

/* ---- Description ---- */
.book-detail-description {
  margin: 4px 0 0;
}
.book-detail-description p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}
.book-detail-description p:last-child { margin-bottom: 0; }

/* ---- Features Pills ---- */
.book-detail-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
}
.book-detail-features .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(240, 127, 34, 0.1);
  color: #c46010;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(240, 127, 34, 0.18);
}

/* ---- Actions ---- */
.book-detail-actions {
  margin: 8px 0 4px;
}
.book-detail-actions .button.primary {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: 16px;
}

/* ---- Meta Card ---- */
.book-detail-meta {
  margin-top: 8px;
}
.book-detail-meta dl {
  margin: 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
}
.book-detail-meta dt,
.book-detail-meta dd {
  margin: 0;
  padding: 12px 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.book-detail-meta dt {
  color: var(--muted);
  font-weight: 600;
}
.book-detail-meta dd {
  color: var(--text);
  font-weight: 400;
}
.book-detail-meta dt:last-of-type,
.book-detail-meta dd:last-of-type {
  border-bottom: none;
}

/* ---- Back Link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 48px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand1);
  text-decoration: none;
  transition: opacity 0.2s ease, gap 0.2s ease;
}
.back-link:hover {
  opacity: 0.75;
  gap: 10px;
}
.back-link svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.back-link:hover svg {
  transform: translateX(-3px);
}

/* ---- Responsive: small phone ---- */
@media (max-width: 420px) {
  .brand { font-size: 22px; }
  .container { width: min(var(--container), calc(100% - 28px)); }
  .hero-content h1 { font-size: 24px; }
  .hero-sub { font-size: 18px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ---- Responsive: book detail tablet ---- */
@media (max-width: 980px) {
  .book-detail-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 600px;
    margin: 0 auto;
  }
  .book-detail-cover {
    position: static;
    display: flex;
    justify-content: center;
  }
  .book-detail-cover img {
    max-width: 320px;
  }
}

/* ---- Responsive: book detail phone ---- */
@media (max-width: 420px) {
  .book-detail-grid {
    gap: 24px;
    padding: 20px 0 16px;
  }
  .book-detail-cover img {
    max-width: 260px;
  }
  .book-detail-title {
    font-size: 24px;
  }
  .book-detail-price {
    font-size: 26px;
  }
  .book-detail-meta dl {
    grid-template-columns: 120px 1fr;
  }
  .breadcrumb {
    padding: 16px 0 4px;
    font-size: 13px;
  }
}
