/*
Theme Name: أثر - Athar
Theme URI: https://athar-blog.com
Author: Athar Team
Description: قالب مدونة ثقافية عربية بتصميم Bento/Notion مستوحى من البساطة والهدوء البصري. يدعم RTL بالكامل.
Version: 1.0.0
Text Domain: athar
Tags: rtl-language-support, blog, custom-menu, featured-images, translation-ready
License: GNU General Public License v2 or later
*/

/* ===== Typography Fonts ===== */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Cairo'), local('Cairo-Regular'), url('./assets/fonts/cairo-v28-arabic_latin-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('Cairo SemiBold'), local('Cairo-SemiBold'), url('./assets/fonts/cairo-v28-arabic_latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Cairo Bold'), local('Cairo-Bold'), url('./assets/fonts/cairo-v28-arabic_latin-700.woff2') format('woff2');
}



/* ===== CSS Variables ===== */
:root {
  --royal-green: #1A4D2E;
  --royal-green-dark: #153a23;
  --ivory: #FBFBF9;
  --soft-green: #E9EFEC;
  --charcoal: #2C3333;
  --muted-gray: #94A3B8;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-3xl: 40px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .07), 0 4px 6px -4px rgba(0, 0, 0, .05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .08), 0 8px 10px -6px rgba(0, 0, 0, .04);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  background: var(--ivory);
  color: var(--charcoal);
  line-height: 1.6;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

ul,
ol {
  list-style: none;
}

/* ===== Typography ===== */
h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

h4 {
  font-size: 1rem;
  font-weight: 700;
}

/* ===== Layout ===== */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-12 {
  grid-template-columns: repeat(12, 1fr);
}

.col-span-2 {
  grid-column: span 2;
}

.col-span-4 {
  grid-column: span 4;
}

.col-span-8 {
  grid-column: span 8;
}

.row-span-2 {
  grid-row: span 2;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: .5rem;
}

.gap-3 {
  gap: .75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.shrink-0 {
  flex-shrink: 0;
}

.text-center {
  text-align: center;
}

.relative {
  position: relative;
}

.overflow-hidden {
  overflow: hidden;
}

.w-full {
  width: 100%;
}

/* ===== Reading Progress Bar ===== */
.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  height: 3px;
  background: var(--royal-green);
  z-index: 60;
  width: 0;
  transition: width .15s ease;
}

/* ===== Navbar ===== */
.site-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 249, .8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}

.navbar-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--royal-green);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--royal-green);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
}

.nav-links a {
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--royal-green);
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  padding: .5rem;
  color: var(--gray-500);
  border-radius: 50%;
  transition: background .2s;
}

.btn-icon:hover {
  background: var(--gray-100);
}

.mobile-menu-btn {
  display: none;
}

/* ===== Sidebar Layout ===== */
.sidebar-sticky {
  position: sticky;
  top: 100px;
  /* Assumes ~64px exact navbar height + margin */
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ===== Mobile Menu ===== */
.mobile-nav {
  display: none;
  background: var(--ivory);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: .75rem 0;
  font-size: .875rem;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
}

.mobile-nav a:hover {
  color: var(--royal-green);
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--royal-green);
  color: #fff;
  padding: .625rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: .875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background .2s, transform .2s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:hover {
  background: var(--royal-green-dark);
}

.btn-secondary {
  background: var(--soft-green);
  color: var(--royal-green);
  padding: .625rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: .875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background .2s;
}

.btn-secondary:active {
  transform: scale(.98);
}

.btn-secondary:hover {
  background: #dce5df;
}

.btn-outline {
  background: #fff;
  color: var(--royal-green);
  border: 1px solid var(--gray-200);
  padding: .625rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: .875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: all .2s;
}

.btn-outline:hover {
  background: var(--gray-50);
}

/* ===== Filter Tabs / Pill Buttons ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .5rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all .2s;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
}

.filter-btn:hover {
  background: var(--gray-100);
}

.filter-btn.active {
  background: var(--royal-green);
  color: #fff;
  border-color: var(--royal-green);
}

.filter-btn-round {
  border-radius: 9999px;
  padding: .625rem 1.5rem;
}

/* ===== Cards ===== */
.card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow .3s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform .5s;
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-body {
  padding: 1rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .625rem;
  color: var(--gray-400);
  margin-bottom: .5rem;
}

.card-meta svg {
  width: 12px;
  height: 12px;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: .5rem;
  line-height: 1.4;
  transition: color .2s;
}

.card:hover .card-title {
  color: var(--royal-green);
}

.card-excerpt {
  font-size: .875rem;
  color: var(--gray-500);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-readmore {
  margin-top: 1rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--royal-green);
  display: flex;
  align-items: center;
  gap: .25rem;
  opacity: 0;
  transition: opacity .2s;
}

.card:hover .card-readmore {
  opacity: 1;
}

/* ===== Bento Hero (index) ===== */
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.hero-featured {
  grid-column: 1;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background: var(--royal-green);
  padding: 2rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 400px;
}

.hero-featured-bg {
  position: absolute;
  inset: 0;
  opacity: .2;
  pointer-events: none;
}

.hero-featured-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-featured .content {
  position: relative;
  z-index: 10;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(233, 239, 236, .2);
  color: #fff;
  font-size: .75rem;
  padding: .25rem .75rem;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .1);
}

.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.author-card {
  background: var(--soft-green);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quote-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-style: italic;
}

.quote-card p {
  font-size: .875rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.quote-card cite {
  font-size: .75rem;
  color: var(--royal-green);
  font-weight: 700;
  font-style: normal;
}

/* ===== Posts Grid ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ===== Article / Single ===== */
.article-header {
  max-width: 768px;
  margin: 0 auto 3rem;
  text-align: center;
}

.article-category-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .75rem;
  border-radius: 9999px;
  background: var(--soft-green);
  color: var(--royal-green);
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.article-category-badge .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--royal-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: .875rem;
  color: var(--gray-500);
}

.article-featured-img {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: 4rem;
  aspect-ratio: 21/9;
  background: var(--gray-200);
}

.article-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-layout {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 3rem;
}

/* ===== Prose (Article Content) ===== */
.prose {
  max-width: none;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 3rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.prose h2 .num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(26, 77, 46, .1);
  color: var(--royal-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
}

.prose p {
  line-height: 1.8;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  font-size: 1.0625rem;
}

.prose img,
.prose iframe {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
  font-size: .875rem;
  direction: ltr;
  /* Code remains LTR */
}

.prose .lead {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--gray-600);
  border-right: 4px solid var(--royal-green);
  padding-right: 1.5rem;
  background: rgba(233, 239, 236, .3);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: 2rem;
}

.prose blockquote {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-sm);
}

.prose blockquote p {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.prose blockquote cite {
  font-size: .875rem;
  color: var(--gray-500);
  font-style: normal;
  font-weight: 700;
}

.prose ul {
  margin: 2rem 0;
}

.prose ul li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1rem;
}

.prose ul li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--royal-green);
  flex-shrink: 0;
  margin-top: .6rem;
}

.prose img {
  border-radius: var(--radius-lg);
  margin: 2rem 0;
}

/* ===== Sidebar ===== */
.sidebar-sticky {
  position: sticky;
  top: 96px;
}

.toc-box {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.toc-title {
  font-weight: 700;
  font-size: .875rem;
  margin-bottom: 1.5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--gray-50);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.toc-link {
  display: block;
  font-size: .875rem;
  color: var(--gray-500);
  padding-right: .75rem;
  margin-bottom: 1rem;
  transition: color .2s;
}

.toc-link:hover {
  color: var(--gray-900);
}

.toc-link.active {
  color: var(--royal-green);
  font-weight: 500;
  border-right: 2px solid var(--royal-green);
}

.sidebar-newsletter {
  background: var(--royal-green);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.sidebar-newsletter .glow {
  position: absolute;
  top: -40px;
  left: -40px;
  width: 96px;
  height: 96px;
  background: rgba(255, 255, 255, .1);
  border-radius: 50%;
  filter: blur(32px);
}

/* ===== Tags ===== */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-100);
}

.tag-link {
  padding: .375rem .75rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .75rem;
  transition: all .2s;
}

.tag-link:hover {
  border-color: var(--royal-green);
  color: var(--royal-green);
}

/* ===== Categories Page ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  grid-auto-rows: 200px;
}

.cat-card {
  border-radius: var(--radius-2xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  transition: all .3s;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.cat-card:hover {
  box-shadow: var(--shadow-md);
}

.cat-card-bg-icon {
  position: absolute;
  bottom: -24px;
  left: -24px;
  opacity: .05;
  transition: transform .5s;
}

.cat-card:hover .cat-card-bg-icon {
  transform: scale(1.1);
}

.cat-card.primary {
  background: var(--royal-green);
  color: #fff;
  grid-column: span 2;
  grid-row: span 2;
}

.cat-card.light {
  background: #fff;
  color: var(--royal-green);
}

.cat-card.soft {
  background: var(--soft-green);
  color: var(--royal-green);
  grid-row: span 2;
}

.cat-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cat-card.primary .cat-icon-box {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.cat-card.light .cat-icon-box,
.cat-card.soft .cat-icon-box {
  background: rgba(26, 77, 46, .05);
  color: var(--royal-green);
}

.cat-count {
  font-size: .625rem;
  font-weight: 700;
  padding: .25rem .5rem;
  border-radius: var(--radius-sm);
}

.cat-card.primary .cat-count {
  background: rgba(255, 255, 255, .2);
}

.cat-card.light .cat-count,
.cat-card.soft .cat-count {
  background: rgba(26, 77, 46, .1);
}

.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.cat-tag {
  font-size: .625rem;
  padding: .25rem .625rem;
  border-radius: 9999px;
  border: 1px solid;
}

.cat-card.primary .cat-tag {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .1);
}

.cat-card.light .cat-tag,
.cat-card.soft .cat-tag {
  border-color: rgba(26, 77, 46, .1);
  background: rgba(26, 77, 46, .05);
}

/* ===== Trending Table ===== */
.trending-table {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.trending-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  padding: 1rem;
  background: var(--gray-50);
  font-size: .625rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.trending-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  padding: 1.25rem 1rem;
  align-items: center;
  border-bottom: 1px solid var(--gray-50);
  transition: background .2s;
  cursor: pointer;
}

.trending-row:last-child {
  border-bottom: none;
}

.trending-row:hover {
  background: var(--gray-50);
}

.trending-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: all .2s;
}

.trending-row:hover .trending-icon {
  background: rgba(26, 77, 46, .1);
  color: var(--royal-green);
}

/* ===== Library Page ===== */
.featured-book {
  background: var(--royal-green);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  color: #fff;
  display: flex;
  box-shadow: var(--shadow-xl);
}

.featured-book-content {
  padding: 2rem 3rem;
  flex: 1;
}

.featured-book-cover {
  width: 33.33%;
  background: rgba(255, 255, 255, .05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-right: 1px solid rgba(255, 255, 255, .1);
}

.featured-book-cover img {
  width: 192px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: rotate(3deg);
  transition: transform .5s;
}

.featured-book-cover:hover img {
  transform: rotate(0);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.book-card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  transition: all .3s;
}

.book-card:hover {
  box-shadow: var(--shadow-lg);
}

.book-card-img {
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--gray-50);
  position: relative;
}

.book-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}

.book-card:hover .book-card-img img {
  transform: scale(1.05);
}

.book-status {
  font-size: .5625rem;
  font-weight: 700;
  padding: .125rem .5rem;
  border-radius: var(--radius-sm);
}

.book-status.read {
  background: #f0fff4;
  color: #38a169;
}

.book-status.reading {
  background: #fffbeb;
  color: #d97706;
}

.book-status.reference {
  background: var(--soft-green);
  color: var(--royal-green);
}

.stars {
  display: flex;
  gap: 2px;
}

.star {
  width: 10px;
  height: 10px;
}

.star.filled {
  color: #f59e0b;
}

.star.empty {
  color: var(--gray-200);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--soft-green);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--royal-green);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: .625rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
}

/* ===== Search Page ===== */
.search-input-wrap {
  max-width: 672px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1rem 3rem;
  font-size: 1.125rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: all .2s;
  font-family: inherit;
  direction: rtl;
}

.search-input:focus {
  border-color: var(--royal-green);
  box-shadow: 0 0 0 3px rgba(26, 77, 46, .1);
}

.search-icon-abs {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  color: var(--royal-green);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.search-clear:hover {
  color: var(--gray-600);
}

.search-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 3rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.search-tab {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.5rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all .2s;
  border: 1px solid var(--gray-100);
  background: #fff;
  color: var(--gray-500);
}

.search-tab:hover {
  background: var(--gray-100);
}

.search-tab.active {
  background: var(--royal-green);
  color: #fff;
  border-color: var(--royal-green);
  box-shadow: 0 8px 16px rgba(26, 77, 46, .2);
}

.search-tab .count {
  font-size: .625rem;
  padding: .125rem .5rem;
  border-radius: 9999px;
}

.search-tab.active .count {
  background: rgba(255, 255, 255, .2);
}

.search-tab .count:not(.search-tab.active .count) {
  background: var(--gray-100);
  color: var(--gray-400);
}

.search-result-card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl);
  padding: 1.25rem;
  display: flex;
  gap: 1.5rem;
  transition: all .2s;
  cursor: pointer;
}

.search-result-card:hover {
  box-shadow: var(--shadow-md);
}

.search-result-img {
  width: 160px;
  height: 128px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-50);
  flex-shrink: 0;
}

.search-result-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}

.search-result-card:hover .search-result-img img {
  transform: scale(1.05);
}

/* ===== Archive Page ===== */
.archive-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--royal-green);
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.archive-year:first-child {
  margin-top: 0;
}

.archive-month {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 1.5rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--gray-100);
}

.archive-post {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--gray-50);
  transition: all .2s;
}

.archive-post:hover {
  padding-right: .5rem;
}

.archive-post:hover .archive-post-title {
  color: var(--royal-green);
}

.archive-post-date {
  font-size: .75rem;
  color: var(--gray-400);
  min-width: 80px;
}

.archive-post-title {
  font-size: .875rem;
  font-weight: 600;
  transition: color .2s;
}

.archive-post-cat {
  font-size: .625rem;
  font-weight: 700;
  background: var(--soft-green);
  color: var(--royal-green);
  padding: .125rem .5rem;
  border-radius: var(--radius-sm);
  margin-right: auto;
}

/* ===== 404 Page ===== */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.error-number {
  font-size: 8rem;
  font-weight: 700;
  color: var(--soft-green);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.error-desc {
  font-size: .875rem;
  color: var(--gray-500);
  max-width: 400px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ===== About Page ===== */
.about-hero {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 1.5rem;
  margin-bottom: 5rem;
}

.about-info-box {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-3xl);
  padding: 2rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.about-avatar-box {
  background: var(--royal-green);
  border-radius: var(--radius-3xl);
  overflow: hidden;
}

.about-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter .7s;
}

.about-avatar-box:hover img {
  filter: grayscale(0);
}

.credential-card {
  border-radius: var(--radius-2xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.credential-card.green-bg {
  background: var(--soft-green);
}

.credential-card.white-bg {
  background: #fff;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}

.credential-card.dark-bg {
  background: var(--royal-green);
  color: #fff;
}

.credential-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.connect-section {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-3xl);
  padding: 3rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--royal-green);
  font-weight: 700;
}

.social-link:hover {
  text-decoration: underline;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--gray-100);
  padding: 3rem 0;
  margin-top: 5rem;
}

.footer-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: .75rem;
  color: var(--gray-500);
}

.footer-links a:hover {
  color: var(--royal-green);
}

.footer-copy {
  font-size: .75rem;
  color: var(--gray-400);
  text-align: center;
}

.footer-tagline {
  font-size: .625rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .2em;
}

/* ===== Newsletter Section ===== */
.newsletter-section {
  margin-top: 6rem;
  padding-top: 3rem;
  border-top: 1px solid var(--gray-100);
  text-align: center;
}

.newsletter-form {
  display: flex;
  gap: .5rem;
  padding: .375rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: .5rem 1rem;
  background: transparent;
  outline: none;
  font-size: .875rem;
  border: none;
  font-family: inherit;
  text-align: right;
}

.newsletter-btn {
  background: var(--royal-green);
  color: #fff;
  padding: .5rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: .875rem;
  font-weight: 500;
  transition: background .2s;
}

.newsletter-btn:hover {
  background: var(--royal-green-dark);
}

/* ===== CTA Section ===== */
.cta-section {
  background: var(--soft-green);
  border-radius: var(--radius-3xl);
  padding: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section .deco-circle {
  position: absolute;
  top: 0;
  right: 0;
  width: 256px;
  height: 256px;
  background: rgba(26, 77, 46, .05);
  border-radius: 50%;
  transform: translate(50%, -50%);
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ===== Post Navigation ===== */
.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--gray-100);
}

.post-nav a {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: color .2s;
}

.post-nav a:hover {
  color: var(--royal-green);
}

.post-nav-label {
  font-size: .75rem;
  color: var(--gray-400);
  margin-bottom: .5rem;
}

/* ===== Author Bio (Single Footer) ===== */
.author-bio-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-top: 6rem;
}

.author-bio-card {
  background: var(--soft-green);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.author-bio-avatar {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  border: 4px solid #fff;
}

.author-bio-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-cta {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* ===== Related Posts ===== */
.related-post {
  display: flex;
  gap: .75rem;
  cursor: pointer;
  margin-bottom: 1rem;
}

.related-post-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gray-200);
}

.related-post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-post:hover h4 {
  color: var(--royal-green);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {

  .grid-4,
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .nav-links,
  .nav-breadcrumb {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-featured {
    min-height: 300px;
  }

  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .cat-card.primary,
  .cat-card.soft {
    grid-column: span 1;
    grid-row: span 1;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .about-hero {
    grid-template-columns: 1fr;
  }

  .author-bio-section {
    grid-template-columns: 1fr;
  }

  .author-bio-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .featured-book {
    flex-direction: column;
  }

  .featured-book-cover {
    width: 100%;
  }

  .search-result-card {
    flex-direction: column;
  }

  .search-result-img {
    width: 100%;
    height: 200px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .trending-header,
  .trending-row {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-12 {
    grid-template-columns: 1fr;
  }

  .post-nav {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.5rem;
  }

  .hero-featured {
    min-height: 250px;
    padding: 1.5rem;
  }
}

/* ===== WordPress Specific ===== */
.alignleft {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.aligncenter {
  display: block;
  margin: 1.5rem auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: .75rem;
  color: var(--gray-500);
  text-align: center;
  padding: .5rem;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

.sticky .card {
  border-color: var(--royal-green);
  border-width: 2px;
}

.page-links {
  margin: 2rem 0;
}

/* ===== Custom Comments UI (Bento Style) ===== */
.comments-area {
  margin-top: 4rem;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.comments-header-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.comments-icon {
  width: 40px;
  height: 40px;
  background: var(--royal-green);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 77, 46, .2);
}

.comments-header-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0;
}

.comments-header-title p {
  font-size: .75rem;
  color: var(--gray-400);
  margin: 0;
}

.comments-count-badge {
  font-size: .875rem;
  font-weight: 700;
  color: var(--royal-green);
  background: var(--soft-green);
  padding: .375rem 1rem;
  border-radius: 9999px;
}

/* Discussion Rules Banner */
.discussion-rules-banner {
  background: var(--royal-green);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .discussion-rules-banner {
    flex-direction: row;
    align-items: center;
  }
}

.discussion-rules-banner .banner-glow {
  position: absolute;
  top: -2.5rem;
  left: -2.5rem;
  width: 128px;
  height: 128px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  filter: blur(16px);
}

.discussion-rules-banner .banner-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.discussion-rules-banner .banner-text h3 {
  font-weight: 700;
  font-size: .875rem;
  margin-bottom: .25rem;
}

.discussion-rules-banner .banner-text p {
  font-size: .6875rem;
  /* ~11px */
  color: var(--gray-200);
  line-height: 1.6;
  margin: 0;
}

/* Custom Comment Form */
.custom-bento-form {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 28px;
  padding: .5rem;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
  margin-bottom: 3rem;
}

.custom-bento-form:focus-within {
  box-shadow: 0 0 0 2px rgba(26, 77, 46, .1);
}

.comment-form-box textarea {
  width: 100%;
  background: transparent;
  padding: 1rem;
  outline: none;
  font-size: .875rem;
  color: var(--gray-600);
  min-height: 120px;
  resize: none;
  border: none;
  font-family: inherit;
}

.form-submit-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem;
  border-top: 1px solid var(--gray-50);
}

.user-icon-placeholder {
  padding: .5rem;
  color: var(--gray-400);
  border-radius: var(--radius-sm);
}

.btn-comment-submit {
  background: var(--royal-green);
  color: #fff;
  padding: .5rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .2s;
  box-shadow: 0 8px 16px rgba(26, 77, 46, .1);
}

.btn-comment-submit:hover {
  background: var(--royal-green-dark);
}

.btn-comment-submit:active {
  transform: scale(.98);
}

/* Comments Filter */
.comments-filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-sort-btn {
  font-size: .6875rem;
  font-weight: 700;
  color: var(--royal-green);
  display: flex;
  align-items: center;
  gap: .25rem;
}

.filter-divider {
  height: 1px;
  background: var(--gray-100);
  flex: 1;
}

/* Comment List */
.custom-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.comment-item {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.comment-item.is-reply {
  margin-right: 2rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .comment-item.is-reply {
    margin-right: 3rem;
  }
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--soft-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--royal-green);
  font-weight: 700;
  font-size: .875rem;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}

.comment-content-box {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s;
}

.comment-item:hover .comment-content-box {
  border-color: rgba(26, 77, 46, .1);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.comment-author-name {
  font-weight: 700;
  font-size: .875rem;
  color: var(--gray-900);
}

.comment-time {
  font-size: 10px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: .25rem;
}

.comment-options-btn {
  color: var(--gray-300);
  transition: color .2s;
}

.comment-options-btn:hover {
  color: var(--gray-600);
}

.comment-text {
  font-size: .875rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.comment-text p {
  margin: 0;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: .75rem;
  margin-right: .5rem;
}

.comment-action-btn,
.comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  transition: color .2s;
}

.comment-action-btn:hover,
.comment-reply-link:hover {
  color: var(--royal-green);
}

.comment-awaiting-moderation {
  color: #d97706;
  font-style: italic;
  margin-bottom: .5rem !important;
}

/* Hide WP Default elements in our custom form */
.comment-form-cookies-consent,
.logged-in-as,
.comment-notes {
  display: none;
}