/* ============================================================
   Irfan Healthcare Solutions — Health Knowledge Center
   Modern, minimalist, mobile-first, healthcare theme.
   Covers: article listing feed, article detail, reactions,
   follow, comments/replies, author page, and the editor.
   ============================================================ */

/* ---------- Nav (main) ---------- */
.nav--main { display: flex; align-items: center; gap: 0.9rem; }
.nav__link { font-size: 0.9rem; font-weight: 600; color: var(--text); text-decoration: none; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); transition: all 0.2s; }
.nav__link:hover { color: var(--primary); background: var(--primary-light); }
.nav__toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 24px; height: 2.5px; background: var(--text); border-radius: 2px; }
.header__inner { position: relative; }
@media (max-width: 640px) {
  .nav--main { flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 1rem; display: none; align-items: stretch; z-index: 99; }
  .nav--main.is-open { display: flex; }
  .nav__toggle { display: inline-flex; }
  .nav__link { text-align: center; }
  .nav--main .btn { justify-content: center; }
}

/* ---------- Listing page shell ---------- */
.articles-page { padding: 2rem 0 3rem; }
.articles-hero { text-align: center; margin-bottom: 1.75rem; }
.articles-hero--gradient { background: linear-gradient(135deg, #e8f4f4 0%, #f0f8ff 50%, #fff 100%); border-radius: var(--radius); padding: 2rem 1.5rem; margin-bottom: 2rem; position: relative; overflow: hidden; }
.articles-hero__badge { display: inline-block; background: var(--primary); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.3rem 0.9rem; border-radius: 20px; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.articles-hero__title { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; color: var(--primary-dark); margin-bottom: 0.5rem; letter-spacing: -0.5px; }
.articles-hero__subtitle { font-size: 0.98rem; color: var(--text-light); max-width: 620px; margin: 0 auto; line-height: 1.6; }

/* ---------- Toolbar ---------- */
.articles-toolbar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-top: 1.5rem; }
.articles-toolbar__search { background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a9aaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 12px center no-repeat; padding-left: 2.2rem; }
.filter-bar__group { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-bar__group--wide { flex: 1 1 220px; }
.filter-bar__label { font-size: 0.75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }
.filter-bar__input, .filter-bar__select { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.55rem 0.75rem; font-family: var(--font); font-size: 0.9rem; background: #fff; color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; }
.filter-bar__input:focus, .filter-bar__select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,122,122,0.12); }
.filter-bar__actions { display: flex; gap: 0.5rem; align-items: flex-end; }

/* ---------- Feed header ---------- */
.articles-main { display: flex; flex-direction: column; gap: 1.25rem; }
.articles-feed__header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 0.9rem; border-bottom: 2px solid var(--primary-light); }
.articles-feed__title { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); margin: 0; }
.articles-feed__count { font-size: 0.85rem; color: var(--text-muted); }
.articles-feed__count strong { color: var(--primary); }

/* ---------- Article grid ---------- */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 480px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .article-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Article card ---------- */
.article-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); transition: transform 0.25s ease, box-shadow 0.25s ease; display: flex; flex-direction: column; }
.article-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 40, 40, 0.14); }
.article-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none !important; }
.article-card__thumb { position: relative; aspect-ratio: 16 / 9; background: var(--primary-light); overflow: hidden; }
.article-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.article-card:hover .article-card__thumb img { transform: scale(1.05); }
.article-card__thumb.is-placeholder img { display: none; }
.article-card__thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: linear-gradient(135deg, var(--primary-light), #fff); }
.article-card__category { position: absolute; bottom: 0.7rem; left: 0.7rem; background: rgba(26, 122, 122, 0.92); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.7rem; border-radius: 20px; letter-spacing: 0.3px; backdrop-filter: blur(2px); }
.article-card__body { padding: 1.1rem 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.article-card__title { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card__excerpt { font-size: 0.86rem; color: var(--text-light); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.article-card__author { display: flex; align-items: center; gap: 0.5rem; padding-top: 0.7rem; border-top: 1px solid var(--border); }
.article-card__avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.article-card__author-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.article-card__meta { display: flex; gap: 0.7rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--text-muted); }
.article-card__stat { display: inline-flex; align-items: center; gap: 0.2rem; }
.article-card__stat strong { color: var(--text); font-weight: 700; }
.article-card__readmore { margin-top: 0.35rem; align-self: flex-start; font-size: 0.78rem; padding: 0.35rem 0.9rem; transition: all 0.2s; }
.article-card__link:hover .article-card__readmore { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Verified badge ---------- */
.verified-badge { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 0.65rem; font-weight: 800; line-height: 1; vertical-align: middle; }
.verified-badge--lg { width: 26px; height: 26px; font-size: 0.9rem; }

/* ---------- Empty state ---------- */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem 1.5rem; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state__icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.empty-state p { color: var(--text-light); margin-bottom: 1rem; }

/* ---------- Skeleton / load more ---------- */
.skeleton-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; height: 300px; position: relative; overflow: hidden; }
.skeleton-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent); animation: skeleton-shimmer 1.2s infinite; }
@keyframes skeleton-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.articles-load-more { text-align: center; margin-top: 1rem; }

/* ============================================================
   ARTICLE DETAIL PAGE
   ============================================================ */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0%; z-index: 200; transition: width 0.1s; }
.article-detail-page { padding: 2rem 0 3rem; background: var(--bg-card); }
.article-detail-container { max-width: 820px; }
.article-detail__header { margin-bottom: 1.5rem; }
.article-detail__category { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.85rem; border-radius: 20px; margin-bottom: 0.9rem; text-decoration: none; transition: all 0.2s; }
.article-detail__category:hover { background: var(--primary); color: #fff; }
.article-detail__title { font-size: clamp(1.75rem, 5vw, 2.6rem); font-weight: 800; color: var(--text); line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.article-detail__excerpt { font-size: 1.1rem; color: var(--text-light); line-height: 1.6; margin-bottom: 1.25rem; }
.article-detail__byline { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 560px) { .article-detail__byline { flex-direction: row; justify-content: space-between; align-items: center; } }
.article-detail__author { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; color: inherit; }
.article-detail__avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-light); }
.article-detail__author-info { display: flex; flex-direction: column; }
.article-detail__author-name { font-size: 0.98rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.35rem; }
.article-detail__author-title { font-size: 0.82rem; color: var(--text-muted); }
.article-detail__meta { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); }
.article-detail__meta-item { display: inline-flex; align-items: center; gap: 0.25rem; }
.article-detail__cover { border-radius: 16px; overflow: hidden; margin-bottom: 2rem; box-shadow: var(--shadow); }
.article-detail__cover img { width: 100%; max-height: 480px; object-fit: cover; }

/* ---------- Article body typography ---------- */
.article-body { font-size: 1.06rem; color: var(--text); line-height: 1.85; }
.article-body h2 { font-size: 1.45rem; font-weight: 700; color: var(--primary-dark); margin: 2rem 0 0.8rem; }
.article-body h3 { font-size: 1.2rem; font-weight: 700; color: var(--primary-dark); margin: 1.6rem 0 0.6rem; }
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.1rem 1.5rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body blockquote { border-left: 4px solid var(--primary); background: var(--primary-light); padding: 0.9rem 1.2rem; margin: 1.2rem 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--primary-dark); font-style: italic; }
.article-body img { border-radius: var(--radius); margin: 1.2rem 0; max-width: 100%; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.92rem; }
.article-body table th, .article-body table td { border: 1px solid var(--border); padding: 0.55rem 0.8rem; text-align: left; }
.article-body table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.article-body a { text-decoration: underline; }
.article-body .media-infographic { background: var(--primary-light); border: 2px solid var(--primary); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; text-align: center; }
.article-body .media-infographic img { margin: 0; }
.article-body .file-attachment { display: flex; align-items: center; gap: 0.6rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin: 1rem 0; }

/* ---------- Tags ---------- */
.article-detail__tags { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin: 2rem 0; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.article-detail__tags-label { font-size: 0.85rem; font-weight: 700; color: var(--text-light); }
.tag-cloud__item { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-size: 0.78rem; font-weight: 600; padding: 0.3rem 0.8rem; border-radius: 20px; text-decoration: none; transition: all 0.2s; }
.tag-cloud__item:hover { background: var(--primary); color: #fff; }

/* ---------- Reactions bar ---------- */
.reactions-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 2rem 0; flex-wrap: wrap; }
.reactions-bar__buttons { display: flex; gap: 0.6rem; }
.reaction-btn { display: inline-flex; align-items: center; gap: 0.45rem; border: 2px solid var(--border); background: #fff; color: var(--text); font-size: 0.92rem; font-weight: 600; padding: 0.5rem 1.1rem; border-radius: 24px; cursor: pointer; transition: all 0.2s; font-family: var(--font); }
.reaction-btn:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.reaction-btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.reaction-btn.is-active .reaction-btn__count { color: #fff; }
.reaction-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.reaction-btn__count { font-weight: 700; }
.reaction-btn--love.is-active { background: #e91e63; border-color: #e91e63; }
.reactions-bar__counter { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Author card ---------- */
.author-card { display: flex; gap: 1.1rem; background: var(--primary-light); border: 1px solid var(--primary); border-radius: 16px; padding: 1.3rem; margin-bottom: 2rem; align-items: flex-start; }
.author-card__photo { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; flex-shrink: 0; box-shadow: var(--shadow); }
.author-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.author-card__info { flex: 1; }
.author-card__name { font-size: 1.05rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.author-card__name a { color: inherit; text-decoration: none; }
.author-card__title { font-size: 0.86rem; color: var(--text-light); margin-bottom: 0.35rem; }
.author-card__bio { font-size: 0.86rem; color: var(--text-light); line-height: 1.55; margin-bottom: 0.7rem; }
.author-card .follow-btn { background: #fff; }

/* ---------- Follow button ---------- */
.follow-btn.is-following { background: var(--success); color: #fff; border-color: var(--success); }

/* ============================================================
   RELATED ARTICLES (max 3)
   ============================================================ */
.related-articles { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--primary-light); }
.related-articles__title { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 1.25rem; }
.related-articles__grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .related-articles__grid { grid-template-columns: repeat(3, 1fr); } }
.related-article { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none !important; color: inherit; box-shadow: var(--shadow); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.related-article:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0, 40, 40, 0.13); }
.related-article__thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.related-article__body { padding: 0.9rem 1rem 1.05rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.related-article__cat { font-size: 0.7rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.3px; }
.related-article__title { font-size: 0.92rem; font-weight: 700; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-article__meta { font-size: 0.75rem; color: var(--text-muted); margin-top: auto; }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section { margin-top: 2.5rem; }
.comments-section__title { font-size: 1.25rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 1.1rem; }
.comment-composer { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; }
.comment-composer__input { margin-bottom: 0.6rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; font-family: var(--font); font-size: 0.92rem; color: var(--text); width: 100%; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s; }
.comment-composer__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,122,122,0.12); }
.comment-composer__toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.comment-composer__hint { flex: 1; font-size: 0.8rem; color: var(--text-muted); }

.comments-list { display: flex; flex-direction: column; gap: 1rem; }
.comment { display: flex; gap: 0.75rem; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); padding: 1rem; box-shadow: 0 1px 4px rgba(0,40,40,0.04); animation: comment-in 0.3s ease; }
@keyframes comment-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.comment--deleted { opacity: 0.7; background: var(--bg); }
.comment__avatar-wrap { flex-shrink: 0; }
.comment__avatar-wrap a { display: block; }
.comment__avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.comment__body { flex: 1; min-width: 0; }
.comment__header { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.comment__author { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; color: inherit; }
.comment__author-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.comment__date { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.comment__text { font-size: 0.92rem; line-height: 1.6; color: var(--text); word-wrap: break-word; }
.comment__text img { max-width: 100%; border-radius: var(--radius-sm); margin: 0.4rem 0; }
.comment__deleted-text { font-size: 0.85rem; color: var(--text-muted); }
.comment__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.comment__action { background: none; border: none; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font); }
.comment__action:hover { background: var(--primary-light); color: var(--primary-dark); }
.comment__action--danger:hover { background: #fbe9e7; color: var(--danger); }
.comment__reply-form { margin-top: 0.75rem; }
.comment__reply-form textarea { width: 100%; margin-bottom: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; font-family: var(--font); font-size: 0.9rem; color: var(--text); resize: vertical; }
.comment__reply-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,122,122,0.12); }
.comment__reply-tools { display: flex; gap: 0.4rem; align-items: center; }
.comment__replies { margin-left: 0.9rem; padding-left: 0.9rem; border-left: 2px solid var(--border); margin-top: 0.9rem; display: flex; flex-direction: column; gap: 0.9rem; }
.comment-empty { text-align: center; color: var(--text-muted); padding: 2rem 1rem; background: var(--bg); border-radius: var(--radius); }
.comment-empty__icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.comment-loading { text-align: center; color: var(--text-muted); padding: 1rem; }

/* ============================================================
   AUTHOR PAGE
   ============================================================ */
.author-page { padding: 2rem 0 3rem; }
.author-hero-card { display: flex; flex-direction: column; gap: 1.25rem; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: var(--radius); padding: 2rem 1.5rem; box-shadow: var(--shadow-lg); margin-bottom: 2rem; align-items: center; text-align: center; }
@media (min-width: 640px) { .author-hero-card { flex-direction: row; text-align: left; align-items: flex-start; } }
.author-hero-card__photo { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; border: 4px solid rgba(255,255,255,0.35); flex-shrink: 0; background: rgba(255,255,255,0.15); }
.author-hero-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.author-hero-card__info { display: flex; flex-direction: column; gap: 0.45rem; align-items: center; }
@media (min-width: 640px) { .author-hero-card__info { align-items: flex-start; } }
.author-hero-card__name { font-size: 1.6rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; }
.author-hero-card__title { font-size: 1rem; opacity: 0.95; }
.author-hero-card__quals { font-size: 0.88rem; opacity: 0.9; }
.author-hero-card__bio { font-size: 0.9rem; line-height: 1.6; opacity: 0.95; max-width: 520px; }
.author-hero-card__stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.author-stat { text-align: center; }
.author-stat strong { display: block; font-size: 1.3rem; font-weight: 800; }
.author-stat span { font-size: 0.78rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.4px; }
.author-hero-card .follow-btn { align-self: center; margin-top: 0.5rem; background: #fff; color: var(--primary-dark); border-color: #fff; }
@media (min-width: 640px) { .author-hero-card .follow-btn { align-self: flex-start; } }
.author-hero-card .follow-btn.is-following { background: var(--success); color: #fff; }
.author-page__section-title { font-size: 1.25rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 1.25rem; }

/* ============================================================
   EDITOR
   ============================================================ */
.editor-page { padding: 2rem 0 3rem; }
.editor-page__header { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.editor-page__title { font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); }
.editor-page__status { display: flex; align-items: center; gap: 0.75rem; }
.autosave-status { font-size: 0.82rem; color: var(--text-muted); }
.autosave-status--saved { color: var(--success); }
.autosave-status--saving { color: var(--accent); }
.editor-form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 860px; }
.simple-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.simple-card__title { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 1rem; }
.rich-editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-bottom: none; }
.re-tool { background: #fff; border: 1px solid var(--border); border-radius: 4px; min-width: 32px; height: 32px; padding: 0 0.5rem; font-size: 0.82rem; font-family: var(--font); cursor: pointer; transition: all 0.15s; color: var(--text); }
.re-tool:hover { border-color: var(--primary); background: var(--primary-light); }
.re-tool-sep { width: 1px; background: var(--border); margin: 0 0.25rem; }
.rich-editor-body { min-height: 380px; background: #fff; border: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 1.25rem; font-size: 1rem; line-height: 1.7; color: var(--text); outline: none; }
.rich-editor-body:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,122,122,0.12); }
.rich-editor-body img { max-width: 100%; border-radius: var(--radius-sm); }
.rich-editor-body blockquote { border-left: 4px solid var(--primary); background: var(--primary-light); padding: 0.6rem 0.9rem; margin: 0.6rem 0; }
.rich-editor-body table { width: 100%; border-collapse: collapse; }
.rich-editor-body table td, .rich-editor-body table th { border: 1px solid var(--border); padding: 0.4rem; }
.editor-media-modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.editor-media-modal__box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: 1.25rem; position: relative; }
.editor-media-modal__close { position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
.editor-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.editor-actions .btn { flex: 1; min-width: 140px; }
.editor-actions--sticky { position: sticky; bottom: 0.75rem; background: rgba(255,255,255,0.92); backdrop-filter: blur(6px); padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50; }

/* ---------- Cover uploader ---------- */
.cover-uploader { display: block; }
.cover-uploader__dropzone { position: relative; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--bg); min-height: 200px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; transition: border-color 0.2s, background 0.2s; }
.cover-uploader__dropzone:hover { border-color: var(--primary); background: var(--primary-light); }
.cover-uploader__preview img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.cover-uploader__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.35); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; opacity: 0; transition: opacity 0.2s; }
.cover-uploader__dropzone:hover .cover-uploader__overlay { opacity: 1; }
.cover-uploader__icon { font-size: 2.5rem; }
.cover-uploader__title { font-weight: 700; color: var(--text); }
.cover-uploader__hint, .cover-uploader__formats { font-size: 0.8rem; color: var(--text-muted); }
.cover-uploader__progress { height: 6px; background: var(--border); border-radius: 20px; margin-top: 0.6rem; overflow: hidden; }
.cover-uploader__progress-bar { height: 100%; background: var(--primary); border-radius: 20px; transition: width 0.2s; }
.cover-uploader__btn-icon { font-size: 1.1rem; }

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.notif-bell { position: relative; }
.notif-bell__btn { position: relative; background: var(--primary-light); border: 1px solid var(--border); border-radius: 50%; width: 36px; height: 36px; font-size: 1.05rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.notif-bell__btn:hover { border-color: var(--primary); }
.notif-bell__badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 20px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.notif-panel { position: absolute; right: 0; top: 42px; width: 320px; max-width: 90vw; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 400; overflow: hidden; }
.notif-panel__header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: var(--primary-light); border-bottom: 1px solid var(--border); }
.notif-panel__header strong { color: var(--primary-dark); }
.notif-panel__mark-all { background: none; border: none; color: var(--primary); font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.notif-panel__list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 0.6rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; text-decoration: none; color: inherit; transition: background 0.2s; }
.notif-item:hover { background: var(--bg); }
.notif-item.is-unread { background: var(--primary-light); }
.notif-item__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--border); }
.notif-item__text { flex: 1; line-height: 1.4; }
.notif-item__time { font-size: 0.72rem; color: var(--text-muted); display: block; margin-top: 0.15rem; }
.notif-panel__empty { text-align: center; color: var(--text-muted); padding: 1.25rem; font-size: 0.85rem; }

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] body { background: #0f1a1a; color: #dce8e8; }
[data-theme="dark"] .header,
[data-theme="dark"] .card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .comment,
[data-theme="dark"] .notif-panel,
[data-theme="dark"] .simple-card,
[data-theme="dark"] .rich-editor-body,
[data-theme="dark"] .editor-media-modal__box,
[data-theme="dark"] .related-article { background: #14232a; border-color: #1f3a3a; color: #dce8e8; }
[data-theme="dark"] .article-detail-page { background: #0f1a1a; }
[data-theme="dark"] .article-detail-page .article-detail__title,
[data-theme="dark"] .editor-page__title,
[data-theme="dark"] .articles-hero__title,
[data-theme="dark"] .articles-feed__title,
[data-theme="dark"] .related-articles__title,
[data-theme="dark"] .comments-section__title { color: #fff; }
[data-theme="dark"] .article-body p,
[data-theme="dark"] .article-body li { color: #cfe0e0; }
[data-theme="dark"] .reactions-bar,
[data-theme="dark"] .comment-composer,
[data-theme="dark"] .rich-editor-toolbar,
[data-theme="dark"] .articles-toolbar,
[data-theme="dark"] .articles-hero--gradient { background: #14232a; color: #dce8e8; }
[data-theme="dark"] .articles-hero--gradient { background: linear-gradient(135deg, #14232a 0%, #0f1a1a 100%); }
[data-theme="dark"] .article-card__title,
[data-theme="dark"] .related-article__title { color: #fff; }
[data-theme="dark"] .article-card__excerpt,
[data-theme="dark"] .article-detail__excerpt { color: #b6c6c6; }
[data-theme="dark"] .filter-bar__input, [data-theme="dark"] .filter-bar__select,
[data-theme="dark"] .comment-composer__input, [data-theme="dark"] .comment__reply-form textarea { background: #0f1a1a; color: #dce8e8; border-color: #1f3a3a; }
[data-theme="dark"] .reaction-btn { background: #14232a; color: #dce8e8; border-color: #1f3a3a; }
[data-theme="dark"] .reaction-btn.is-active { background: var(--primary); color: #fff; }
[data-theme="dark"] .reaction-btn--love.is-active { background: #e91e63; }
[data-theme="dark"] .author-card { background: #14232a; border-color: #1f3a3a; }
[data-theme="dark"] .skeleton-card { background: #14232a; border-color: #1f3a3a; }
[data-theme="dark"] .empty-state { background: #14232a; border-color: #1f3a3a; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.verified-badge, .reaction-btn, .follow-btn, .composer-tool { min-height: 28px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--primary); color: #fff; padding: 0.5rem 1rem; z-index: 1000; }
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
