/* =============================================================================
   FRONT PAGE - Inkitt Style
   ============================================================================= */

/* Google Fonts: Inter (English) + Noto Sans SC (Chinese) + Noto Sans JP (Japanese) + Noto Sans KR (Korean) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;600;700;800&family=Noto+Sans+JP:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;600;700;800&display=swap');

/* Default: English - Inter */
.fp-nav,
.fp-nav *,
.main.front-page,
.main.front-page * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Chinese (Simplified) */
html[lang="zh-CN"] .fp-nav,
html[lang="zh-CN"] .fp-nav *,
html[lang="zh-CN"] .main.front-page,
html[lang="zh-CN"] .main.front-page * {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
}

/* Chinese (Traditional) */
html[lang="zh-TW"] .fp-nav,
html[lang="zh-TW"] .fp-nav *,
html[lang="zh-TW"] .main.front-page,
html[lang="zh-TW"] .main.front-page * {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Microsoft JhengHei', sans-serif !important;
}

/* Japanese */
html[lang="ja"] .fp-nav,
html[lang="ja"] .fp-nav *,
html[lang="ja"] .main.front-page,
html[lang="ja"] .main.front-page * {
  font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', sans-serif !important;
}

/* Korean */
html[lang="ko-KR"] .fp-nav,
html[lang="ko-KR"] .fp-nav *,
html[lang="ko-KR"] .main.front-page,
html[lang="ko-KR"] .main.front-page * {
  font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif !important;
}

/* 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%;
  margin: 0 !important;
  padding: 0 !important;
}

.fp-nav__search form .fp-nav__search-wrap {
  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;
  z-index: 1;
}

.fp-nav__search-input {
  width: 100% !important;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 9999px !important;
  background: #f9fafb !important;
  font-size: 0.875rem !important;
  color: #374151 !important;
  outline: none !important;
  transition: all 0.15s;
  box-shadow: none !important;
  height: auto !important;
  margin: 0 !important;
  line-height: 1.5 !important;
  -webkit-appearance: none;
  appearance: none;
}

.fp-nav__search-input:focus {
  background: #fff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}

.fp-nav__search-input::placeholder {
  color: #9ca3af !important;
}

/* Nav menu is used instead of __right */

.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;
  font-family: inherit;
  line-height: 1.5;
  text-decoration: none;
}

.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._desktop-only {
    display: none;
  }
}

/* Nav menu area */
.fp-nav__menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.fp-nav__wp-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fp-nav__wp-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fp-nav__wp-menu li a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563 !important;
  text-decoration: none !important;
  transition: color 0.15s;
  white-space: nowrap;
}

.fp-nav__wp-menu li a:hover {
  color: #2563eb !important;
}

/* User avatar dropdown */
.fp-nav__user {
  position: relative;
}

.fp-nav__avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 9999px;
  transition: background 0.15s;
}

.fp-nav__avatar-btn:hover {
  background: #f3f4f6;
}

.fp-nav__avatar-img {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  object-fit: cover;
}

.fp-nav__avatar-arrow {
  width: 1rem;
  height: 1rem;
  color: #6b7280;
  transition: transform 0.2s;
}

.fp-nav__user._open .fp-nav__avatar-arrow {
  transform: rotate(180deg);
}

.fp-nav__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 16rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 100;
  overflow: hidden;
}

.fp-nav__user._open .fp-nav__dropdown {
  display: block;
}

.fp-nav__dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.fp-nav__dropdown-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.fp-nav__dropdown-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-nav__dropdown-email {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-nav__dropdown-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 0;
}

.fp-nav__dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #374151 !important;
  text-decoration: none !important;
  transition: background 0.15s;
}

.fp-nav__dropdown-item:hover {
  background: #f9fafb;
}

.fp-nav__dropdown-item i {
  width: 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.8rem;
}

.fp-nav__dropdown-item._logout {
  color: #dc2626 !important;
}

.fp-nav__dropdown-item._logout i {
  color: #dc2626;
}

.fp-nav__dropdown-item._logout:hover {
  background: #fef2f2;
}

/* Mobile hamburger toggle */
.fp-nav__mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #374151;
}

.fp-nav__mobile-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media only screen and (max-width: 768px) {
  .fp-nav__menu {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    align-items: stretch;
    border-top: 1px solid #f3f4f6;
  }

  .fp-nav__menu._mobile-open {
    display: flex;
  }

  .fp-nav__link._desktop-only {
    display: block;
  }

  .fp-nav__link {
    display: block;
    padding: 0.5rem 0;
  }

  .fp-nav__login-btn {
    text-align: center;
    display: block;
  }

  .fp-nav__mobile-toggle {
    display: block;
  }

  .fp-nav__wp-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .fp-nav__wp-menu li a {
    display: block;
    padding: 0.5rem 0;
  }

  .fp-nav__user {
    width: 100%;
  }

  .fp-nav__dropdown {
    position: static;
    width: 100%;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    margin-top: 0.5rem;
  }
}

/* Dark mode dropdown */
[data-mode="dark"] .fp-nav__avatar-btn:hover {
  background: #1e293b;
}

[data-mode="dark"] .fp-nav__dropdown {
  background: #1e293b;
  border-color: #334155;
}

[data-mode="dark"] .fp-nav__dropdown-name {
  color: #f1f5f9;
}

[data-mode="dark"] .fp-nav__dropdown-email {
  color: #94a3b8;
}

[data-mode="dark"] .fp-nav__dropdown-divider {
  background: #334155;
}

[data-mode="dark"] .fp-nav__dropdown-item {
  color: #e2e8f0 !important;
}

[data-mode="dark"] .fp-nav__dropdown-item:hover {
  background: #334155;
}

[data-mode="dark"] .fp-nav__dropdown-item i {
  color: #94a3b8;
}

[data-mode="dark"] .fp-nav__dropdown-item._logout {
  color: #f87171 !important;
}

[data-mode="dark"] .fp-nav__dropdown-item._logout i {
  color: #f87171;
}

[data-mode="dark"] .fp-nav__dropdown-item._logout:hover {
  background: rgba(220, 38, 38, 0.1);
}

[data-mode="dark"] .fp-nav__mobile-toggle {
  color: #e2e8f0;
}

[data-mode="dark"] .fp-nav__wp-menu li a {
  color: #94a3b8 !important;
}

[data-mode="dark"] .fp-nav__wp-menu li a:hover {
  color: #60a5fa !important;
}

@media only screen and (max-width: 768px) {
  [data-mode="dark"] .fp-nav__menu {
    background: #1e293b;
    border-color: #334155;
  }
}

/* ---- Dark/Light Mode Toggle (native theme icon) ---- */
.fp-nav__darkmode-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.fp-nav__darkmode-icon button {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: 9999px;
  color: #6b7280;
  font-size: 1.1rem;
  transition: color 0.2s, background 0.2s;
}

.fp-nav__darkmode-icon button:hover {
  background: #f3f4f6;
  color: #111827;
}

[data-mode="dark"] .fp-nav__darkmode-icon button {
  color: #94a3b8;
}

[data-mode="dark"] .fp-nav__darkmode-icon button:hover {
  background: #1e293b;
  color: #fbbf24;
}

.fp-nav__darkmode-icon .only-lightmode,
.fp-nav__darkmode-icon .only-darkmode {
  width: 1.15rem;
  height: 1.15rem;
}

/* Show sun icon in dark mode, moon icon in light mode (handled by theme's .only-darkmode/.only-lightmode classes) */

/* 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;
}

/* Dark mode background for front page */
[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,
[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;
}

/* ---- 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;
  /* Default gray - overridden by inline style for colored tags */
  color: #4b5563;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.fp-categories__tag:hover {
  opacity: 0.8;
  filter: brightness(0.95);
}

/* Colored genre tags using CSS custom properties to override theme link styles */
.fp-categories__tag._colored {
  background: var(--tag-bg, #f3f4f6) !important;
  color: var(--tag-color, #4b5563) !important;
  border-color: var(--tag-border, #e5e7eb) !important;
}

/* "All" button keeps dark style */
.fp-categories__tag._all {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

.fp-categories__tag._all._active {
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
}

/* Active colored tag overrides inline colors */
.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%;
}

/* ---- Inline HTML class aliases (used in front-page.php template) ---- */
.fp-carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  padding-top: 0.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.fp-carousel::-webkit-scrollbar {
  display: none;
}

.fp-card {
  flex: 0 0 9rem;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  color: inherit;
}

.fp-card__cover-wrap {
  position: relative;
  width: 100%;
  height: 13rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  background: #f3f4f6;
}

.fp-card:hover .fp-card__cover-wrap {
  transform: scale(1.03);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

.fp-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-card__badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: #fbbf24;
  color: #78350f;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.fp-card__info {
  margin-top: 0.75rem;
}

.fp-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 0.25rem;
  transition: color 0.2s;
}

.fp-card:hover .fp-card__title {
  color: #2563eb;
}

.fp-card__author {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.fp-card__rating {
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
}

.fp-card__stats {
  color: #9ca3af;
}

.fp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media(max-width: 1024px) {
  .fp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width: 640px) {
  .fp-grid {
    grid-template-columns: 1fr;
  }
}

.fp-list-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none !important;
  align-items: center;
  color: inherit;
}

.fp-list-item:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border-color: #e5e7eb;
}

.fp-list-item__cover-wrap {
  width: 4rem;
  height: 6rem;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #e5e7eb;
}

.fp-list-item__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-list-item__info {
  flex: 1;
  min-width: 0;
}

.fp-list-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.fp-list-item__title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-list-item__tag {
  font-size: 0.65rem;
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.fp-list-item__author {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-list-item__meta {
  font-size: 0.75rem;
  color: #9ca3af;
}

.fp-section__desc {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Dark mode for inline-class aliases */
[data-mode="dark"] .fp-card__title {
  color: #f1f5f9;
}

[data-mode="dark"] .fp-card:hover .fp-card__title {
  color: #60a5fa;
}

[data-mode="dark"] .fp-card__author {
  color: #94a3b8;
}

[data-mode="dark"] .fp-card__stats {
  color: #6b7280;
}

[data-mode="dark"] .fp-card__cover-wrap {
  background: #374151;
}

[data-mode="dark"] .fp-list-item {
  background: #1e293b;
  border-color: #334155;
}

[data-mode="dark"] .fp-list-item__title {
  color: #f1f5f9;
}

[data-mode="dark"] .fp-list-item__author {
  color: #94a3b8;
}

[data-mode="dark"] .fp-list-item__meta {
  color: #6b7280;
}

[data-mode="dark"] .fp-list-item__tag {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

[data-mode="dark"] .fp-list-item__cover-wrap {
  background: #374151;
}

/* ========== 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;
  border-color: #334155;
}

[data-mode="dark"] .fp-categories__tag:hover {
  opacity: 0.85;
}

[data-mode="dark"] .fp-categories__tag._all {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

[data-mode="dark"] .fp-categories__tag._all._active {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

[data-mode="dark"] .fp-categories__tag._active {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  border-color: #e2e8f0 !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;
}

/* Dark mode: categories area background */
[data-mode="dark"] .fp-categories {
  background: transparent;
}

[data-mode="dark"] .fp-categories__tag {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-mode="dark"] .fp-categories__tag._all {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

[data-mode="dark"] .fp-categories__tag._all._active {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

[data-mode="dark"] .fp-categories__tag._active {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  border-color: #e2e8f0 !important;
}

[data-mode="dark"] .fp-categories__tag._colored {
  opacity: 0.9;
}

/* Dark mode: overall page & section backgrounds */
[data-mode="dark"] .fp-section {
  color: #e2e8f0;
}

[data-mode="dark"] .fp-section__desc {
  color: #94a3b8 !important;
}

[data-mode="dark"] .fp-card__cover-wrap {
  background: #374151;
}

[data-mode="dark"] .fp-card__title {
  color: #f1f5f9;
}

[data-mode="dark"] .fp-card:hover .fp-card__title {
  color: #60a5fa;
}

[data-mode="dark"] .fp-card__author {
  color: #94a3b8;
}

[data-mode="dark"] .fp-card__stats {
  color: #6b7280;
}

[data-mode="dark"] .fp-carousel {
  color: #e2e8f0;
}