/* Ratawa blog CMS: article pages, author pages, Write for Us, and the editor (admin + writer portal) */

/* ---------- Admin/author-area helpers (also in admin.css locally; repeated here because the live admin.css is older) ---------- */
.admin-side nav a span.nav-alert, .nav-alert { background: #F59E0B !important; color: #1F1F1F !important; font-weight: 700; }
.approve-banner { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; background: var(--warn-bg, #FFFBEB); border: 1px solid #FDE68A; color: #78350F; border-radius: 12px; padding: .8rem 1rem; font-size: .92rem; }
.approve-banner .btn { padding: .45rem .9rem; font-size: .85rem; margin-left: auto; }
.access-panel { display: flex; gap: 1.2rem; justify-content: space-between; align-items: center; flex-wrap: wrap; border-left: 5px solid var(--accent); }
.access-panel h2 { font-size: 1.15rem; margin-bottom: .3rem; }
.access-panel p { font-size: .92rem; }
.access-pending { border-left-color: #F59E0B; background: #FFFBEB; }
.access-inactive { border-left-color: #9CA3AF; }
.access-active { border-left-color: var(--ok, #059669); }
.access-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.access-actions form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.access-actions .check { padding: .35rem .6rem; font-size: .82rem; }

/* ---------- Shared bits ---------- */
.small { font-size: .84rem; }
.danger-text { color: #B91C1C !important; }
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--lavender); }
.avatar-txt { display: inline-grid; place-items: center; background: var(--grad); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: .8em; border-radius: 50%; flex-shrink: 0; }
.card-author { display: flex; align-items: center; gap: .55rem; font-size: .85rem; color: var(--ink-2); margin-top: 1rem; }
.card-author .avatar-txt { font-size: .7rem; }
.post-card .post-meta a.tag:hover { color: var(--violet); }
.err-list { margin: .4rem 0 0 1.1rem; list-style: disc; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error.show { display: block; }

/* ---------- Article page ---------- */
.preview-banner { background: #FEF3C7; color: #78350F; text-align: center; padding: .7rem 1rem; font-size: .92rem; border-bottom: 1px solid #FDE68A; }
.preview-banner a { color: #78350F; text-decoration: underline; font-weight: 600; }
.article-head { background: radial-gradient(900px 420px at 80% -20%, #F3E8FF 0%, rgba(243,232,255,0) 60%), var(--bg-soft); padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.article-narrow { max-width: 860px; }
.article-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.18; letter-spacing: -.02em; margin-top: .4rem; }
.article-head .lead { margin-top: 1rem; max-width: 64ch; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-top: 1.6rem; }
.byline-who { display: grid; line-height: 1.35; }
.byline-who a, .byline-who strong { font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.byline-who a:hover { color: var(--primary); }
.byline-who span { font-size: .85rem; color: var(--muted); }
.byline-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; color: var(--muted); padding-left: 1.2rem; border-left: 1px solid var(--border); }
.article-cover { max-width: 1060px; margin: calc(-1 * clamp(1.5rem, 4vw, 3rem)) auto 0; }
.article-cover img { width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(1.6rem, 4vw, 3.5rem); align-items: start; padding: clamp(2rem, 5vw, 3.5rem) 0; }
.article-main { max-width: 760px; min-width: 0; }
.toc .toc-l3 { margin-left: 1rem; list-style: circle; font-size: .94rem; }

.prose { font-size: 1.07rem; line-height: 1.8; color: #2A2A33; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin-top: 2.2em; line-height: 1.3; }
.prose h3 { font-size: 1.28rem; margin-top: 1.8em; line-height: 1.35; }
.prose h4 { font-size: 1.08rem; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose ul { list-style: disc; padding-left: 1.4rem; }
.prose ol { list-style: decimal; padding-left: 1.4rem; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { border-left: 4px solid var(--accent); background: var(--bg-soft); padding: 1rem 1.3rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-2); font-style: italic; }
.prose img { border-radius: var(--radius); height: auto; margin-inline: auto; }
.prose figure { margin: 1.8em 0; }
.prose figcaption { text-align: center; font-size: .88rem; color: var(--muted); margin-top: .6rem; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose pre { background: #1F1033; color: #F4ECFF; padding: 1rem 1.2rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.prose code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--lavender); padding: .1em .35em; border-radius: 5px; }
.prose pre code { background: none; padding: 0; }
.prose .table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: .6rem .8rem; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); font-family: var(--font-head); font-size: .88rem; }
.prose .video-embed { position: relative; aspect-ratio: 16 / 9; }
.prose .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.article-tags { margin-top: 2rem; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.6rem; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: .9rem; }
.share-row span { font-weight: 600; margin-right: .3rem; }
.share-row a, .share-row button { padding: .4rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--ink); background: #fff; font-size: .85rem; cursor: pointer; font-family: inherit; }
.share-row a:hover, .share-row button:hover { border-color: var(--accent); color: var(--primary); }
.author-box { display: flex; gap: 1.3rem; align-items: flex-start; margin-top: 2rem; padding: 1.6rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.author-box h2 { font-size: 1.25rem; margin-top: .2rem; }
.author-box h2 a { color: var(--ink); }
.author-box h2 a:hover { color: var(--primary); }
.author-box p { font-size: .95rem; margin-top: .5rem; color: var(--ink-2); }
.author-role { font-size: .9rem !important; color: var(--muted) !important; margin-top: .15rem !important; }
.author-links { display: flex; gap: .5rem; margin-top: .9rem; }
.author-links a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--primary); }
.author-links a:hover { background: var(--grad); color: #fff; border-color: transparent; }
.author-links svg { width: 18px; height: 18px; }
.article-side { top: calc(var(--header-h) + 1.5rem); }
.related { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.related h2 { font-size: 1.5rem; margin-bottom: 1.4rem; }
.author-hero { display: flex; gap: clamp(1.2rem, 3vw, 2rem); align-items: flex-start; margin-top: .6rem; }
.author-hero h1 { max-width: none; }
.author-hero .lead { margin-top: .8rem; }
.blog-search label { display: block; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; min-width: 0; padding: .6rem .8rem; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; }
.search-row .btn { padding: .6rem .8rem; }
.search-row svg { width: 18px; height: 18px; }
.widget-list a[aria-current] { color: var(--primary); font-weight: 600; }

/* ---------- Write for Us ---------- */
.check-list { display: grid; gap: .75rem; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .96rem; color: var(--ink-2); }
.check-list svg { width: 20px; height: 20px; color: var(--ok, #059669); flex-shrink: 0; margin-top: .2rem; }
.steps-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; counter-reset: none; }
.steps-row li { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; display: grid; gap: .4rem; box-shadow: var(--shadow-sm); }
.steps-row strong { font-family: var(--font-head); color: var(--primary); }
.steps-row span { font-size: .9rem; color: var(--ink-2); }

/* ---------- Write for Us (public editor) ---------- */
.section-tight { padding-block: clamp(1.5rem, 3vw, 2.2rem); }
.container-wide { max-width: 1320px; }
.wfu-hero h1 { max-width: none; }
.wfu-guide { padding: 1.1rem 1.4rem !important; }
.wfu-guide summary { cursor: pointer; }
.wfu-guide-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 1.6rem; margin-top: 1.2rem; }
.wfu-guide h3 { font-size: 1rem; margin-bottom: .7rem; }
.wfu-guide .check-list { gap: .5rem; }
.wfu-guide .check-list li { font-size: .92rem; }
.editor-step { font-size: 1.15rem; }
.public-editor .editor-main { display: grid; gap: 1.2rem; align-content: start; }
.public-editor .editor-side { top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); }
.public-editor .card:hover { transform: none; }
.public-editor .form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.publish-box .check { align-items: flex-start; }
.wfu-thanks { text-align: center; padding: clamp(1.8rem, 4vw, 2.8rem) !important; }
.wfu-thanks .icon-badge { margin: 0 auto 1rem; }
.wfu-thanks h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.wfu-thanks p { margin-top: .8rem; color: var(--ink-2); }
.wfu-thanks .wfu-title { font-family: var(--font-head); font-weight: 600; color: var(--primary); }
.wfu-thanks .actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.wfu-steps { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.4rem; font-size: .92rem; color: var(--muted); }
.wfu-steps li { display: flex; align-items: center; gap: .5rem; }
.wfu-steps span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1.5px solid var(--border); font-family: var(--font-head); font-weight: 700; font-size: .85rem; }
.wfu-steps li.on { color: var(--ink); font-weight: 600; }
.wfu-steps li.on span { background: var(--grad); color: #fff; border-color: transparent; }
.wfu-steps li.done span { background: var(--ok-bg, #ECFDF5); color: var(--ok, #059669); border-color: transparent; }
.wfu-me { margin-top: 1rem; font-size: .92rem; }
.wfu-draft { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 5px solid var(--accent); }
.wfu-draft h2 { font-size: 1.2rem; margin-top: .2rem; }
.wfu-step2-title { font-size: 1.4rem; margin: 2rem 0 1rem; }
.wfu-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem; }
.wfu-choice button { display: flex; gap: .9rem; align-items: flex-start; text-align: left; background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.wfu-choice button:hover { border-color: #D9C4F2; }
.wfu-choice button.on { border-color: var(--accent); box-shadow: var(--shadow); background: #FBF7FF; }
.wfu-choice svg { width: 30px; height: 30px; color: var(--primary); flex-shrink: 0; }
.wfu-choice strong { display: block; font-family: var(--font-head); font-size: 1.05rem; }
.wfu-choice small { display: block; color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.wfu-panel[hidden] { display: none !important; }
.wfu-login-box { text-align: left; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-top: 1.2rem; }
.wfu-login-box dl { display: grid; grid-template-columns: 120px 1fr; gap: .35rem .8rem; margin-top: .6rem; font-size: .95rem; }
.wfu-login-box dt { color: var(--muted); }
.wfu-login-box dd { margin: 0; font-weight: 600; }
@media (max-width: 760px) {
  .wfu-guide-grid, .public-editor .form-row-3, .public-editor .form-row, .wfu-choice, .wfu-panel .form-row, .wfu-panel .form-row-3 { grid-template-columns: 1fr; }
}

/* ---------- Editor ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; margin-top: 1rem; }
.editor-card { display: grid; gap: 1.1rem; }
.title-input { font-family: var(--font-head) !important; font-size: 1.35rem !important; font-weight: 700; }
.slug-row { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.slug-row span { padding: 0 .1rem 0 .8rem; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.slug-row input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; padding-left: .1rem !important; }
.slug-row input[readonly] { color: var(--muted); background: #fff; }
.counter { font-size: .78rem; color: var(--muted); justify-self: end; }
.counter.ok { color: var(--ok, #059669); }
.counter.over { color: #B45309; }
.editor-side { display: grid; gap: 1rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding-bottom: 1rem; }
.side-box { display: grid; gap: .8rem; padding: 1.1rem !important; }
.side-box h3 { font-size: 1rem; display: flex; justify-content: space-between; align-items: center; }
.side-box .field label { font-size: .84rem; }
.side-box .check { font-size: .86rem; }
.btn-stack { display: grid; gap: .5rem; }
.status-line { font-size: .9rem; }
.review-note { background: var(--warn-bg, #FFFBEB); border: 1px solid #FDE68A; border-radius: 10px; padding: .7rem .8rem; font-size: .86rem; color: #78350F; }
.review-note p { margin-top: .3rem; }
.more-actions { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; }
.more-actions summary { cursor: pointer; font-size: .88rem; font-weight: 600; }
.more-actions[open] { display: grid; gap: .6rem; }
.cover-drop { display: grid; gap: .5rem; }
.cover-drop img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.cover-drop label.btn { cursor: pointer; }
.seo-score { font-size: .8rem; padding: .15rem .55rem; border-radius: 99px; background: #F3F4F6; }
.seo-score.good { background: var(--ok-bg, #ECFDF5); color: var(--ok, #059669); }
.seo-score.warn { background: var(--warn-bg, #FFFBEB); color: #B45309; }
.seo-score.bad { background: #FEF2F2; color: #B91C1C; }
.serp { display: grid; gap: .15rem; padding: .8rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-family: Arial, sans-serif; }
.serp-url { font-size: .78rem; color: #4D5156; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 1.05rem; color: #1A0DAB; line-height: 1.3; }
.serp-desc { font-size: .82rem; color: #4D5156; line-height: 1.45; }
.seo-checks { display: grid; gap: .4rem; font-size: .82rem; }
.seo-checks li { position: relative; padding-left: 1.3rem; line-height: 1.4; }
.seo-checks li::before { content: ""; position: absolute; left: 0; top: .3em; width: .7rem; height: .7rem; border-radius: 50%; }
.seo-checks li.good::before { background: #10B981; }
.seo-checks li.warn::before { background: #F59E0B; }
.seo-checks li.bad::before { background: #EF4444; }
.seo-checks li.good { color: var(--muted); }
.profile-photo { display: flex; gap: 1.2rem; align-items: center; }
.profile-photo .field { flex: 1; }
.tox-tinymce { border-radius: 12px !important; border-color: var(--border) !important; }

@media (max-width: 1100px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; max-height: none; overflow: visible; }
  .steps-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-side { position: static; }
  .byline-meta { padding-left: 0; border-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .author-box, .author-hero { flex-direction: column; }
  .steps-row { grid-template-columns: 1fr; }
  .article-cover { margin-top: -1rem; }
}
