/**
 * UrduPaper — Authorship module front-end styles.
 *
 * Scoped under the `.upaper-authorship` body class added by inc/authorship.php
 * so we never bleed into theme defaults. Tokens mirror the admin dashboard
 * palette (defined in inc/admin-menu.php) for visual continuity.
 *
 * Layout strategy:
 *   - Auth pages (login/signup/forgot/reset)  → centered single card.
 *   - Account pages (dashboard, posts, submit, edit, profile) → 2-column
 *     grid: sidebar (nav + identity) on the left, main on the right.
 *     Collapses to a stack on tablets.
 */

.upaper-authorship {
    --auth-primary:    #121212;
    --auth-secondary:  #282828;
    --auth-accent:     #f4ac04;
    --auth-accent-2:   #fbf5e6;
    --auth-text:       #333333;
    --auth-muted:      #767676;
    --auth-border:     #e6e6e6;
    --auth-card-bg:    #ffffff;
    --auth-page-bg:    #f5f8f8;
    --auth-radius:     14px;
    --auth-radius-sm:  8px;
    --auth-success:    #1e8e3e;
    --auth-error:      #b3261e;
    --auth-info:       #2b6cb0;
    --auth-shadow-1:   0 1px 2px rgba(18, 18, 18, .04), 0 4px 16px rgba(18, 18, 18, .04);
    --auth-shadow-2:   0 4px 8px rgba(18, 18, 18, .06), 0 16px 32px rgba(18, 18, 18, .08);

    /* Noto Naskh Arabic for any Urdu/Arabic glyph anywhere on the
     * authorship surface (post titles, names, bios, gate copy, status
     * pills, etc.). Listed first so per-glyph fallback in browsers
     * picks it for Arabic-script characters; Latin glyphs fall through
     * to the system sans stack since Naskh has no Latin coverage. */
    font-family: 'Noto Naskh Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.upaper-authorship,
.upaper-authorship input,
.upaper-authorship select,
.upaper-authorship textarea,
.upaper-authorship button {
    font-family: inherit;
}

/* ---------------------------------------------------------------
 * Bilingual labels — every visible string is rendered as an EN-left +
 * UR-right pair via upaper_authorship_dual(). The wrapper is a flex
 * container that lives inside labels, buttons, headings, nav links,
 * and paragraphs without modification.
 *
 * Long strings wrap independently inside each half (so a verbose
 * English hint won't crush its Urdu counterpart). The Urdu half opts
 * into Noto Naskh Arabic — Naskh's compact baseline reads cleanly at
 * UI sizes (Nastaleeq tends to clip descenders in tight rows).
 * ------------------------------------------------------------- */

.upaper-auth-dual {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    width: 100%;
    /* Force LTR ordering of flex children regardless of the page's
     * direction. Without this, an RTL <html dir="rtl"> ancestor (the
     * UrduPaper default) flips space-between so the FIRST child lands
     * on the visual right — i.e. Urdu ends up on the left. Pinning the
     * wrapper to LTR makes "first child → visual left" deterministic;
     * each half still respects its own text direction below. */
    direction: ltr;
    text-align: left;
}
.upaper-auth-hint {
    margin-top: 15px !important;
}
.upaper-auth-hint .upaper-auth-dual {
    flex-direction: column;
    gap: 6px;
}
.upaper-auth-hint .upaper-auth-dual > span {
    flex: 1 1 auto;
     /* Hints can be long, so let each half wrap to multiple lines if
      * needed. */
    max-width: 100%;
}
.upaper-auth-dual-en {
    flex: 1 1 auto;
    text-align: left;
    direction: ltr;
    min-width: 0;
}
.upaper-auth-dual-ur {
    flex: 0 1 auto;
    text-align: right;
    direction: rtl;
    unicode-bidi: isolate;
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', serif;
    font-weight: 500;
    line-height: 1.7;
    max-width: 55%;
    min-width: 0;
}

/* Block-level wrappers (paragraphs, headings, labels) — the dual span
 * needs to fill the row so the two halves can land at the edges. */
.upaper-authorship h1 .upaper-auth-dual,
.upaper-authorship h2 .upaper-auth-dual,
.upaper-authorship h3 .upaper-auth-dual,
.upaper-authorship p  .upaper-auth-dual,
.upaper-authorship label .upaper-auth-dual,
.upaper-authorship a  .upaper-auth-dual {
    width: 100%;
}

/* Headings — bump the Urdu line-height a touch more on big titles so the
 * descenders don't get clipped. */
.upaper-auth-title .upaper-auth-dual-ur {
    font-size: 22px;
    line-height: 1.7;
}
.upaper-account-section-title .upaper-auth-dual-ur {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}
.upaper-account-header h1 .upaper-auth-dual-ur {
    font-size: 20px;
    line-height: 1.6;
}

/* Buttons — dual sits centered as a single inline cluster (EN + gap +
 * UR), not stretched edge-to-edge. A full-width form button with the
 * two halves at opposite ends looks bare; keeping them grouped reads
 * like a normal button label. */
.upaper-auth-button .upaper-auth-dual {
    display: inline-flex;
    width: auto;
    flex: 0 1 auto;
    gap: 12px;
    justify-content: center;
}
.upaper-auth-button .upaper-auth-dual-ur {
    max-width: none;
    line-height: 1.5;
}

/* Inline contexts inside flex rows (Remember me checkbox, Forgot
 * password? link). The dual must size to its content so the parent
 * row's space-between layout still pins each child to its end. */
.upaper-auth-link .upaper-auth-dual,
.upaper-auth-check .upaper-auth-dual {
    display: inline-flex;
    width: auto;
    flex: 0 1 auto;
    gap: 10px;
    align-items: baseline;
}
.upaper-auth-link .upaper-auth-dual-ur,
.upaper-auth-check .upaper-auth-dual-ur {
    max-width: none;
}

/* Auth-card heading + subtitle render as TWO language blocks stacked
 * vertically: a full English (title + description) block followed by a
 * full Urdu (title + description) block. Keeps each language reading as
 * one continuous thought, rather than interleaving EN-heading +
 * UR-heading + EN-desc + UR-desc which fragments comprehension. */
.upaper-auth-card-head {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.upaper-auth-card-head-lang {
    display: block;
}
.upaper-auth-card-head-en {
    text-align: left;
    direction: ltr;
}
.upaper-auth-card-head-ur {
    text-align: right;
    direction: rtl;
    /* Subtle separator so the eye reads "two language blocks" instead
     * of "one wall of text". Dashed top border in muted grey. */
    padding-top: 14px;
    border-top: 1px dashed var(--auth-border);
}
.upaper-auth-card-head-lang .upaper-auth-title {
    margin: 0 0 6px;
}
.upaper-auth-card-head-lang .upaper-auth-sub {
    margin: 0;
}

/* TOS / long agreement text — full sentences in both languages don't
 * fit side-by-side without ugly wrapping. Stack EN above UR. The
 * checkbox stays on the LEFT (label is flex with checkbox first, span
 * second); the span fills the remaining row and stacks its two
 * language lines internally. */
.upaper-auth-tos {
    align-items: flex-start;
}
.upaper-auth-tos > span {
    flex: 1 1 auto;
}
.upaper-auth-tos .upaper-auth-dual {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
}
.upaper-auth-tos .upaper-auth-dual-en,
.upaper-auth-tos .upaper-auth-dual-ur {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
}
.upaper-auth-tos .upaper-auth-dual-ur {
    text-align: right;
}

/* The dotted underline on inline help links should sit under the text
 * only — not stretch across the row. */
.upaper-auth-link {
    display: inline-flex;
    align-items: baseline;
    line-height: 1.6;
}

/* Nav links — the label span (after the dashicon) becomes a dual flex. */
.upaper-account-nav-link > .upaper-auth-dual {
    flex: 1;
}

/* Filter pills + table actions are short — render dual inline with a
 * thin separator so the pill doesn't grow to row-width. */
.upaper-account-filter a .upaper-auth-dual,
.upaper-account-action .upaper-auth-dual,
.upaper-account-pill .upaper-auth-dual,
.upaper-account-stat-label .upaper-auth-dual,
.upaper-account-recent-meta .upaper-auth-dual {
    display: inline-flex;
    gap: 8px;
    width: auto;
}
.upaper-account-filter a .upaper-auth-dual-ur,
.upaper-account-action .upaper-auth-dual-ur,
.upaper-account-pill .upaper-auth-dual-ur,
.upaper-account-stat-label .upaper-auth-dual-ur,
.upaper-account-recent-meta .upaper-auth-dual-ur {
    max-width: none;
}

/* On very narrow screens the two halves stack — keeps long sentences
 * legible instead of squishing both into thin columns. */
@media (max-width: 480px) {
    .upaper-auth-dual {
        flex-wrap: wrap;
    }
    .upaper-auth-dual-en,
    .upaper-auth-dual-ur {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .upaper-auth-dual-ur {
        text-align: right;
    }
}

/* ---------------------------------------------------------------
 * Outer wrap — full-bleed soft background so the cards float.
 * ------------------------------------------------------------- */

.upaper-auth-wrap {
    background: var(--auth-page-bg);
    padding: 28px 20px;
    min-height: 60vh;
    margin-top: 20px;
    border-radius: var(--auth-radius);
}
.upaper-auth-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Flash message banner — set inline-block above any card. */

.upaper-auth-flash {
    padding: 12px 18px;
    border-radius: var(--auth-radius-sm);
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.upaper-auth-flash.is-success {
    background: #e7f3eb;
    color: #155a2c;
    border-color: #b6dec3;
}
.upaper-auth-flash.is-error {
    background: #fbeaea;
    color: #7a1f1f;
    border-color: #f0c2c2;
}

/* ---------------------------------------------------------------
 * Single-card auth pages.
 * ------------------------------------------------------------- */

.upaper-auth-card {
    max-width: 460px;
    margin: 0 auto;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow-1);
    padding: 36px 36px 32px;
}
.upaper-auth-card-head {
    margin-bottom: 24px;
}
.upaper-auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--auth-primary);
    margin: 0 0 6px;
    line-height: 1.25;
}
.upaper-auth-sub {
    font-size: 14px;
    color: var(--auth-muted);
    line-height: 1.55;
    margin: 0;
}

/* Form layout primitives — reused on every form on every page. */

.upaper-auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.upaper-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.upaper-auth-field > img {
    display: none;
}
.upaper-auth-field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--auth-primary);
    letter-spacing: .02em;
    display: block;
    width: 100%;
}
.upaper-auth-field input[type="text"],
.upaper-auth-field input[type="email"],
.upaper-auth-field input[type="url"],
.upaper-auth-field input[type="password"],
.upaper-auth-field input[type="file"],
.upaper-auth-field textarea,
.upaper-auth-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: #fafafa;
    color: var(--auth-text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    box-sizing: border-box;
}
.upaper-auth-field input:focus,
.upaper-auth-field textarea:focus,
.upaper-auth-field select:focus {
    border-color: var(--auth-accent);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(244, 172, 4, .18);
}
.upaper-auth-field input[type="file"] {
    padding: 8px;
    background: #fff;
}
.upaper-auth-field textarea {
    resize: vertical;
    min-height: 90px;
}
.upaper-auth-hint {
    margin: 0;
    font-size: 12px;
    color: var(--auth-muted);
    line-height: 1.5;
}
.upaper-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 540px) {
    .upaper-auth-grid {
        grid-template-columns: 1fr;
    }
}

.upaper-auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.upaper-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--auth-text);
    cursor: pointer;
}
.upaper-auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
}
.upaper-auth-tos {
    margin-top: 4px;
    font-size: 13px;
    color: var(--auth-text);
    align-items: flex-start;
    line-height: 1.5;
}
.upaper-auth-tos input {
    margin-top: 2px;
}

/* CTA button — full-width on auth cards, inline on dashboard. */

.upaper-auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--auth-primary);
    color: var(--auth-accent);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    box-sizing: border-box;
}
.upaper-auth-button:hover,
.upaper-auth-button:focus {
    background: #000;
    color: var(--auth-accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(18, 18, 18, .2);
    outline: none;
}
.upaper-auth-button--small {
    padding: 9px 16px;
    font-size: 13px;
}
.upaper-auth-button--ghost {
    background: transparent;
    color: var(--auth-primary);
    border: 1px solid var(--auth-border);
}
.upaper-auth-button--ghost:hover,
.upaper-auth-button--ghost:focus {
    background: var(--auth-primary);
    color: var(--auth-accent);
    border-color: var(--auth-primary);
}
.upaper-auth-form .upaper-auth-button {
    margin-top: 8px;
    width: 100%;
}

.upaper-auth-link {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted rgba(18, 18, 18, .3);
}
.upaper-auth-link:hover,
.upaper-auth-link:focus {
    color: #8a6300;
    border-bottom-color: #8a6300;
}

.upaper-auth-foot {
    margin: 22px 0 0;
    font-size: 13.5px;
    color: var(--auth-muted);
    text-align: center;
}

/* ---------------------------------------------------------------
 * Account layout — 2-column shell with sidebar + main.
 * ------------------------------------------------------------- */

.upaper-account {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 880px) {
    .upaper-account {
        grid-template-columns: 1fr;
    }
}

.upaper-account-sidebar {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 22px;
    position: sticky;
    top: 84px;
}
@media (max-width: 880px) {
    .upaper-account-sidebar {
        position: static;
    }
}

.upaper-account-id {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--auth-border);
}
.upaper-account-avatar,
.upaper-account-id img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}
.upaper-account-name {
    font-weight: 700;
    color: var(--auth-primary);
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
    word-break: break-word;
}
.upaper-account-email {
    font-size: 12px;
    color: var(--auth-muted);
    margin: 2px 0 0;
    word-break: break-all;
}

.upaper-account-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: #f4f4f4;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--auth-text);
    letter-spacing: .02em;
}
.upaper-account-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.upaper-account-nav {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.upaper-account-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.upaper-account-nav-link:hover,
.upaper-account-nav-link:focus {
    background: var(--auth-accent-2);
    color: var(--auth-primary);
    outline: none;
}
.upaper-account-nav-link.is-active {
    background: var(--auth-primary);
    color: var(--auth-accent);
}
.upaper-account-nav-link.is-active .dashicons {
    color: var(--auth-accent);
}
.upaper-account-nav-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--auth-muted);
}
.upaper-account-logout {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px dashed var(--auth-border);
    color: var(--auth-muted);
}

/* Main content surface. */

.upaper-account-main {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 32px;
    min-height: 400px;
}
@media (max-width: 600px) {
    .upaper-account-main {
        padding: 20px;
    }
}

.upaper-account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--auth-border);
    margin-bottom: 22px;
}
.upaper-account-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--auth-primary);
    margin: 0;
    padding: 0;
    line-height: 1.25;
}
.upaper-account-header p {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: var(--auth-muted);
    flex-basis: 100%;
}

/* Gate cards (verification pending, awaiting approval, suspended). */

.upaper-account-gate {
    background: #fffbf2;
    border: 1px solid var(--auth-accent);
    border-radius: var(--auth-radius);
    padding: 20px 24px;
    margin-bottom: 22px;
}
.upaper-account-gate h2 {
    margin: 0 0 6px;
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--auth-primary);
}
.upaper-account-gate p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--auth-text);
}
.upaper-account-gate--info {
    background: #eef5fc;
    border-color: var(--auth-info);
}
.upaper-account-gate--danger {
    background: #fbeaea;
    border-color: var(--auth-error);
}

/* Quick stats tiles on the overview. */

.upaper-account-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 540px) {
    .upaper-account-stats {
        grid-template-columns: 1fr;
    }
}
.upaper-account-stat {
    background: #fafafa;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.upaper-account-stat-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--auth-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.upaper-account-stat-label {
    font-size: 12px;
    color: var(--auth-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

.upaper-account-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.upaper-account-section {
    margin-top: 28px;
}
.upaper-account-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--auth-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 12px;
    padding: 0;
}

.upaper-account-recent {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.upaper-account-recent li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--auth-radius-sm);
    border: 1px solid var(--auth-border);
    background: #fafafa;
    flex-wrap: wrap;
}
.upaper-account-recent-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.upaper-account-recent-title {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}
.upaper-account-recent-title:hover,
.upaper-account-recent-title:focus {
    color: #8a6300;
    text-decoration: underline;
}
.upaper-account-recent-meta {
    font-size: 12px;
    color: var(--auth-muted);
}

.upaper-account-empty,
.upaper-account-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--auth-muted);
    background: #fafafa;
    border: 1px dashed var(--auth-border);
    border-radius: var(--auth-radius-sm);
}
.upaper-account-empty-state .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--auth-accent);
    margin-bottom: 8px;
}

/* Filter pill row on the posts list. */

.upaper-account-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}
.upaper-account-filter a {
    padding: 6px 14px;
    border-radius: 999px;
    background: #f4f4f4;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
}
.upaper-account-filter a.is-active {
    background: var(--auth-primary);
    color: var(--auth-accent);
}

/* Articles table. */

.upaper-account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.upaper-account-table th,
.upaper-account-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--auth-border);
    vertical-align: middle;
}
.upaper-account-table thead th {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--auth-muted);
    background: #fafafa;
}
.upaper-account-table-title {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}
.upaper-account-table-title:hover,
.upaper-account-table-title:focus {
    color: #8a6300;
    text-decoration: underline;
}
.upaper-account-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
}
.upaper-td-date {
    font-size: 12.5px;
    color: var(--auth-muted);
    white-space: nowrap;
}
.upaper-td-actions {
    text-align: right;
    white-space: nowrap;
}
.upaper-account-action {
    display: inline-block;
    margin-left: 6px;
    padding: 5px 12px;
    border: 1px solid var(--auth-border);
    border-radius: 999px;
    background: #fff;
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.upaper-account-action:hover,
.upaper-account-action:focus {
    background: var(--auth-primary);
    color: var(--auth-accent);
    border-color: var(--auth-primary);
    outline: none;
}
.upaper-account-action.is-danger {
    color: #a02323;
    border-color: #f0c2c2;
}
.upaper-account-action.is-danger:hover,
.upaper-account-action.is-danger:focus {
    background: #a02323;
    color: #fff;
    border-color: #a02323;
}
.upaper-account-pagination {
    margin-top: 18px;
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}
.upaper-account-pagination a,
.upaper-account-pagination span {
    padding: 6px 12px;
    border-radius: var(--auth-radius-sm);
    background: #f4f4f4;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.upaper-account-pagination .current {
    background: var(--auth-primary);
    color: var(--auth-accent);
}

@media (max-width: 600px) {
    .upaper-account-table thead {
        display: none;
    }
    .upaper-account-table,
    .upaper-account-table tbody,
    .upaper-account-table tr,
    .upaper-account-table td {
        display: block;
        width: 100%;
    }
    .upaper-account-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--auth-border);
        border-radius: var(--auth-radius-sm);
        padding: 8px;
    }
    .upaper-account-table td {
        border-bottom: 0;
        padding: 6px 8px;
    }
    .upaper-td-actions {
        text-align: left;
    }
    .upaper-account-action {
        margin: 4px 6px 0 0;
    }
}

/* ---------------------------------------------------------------
 * Article submit / edit form — 2-column with main + sidebar.
 * ------------------------------------------------------------- */

.upaper-post-form-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}
@media (max-width: 880px) {
    .upaper-post-form-grid {
        grid-template-columns: 1fr;
    }
}
.upaper-post-form-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.upaper-post-form-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.upaper-post-form-card {
    background: #fafafa;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 14px 16px;
}
.upaper-post-form-card h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--auth-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 8px;
    padding: 0;
}
.upaper-post-form-card input[type="text"],
.upaper-post-form-card input[type="file"],
.upaper-post-form-card select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: #fff;
    font-size: 13.5px;
    color: var(--auth-text);
    box-sizing: border-box;
}
.upaper-post-form-card input[type="file"] {
    padding: 6px;
}
.upaper-post-thumb-preview {
    margin-bottom: 8px;
}
.upaper-post-thumb-preview img {
    width: 100%;
    height: auto;
    border-radius: var(--auth-radius-sm);
    display: block;
    margin-bottom: 6px;
}
.upaper-post-submit {
    width: 100%;
}
.upaper-post-back {
    text-align: center;
    margin-top: 4px;
    font-size: 13px;
}

/* TinyMCE — make sure wp_editor doesn't push past the column. */

.upaper-post-form .wp-editor-container {
    border-radius: var(--auth-radius-sm);
    overflow: hidden;
    border: 1px solid var(--auth-border);
}
.upaper-post-form .wp-editor-tabs {
    background: #fafafa;
}

/* ---------------------------------------------------------------
 * Profile editor — identity row with avatar + fields side by side.
 * ------------------------------------------------------------- */

.upaper-profile-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 700px) {
    .upaper-profile-grid {
        grid-template-columns: 1fr;
    }
}
.upaper-profile-avatar-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}
.upaper-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}
.upaper-avatar-upload {
    cursor: pointer;
}
.upaper-profile-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.upaper-profile-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.upaper-profile-form > .upaper-auth-button {
    align-self: flex-start;
}

.upaper-account-danger-zone {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px dashed var(--auth-border);
}

/* ---------------------------------------------------------------
 * RTL — UrduPaper installs default to Urdu (RTL). Most flex layouts
 * mirror automatically; these are the bits that need an explicit
 * directional flip.
 * ------------------------------------------------------------- */

.rtl .upaper-account-nav-link {
    flex-direction: row-reverse;
}
.rtl .upaper-account-recent-status {
    margin-left: 0;
    margin-right: 0;
}
.rtl .upaper-account-action {
    margin-left: 0;
    margin-right: 6px;
}
.rtl .upaper-td-actions {
    text-align: left;
}
.rtl .upaper-account-table th,
.rtl .upaper-account-table td {
    text-align: right;
}
.rtl .upaper-auth-tos {
    text-align: right;
}
