
/* ===================== ROOT TOKENS ===================== */
:root{
  --purple-1:#5B2A9D;
  --purple-2:#8B3FA8;
  --purple-3:#7C3AED;
  --pink-1:#EC4899;
  --orange-1:#F97316;
  --orange-2:#EF4444;
  --green-1:#16A34A;
  --gold:#D4A017;
  --footer-bg:#2A1F5E;
  --footer-bg-2:#3D2A7A;
  --text-dark:#1F2430;
  --text-muted:#8A8FA3;
  --bg-page:#FAFAFC;
  --card-shadow: 0 6px 24px rgba(91,42,157,0.08);
}

*{box-sizing:border-box; margin:0; padding:0;}

body{
  font-family:'Mehr','Lato',sans-serif;
  background:var(--bg-page);
  color:var(--text-dark);
  line-height:1.9;
  -webkit-font-smoothing:antialiased;
}

a{ text-decoration:none; color:inherit; }
ul{ list-style:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; cursor:pointer; border:none; }

.rtl{ direction:rtl; text-align:right; }
.container{ max-width:1200px; margin:0 auto; padding:0 24px; }

/* ===================== BUTTONS ===================== */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:12px 28px; border-radius:10px;
  font-weight:700; font-size:15px;
  transition:transform .2s ease, box-shadow .2s ease;
  white-space:nowrap;
}
.btn:hover{ transform:translateY(-2px); }
.btn-gradient-orange{
  background:linear-gradient(90deg,var(--orange-1),var(--orange-2));
  color:#fff;
  box-shadow:0 8px 20px rgba(239,68,68,0.28);
}
.btn-gradient-purple{
  background:linear-gradient(90deg,var(--purple-3),var(--pink-1));
  color:#fff;
  box-shadow:0 8px 20px rgba(124,58,237,0.28);
}
.btn-outline{
  background:#fff;
  border:1.5px solid #E7E3F4;
  color:var(--purple-1);
}
.btn-outline:hover{ border-color:var(--purple-3); }
.btn-sm{ padding:8px 18px; font-size:13px; border-radius:8px; }
.btn-block{ width:100%; justify-content:center; }

/* ===================== HEADER (DESKTOP) ===================== */
.site-header{
  background:#fff;
  border-bottom:1px solid #F1EEF9;
  position:sticky; top:0; z-index:100;
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 24px;
  gap:20px;
}
.logo{
  display:flex; align-items:center; gap:10px;
  font-size:28px; font-weight:800;
  background:linear-gradient(90deg,var(--purple-1),var(--pink-1));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.logo .fa-feather{ color:var(--orange-1); -webkit-text-fill-color:var(--orange-1); }

.main-nav{ display:flex; gap:32px; }
.main-nav a{
  font-size:15px; font-weight:600; color:#5A5F72;
  position:relative; padding-bottom:6px;
}
.main-nav a.active{ color:var(--purple-1); }
.main-nav a.active::after{
  content:''; position:absolute; bottom:0; right:0; left:0;
  height:3px; border-radius:3px;
  background:linear-gradient(90deg,var(--purple-3),var(--orange-1));
}
.header-actions{ display:flex; align-items:center; gap:12px; }
.icon-btn{
  width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:#F6F3FC; color:var(--purple-1);
}

.mobile-header{ display:none; }

/* ===================== HERO ===================== */
.hero-section{
  background:var(--bg-page);
  padding:0;
}
.hero{
  position:relative;
  width:100%;
  overflow:hidden;
  background-color:#F3EEFB;
  background-image:url("../img/hero-desktop.jpg");
  background-size:contain; background-repeat:no-repeat; background-position:center;
  padding:110px 40px 70px;
}
.hero::before{
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.72) 32%, rgba(255,255,255,0.4) 58%, rgba(255,255,255,0.08) 100%);
}
.hero-inner{
  position:relative; z-index:2;
  max-width:560px;
  margin:0 auto 0 0;
  margin-right:230px;
}
.hero h1{
  font-size:60px; font-weight:800; line-height:1.7;
  background:linear-gradient(90deg,var(--purple-1),var(--pink-1));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  margin-bottom:0;
  padding-top:6px;
}
.hero .tagline{
  font-size:22px; font-weight:700; color:var(--orange-1);
  margin-bottom:18px;
}
.hero p{
  font-size:15px; color:#6B7080; max-width:520px; margin-bottom:26px;
}
.hero-actions{ display:flex; gap:14px; margin-bottom:0; }

.stats-row{
  position:relative; z-index:2;
  display:flex; gap:14px; flex-wrap:wrap;
  background:#fff; padding:18px 24px; border-radius:16px;
  box-shadow:var(--card-shadow);
  border:1px solid #EDE9F7;
  max-width:820px;
  margin:0 auto;
}
.stats-wrap{ max-width:1200px; margin:-38px auto 0; padding:0 24px; position:relative; z-index:3; }
.stat{ flex:1; min-width:90px; text-align:center; }
.stat .num{ font-size:19px; font-weight:800; color:var(--purple-1); display:flex; align-items:center; justify-content:center; gap:6px; }
.stat .num i{ color:var(--orange-1); font-size:15px; }
.stat .label{ font-size:12px; color:var(--text-muted); margin-top:4px; }

/* ===================== SECTION HEADINGS ===================== */
.section{ padding:56px 0; }
.section-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:28px;
}
.section-title-wrap{ display:flex; align-items:center; gap:14px; }
.section-title{ font-size:24px; font-weight:800; color:var(--text-dark); }
.section-title .dash{
  display:inline-block; width:34px; height:3px; border-radius:3px;
  background:linear-gradient(90deg,var(--purple-3),var(--orange-1));
}

/* ===================== MAIN GRID ===================== */
.main-grid{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:32px;
  align-items:start;
}

/* article cards */
.article-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:22px;
  margin-bottom:26px;
}
.article-card{
  background:#fff; border-radius:18px; overflow:hidden;
  box-shadow:var(--card-shadow);
  transition:transform .25s ease, box-shadow .25s ease;
}
.article-card:hover{ transform:translateY(-6px); box-shadow:0 16px 34px rgba(91,42,157,0.14); }
.article-thumb{ position:relative; height:190px; overflow:hidden; }
.article-thumb img{ width:100%; height:100%; object-fit:cover; }
.tag{
  position:absolute; top:12px; right:12px; z-index:2;
  font-size:12px; font-weight:700; color:#fff;
  padding:4px 14px; border-radius:8px;
}
.tag.poetry{ background:var(--purple-3); }
.tag.story{ background:var(--orange-1); }
.tag.novel{ background:var(--green-1); }
.thumb-views{
  position:absolute; top:12px; left:12px; z-index:2;
  font-size:11px; font-weight:700; color:#fff;
  background:rgba(0,0,0,0.45);
  padding:4px 10px; border-radius:8px;
  display:flex; align-items:center; gap:5px;
  backdrop-filter:blur(2px);
}
.thumb-title-overlay{
  position:absolute; left:0; right:0; bottom:0; z-index:2;
  padding:28px 16px 14px;
  background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.72) 100%);
}
.thumb-title-overlay h3{
  color:#fff; font-size:17px; font-weight:800;
  text-shadow:0 2px 6px rgba(0,0,0,0.5);
}
.article-body{ padding:14px 18px 18px; }
.article-body p{ font-size:13px; color:var(--text-muted); margin-bottom:14px; }
.article-meta{ display:flex; align-items:center; gap:10px; }
.avatar{ width:34px; height:34px; border-radius:50%; object-fit:cover; }
.meta-info{ flex:1; }
.meta-info .name{ font-size:13px; font-weight:700; }
.meta-info .date{ font-size:11px; color:var(--text-muted); }
.views{ font-size:12px; color:var(--text-muted); display:flex; align-items:center; gap:5px; }

/* pagination */
.pagination{ display:flex; align-items:center; justify-content:center; gap:8px; margin-top:8px; }
.page-btn{
  width:38px; height:38px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  background:#fff; border:1px solid #EDE9F7; color:#5A5F72;
  font-weight:700; font-size:13px;
}
.page-btn.active{
  background:linear-gradient(90deg,var(--purple-3),var(--pink-1));
  color:#fff; border-color:transparent;
}

/* sidebar */
.card-box{
  background:#fff; border-radius:18px; padding:20px;
  box-shadow:var(--card-shadow); margin-bottom:22px;
}
.cat-header{
  background:linear-gradient(90deg,var(--purple-3),var(--pink-1));
  color:#fff; text-align:center; font-weight:800; font-size:16px;
  padding:14px; border-radius:14px; margin-bottom:16px;
}
.cat-list li{
  display:flex; align-items:center; justify-content:space-between;
  padding:11px 4px; border-bottom:1px dashed #EFEBFA;
  font-size:14px; font-weight:600;
}
.cat-list li:last-child{ border-bottom:none; }
.cat-list .cname{ display:flex; align-items:center; gap:10px; color:#4B5063; }
.cat-list .cname i{ color:var(--purple-3); width:16px; text-align:center; }
.cat-list .count{
  background:#F6F3FC; color:var(--purple-1); font-size:12px; font-weight:800;
  padding:3px 10px; border-radius:12px;
}

/* writers */
.writers-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
.writer-card{
  background:#fff; border-radius:18px; padding:22px 16px; text-align:center;
  box-shadow:var(--card-shadow);
}
.writer-card img{
  width:72px; height:72px; border-radius:50%; object-fit:cover; margin:0 auto 12px;
  border:3px solid #F6F3FC;
}
.writer-card h4{ font-size:15px; font-weight:800; margin-bottom:2px; }
.writer-card .role{ font-size:12px; color:var(--purple-3); font-weight:700; margin-bottom:6px; }
.writer-card .count{ font-size:12px; color:var(--text-muted); margin-bottom:14px; }

/* ===================== FOOTER ===================== */
.site-footer{
  background:linear-gradient(135deg,var(--footer-bg),var(--footer-bg-2));
  color:#D9D5EE; padding:56px 0 0; margin-top:20px;
}
.footer-grid{
  display:grid; grid-template-columns:1.4fr 1fr 1fr;
  gap:36px; padding-bottom:40px;
}
.footer-logo{
  font-size:26px; font-weight:800; color:#fff; display:flex; align-items:center; gap:10px; margin-bottom:14px;
}
.footer-logo i{ color:var(--orange-1); }
.footer-grid p{ font-size:13px; color:#B7B1DA; max-width:280px; }
.footer-col h5{ color:#fff; font-size:16px; font-weight:800; margin-bottom:18px; }
.footer-col ul li{ margin-bottom:11px; font-size:13px; }
.footer-col ul li a:hover{ color:#fff; }
.footer-col .contact-item{ display:flex; align-items:center; gap:10px; margin-bottom:14px; font-size:13px; }
.footer-col .contact-item i{ color:var(--orange-1); width:16px; }
.social-row{ display:flex; gap:10px; margin-top:16px; }
.social-row a{
  width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,0.08);
  display:flex; align-items:center; justify-content:center; color:#fff;
}
.footer-bottom{
  border-top:1px solid rgba(255,255,255,0.1);
  text-align:center; padding:18px 0; font-size:12px; color:#9C96C2;
  position:relative;
}
.scroll-top{
  position:absolute; left:24px; top:-24px;
  width:44px; height:44px; border-radius:50%;
  background:var(--orange-1); color:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 20px rgba(239,68,68,0.35);
}

.mobile-nav-panel{ display:none; }
.nav-backdrop{ display:none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px){
  .main-nav, .header-actions .btn{ display:none; }
  .site-header .header-inner{ display:none; }
  .mobile-header{
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 18px;
  }
  .mobile-header .logo{ font-size:22px; }
  .mobile-header .icon-btn{ width:36px; height:36px; }

  .hero-section{ padding:0; }
  .hero{
    border-radius:0;
    background-image:url("../img/hero-mobile.jpg");
    background-size:cover;
    background-position:left center;
    padding:90px 20px 40px;
  }
  .hero::before{
    background:linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.6) 55%, rgba(255,255,255,0.97) 86%);
  }
  .hero-inner{ max-width:100%; margin-right:0; padding-top:0; }
  .hero h1{ font-size:30px; line-height:1.55; padding-top:4px; }
  .hero .tagline{ font-size:15px; margin-bottom:14px; }
  .hero p{ display:none; }
  .hero-actions{ flex-direction:column; align-items:center; gap:10px; }
  .hero-actions .btn{
    width:78%; justify-content:center;
    padding:11px 18px; font-size:14px; border-radius:30px;
  }
  .stats-wrap{ margin-top:-30px; }
  .stats-row{
    flex-wrap:nowrap; padding:14px 10px; gap:4px;
  }
  .stats-row .stat:nth-child(4){ display:none; }
  .stats-row .stat:nth-child(5){ display:none; }
  .stats-row .num{ font-size:14px; gap:4px; }
  .stats-row .label{ font-size:10px; }
  .writers-section{ display:none; }

  .main-grid{ grid-template-columns:1fr; }
  .article-grid{ grid-template-columns:1fr; }
  .writers-grid{ grid-template-columns:1fr 1fr; }
  .section{ padding:34px 0; }

  /* mobile side drawer nav */
  .nav-backdrop{
    display:block;
    position:fixed; inset:0; z-index:290;
    background:rgba(20,10,40,0.45);
    opacity:0; visibility:hidden;
    transition:opacity .3s ease, visibility .3s ease;
  }
  .nav-backdrop.open{ opacity:1; visibility:visible; }

  .mobile-nav-panel{
    display:block;
    position:fixed; top:0; right:0; bottom:0; z-index:300;
    width:78%; max-width:300px; height:100%;
    background:#fff;
    box-shadow:-10px 0 30px rgba(0,0,0,0.18);
    transform:translateX(100%);
    transition:transform .32s ease;
    overflow-y:auto;
  }
  .mobile-nav-panel.open{ transform:translateX(0); }
  .mobile-nav-panel .drawer-head{
    display:flex; align-items:center; justify-content:space-between;
    padding:18px 20px; border-bottom:1px solid #F1EEF9;
  }
  .mobile-nav-panel .drawer-head .logo{ font-size:20px; }
  .mobile-nav-panel .drawer-close{
    width:34px; height:34px; border-radius:50%;
    background:#F6F3FC; color:var(--purple-1);
    display:flex; align-items:center; justify-content:center;
  }
  .mobile-nav-panel ul{ padding:6px 20px 20px; }
  .mobile-nav-panel li{ border-bottom:1px dashed #F0EDF8; }
  .mobile-nav-panel a{
    display:block; padding:14px 4px; font-size:15px; font-weight:700; color:#4B5063;
  }
  .mobile-nav-panel .drawer-cta{ padding:6px 20px 20px; display:flex; flex-direction:column; gap:10px; }
}

@media (max-width:560px){
  .writers-grid{ grid-template-columns:1fr 1fr; }
  .hero h1{ font-size:28px; }
}

/* ===================== PAGE BANNER (inner pages) ===================== */
.page-banner{
  background:linear-gradient(120deg,#F3EEFB,#FDF3EE);
  padding:44px 0 34px;
  position:relative; overflow:hidden;
}
.page-banner::after{
  content:'\f10d'; font-family:FontAwesome;
  position:absolute; left:-10px; top:-20px; font-size:140px;
  color:rgba(124,58,237,0.06); transform:rotate(15deg);
}
.breadcrumb{ font-size:13px; color:var(--text-muted); margin-bottom:10px; }
.breadcrumb a{ color:var(--purple-1); font-weight:700; }
.page-banner h1{ font-size:32px; font-weight:800; color:var(--text-dark); }
.page-banner p{ font-size:14px; color:var(--text-muted); margin-top:8px; max-width:560px; }

/* ===================== FILTER TABS ===================== */
.filter-tabs{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:26px; }
.filter-tabs a{
  padding:8px 20px; border-radius:24px; font-size:13px; font-weight:700;
  background:#fff; border:1px solid #EDE9F7; color:#5A5F72;
}
.filter-tabs a.active{
  background:linear-gradient(90deg,var(--purple-3),var(--pink-1)); color:#fff; border-color:transparent;
}

/* ===================== FORMS (login/register/contact/submit) ===================== */
.auth-wrap{ display:flex; justify-content:center; padding:20px 0; }
.auth-card{
  background:#fff; border-radius:20px; box-shadow:var(--card-shadow);
  padding:36px 34px; max-width:440px; width:100%;
}
.auth-card .auth-icon{
  width:60px; height:60px; border-radius:50%; margin:0 auto 14px;
  background:linear-gradient(135deg,var(--purple-3),var(--pink-1));
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:24px;
}
.auth-card h2{ text-align:center; font-size:22px; font-weight:800; margin-bottom:6px; }
.auth-card .sub{ text-align:center; font-size:13px; color:var(--text-muted); margin-bottom:26px; }
.form-group{ margin-bottom:18px; }
.form-group label{ display:block; font-size:13px; font-weight:700; color:#4B5063; margin-bottom:8px; }
.form-control{
  width:100%; padding:12px 16px; border-radius:10px;
  border:1.5px solid #E7E3F4; font-family:inherit; font-size:14px;
  background:#FBFAFD; color:var(--text-dark); outline:none;
}
.form-control:focus{ border-color:var(--purple-3); background:#fff; }
textarea.form-control{ resize:vertical; min-height:120px; }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-check{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-muted); margin-bottom:20px; }
.auth-divider{ text-align:center; font-size:12px; color:var(--text-muted); margin:22px 0; position:relative; }
.auth-divider::before, .auth-divider::after{
  content:''; position:absolute; top:50%; width:38%; height:1px; background:#EDE9F7;
}
.auth-divider::before{ right:0; } .auth-divider::after{ left:0; }
.auth-foot{ text-align:center; font-size:13px; color:var(--text-muted); margin-top:6px; }
.auth-foot a{ color:var(--purple-1); font-weight:700; }
.upload-box{
  border:2px dashed #E7E3F4; border-radius:14px; padding:30px 16px;
  text-align:center; color:var(--text-muted); font-size:13px; background:#FBFAFD;
}
.upload-box i{ font-size:26px; color:var(--purple-3); margin-bottom:8px; display:block; }

/* ===================== ARTICLE DETAIL ===================== */
.article-hero{
  position:relative; border-radius:20px; overflow:hidden; height:340px;
  margin-bottom:-60px;
}
.article-hero img{ width:100%; height:100%; object-fit:cover; }
.article-hero-overlay{
  position:absolute; inset:0;
  background:linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 60%);
  display:flex; align-items:flex-end; padding:26px;
}
.article-hero-overlay .tag{ position:static; margin-bottom:10px; }
.article-hero-overlay h1{ color:#fff; font-size:26px; font-weight:800; }
.article-detail-card{
  background:#fff; border-radius:20px; box-shadow:var(--card-shadow);
  padding:70px 34px 34px; position:relative; z-index:2; max-width:900px; margin:0 auto;
}
.article-detail-meta{
  display:flex; align-items:center; gap:14px; padding-bottom:20px; margin-bottom:22px;
  border-bottom:1px solid #F1EEF9;
}
.article-detail-meta .meta-info .name{ font-size:14px; font-weight:800; }
.article-detail-meta .meta-info .date{ font-size:12px; color:var(--text-muted); }
.article-detail-meta .spacer{ flex:1; }
.article-detail-meta .stat-pill{
  font-size:12px; color:var(--text-muted); display:flex; align-items:center; gap:5px;
}
.article-body-text{ font-size:16px; line-height:2.3; color:#3C4152; }
.article-body-text p{ margin-bottom:18px; color:#3C4152; }
.share-box{
  display:flex; align-items:center; gap:10px; margin-top:30px; padding-top:22px; border-top:1px solid #F1EEF9;
}
.share-box a{
  width:38px; height:38px; border-radius:50%; background:#F6F3FC; color:var(--purple-1);
  display:flex; align-items:center; justify-content:center;
}

/* ===================== WRITER PROFILE ===================== */
.profile-header{
  background:#fff; border-radius:20px; box-shadow:var(--card-shadow);
  padding:34px; display:flex; align-items:center; gap:22px; margin-bottom:32px;
}
.profile-header img{ width:100px; height:100px; border-radius:50%; object-fit:cover; border:4px solid #F6F3FC; }
.profile-header h1{ font-size:22px; font-weight:800; }
.profile-header .role{ color:var(--purple-3); font-weight:700; font-size:13px; margin-bottom:8px; }
.profile-header .bio{ font-size:13px; color:var(--text-muted); max-width:520px; }
.profile-stats{ display:flex; gap:22px; margin-top:12px; }
.profile-stats div{ font-size:12px; color:var(--text-muted); }
.profile-stats b{ display:block; color:var(--purple-1); font-size:16px; }

@media (max-width:768px){
  .profile-header{ flex-direction:column; text-align:center; }
  .article-detail-card{ padding:50px 18px 24px; }
  .article-hero{ height:220px; margin-bottom:-40px; }
  .form-row{ grid-template-columns:1fr; }
}
