/* =============================================================================
   FRONT PAGE - Inkitt Style
   ============================================================================= */

/* Hide site header/title area AND original nav on front page */
.is-front-page-inkitt .header,
.is-front-page-inkitt .main-navigation {
  display: none !important;
}

/* ---- Inkitt-style Nav Bar ---- */
.fp-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.fp-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.fp-nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
  flex-shrink: 0;
}

.fp-nav__logo-icon {
  width: 2rem; height: 2rem;
  background: #2563eb;
  border-radius: 0.375rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.1rem;
}

.fp-nav__logo-text {
  font-weight: 700;
  font-size: 1.2rem;
  color: #111827 !important;
  letter-spacing: -0.02em;
}

.fp-nav__search {
  flex: 1;
  max-width: 36rem;
  margin: 0 2rem;
}

.fp-nav__search form {
  position: relative;
  width: 100%;
}

.fp-nav__search-icon {
  position: absolute;
  left: 0.75rem; top: 50%;
  transform: translateY(-50%);
  width: 1.25rem; height: 1.25rem;
  color: #9ca3af;
  pointer-events: none;
}

.fp-nav__search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #f9fafb;
  font-size: 0.875rem;
  color: #374151;
  outline: none;
  transition: all 0.15s;
}

.fp-nav__search-input:focus {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.fp-nav__search-input::placeholder {
  color: #9ca3af;
}

.fp-nav__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.fp-nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563 !important;
  text-decoration: none !important;
  transition: color 0.15s;
  white-space: nowrap;
}

.fp-nav__link:hover { color: #2563eb !important; }

.fp-nav__login-btn {
  background: #111827;
  color: #fff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.fp-nav__login-btn:hover { background: #000; }

/* Dark mode nav */
[data-mode="dark"] .fp-nav { background: #111827; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
[data-mode="dark"] .fp-nav__logo-text { color: #f1f5f9 !important; }
[data-mode="dark"] .fp-nav__search-input { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-mode="dark"] .fp-nav__search-input:focus { border-color: #2563eb; background: #1e293b; }
[data-mode="dark"] .fp-nav__search-input::placeholder { color: #6b7280; }
[data-mode="dark"] .fp-nav__link { color: #94a3b8 !important; }
[data-mode="dark"] .fp-nav__link:hover { color: #60a5fa !important; }
[data-mode="dark"] .fp-nav__login-btn { background: #e2e8f0; color: #111827 !important; }
[data-mode="dark"] .fp-nav__login-btn:hover { background: #fff; }

/* Nav responsive */
@media only screen and (max-width: 768px) {
  .fp-nav__search { display: none; }
  .fp-nav__link { display: none; }
}

/* Override theme layout constraints for front page */
.main.front-page {
  max-width: none !important;
  padding: 0 !important;
  width: 100%;
  margin-top: 0 !important;
}

.main.front-page > .main__background {
  display: none !important;
}

.main.front-page > .main__wrapper {
  max-width: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* Force light background on front page */
.is-front-page-inkitt,
.is-front-page-inkitt .site,
.is-front-page-inkitt .site.background-texture {
  background-color: #fcfcfc !important;
  background-image: none !important;
}

/* ---- Hero Section ---- */
.fp-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 50%, #f5f3ff 100%);
  padding: 4rem 2rem 5rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.fp-hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.fp-hero__text {
  flex: 1;
  min-width: 0;
}

.fp-hero__title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: #111827 !important;
  margin: 0 0 1rem;
  text-shadow: none !important;
}

.fp-hero__title-highlight {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fp-hero__desc {
  font-size: 1.1rem;
  color: #4b5563 !important;
  margin: 0 0 2rem;
  max-width: 28rem;
  line-height: 1.6;
  text-shadow: none !important;
}

.fp-hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.fp-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.fp-hero__btn._primary {
  background: #2563eb;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.fp-hero__btn._primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

.fp-hero__btn._secondary {
  background: #fff;
  color: #374151 !important;
  border: 2px solid #e5e7eb;
}

.fp-hero__btn._secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Hero book decoration */
.fp-hero__books {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
  height: 16rem;
  min-width: 300px;
}

.fp-hero__book {
  position: absolute;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #e5e7eb;
}

.fp-hero__book._left {
  width: 8rem; height: 12rem;
  transform: rotate(-12deg);
  left: 15%; top: 1rem;
  opacity: 0.8;
}

.fp-hero__book._center {
  width: 9rem; height: 14rem;
  z-index: 2;
  left: 50%; transform: translateX(-50%);
  top: 0;
}

.fp-hero__book._right {
  width: 8rem; height: 12rem;
  transform: rotate(12deg);
  right: 15%; top: 1rem;
  opacity: 0.8;
}

.fp-hero__book-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.fp-hero__book-placeholder {
  width: 100%; height: 100%;
  background: #d1d5db;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 2rem;
}

/* ---- Category Tags ---- */
.fp-categories {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}

.fp-categories__list {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.fp-categories__list::-webkit-scrollbar { display: none; }

.fp-categories__tag {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  color: #4b5563 !important;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.fp-categories__tag:hover {
  background: #e5e7eb;
}

.fp-categories__tag._active {
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
}

/* ---- Section Header ---- */
.fp-section {
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

.fp-section__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.fp-section__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827 !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  text-shadow: none !important;
}

.fp-section__title-icon {
  color: #ef4444;
  font-size: 1.25rem;
}

.fp-section__subtitle {
  font-size: 0.875rem;
  color: #6b7280 !important;
  margin: 0.25rem 0 0;
  text-shadow: none !important;
}

.fp-section__more {
  font-size: 0.875rem;
  font-weight: 500;
  color: #2563eb !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.fp-section__more:hover { color: #1e40af !important; }

/* ---- Trending: Horizontal Scroll ---- */
.fp-trending__scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 2rem;
  padding-top: 0.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.fp-trending__scroll::-webkit-scrollbar { display: none; }

.fp-book-card {
  flex-shrink: 0;
  width: 9rem;
  cursor: pointer;
  text-decoration: none !important;
  color: inherit;
  display: block;
}

.fp-book-card:hover .fp-book-card__cover {
  transform: scale(1.03);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.fp-book-card__cover {
  width: 100%; height: 13rem;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  background: #e5e7eb;
}

.fp-book-card__img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.fp-book-card__img._no-cover {
  display: flex; align-items: center; justify-content: center;
  background: #d1d5db; color: #9ca3af; font-size: 1.5rem;
  width: 100%; height: 100%;
}

.fp-book-card__rank {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.fp-book-card__rank._gold { background: #fbbf24; color: #78350f; }
.fp-book-card__rank._silver { background: #f3f4f6; color: #374151; }
.fp-book-card__rank._bronze { background: #fed7aa; color: #7c2d12; }

.fp-book-card__info { margin-top: 0.75rem; }

.fp-book-card__title {
  font-size: 0.9375rem; font-weight: 700;
  color: #111827 !important;
  line-height: 1.3; margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
  text-shadow: none !important;
}

.fp-book-card:hover .fp-book-card__title { color: #2563eb !important; }

.fp-book-card__author {
  font-size: 0.75rem; color: #6b7280 !important;
  margin-top: 0.25rem; text-shadow: none !important;
}

.fp-book-card__stats {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.25rem; font-size: 0.75rem;
  color: #9ca3af !important; text-shadow: none !important;
}

/* ---- New Releases: Grid Cards ---- */
.fp-new-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.fp-new-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s;
  text-decoration: none !important;
  color: inherit;
  cursor: pointer;
}

.fp-new-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fp-new-card__cover {
  width: 4rem; height: 6rem;
  border-radius: 0.25rem;
  overflow: hidden;
  flex-shrink: 0;
  background: #e5e7eb;
}

.fp-new-card__cover-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.fp-new-card__cover-img._no-cover {
  display: flex; align-items: center; justify-content: center;
  background: #d1d5db; color: #9ca3af; font-size: 1.25rem;
  width: 100%; height: 100%;
}

.fp-new-card__body {
  margin-left: 1rem; flex: 1; min-width: 0;
}

.fp-new-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.fp-new-card__title {
  font-size: 0.9375rem; font-weight: 700;
  color: #111827 !important; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: none !important;
}

.fp-new-card__genre {
  flex-shrink: 0; font-size: 0.7rem; font-weight: 500;
  padding: 0.15rem 0.5rem; border-radius: 0.25rem;
  white-space: nowrap;
  background: #eff6ff; color: #1e40af;
}

.fp-new-card__author {
  font-size: 0.8125rem; color: #6b7280 !important;
  margin-top: 0.25rem; text-shadow: none !important;
}

.fp-new-card__meta {
  font-size: 0.75rem; color: #9ca3af !important;
  margin-top: 0.5rem; text-shadow: none !important;
}

/* ---- Empty state ---- */
.fp-empty-inline {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
  width: 100%;
}

/* ========== RESPONSIVE ========== */
@media only screen and (max-width: 1024px) {
  .fp-new-grid { grid-template-columns: repeat(2, 1fr); }
}

@media only screen and (max-width: 768px) {
  .fp-hero__inner { flex-direction: column; text-align: center; }
  .fp-hero__text { text-align: center; }
  .fp-hero__desc { margin-left: auto; margin-right: auto; }
  .fp-hero__actions { justify-content: center; }
  .fp-hero__books { display: none; }
  .fp-hero__title { font-size: 2rem; }
}

@media only screen and (max-width: 640px) {
  .fp-new-grid { grid-template-columns: 1fr; }
  .fp-hero { padding: 2.5rem 1rem 3rem; }
  .fp-hero__title { font-size: 1.75rem; }
  .fp-hero__desc { font-size: 1rem; }
  .fp-section__title { font-size: 1.25rem; }
}

@media only screen and (max-width: 480px) {
  .fp-book-card { width: 7.5rem; }
  .fp-book-card__cover { height: 11rem; }
}

/* ========== DARK MODE OVERRIDES ========== */
[data-mode="dark"] .is-front-page-inkitt,
[data-mode="dark"] .is-front-page-inkitt .site,
[data-mode="dark"] .is-front-page-inkitt .site.background-texture {
  background-color: #0f172a !important;
  background-image: none !important;
}
[data-mode="dark"] .fp-hero { background: linear-gradient(135deg, #1e293b 0%, #1e1b4b 50%, #1e1b4b 100%); }
[data-mode="dark"] .fp-hero__title { color: #f1f5f9 !important; }
[data-mode="dark"] .fp-hero__desc { color: #94a3b8 !important; }
[data-mode="dark"] .fp-hero__btn._secondary { background: #334155; color: #e2e8f0 !important; border-color: #475569; }
[data-mode="dark"] .fp-hero__book-placeholder { background: #374151; color: #6b7280; }
[data-mode="dark"] .fp-categories__tag { background: #1e293b; color: #cbd5e1 !important; border-color: #334155; }
[data-mode="dark"] .fp-categories__tag:hover { background: #334155; }
[data-mode="dark"] .fp-categories__tag._active { background: #e2e8f0 !important; color: #1e293b !important; }
[data-mode="dark"] .fp-section__title { color: #f1f5f9 !important; }
[data-mode="dark"] .fp-section__subtitle { color: #94a3b8 !important; }
[data-mode="dark"] .fp-book-card__title { color: #f1f5f9 !important; }
[data-mode="dark"] .fp-book-card__author { color: #94a3b8 !important; }
[data-mode="dark"] .fp-book-card__stats { color: #6b7280 !important; }
[data-mode="dark"] .fp-book-card__cover { background: #374151; }
[data-mode="dark"] .fp-book-card__img._no-cover { background: #374151; color: #6b7280; }
[data-mode="dark"] .fp-new-card { background: #1e293b; border-color: #334155; }
[data-mode="dark"] .fp-new-card__title { color: #f1f5f9 !important; }
[data-mode="dark"] .fp-new-card__author { color: #94a3b8 !important; }
[data-mode="dark"] .fp-new-card__meta { color: #6b7280 !important; }
[data-mode="dark"] .fp-new-card__genre { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
[data-mode="dark"] .fp-new-card__cover { background: #374151; }
[data-mode="dark"] .fp-new-card__cover-img._no-cover { background: #374151; color: #6b7280; }
[data-mode="dark"] .fp-empty-inline { color: #6b7280; }
