/* homepage.css */
:root {
  --home-bg: #fff;
  --home-nav-bg: #f6f0ee;
  --shadow-soft: 0 10px 25px rgba(0,0,0,0.08);
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

/* optional filter button style if reused */
.filter-btn {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: rgba(0,0,0,0.55);
}

.filter-btn:hover {
  background: rgba(0,0,0,0.05);
}

/* Hero */
.home-hero {
  min-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 58px;
  padding: 30px 112px 20px;
  box-sizing: border-box;
}

.hero-left {
  width: 47%;
  max-width: 590px;
  margin-left: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  font-family: 'Georgia', serif;
  font-size: clamp(56px, 5vw, 78px);
  line-height: 1.08;
  margin: 0 0 20px 0;
  font-weight: 500;
  color: #111;
}

.hero-subtitle {
  margin: 0 0 32px 0;
  color: #222;
  font-size: 17px;
  line-height: 1.7;
  max-width: 500px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--red);
  border-radius: 12px;
  height: 52px;
  padding: 0 0 0 22px;
  text-decoration: none;
  font-weight: 600;
  color: #111;
  overflow: hidden;
  align-self: center;
}

.cta-arrow {
  height: 52px;
  width: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 20px;
}

/* Book collage */
.hero-right {
  width: min(62%, 940px);
  position: relative;
  height: 620px;
  flex-shrink: 0;
  margin-right: 0;
  transform: translateX(-30px) scale(1.12);
  transform-origin: center center;
}

.book-card {
  position: absolute;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.15);
  transform: rotate(var(--rot, 0deg));
}

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

.book-1 { width: 185px; height: 265px; left: 25px;  top: 155px; --rot: -8deg; }
.book-2 { width: 195px; height: 285px; left: 175px; top: 50px;  --rot:  5deg; }
.book-3 { width: 190px; height: 270px; left: 480px; top: 20px;  --rot:  9deg; }
.book-4 { width: 240px; height: 350px; left: 290px; top: 145px; --rot: 11deg; }
.book-5 { width: 200px; height: 295px; left: 525px; top: 205px; --rot: -5deg; }
.book-6 { width: 180px; height: 260px; left: 690px; top: 320px; --rot:  8deg; }

/* Bottom color bar */
.bottom-decor-bar {
  width: 100%;
  height: 22px;
  display: flex;
}

.decor-segment { flex: 1; }
.seg-1 { background-color: #F9A8A8; }
.seg-2 { background-color: #F38181; }
.seg-3 { background-color: #F05454; }
.seg-4 { background-color: #300101; }

/* Sections */
.home-section {
  padding: 34px 90px 10px;
  box-sizing: border-box;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.section-link {
  color: inherit;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

.scroll-lane {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-lane::-webkit-scrollbar {
  display: none;
}

/* Popular */
.popular-track {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  scroll-snap-type: x mandatory;
  width: max-content;
  min-height: 330px;
}

.home-inline-status {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.book-tile {
  width: 180px;
  text-align: center;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.tile-cover-link {
  text-decoration: none;
}

.tile-cover {
  width: 180px;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0,0,0,0.12);
  margin: 0 auto 16px;
  background: #eee;
}

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

.tile-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #eee7e4;
  color: #7a6f6f;
  font-size: 56px;
  font-weight: 700;
}

.tile-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-author {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--red);
  text-transform: uppercase;
}

/* Genres */
.genre-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

.genre-card {
  width: 100%;
  min-width: 0;
  height: 180px;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  box-sizing: border-box;
  color: #fff;
  overflow: hidden;
  transition: filter 0.2s;
  text-align: center;
}

.genre-card:hover {
  filter: brightness(1.08);
}

.genre-text {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.genre-text h3 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  text-align: center;
}

.genre-text p {
  display: none;
}

.genre-card.horror   { background: #4b0606; }
.genre-card.fantasy  { background: #ff3b3b; }
.genre-card.romance  { background: #ffb3b8; color: #111; }
.genre-card.scifi    { background: #ff5a66; }

/* Start Writing */
.writing-cta {
  padding: 46px 90px 58px;
  background: #fff;
}

.writing-inner {
  display: grid;
  grid-template-columns: 520px 1fr;
  align-items: center;
  gap: 70px;
  max-width: 1200px;
  margin: 0 auto;
}

.writing-illustration {
  width: 520px;
  max-width: 100%;
  display: block;
}

.writing-title {
  font-family: 'Georgia', serif;
  font-size: 56px;
  line-height: 1.1;
  margin: 0 0 18px 0;
  font-weight: 500;
  color: #111;
}

.writing-subtitle {
  margin: 0 0 22px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #222;
  max-width: 520px;
}

.writing-btn {
  display: inline-flex;
  align-items: center;
  height: 42px;
  border: 1px solid var(--red);
  text-decoration: none;
  overflow: hidden;
  background: #fff;
}

.writing-btn-text {
  padding: 0 18px;
  font-weight: 600;
  font-size: 12px;
  color: #111;
}

.writing-btn-arrow {
  width: 56px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 18px;
}

/* Footer */
.site-footer {
  margin-top: 0;
}

.footer-top {
  background: #f6f0ee;
  padding: 46px 90px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 180px 180px 1fr;
  gap: 40px;
  align-items: start;
}

.footer-brand {
  font-size: 20px;
  font-weight: 700;
  color: #4b0606;
}

.footer-col h4 {
  margin: 0 0 14px 0;
  font-size: 12px;
  font-weight: 700;
  color: #111;
}

.footer-col a {
  display: block;
  text-decoration: none;
  color: rgba(0,0,0,0.7);
  font-size: 11px;
  margin: 0 0 10px 0;
}

.footer-col a:hover {
  color: rgba(0,0,0,0.9);
}

.footer-newsletter h4 {
  margin-bottom: 12px;
}

.newsletter {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 320px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.newsletter-input {
  border: none !important;
  outline: none;
  padding: 12px 14px;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  background: transparent !important;
  margin: 0 !important;
}

.newsletter-btn {
  width: 60px;
  height: 44px;
  border: none;
  margin: 0;
  border-radius: 0;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Contact bar */
.footer-contact {
  background: #300101;
  padding: 34px 18px 38px;
}

.contact-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner h3 {
  margin: 0 0 22px 0;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 26px;
}

.social-btn {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  color: #c83b3b;
  text-decoration: none;
}

.social-btn:hover {
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 1280px) {
  .home-hero {
    min-height: auto;
    align-items: center;
    padding: 24px 28px 20px;
    gap: 34px;
  }

  .hero-left {
    width: min(100%, 520px);
  }

  .hero-title {
    font-size: clamp(52px, 5vw, 68px);
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-right {
    width: min(100%, 700px);
    height: 460px;
    transform: scale(0.88);
    transform-origin: top center;
    margin: 0 auto;
  }

  .home-section {
    padding: 28px 28px 8px;
  }

  .genre-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .genre-card {
    height: 170px;
    padding: 24px;
  }

  .genre-text h3 {
    font-size: 28px;
  }

  .writing-cta {
    padding: 36px 28px 50px;
  }

  .footer-top {
    padding: 40px 28px;
  }

  .writing-inner {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .writing-right {
    text-align: left;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .home-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-left,
  .hero-right {
    width: 100%;
  }

  .hero-left {
    align-items: center;
    text-align: center;
  }

  .hero-title {
    font-size: clamp(46px, 7vw, 62px);
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .hero-right {
    height: 400px;
    transform: scale(0.78);
    transform-origin: top center;
    margin-top: 8px;
  }

  .book-tile {
    width: 165px;
  }

  .tile-cover {
    width: 165px;
    height: 230px;
  }

  .genre-card {
    height: 155px;
    padding: 22px;
  }

  .genre-text h3 {
    font-size: 24px;
  }
}

@media (max-width: 640px) {
  .home-hero {
    padding: 22px 18px 18px;
    gap: 24px;
  }

  .hero-title {
    font-size: clamp(38px, 10vw, 52px);
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .hero-right {
    height: 260px;
    transform: scale(0.58);
    transform-origin: top center;
  }

  .home-section {
    padding: 24px 18px 8px;
  }

  .book-tile {
    width: 145px;
  }

  .tile-cover {
    width: 145px;
    height: 205px;
  }

  .genre-row {
    grid-template-columns: 1fr;
  }

  .genre-card {
    height: 145px;
    padding: 22px;
  }

  .genre-text h3 {
    font-size: 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .writing-title {
    font-size: 44px;
  }
}