/*
 * Page content. Titles and loose text sit on the blue background; content blocks are
 * white framed boxes (the phpBB style's .nklr_box). Loaded after the default theme's
 * component and page styles, which provide the structure this file restyles.
 */

.page {
    padding: 0 5px 10px;
    color: #eee;
}

/* Pages the default theme narrows use the full content width here. */
.thread-show,
.moderation-reports,
.pm-inbox,
.pm-thread { max-width: var(--page-width); }

.page a { color: #fff; }
.page a:hover { color: var(--rn-yellow); }

/* Page titles (.nklr_box_header) */
.page > h1,
.styleguide > section > h2 {
    margin: 5px 0 10px;
    color: var(--rn-title-text);
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 3px 0 #000;
    overflow-wrap: anywhere;
}

/* ---- Boxes ------------------------------------------------------------- */

.data-table,
.page article.post,
.form-stack form,
.auth-page,
.search-form,
.result-item,
.pm-inbox table,
.pm-thread .pm-message,
.passkey-table,
.moderation-reports article.report,
.thread-show .thread-closed,
.thread-moderation .post-list li,
.user-profile .profile-head,
.user-profile .bio,
.rn-profile-box,
.thread-poll,
.notif-panel,
.styleguide .sg-swatch,
.styleguide .sg-shape {
    background-color: var(--surface);
    color: var(--text);
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius);
    box-shadow: var(--rn-box-shadow);
}

:is(.data-table, .page article.post, .form-stack form, .auth-page, .search-form, .result-item, .pm-inbox table,
    .pm-thread .pm-message, .passkey-table, .moderation-reports article.report, .thread-show .thread-closed,
    .thread-moderation .post-list li, .user-profile .profile-head, .user-profile .bio, .rn-profile-box, .thread-poll, .notif-panel) a {
    color: var(--link);
}

:is(.data-table, .page article.post, .form-stack form, .auth-page, .search-form, .result-item, .pm-inbox table,
    .pm-thread .pm-message, .passkey-table, .moderation-reports article.report, .thread-show .thread-closed,
    .thread-moderation .post-list li, .user-profile .profile-head, .user-profile .bio, .rn-profile-box, .thread-poll, .notif-panel) a:hover {
    color: var(--link-hover);
}

/* ---- Buttons ----------------------------------------------------------- */

:is(.page, .auth-page) button,
:is(.page, .auth-page) button[type="submit"],
:is(.page, .auth-page) input[type="submit"] {
    padding: 5px 12px;
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius);
    background: var(--button-bg);
    color: var(--text);
    box-shadow: 0 2px 0 var(--rn-ink);
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

:is(.page, .auth-page) button:hover,
:is(.page, .auth-page) button[type="submit"]:hover,
:is(.page, .auth-page) input[type="submit"]:hover {
    background: var(--rn-coral);
    color: #fff;
}

:is(.page, .auth-page) button:disabled { opacity: 0.6; cursor: default; }

.page button[type="submit"]:is([value="delete"], [value="dismiss"]),
.passkey-danger-button { color: var(--rn-red); }

/* ---- Tables ------------------------------------------------------------ */

.data-table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    margin-bottom: 10px;
    font-size: 1rem;
}

.data-table th,
.data-table td {
    padding: 6px 8px;
    border: 0;
    border-bottom: 1px solid var(--rn-rule);
}

.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:nth-child(even) > td { background-color: var(--rn-row-alt); }

.data-table thead th {
    background: var(--thead);
    color: var(--text);
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
}

.forum-list .category-header th {
    padding: 8px;
    border-bottom: 2px solid var(--rn-ink);
    background: var(--category-header-bg);
    color: var(--category-header-text);
    font-size: 1.25em;
}

.forum-list .forum-columns th { background: var(--thead); font-weight: 700; }
.forum-overview .forum-list + .forum-list { margin-top: 15px; }
:is(.forum-overview, .subforum-list) .forum-title > a { font-size: 1.15em; font-weight: 700; text-decoration: none; }
:is(.forum-overview, .subforum-list) .forum-desc { margin: 2px 0 0; font-weight: 400; color: var(--text); }
.forum-show .subforum-list { margin-bottom: 15px; }

/* "Sub forums: A, B" under a forum's description */
.forum-list .subforums { margin: 2px 0 0; font-size: 0.9em; }
.forum-list .subforums a { font-weight: 600; text-decoration: none; }
.forum-list .subforums .fa-file { margin-right: 2px; }

/* "Threads: x | Posts: y" in the title cell, replaces the count columns on small screens */
.forum-list .forum-stats { display: none; margin: 4px 0 0; font-size: 0.9em; color: var(--text-muted); }

.thread-list .pinned-group th {
    background: var(--thead);
    color: var(--text);
    font-size: 0.85em;
    text-transform: uppercase;
}

.thread-list .thread-title a { text-decoration: none; }
.thread-list .thread-title > a:first-of-type { font-weight: 600; }
/* Title, forum, author and counts match the post body (1.15em of the 1rem base; tables are 0.95rem). */
.thread-list .thread-title > :is(a:first-of-type, span),
.thread-list td:is(.thread-forum, .thread-author, .thread-count) { font-size: 1.15rem; }

/* "by X (in Forum)" and "Replies | Views" in the title cell, replace those columns on small screens */
.thread-list :is(.thread-byline, .thread-stats) { display: none; margin: 2px 0 0; font-size: 0.9em; color: var(--text-muted); }
.thread-list .thread-last-author { display: block; color: var(--text-muted); }
.thread-list .thread-last-post-inner { display: flex; align-items: center; gap: 12px; }
.thread-list .thread-last-post-link { flex: none; font-size: 1.15em; text-decoration: none; }

/* "new" markers */
.thread-list .thread-title a.thread-new,
.forum-overview .unread-marker,
.subforum-list .unread-marker,
.pm-inbox .unread-marker {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: var(--radius);
    background: var(--rn-red);
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    text-transform: uppercase;
    vertical-align: middle;
}

.thread-list .thread-title a.thread-new:hover { background: var(--rn-coral); color: #fff; }

.page .empty-cell { color: var(--text-faint); }
.page > .empty-cell { color: #eee; }

/* ---- Posts ------------------------------------------------------------- */

/* Author column on the left, post on the right. */
.page article.rn-post {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    margin-bottom: 10px;
    padding: 0;
}

.rn-postprofile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 8px 10px 10px;
    border-right: 1px dotted var(--rn-rule);
}

.rn-postauthor { font-size: 1.35em; font-weight: 700; line-height: 1.2; text-decoration: none; overflow-wrap: anywhere; }
.rn-postrank { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; color: var(--text-muted); }
.rn-postprofile-avatar-link { line-height: 0; }

.rn-postprofile-avatar {
    width: 120px;
    height: 120px;
    margin: 6px 0;
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    object-fit: cover;
    font-size: 64px;
}

.rn-postprofile-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 5px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9em;
}

.rn-postprofile-details dd { margin: 0; }

.rn-post-main { padding: 8px 12px 12px; }

/* Header row: date on the left, actions on the right, a brand-coloured rule below. */
.rn-post .rn-post-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--rn-yellow);
    color: var(--text-muted);
    font-size: 1.05em; /* between the base size and the post body (1.15em) */
}

.rn-post .rn-post-head .post-edited { font-size: 0.9em; }

/* Selectors outweigh the default theme's .thread-show .post-meta a and the box link colour. */
.page article.rn-post .rn-post-link { color: var(--text); text-decoration: none; }
.page article.rn-post .rn-post-link:hover { color: var(--link-hover); }
.rn-post .rn-post-link .fa-file-lines { margin-right: 2px; color: var(--text-muted); }
.rn-post .rn-post-time { color: var(--text-muted); }
.rn-post .post-body { font-size: 1.15em; line-height: 1.55; }
/* Signatures read like the post itself (also in private messages, which use the post layout). */
.rn-post .signature { color: inherit; font-size: 1.15em; line-height: 1.55; }

.rn-post .post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
    font-size: inherit;
    font-weight: 700;
}

.rn-post .post-actions li + li::before { content: "|" / ""; margin: 0 5px; color: var(--text-muted); font-weight: normal; }
.rn-post .post-actions a { text-decoration: none; }
.rn-post .post-actions a:hover { text-decoration: underline; }
.rn-post .post-actions form { display: inline; margin: 0; }
.rn-post .post-actions .fa-solid { margin-right: 2px; }
.rn-post .post-actions :is(.fa-heart, .fa-heart-crack) { color: var(--rn-red); }

/* Inline post actions (like, delete) read as links, not as big buttons. */
.rn-post .post-actions button {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--link);
    font-weight: 700;
}

.rn-post .post-actions button:hover { background: none; color: var(--link-hover); text-decoration: underline; }

/* BBCode output (the plugin styles only its editor toolbar) */
.post-body .bbcode-quote {
    margin: 0.5em 0;
    padding: 6px 10px;
    border-left: 4px solid var(--rn-yellow);
    border-radius: var(--radius);
    background: var(--rn-row-alt);
}
.post-body .bbcode-quote-meta { color: var(--text-muted); font-size: 0.9em; font-weight: 700; }
.post-body .bbcode-code {
    margin: 0.5em 0;
    padding: 6px 10px;
    overflow-x: auto;
    border: 1px solid var(--rn-rule);
    border-radius: var(--radius);
    background: var(--code-bg);
    font-family: var(--font-mono);
    white-space: pre;
}
.post-body .bbcode-list { margin: 0; padding-left: 1.5em; }
.post-body .bbcode-img { max-width: 100%; height: auto; }
.post-body .bbcode-spoiler { border: 1px dashed var(--rn-rule); border-radius: var(--radius); padding: 4px 8px; }

/* Poll plugin: lighter bar track than the black --border it defaults to */
.page .thread-poll .poll-bar { background: var(--rn-rule); }
.page .thread-poll .poll-bar > span { background: var(--rn-coral); }

.thread-show .thread-closed { padding: 8px 12px; font-weight: bold; }
.thread-show .thread-toolbar { gap: 6px 12px; margin: 0 0 8px; }
.thread-show .thread-toolbar-bottom { margin: 8px 0 0; }
.thread-show .reply-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 1.1em;
}
.thread-show .reply-actions form { margin: 0; }
.page .action-button {
    gap: 6px;
    padding: 5px 12px;
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius);
    background: var(--button-bg);
    color: var(--text);
    box-shadow: 0 2px 0 var(--rn-ink);
    font-weight: bold;
}
.page a.action-button:hover { background: var(--rn-coral); color: #fff; }
.page .action-button-locked:hover,
.page .action-button-locked:focus { background: var(--rn-red); color: #fff; }

/* Moderation dropdown: summary styled like the theme's buttons, panel like its boxes. */
.mod-menu { font-size: 1.1em; }
.mod-menu > summary {
    padding: 5px 12px;
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius);
    background: var(--button-bg);
    color: var(--text);
    box-shadow: 0 2px 0 var(--rn-ink);
    font-weight: bold;
}
.mod-menu > summary:hover,
.mod-menu[open] > summary { background: var(--rn-coral); color: #fff; }
.mod-menu-list {
    top: calc(100% + 6px);
    border: 2px solid var(--rn-ink);
    box-shadow: var(--rn-box-shadow);
}
.page .mod-menu-list a,
.page .mod-menu-list button { color: var(--text); font-weight: normal; box-shadow: none; border: 0; border-radius: 0; background: none; padding: 6px 12px; }
.page .mod-menu-list a:hover,
.page .mod-menu-list button:hover,
.page .mod-menu-list a:focus-visible,
.page .mod-menu-list button:focus-visible { background: var(--rn-coral); color: #fff; }
.page .mod-menu-list .mod-menu-danger { color: var(--rn-red); }
.page .mod-menu-list .mod-menu-danger:hover { background: var(--rn-red); color: #fff; }
.mod-menu-divider { border-top-color: var(--rn-rule); }

/* ---- Member profile ---------------------------------------------------- */

.rn-profile-box {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    overflow: hidden;
}

.rn-profile-side {
    padding: 16px 12px;
    border-right: 1px solid var(--rn-rule);
    background: var(--rn-row-alt);
    text-align: center;
}

.rn-profile-avatar {
    display: inline-flex;
    width: 150px;
    height: 150px;
    margin-bottom: 14px;
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    object-fit: cover;
    font-size: 80px;
}

.rn-profile-links { margin: 0; padding: 0; list-style: none; font-weight: 700; text-align: left; }
.rn-profile-links li { margin: 3px 0; }
.rn-profile-links li::before { content: "» " / ""; }
.rn-profile-links a { text-decoration: none; }
.rn-profile-links a:hover { text-decoration: underline; }
.rn-profile-links .rn-profile-note { color: var(--text-muted); font-weight: normal; }

.rn-profile-main { padding: 10px 14px 18px; }

.rn-profile-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.rn-profile-name { font-size: 1.6em; font-weight: 700; }
.rn-profile-activity { color: var(--text-muted); }
.rn-profile-activity strong { color: var(--text); }

.rn-profile-rank {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: var(--text-muted);
}

.rn-profile-rank img { max-height: 40px; width: auto; }

.rn-profile .rn-profile-details {
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 6px 16px;
    margin: 20px 0 0 12%;
    font-size: 1.1em;
}

.rn-profile-details dt { color: var(--text); font-weight: 700; }
.rn-profile-details dd small { display: block; color: var(--text-muted); font-size: 0.85em; }
.rn-profile-lastpost { font-weight: 700; text-decoration: none; }
.rn-profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Notification panel ---------------------------------------------- */

.notif-panel { overflow: hidden; }
.notif-panel header { background: var(--rn-yellow); color: #000; border-bottom: 2px solid var(--rn-ink); }
.notif-panel header strong { text-transform: uppercase; }
.notif-panel .notification-item { border-top-color: var(--rn-rule); }
.notif-panel .notification-mark-all { padding: 4px 12px 6px; border-bottom-color: var(--rn-rule); }
.page .notif-panel .notification-link,
.notif-panel .notification-link {
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--text);
    font-weight: normal;
}
.notif-panel .notification-item.unread .notification-link { font-weight: 700; }
.page .notif-panel .notification-link:hover,
.notif-panel .notification-link:hover { background: var(--thead); color: var(--text); }

/* ---- Forms ------------------------------------------------------------- */

.form-stack form,
.search-form { padding: 10px 14px 14px; margin-bottom: 10px; }

.auth-page {
    max-width: 30rem;
    margin: 0 auto 10px;
    padding: 12px 16px 16px;
}

.auth-page h1 { margin: 0 0 8px; font-size: 1.6em; text-transform: uppercase; }

:is(.page, .auth-page) :is(input[type="text"], input[type="email"], input[type="password"], input[type="search"],
    input[type="url"], input[type="tel"], input[type="number"], select, textarea) {
    padding: 5px 8px;
    border: 2px solid var(--input-border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

:is(.page, .auth-page) :is(input, select, textarea):focus-visible {
    outline: 2px solid var(--rn-coral);
    outline-offset: 1px;
}

/* Symfony's default form theme renders field errors as a bare list. */
:is(.page, .auth-page) form ul:has(> li[id$="_error1"]) {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    color: var(--error);
    font-weight: bold;
}

/* ---- Pagination & action rows on the background -------------------- */

.page .pagination { color: #eee; }
.page .pagination a,
.page .pagination strong {
    display: inline-block;
    min-width: 2em;
    padding: 1px 6px;
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius);
    background: #fff;
    color: #000;
    text-align: center;
    text-decoration: none;
}
.page .pagination a:hover { background: var(--rn-coral); color: #fff; }
.page .pagination strong { background: var(--rn-yellow); }
.page .pagination .sep { color: #eee; }

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 700px) {
    .page article.rn-post { grid-template-columns: minmax(0, 1fr); }

    /* Author column becomes a compact row above the post. */
    .rn-postprofile {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 10px;
        border-right: 0;
        border-bottom: 1px dotted var(--rn-rule);
    }

    .rn-postprofile-avatar-link { order: -1; }
    .rn-postprofile-avatar { width: 40px; height: 40px; margin: 0; font-size: 22px; }
    .rn-postrank { flex-direction: row; align-items: center; }
    .rn-postprofile-details { display: none; }
    .rn-post .post-actions { margin-left: 0; }

    .data-table { font-size: 0.95rem; }

    .forum-list .forum-count { display: none; }
    .forum-list .forum-stats { display: block; }
    .forum-list td.forum-recent { vertical-align: middle; }

    .thread-list :is(.thread-author, .thread-forum, .thread-count) { display: none; }
    .thread-list :is(.thread-byline, .thread-stats) { display: block; }
    .thread-list td.thread-last-post { vertical-align: middle; }

    .rn-profile-box { grid-template-columns: minmax(0, 1fr); }
    .rn-profile-side { border-right: 0; border-bottom: 1px solid var(--rn-rule); }
    .rn-profile .rn-profile-details { grid-template-columns: auto minmax(0, 1fr); margin-left: 0; }
}

/* Private messages: unread state */
.pm-inbox .actions { margin: 0 0 10px; }
.pm-inbox tr.pm-unread td:first-child > a { font-weight: 700; }
.pm-thread .pm-message-unread { border-left: 4px solid var(--rn-red); }

/* User signature under posts and private messages */
.signature {
    margin-top: 1em;
    padding-top: 0.5em;
    border-top: 1px dashed var(--text-muted);
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.4;
    word-break: break-word;
}
.signature .bbcode-img { max-width: 100%; }

/* ---- Attachments --------------------------------------------------------- */

/* Previews framed like the post boxes. */
.page .attachment-preview {
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius-lg);
    box-shadow: var(--rn-box-shadow);
}

.page .attachment-preview:hover,
.page .attachment-preview:focus-visible { border-color: var(--rn-coral); }

.rn-post .post-attachments { padding-top: 8px; border-top: 1px dotted var(--rn-rule); }

.attachment-composer-item {
    border: 2px solid var(--rn-ink);
    border-radius: var(--radius-lg);
}
