/*
 * Rana Journal 4.0: journal home page additions.
 * Only new class names (rj-*) plus two overrides for the left column, so nothing here fights older rules.
 * Logical properties only (inline-start/end): the same rules serve right-to-left and left-to-right pages.
 */

/* Left column: latest-issue card with the archive under it. It scrolls with the page: two stacked cards are taller than a screen. */
.rana-issue-side { position: static; }
.rana-issue-side > .sidebar-card { margin-top: 20px; }

/* Tabs above the issue */
.rj-tabs { display: flex; flex-wrap: wrap; gap: 0 26px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.rj-tabs a { margin-bottom: -1px; padding: 10px 2px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; }
.rj-tabs a:hover { color: var(--text); }
.rj-tabs a.is-active { border-bottom-color: var(--journal-accent); color: var(--journal-accent-ink); }
.rj-tabs a:hover, .rj-tabs a:focus { text-decoration: none; }

/* Panels: all visible without JavaScript; with it, one at a time */
.rj-panel + .rj-panel { margin-top: 36px; }
.rj-tabs-js .rj-panel { display: none; }
.rj-tabs-js .rj-panel.is-active { display: block; }
.rj-tabs-js .rj-panel + .rj-panel { margin-top: 0; }
.rj-panel-title { margin: 0 0 14px; font: 800 22px/1.4 var(--font-ui); }

/* Numbered lists: Early view, Most read */
.rj-list { margin: 0; padding: 0; list-style: none; counter-reset: rj; }
.rj-list li { counter-increment: rj; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rj-list li::before { content: counter(rj); color: var(--journal-accent-ink); font: 800 20px/1.3 var(--font-ui); }
:lang(fa) .rj-list li::before { content: counter(rj, persian); }
.rj-list-title { display: block; color: var(--text); font-weight: 700; line-height: 1.6; }
.rj-list-title:hover { color: var(--journal-accent-ink); }
.rj-list-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; }

/* Log in / Register card and account card (right column) */
.rj-login { padding: 0; overflow: hidden; }
.rj-login-tabs { display: flex; border-bottom: 1px solid var(--line); }
.rj-login-tabs > * { flex: 1; margin-bottom: -1px; padding: 13px 8px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-align: center; text-decoration: none; }
.rj-login-tabs a:hover { color: var(--text); text-decoration: none; }
.rj-login-tabs .is-active { border-bottom-color: var(--journal-accent); color: var(--text); }
.rj-login-form { display: grid; gap: 6px; padding: 16px 18px 18px; }
.rj-login-form label { font-size: 13px; font-weight: 700; }
.rj-login-form input[type="text"],
.rj-login-form input[type="password"] { width: 100%; margin-bottom: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface, #fff); color: var(--text); font: inherit; }
.rj-login-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin: 2px 0 8px; font-size: 13px; }
.rj-login-row .rj-remember { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.rj-account-links { margin: 0; padding: 0; list-style: none; }
.rj-account-links a { display: block; padding: 8px 0; border-top: 1px solid var(--line); }

/* Most read / Early view: the same article cards as the issue, same spacing between them */
.rj-cards { display: flex; flex-direction: column; gap: 28px; margin: 0; padding: 0; list-style: none; }
.rj-cards > li { margin: 0; padding: 0; }

/* Journal home hero: small, very faint line-art bookshelf in the corner (decorative). Colour follows the masthead text colour. */
.masthead-books { position: absolute; inset-block-end: 0; inset-inline-end: 0; width: 38%; height: 58%; z-index: -1; pointer-events: none; color: var(--masthead-text, #fff); opacity: .06;
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent 100%); mask-image: linear-gradient(to left, #000 35%, transparent 100%); }
html[dir="rtl"] .masthead-books { -webkit-mask-image: linear-gradient(to right, #000 35%, transparent 100%); mask-image: linear-gradient(to right, #000 35%, transparent 100%); }
.masthead-books-svg { display: block; width: 100%; height: 100%; }
@media (max-width: 760px) { .masthead-books { width: 70%; height: 40%; opacity: .045; } }
@media print { .masthead-books { display: none; } }
