/*
Theme Name: بعبظة فكرية - Ba3baza Fekreya
Theme URI: https://github.com/ba3baza-fekreya/theme
Author: بعبظة فكرية
Author URI: https://ba3baza.org
Description: قالب ووردبريس عصري وصحفي لمنصة «بعبظة فكرية» للكتابة والتأملات بالأسماء المستعارة (Because the plot thickened).
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ba3baza-fekreya
Domain Path: /languages
Tags: blog, editorial, rtl-language-support, right-to-left, two-columns, custom-colors, post-formats
*/

:root {
  --bg-primary: #FBFBFA;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-dark: #121316;
  --bg-dark-surface: #1E2024;
  --text-primary: #18191B;
  --text-secondary: #575D65;
  --text-muted: #8A929E;
  --border-light: #EBECEF;
  --border-dark: #2C2F36;
  --accent-amber: #D96B27;
  --accent-teal: #1F7A70;
  --accent-charcoal: #25282F;
  --accent-warm: #FFF9F3;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-heading: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Amiri', 'Georgia', serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.08);
  --container-max: 1140px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  direction: rtl;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

body.mobile-nav-open {
  overflow: hidden !important;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-narrow {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 1.25rem;
}

.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.site-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-link:hover .site-brand-mark {
  transform: rotate(-8deg) scale(1.05);
}

.site-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.site-title-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.15;
  white-space: nowrap;
}

.site-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  direction: ltr;
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-shrink: 1;
}

.nav-link {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.4rem 0.15rem;
  position: relative;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  left: 0;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-write-btn {
  padding: 0.6rem 1.35rem;
}

.write-btn-compact {
  display: none;
}

.write-btn-full {
  display: inline;
}

.btn-auth-login,
.btn-auth-reg {
  padding: 0.42rem 0.95rem;
  font-size: 0.88rem;
}

.btn-auth-reg {
  border-color: var(--text-primary);
  color: var(--text-primary);
  font-weight: 700;
}

/* User Menu in Header */
.user-header-menu {
  position: relative;
  flex-shrink: 0;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-btn:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

.user-menu-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.82rem;
  background: var(--text-primary);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-menu-name {
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-chevron {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.user-dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  z-index: 150;
  padding: 0.5rem 0;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-header {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: background 0.15s;
}

.user-dropdown-item:hover {
  background: #F9FAFB;
}

.user-dropdown-divider {
  border-top: 1px solid var(--border-light);
  margin: 0.3rem 0;
}

.user-dropdown-logout {
  color: #DC2626;
}

.user-dropdown-logout:hover {
  background: #FEF2F2;
}

/* Mobile Nav Toggle & Backdrop & Drawer */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 1.05rem;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 490;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 58px;
  right: 0;
  left: 0;
  max-height: calc(100vh - 58px);
  background: #FFFFFF;
  z-index: 495;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.18);
  border-radius: 0 0 20px 20px;
  padding: 1.25rem 1rem 2.5rem;
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.mobile-nav-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* Auth card in mobile drawer */
.mobile-drawer-auth-card {
  background: linear-gradient(135deg, #FFF8F3 0%, #FFF1E8 100%);
  border: 1px solid #FED7AA;
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.mobile-drawer-auth-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}

.mobile-auth-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #D96B27;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.mobile-auth-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-primary);
  display: block;
}

.mobile-auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 2px 0 0;
  line-height: 1.45;
}

.mobile-drawer-auth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.mobile-drawer-auth-buttons .btn {
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  width: 100%;
}

/* User profile card in mobile drawer */
.mobile-drawer-user-card {
  background: #F9FAFB;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.mobile-user-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.mobile-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  flex-shrink: 0;
}

.mobile-user-details {
  display: flex;
  flex-direction: column;
}

.mobile-user-name {
  font-size: 1.02rem;
  color: var(--text-primary);
  font-weight: 700;
}

.mobile-user-login {
  font-size: 0.8rem;
  color: var(--text-muted);
  direction: ltr;
  text-align: right;
}

.mobile-user-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-user-action-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  transition: background 0.15s;
}

.mobile-user-action-pill:hover {
  background: #F3F4F6;
}

.mobile-user-action-pill.logout-pill {
  color: #EF4444;
  border-color: #FEE2E2;
  background: #FFF5F5;
  margin-top: 0.35rem;
}

.mobile-unread-count {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-right: auto;
}

/* Fast Write CTA in mobile drawer */
.mobile-drawer-write-cta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #18191B 0%, #2A2D34 100%);
  color: #FFFFFF !important;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: transform 0.15s ease;
}

.mobile-drawer-write-cta:hover {
  transform: translateY(-1px);
}

.write-cta-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #D96B27;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.write-cta-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.write-cta-heading {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: #FFFFFF;
}

.write-cta-sub {
  font-size: 0.78rem;
  color: #9CA3AF;
  margin-top: 1px;
}

.write-cta-arrow {
  font-size: 0.9rem;
  color: #D96B27;
}

/* Nav Group & Links list in mobile drawer */
.mobile-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 0.5rem;
}

.mobile-nav-links-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #F9FAFB;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  background: #F3F4F6;
  border-color: #D1D5DB;
  color: #D96B27;
}

.nav-item-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.nav-item-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile Drawer Footer */
.mobile-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-light);
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.mobile-footer-brand {
  display: flex;
  flex-direction: column;
}

.mobile-footer-brand .brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
}

.mobile-footer-brand .brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  direction: ltr;
}

.mobile-footer-twitter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: #F3F4F6;
  font-weight: 600;
  font-size: 0.8rem;
}

.btn-primary {
  background-color: var(--text-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: #333742;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline {
  border-color: var(--border-light);
  background: transparent;
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: #F3F4F6;
  border-color: #D1D5DB;
}

.btn-accent {
  background-color: var(--accent-amber);
  color: #FFFFFF;
}

.btn-accent:hover {
  background-color: #B85317;
}

.hero-section {
  padding: 2rem 0 1rem;
}

.cover-banner-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.cover-banner-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-light);
}

.cover-banner-content {
  padding: 1.75rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
}

.hero-manifesto {
  max-width: 650px;
}

.hero-manifesto h1,
.hero-manifesto-heading {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.hero-manifesto p {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Category Filter Bar Wrapper with Navigation Chevrons */
.category-filter-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0.5rem 0 1.25rem;
  width: 100%;
}

.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.85rem 0.25rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  width: 100%;
}

.category-filter-bar.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto !important;
}

.category-filter-bar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.filter-pill {
  flex-shrink: 0; /* CRITICAL: Prevent shrinking */
  white-space: nowrap;
  padding: 0.55rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-pill:hover {
  background: #F0F2F5;
  color: var(--text-primary);
  border-color: #D0D5DD;
}

.filter-pill.active {
  background: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
}

/* Nav Chevrons for Desktop Scrolling */
.filter-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
  font-size: 0.85rem;
}

.filter-nav-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.filter-nav-btn:hover {
  background: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

/* In RTL: right is start (backward/previous), left is end (forward/next) */
.filter-nav-prev {
  right: -8px;
}

.filter-nav-next {
  left: -8px;
}

/* Edge Fade Gradients to signal overflow */
.category-filter-wrapper::before,
.category-filter-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.category-filter-wrapper::before {
  right: 0;
  background: linear-gradient(to left, var(--bg-main, #FDFBF7) 20%, rgba(253, 251, 247, 0));
}

.category-filter-wrapper::after {
  left: 0;
  background: linear-gradient(to right, var(--bg-main, #FDFBF7) 20%, rgba(253, 251, 247, 0));
}

.category-filter-wrapper.has-scroll-right::before {
  opacity: 1;
}

.category-filter-wrapper.has-scroll-left::after {
  opacity: 1;
}

.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #F0F2F5;
  color: #475467;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--accent-warm);
  color: var(--accent-amber);
  border: 1px solid #FFE4CE;
}

.featured-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-badge-tag {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.featured-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.featured-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.featured-excerpt {
  font-size: 1.12rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.75rem;
  max-width: 880px;
}

.author-pen-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: #EAECEF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1.1rem;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.pen-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.author-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #D1D5DB;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.post-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #F3F4F6;
  padding-top: 1rem;
  margin-top: auto;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.action-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: color 0.15s ease;
  background: transparent;
  border: none;
  font-size: 0.85rem;
  color: inherit;
}

.action-item:hover, .action-item.liked {
  color: var(--accent-amber);
}

.like-btn {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.like-btn i {
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease;
}

.like-btn.liked i {
  color: #D96B27 !important;
}

.btn.like-btn.liked {
  border-color: #D96B27 !important;
  color: #D96B27 !important;
  background-color: rgba(217, 107, 39, 0.06);
}

.like-btn.like-pop i {
  animation: ba3bazaLikePop 0.35s ease;
}

@keyframes ba3bazaLikePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.single-article {
  padding: 3rem 0;
}

.article-header {
  margin-bottom: 2.5rem;
  text-align: right;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 1.2rem 0;
  color: var(--text-primary);
}

.article-content {
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 2.1;
  color: #27292D;
}

.article-content p {
  margin-bottom: 1.85rem;
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 2.5rem 0 1.2rem;
  color: var(--text-primary);
}

.article-content blockquote {
  border-right: 4px solid var(--text-primary);
  background: #F6F7F9;
  padding: 1.5rem 2rem;
  border-radius: var(--radius-sm);
  margin: 2.2rem 0;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.85;
}

.article-content hr {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 3rem 0;
}

.article-share-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 3rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.write-form-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin: 2.5rem 0;
}

.form-group {
  margin-bottom: 1.6rem;
}

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-label .required {
  color: #D92D20;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #FAFBFB;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(24, 25, 27, 0.08);
}

textarea.form-control {
  min-height: 220px;
  resize: vertical;
  line-height: 1.8;
}

.form-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.pseudonym-row {
  display: flex;
  gap: 0.75rem;
}

.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 3.5rem 0 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.alert-success {
  background: #ECFDF3;
  color: #027A48;
  border: 1px solid #A6F4C5;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  font-weight: 600;
}

@media (max-width: 1080px) {
  .site-nav {
    gap: 0.9rem;
  }
  .nav-link {
    font-size: 0.88rem;
    padding: 0.35rem 0;
  }
  .header-actions {
    gap: 0.5rem;
  }
  .header-write-btn {
    padding: 0.5rem 1rem;
    font-size: 0.86rem;
  }
  .site-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .desktop-only-auth,
  .btn-auth-login,
  .btn-auth-reg {
    display: none !important;
  }
  .site-tagline {
    display: none !important;
  }
  .write-btn-full {
    display: none !important;
  }
  .write-btn-compact {
    display: inline !important;
  }
  .header-inner {
    min-height: 58px;
  }
  .header-actions {
    gap: 0.45rem;
  }
  .site-branding {
    min-width: 0;
  }
  .site-brand-mark {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
  .site-title {
    font-size: 1.15rem;
  }
  .user-menu-name {
    display: none !important;
  }
  .user-menu-chevron {
    display: none !important;
  }
  .user-menu-btn {
    padding: 0.2rem !important;
    border-radius: 50% !important;
  }
  .header-chat-btn {
    width: 36px !important;
    height: 36px !important;
    margin-left: 0.25rem !important;
  }
  .header-write-btn {
    padding: 0.42rem 0.85rem !important;
    font-size: 0.84rem !important;
    gap: 0.35rem !important;
  }
  .mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
  }
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .filter-nav-btn {
    display: none !important;
  }
  .category-filter-wrapper::before,
  .category-filter-wrapper::after {
    width: 24px;
  }
  .category-filter-bar {
    padding: 0.65rem 0;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  .filter-pill {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.84rem;
    padding: 0.45rem 1rem;
  }
  .cover-banner-content {
    padding: 1.25rem 1rem;
    gap: 1.15rem;
  }
  .hero-manifesto h1,
  .hero-manifesto-heading {
    font-size: 1.35rem !important;
    line-height: 1.55 !important;
  }
  .hero-manifesto p {
    font-size: 0.95rem !important;
    line-height: 1.75 !important;
  }
  .featured-title {
    font-size: 1.45rem;
  }
  .featured-card {
    padding: 1.25rem;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-newsletter-card {
    padding: 1.5rem 1rem !important;
    border-radius: 12px !important;
    gap: 1.25rem !important;
  }
  .footer-newsletter-card > div {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #footer-newsletter-form {
    flex-direction: column !important;
    gap: 0.6rem !important;
  }
  #footer-newsletter-form input,
  #footer-newsletter-form button {
    width: 100% !important;
  }
  .chat-window-card {
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
    min-height: 520px !important;
  }
  .chat-sidebar {
    width: 100% !important;
    max-height: 220px !important;
    border-left: none !important;
    border-bottom: 1px solid var(--border-light) !important;
  }
  .article-title {
    font-size: 1.65rem;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.05rem;
  }
  .header-write-btn {
    padding: 0.38rem 0.72rem !important;
    font-size: 0.8rem !important;
  }
  .mobile-drawer-auth-buttons {
    grid-template-columns: 1fr;
  }
  .mobile-nav-links-list {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }
  .mobile-nav-item {
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
    gap: 0.4rem;
  }
}

@media (max-width: 360px) {
  .mobile-nav-links-list {
    grid-template-columns: 1fr;
  }
  .site-title {
    font-size: 0.95rem;
  }
}

/* Modal Dialogs */
.ba3baza-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ba3baza-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

.ba3baza-modal-card {
  position: relative;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  z-index: 10;
  border: 1px solid var(--border-light);
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ba3baza-modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.ba3baza-modal-close:hover {
  background: #F3F4F6;
  color: var(--text-primary);
}

/* Auth Tabs */
.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.auth-alert-error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #F87171;
}

.auth-alert-success {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #34D399;
}

/* Post Cards with Thumbnails */
.post-card-thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: block;
}

/* Curated Pseudonym Pills */
.pseudonym-pill-btn {
  user-select: none;
  -webkit-user-select: none;
}
.pseudonym-pill-btn:not(:disabled):hover {
  border-color: #D96B27 !important;
  color: #D96B27 !important;
  background: #FFF7ED !important;
  transform: translateY(-1px);
}
.reg-pill-btn:not(:disabled):hover {
  border-color: #D96B27 !important;
  color: #D96B27 !important;
  background: #FFF7ED !important;
}
.modal-curated-pill:not(:disabled):hover {
  border-color: #D96B27 !important;
  color: #D96B27 !important;
  background: #FFF7ED !important;
}