/*
Theme Name: ReadHub
Theme URI: https://readhub.com
Author: ReadHub Team
Description: A modern book discovery and blog platform — Discover. Learn. Grow.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: readhub
*/

/* ============================================================
   CSS VARIABLES & RESET
   ============================================================ */
:root {
  --blue-deep:    #0a1a4a;
  --blue-mid:     #1a2f7a;
  --blue-bright:  #1e35d8;
  --blue-light:   #3b5ce6;
  --gold:         #e8a020;
  --gold-dark:    #c8880a;
  --white:        #ffffff;
  --off-white:    #f8f9fc;
  --gray-100:     #f1f3f8;
  --gray-200:     #e4e8f0;
  --gray-400:     #9aa3b8;
  --gray-600:     #5a6380;
  --text-dark:    #111827;
  --text-mid:     #374151;
  --text-light:   #6b7280;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', 'Helvetica Neue', sans-serif;
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --shadow-sm:    0 1px 4px rgba(10,26,74,0.08);
  --shadow-md:    0 4px 20px rgba(10,26,74,0.12);
  --shadow-lg:    0 8px 40px rgba(10,26,74,0.18);
  --transition:   all 0.22s cubic-bezier(0.4,0,0.2,1);
  --header-h:     68px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); color: var(--text-dark); background: var(--white); -webkit-font-smoothing: antialiased; }
img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; transition: var(--transition); }
ul, ol { list-style: none; }
button, input, textarea, select { font-family: inherit; }

h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); line-height: 1.2; color: var(--text-dark); font-weight: 700; }
h1 { font-size: clamp(2.2rem,5vw,3.5rem); }
h2 { font-size: clamp(1.6rem,3vw,2.25rem); }
h3 { font-size: 1.25rem; }
p  { margin-bottom: 1rem; color: var(--text-mid); }
p:last-child { margin-bottom: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: 0 1px 0 var(--gray-200);
  transition: box-shadow 0.3s, background 0.3s;
}
#site-header.rh-scrolled { box-shadow: var(--shadow-md); }

/* ── Homepage: dark transparent over hero ── */
body.home #site-header {
  background: rgba(10, 20, 72, 0.88);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
body.home #site-header .rh-name-first  { color: #ffffff; }
body.home #site-header .rh-name-second { color: #3b82f6; }
body.home #site-header .rh-nav-link    { color: rgba(255,255,255,0.8); }
body.home #site-header .rh-nav-link:hover,
body.home #site-header .rh-nav-link--active { color: #fff; background: rgba(255,255,255,0.10); }
body.home #site-header .rh-btn-search  { color: rgba(255,255,255,0.8); }
body.home #site-header .rh-btn-search:hover { color: #fff; background: rgba(255,255,255,0.10); }
body.home #site-header .rh-btn-login   { color: rgba(255,255,255,0.8); }
body.home #site-header .rh-btn-login:hover { color: #fff; }
body.home #site-header .rh-btn-subscribe { background: #2563eb; border-color: #2563eb; color: #fff; }
body.home #site-header .rh-hamburger span { background: #fff; }
body.home .rh-logo-img-link .custom-logo { filter: brightness(0) invert(1); }

/* Header inner layout */
.rh-header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  gap: 1.5rem;
}

/* ── LOGO + BRAND NAME ── */
.rh-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  text-decoration: none;
}

/* Custom logo image */
.rh-logo-img-link { display: flex; align-items: center; }
.rh-logo-img-link .custom-logo {
  height: 40px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

/* Brand text: READ HUB */
.rh-brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  text-decoration: none;
  line-height: 1;
}
.rh-name-first {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-dark);        /* white on homepage via body.home override */
  letter-spacing: -0.02em;
  transition: color 0.3s;
}
.rh-name-second {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  color: #3b82f6;                  /* always blue */
  letter-spacing: -0.02em;
}

/* ── PRIMARY NAV ── */
.rh-primary-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}
.rh-nav-list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0; padding: 0;
}
.rh-nav-item { position: relative; }
.rh-nav-link {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
}
.rh-nav-link:hover, .rh-nav-link--active {
  color: var(--blue-bright);
  background: var(--gray-100);
}
.rh-dropdown-caret { font-size: 0.5rem; margin-left: 2px; opacity: 0.55; }

/* Dropdown */
.rh-has-dropdown { position: relative; }
.rh-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 200;
  list-style: none;
}
.rh-has-dropdown:hover .rh-dropdown,
.rh-has-dropdown:focus-within .rh-dropdown { display: block; }
.rh-dropdown .rh-nav-link { display: block; padding: 0.5rem 1rem; font-size: 0.88rem; color: var(--text-mid); }
.rh-dropdown .rh-nav-link:hover { background: var(--gray-100); color: var(--blue-bright); }

/* ── HEADER ACTIONS ── */
.rh-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.rh-btn-search {
  background: none; border: none; cursor: pointer;
  color: var(--gray-600); padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; transition: var(--transition);
}
.rh-btn-search:hover { color: var(--blue-bright); background: var(--gray-100); }

.rh-btn-login {
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-mid); padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.rh-btn-login:hover { color: var(--blue-bright); }

.rh-btn-subscribe {
  background: var(--blue-bright);
  color: var(--white);
  border: 2px solid var(--blue-bright);
  padding: 0.5rem 1.3rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 700;
  white-space: nowrap; display: inline-flex; align-items: center;
  transition: var(--transition);
}
.rh-btn-subscribe:hover { background: var(--blue-mid); border-color: var(--blue-mid); }

/* Hamburger */
.rh-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
}
.rh-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text-dark); border-radius: 2px;
  transition: var(--transition);
}
.rh-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.rh-hamburger.is-open span:nth-child(2) { opacity: 0; }
.rh-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   MOBILE NAV PANEL
   ============================================================ */
.rh-mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 998;
  backdrop-filter: blur(2px);
}
.rh-mobile-overlay.is-open { display: block; }

.rh-mobile-nav {
  position: fixed; top: 0; right: -320px;
  width: 300px; max-width: 85vw; height: 100%;
  background: var(--white); z-index: 999;
  display: flex; flex-direction: column;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  transition: right 0.32s cubic-bezier(0.4,0,0.2,1);
  padding-bottom: 2rem;
}
.rh-mobile-nav.is-open { right: 0; }

.rh-mobile-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.rh-mob-brand {
  display: flex; align-items: center; gap: 0.4rem;
  text-decoration: none;
}
.rh-mob-brand .custom-logo { height: 32px; width: auto; }
.rh-mob-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 900; }
.rh-mob-name .rh-name-first  { color: var(--text-dark); }
.rh-mob-name .rh-name-second { color: #3b82f6; }

.rh-mobile-close {
  background: none; border: none; font-size: 1.6rem;
  cursor: pointer; color: var(--text-dark); line-height: 1; padding: 0.25rem;
}
.rh-mobile-menu { list-style: none; padding: 0.5rem 0; margin: 0; flex: 1; }
.rh-mob-item { border-bottom: 1px solid var(--gray-100); }
.rh-mob-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem;
  font-size: 0.98rem; font-weight: 600;
  color: var(--text-dark); text-decoration: none; transition: var(--transition);
}
.rh-mob-link:hover,
.rh-mob-current > .rh-mob-link { color: var(--blue-bright); background: var(--gray-100); }
.rh-mob-caret { font-size: 0.55rem; opacity: 0.45; }
.rh-mob-sub { list-style: none; padding: 0; background: var(--gray-100); }
.rh-mob-link--sub { padding-left: 2rem; font-size: 0.9rem; font-weight: 500; }
.rh-mobile-subscribe {
  display: block; margin: 1rem 1.25rem 0;
  background: var(--blue-bright); color: var(--white);
  text-align: center; padding: 0.8rem 1rem;
  border-radius: var(--radius-sm); font-size: 0.92rem; font-weight: 700;
  transition: var(--transition);
}
.rh-mobile-subscribe:hover { background: var(--blue-mid); }

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.rh-search-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(10,26,74,0.92); z-index: 2000;
  align-items: center; justify-content: center; padding: 2rem;
}
.rh-search-overlay.is-open { display: flex; }
.rh-search-box {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 2rem; width: 100%; max-width: 640px; position: relative;
}
.rh-search-box input[type="search"] {
  width: 100%; border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 1rem 1.25rem; font-size: 1.1rem; outline: none;
  transition: border-color 0.2s; font-family: var(--font-body);
}
.rh-search-box input[type="search"]:focus { border-color: var(--blue-bright); }
.rh-search-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; font-size: 1.6rem;
  cursor: pointer; color: var(--gray-600);
}
.rh-search-hint { margin-top: 0.75rem; font-size: 0.82rem; color: var(--text-light); }

/* ============================================================
   BADGES, STARS, UTILITIES
   ============================================================ */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.badge-light       { background: var(--gray-100); color: var(--gray-600); }
.badge-mindset     { background: #eef2ff; color: #4338ca; }
.badge-productivity{ background: #fef3c7; color: #92400e; }
.badge-business    { background: #dcfce7; color: #166534; }
.badge-selfgrowth  { background: #fce7f3; color: #9d174d; }
.badge-finance     { background: #ecfdf5; color: #065f46; }
.stars { color: var(--gold); font-size: 0.95rem; display: flex; gap: 2px; align-items: center; }
.stars span { color: var(--text-light); font-size: 0.8rem; margin-left: 4px; font-weight: 600; }

/* ============================================================
   BOOK & POST CARDS
   ============================================================ */
.book-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.25rem; display: flex; gap: 1rem; align-items: flex-start; transition: var(--transition); box-shadow: var(--shadow-sm); }
.book-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue-light); transform: translateY(-3px); }
.book-cover-thumb { width: 80px; min-width: 80px; height: 110px; border-radius: var(--radius-sm); object-fit: cover; }
.book-cover-placeholder { width: 80px; min-width: 80px; height: 110px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; text-align: center; padding: 0.5rem; font-size: 0.7rem; font-weight: 800; color: var(--white); line-height: 1.3; }
.book-meta h3 { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.2rem; line-height: 1.3; }
.book-author { color: var(--blue-bright); font-size: 0.82rem; font-weight: 600; margin-bottom: 0.4rem; display: block; }
.book-meta p { font-size: 0.83rem; color: var(--text-light); margin: 0.5rem 0 0.75rem; line-height: 1.5; }
.btn-view-book { display: inline-block; background: var(--gold); color: var(--white); padding: 0.4rem 1.1rem; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; transition: var(--transition); }
.btn-view-book:hover { background: var(--gold-dark); }

.post-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-thumb { width: 100%; height: 200px; object-fit: cover; }
.post-thumb-placeholder { width: 100%; height: 200px; background: linear-gradient(135deg,var(--blue-mid),var(--blue-bright)); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.post-body { padding: 1.25rem; }
.post-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.post-date { font-size: 0.78rem; color: var(--text-light); }
.post-body h3 { font-size: 1.05rem; color: var(--text-dark); margin-bottom: 0.5rem; line-height: 1.35; }
.post-body p { font-size: 0.87rem; color: var(--text-light); line-height: 1.6; margin-bottom: 0.75rem; }
.read-more { color: var(--blue-bright); font-size: 0.85rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.25rem; }
.read-more::after { content: '→'; transition: transform 0.2s; }
.read-more:hover::after { transform: translateX(3px); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-widget { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--gold); font-family: var(--font-display); }
.recent-post-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--gray-100); }
.recent-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--gray-200); }
.recent-info h4 { font-size: 0.85rem; line-height: 1.35; color: var(--text-dark); margin-bottom: 0.2rem; }
.recent-info span { font-size: 0.75rem; color: var(--text-light); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-cloud a { padding: 0.3rem 0.75rem; background: var(--gray-100); color: var(--text-mid); border-radius: 99px; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--gray-200); transition: var(--transition); }
.tag-cloud a:hover { background: var(--blue-bright); color: var(--white); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: 0.5rem; margin-top: 2.5rem; justify-content: center; flex-wrap: wrap; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; background: var(--white); border: 1px solid var(--gray-200); color: var(--text-mid); transition: var(--transition); }
.page-numbers:hover, .page-numbers.current { background: var(--blue-bright); color: var(--white); border-color: var(--blue-bright); }

/* ============================================================
   WORDPRESS CORE
   ============================================================ */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { margin: 0 auto 1rem; display: block; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.animate-up { animation: fadeUp 0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ============================================================
   RESPONSIVE — HEADER
   ============================================================ */
@media (max-width: 1024px) {
  .rh-primary-nav { display: none; }
  .rh-hamburger   { display: flex; }
  .rh-btn-login   { display: none; }
}
@media (max-width: 600px) {
  :root { --header-h: 60px; }
  .rh-header-inner { padding: 0 1rem; gap: 0.75rem; }
  .rh-name-first,
  .rh-name-second { font-size: 1.25rem; }
  .rh-btn-subscribe { padding: 0.45rem 1rem; font-size: 0.82rem; }
}
@media (max-width: 380px) {
  .rh-name-first,
  .rh-name-second { font-size: 1.1rem; }
  .rh-btn-subscribe { display: none; } /* shown in mobile nav */
}