/* =========================================================
   NovaBook Hub — UI Styles (v1)
   Scoped to .nbh-* to avoid theme collisions
   ========================================================= */

/* Base */
:root{
  --nbh-primary: #447daa;
  --nbh-primary-dark: #376a93;
  --nbh-primary-soft: #5b90bb;
  --nbh-primary-border: rgba(68,125,170,.28);
}

.nbh-page{
  max-width: 1150px;
  margin: 0 auto;
  padding: 28px 16px;
  color: inherit;
}

.nbh-ico{
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
}

/* Layout */
.nbh-hero{
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 26px;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(17,24,39,.06), rgba(255,255,255,1));
  border: 1px solid rgba(17,24,39,.10);
  box-shadow: 0 14px 36px rgba(17,24,39,.10);
}

.nbh-coverbox{
  position: relative;
}

.nbh-cover{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(0,0,0,.18);
}

/* Bookmark */
.nbh-bookmark-btn{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 50px !important;
  min-height: 50px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(239,68,68,.30) !important;
  background: rgba(255,255,255,.97) !important;
  color: #ef4444 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  box-shadow: 0 10px 22px rgba(17,24,39,.14);
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}
.nbh-bookmark-btn svg{
  width: 22px;
  height: 22px;
  display: block;
}
.nbh-bookmark-flame{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transform: translateY(-1px);
}
.nbh-bookmark-btn .nbh-icon,
.nbh-bookmark-btn .nbh-bookmark-flame{
  pointer-events: none;
}
.nbh-bookmark-btn:hover,
.nbh-bookmark-btn:focus{
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 28px rgba(239,68,68,.22);
  color: #e11d48 !important;
  outline: none;
}
.nbh-bookmark-btn.is-active{
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.nbh-bookmark-btn.is-active:hover,
.nbh-bookmark-btn.is-active:focus{
  box-shadow: 0 16px 30px rgba(239,68,68,.28);
  color: #fff !important;
}
.nbh-bookmark-btn.nbh-bookmark-pop{
  transform: scale(1.06);
}

.nbh-cover-actions{
  margin-top: 14px;
  width: 100%;
  max-width: 100%;
}
.nbh-btn--cover{
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Meta */
.nbh-meta{
  min-width: 0;
}
.nbh-kicker{
  display: inline-block;
  font-weight: 800;
  font-size: .86rem;
  opacity: .75;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.nbh-title{
  margin: 0 0 14px 0;
  font-size: 2rem;
  line-height: 1.15;
}

/* Synopsis */
.nbh-synopsis{
  line-height: 1.55;
  margin: 0 0 10px 0;
}
.nbh-synopsis--collapsed{
  max-height: 220px;
  overflow: hidden;
  position: relative;
}
.nbh-synopsis--collapsed:after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,1));
  pointer-events: none;
}
.nbh-synopsis-toggle{
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  color: var(--nbh-primary) !important;
}
.nbh-synopsis-toggle:hover,
.nbh-synopsis-toggle:focus{
  color: var(--nbh-primary-dark) !important;
}

/* Info list */
.nbh-info{
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.nbh-info-item{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.72);
}
.nbh-info-item em{
  font-style: normal;
  font-weight: 800;
}
.nbh-info-item a,
.nbh-meta-link{
  color: var(--nbh-primary) !important;
  text-decoration: none !important;
  font-weight: 700;
}
.nbh-info-item a:hover,
.nbh-info-item a:focus,
.nbh-meta-link:hover,
.nbh-meta-link:focus{
  color: var(--nbh-primary-dark) !important;
  text-decoration: underline !important;
}

/* Share */
.nbh-share{
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.nbh-share-btn{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 22px rgba(17,24,39,.10);
  transition: transform .15s ease;
}
.nbh-share-btn:hover{ transform: translateY(-1px); }

/* Download block */
.nbh-download{
  margin-top: 26px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(17,24,39,.22);
  background: rgba(17,24,39,.03);
}
.nbh-download-title{
  margin: 0 0 12px 0;
  font-size: 1.25rem;
}
.nbh-download-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.nbh-btn{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.14);
  box-sizing: border-box;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.nbh-btn svg{ display:block; }
.nbh-btn,
.nbh-btn:visited{
  color: inherit;
}
.nbh-btn:hover{ transform: translateY(-1px); box-shadow: 0 14px 26px rgba(17,24,39,.14); }

.nbh-btn--primary{
  background: linear-gradient(135deg, var(--nbh-primary), var(--nbh-primary-soft));
  color: #fff !important;
  border-color: var(--nbh-primary-border);
}
.nbh-btn--primary:hover,
.nbh-btn--primary:focus{
  background: linear-gradient(135deg, var(--nbh-primary-dark), var(--nbh-primary));
  color: #fff !important;
}
.nbh-btn--danger{
  background: #ef4444;
  color: #fff;
  border-color: rgba(239,68,68,.35);
}
.nbh-btn--ghost{
  background: rgba(255,255,255,.96);
  color: var(--nbh-primary) !important;
  border-color: var(--nbh-primary-border);
}
.nbh-btn--ghost:hover,
.nbh-btn--ghost:focus{
  color: var(--nbh-primary-dark) !important;
}

.nbh-countdown{
  margin-top: 12px;
  font-weight: 900;
  opacity: .9;
}
.nbh-download-inline{
  margin-top: 14px;
}
.nbh-download-inline--cover{
  width: 100%;
}
.nbh-fake-links{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.nbh-fake-links .nbh-btn{
  display: flex;
  width: 100%;
}


.nbh-bookmarks-list,
.nbh-topreads-list,
.nbh-shortcode-books{
  display: block !important;
  width: 100% !important;
  max-width: 1200px;
}
.nbh-bookmarks-list h2,
.nbh-topreads-list h2{
  margin: 0 0 14px 0;
  font-size: 2em;
  line-height: 1.2;
}
.nbh-shortcode-search{
  margin: 12px 0 22px 0;
  width: 100%;
}
.nbh-shortcode-search-input{
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid rgba(17,24,39,.18);
  border-radius: 12px;
  background: #fff;
}
.nbh-topreads-grid,
.nbh-bookmarks-grid,
.nbh-shortcode-grid,
.nbh-grid{
  gap: 14px !important;
  width: 100% !important;
  align-items: start;
}

.nbh-topreads-list,
.nbh-bookmarks-list,
.nbh-archive{
  width: 100% !important;
}
.nbh-topreads-list .nbh-archive-inner,
.nbh-bookmarks-list .nbh-archive-inner,
.nbh-archive .nbh-archive-inner{
  width: 100% !important;
  max-width: 1200px !important;
  box-sizing: border-box;
}
.nbh-topreads-grid,
.nbh-bookmarks-grid,
.nbh-shortcode-grid,
.nbh-archive-grid{
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  width: 100% !important;
  align-items: stretch !important;
}
.nbh-topreads-grid > *,
.nbh-bookmarks-grid > *,
.nbh-shortcode-grid > *,
.nbh-archive-grid > *{
  flex: 0 0 calc(20% - 11.2px) !important;
  width: calc(20% - 11.2px) !important;
  max-width: calc(20% - 11.2px) !important;
  min-width: 180px !important;
  clear: none !important;
  float: none !important;
  margin: 0 !important;
}
.nbh-topreads-list .nbh-card,
.nbh-bookmarks-list .nbh-card,
.nbh-shortcode-books .nbh-card{
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 !important;
  float: none !important;
}

/* Related */
.nbh-related{
  margin-top: 30px;
}
.nbh-related-title{
  margin: 0 0 12px 0;
  font-size: 1.25rem;
}

/* Grid + Cards (archive + related + shortcodes) */
.nbh-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.nbh-card{
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.12);
  background: #fff;
  box-shadow: 0 14px 34px rgba(17,24,39,.10);
}
.nbh-card a{
  display: block;
  text-decoration: none;
  color: inherit;
}
.nbh-card img{
  width: 100%;
  height: auto;
  display: block;
}
.nbh-card-title{
  margin: 10px 12px 12px;
  font-size: 1rem;
  line-height: 1.2;
}

/* Archive */
.nbh-archive-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px;
}
.nbh-archive-title{
  margin: 0 0 14px 0;
  font-size: 2em;
  line-height: 1.2;
}
.nbh-term-description{
  max-width: 820px;
  margin: 0 0 14px 0;
  opacity: .85;
}
.nbh-archive-search{
  margin: 12px 0 22px 0;
}
.nbh-archive-input{
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid rgba(17,24,39,.18);
  border-radius: 12px;
  background: #fff;
}

.nbh-archive-grid{
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 14px;
  width: 100%;
  align-items: start;
}
.nbh-archive-item{
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 !important;
  float: none !important;
}
.nbh-archive-item .nbh-card-title{
  margin-bottom: 10px;
}
.nbh-card-meta{
  padding: 0 12px 12px;
  font-size: .92rem;
  color: #111827;
}

/* Pagination */
.nbh-pagination{
  max-width: 1200px;
  margin: 24px auto 0 auto;
  padding: 0 16px;
}
.nbh-pagination .page-numbers{
  display: inline-block;
  padding: 8px 12px;
  margin: 0 6px 8px 0;
  border: 1px solid rgba(17,24,39,.14);
  border-radius: 12px;
  text-decoration: none;
  background: #fff;
}
.nbh-pagination .page-numbers.current{
  font-weight: 900;
}

/* Taxonomy index */
.nbh-tax-index{
  width: 100%;
}
.nbh-tax-index-inner{
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px 16px;
}
.nbh-tax-index-title{
  margin: 0 0 10px 0;
  font-size: 2em;
}
.nbh-tax-index-search{
  margin: 12px 0 22px;
}
.nbh-tax-index-input{
  width: 100%;
  max-width: 520px;
  padding: 12px 14px;
  border: 1px solid rgba(17,24,39,.18);
  border-radius: 12px;
}
.nbh-tax-group{
  margin: 18px 0;
}
.nbh-tax-letter{
  font-weight: 900;
  font-size: 1.1rem;
  opacity: .85;
  margin-bottom: 10px;
}
.nbh-tax-list{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
}
.nbh-tax-link{
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.12);
  text-decoration: none;
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nbh-tax-link:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(17,24,39,.10);
}

/* Popup */
#nbh-popup-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.nbh-popup-box{
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 18px 16px;
  text-align: center;
  border: 1px solid rgba(17,24,39,.14);
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
}
#nbh-popup-close{
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(17,24,39,.18);
  background: #111827;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 980px){
  .nbh-hero{ grid-template-columns: 280px 1fr; }
  .nbh-info{ grid-template-columns: 1fr; }
  .nbh-tax-list{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px){
  .nbh-hero{ grid-template-columns: 1fr; }
  .nbh-tax-list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nbh-archive-grid,
  .nbh-topreads-grid,
  .nbh-bookmarks-grid,
  .nbh-shortcode-grid,
  .nbh-grid{ grid-template-columns: repeat(2, minmax(150px, 1fr)) !important; }
}
@media (max-width: 480px){
  .nbh-tax-list{ grid-template-columns: 1fr; }
  .nbh-download-actions{ flex-direction: column; }
  .nbh-archive-grid,
  .nbh-topreads-grid,
  .nbh-bookmarks-grid,
  .nbh-shortcode-grid,
  .nbh-grid{ grid-template-columns: repeat(2, minmax(135px, 1fr)) !important; gap: 12px !important; }
}


@media (max-width: 1100px){
  .nbh-topreads-grid > *,
  .nbh-bookmarks-grid > *,
  .nbh-shortcode-grid > *,
  .nbh-archive-grid > *{
    flex-basis: calc(25% - 10.5px) !important;
    width: calc(25% - 10.5px) !important;
    max-width: calc(25% - 10.5px) !important;
  }
}
@media (max-width: 860px){
  .nbh-topreads-grid > *,
  .nbh-bookmarks-grid > *,
  .nbh-shortcode-grid > *,
  .nbh-archive-grid > *{
    flex-basis: calc(33.333% - 9.5px) !important;
    width: calc(33.333% - 9.5px) !important;
    max-width: calc(33.333% - 9.5px) !important;
  }
}
@media (max-width: 640px){
  .nbh-topreads-grid > *,
  .nbh-bookmarks-grid > *,
  .nbh-shortcode-grid > *,
  .nbh-archive-grid > *{
    flex-basis: calc(50% - 7px) !important;
    width: calc(50% - 7px) !important;
    max-width: calc(50% - 7px) !important;
    min-width: 0 !important;
  }
}
