/* Muallam overrides on top of the ZenBlog template (frontend/css/main.css). */

/*
 * Theme: the look of the original muallam.com - Poppins everywhere, near-black text and
 * bold headings, Bootstrap's standard blue for buttons and links.
 * Every ZenBlog and Muallam style reads these variables, so this block sets the whole look.
 */
:root {
    --default-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --heading-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --nav-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --default-color: #252525;
    --heading-color: #252525;
    --accent-color: #0d6efd;
    --accent-hover-color: #0b5ed7;
    --accent-active-color: #0a58ca;
    --nav-color: #505050;
    --nav-hover-color: #0d6efd;
    --nav-dropdown-color: #505050;
    --nav-dropdown-hover-color: #0d6efd;
    --bs-body-font-family: var(--default-font);
    --bs-link-color: #0d6efd;
    --bs-link-hover-color: #0a58ca;
}

h1, h2, h3 {
    font-weight: 700;
}

h4, h5, h6 {
    font-weight: 600;
}

a {
    color: var(--accent-color);
}

a:hover {
    color: var(--accent-active-color);
}

/* Header */
.header {
    border-bottom: 1px solid #e9ecef;
    padding: 12px 0;
}

.header .logo h1 {
    font-weight: 700;
}

.header-account-toggle {
    color: var(--default-color);
    text-decoration: none;
    font-family: var(--nav-font);
    font-size: 0.95rem;
}

.header-account-toggle:hover,
.header-account-toggle:focus {
    color: var(--accent-color);
}

.user-avatar {
    flex-shrink: 0;
    object-fit: cover;
}

.user-avatar-initials {
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--contrast-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--nav-font);
    font-weight: 600;
}

.header .dropdown-menu {
    font-family: var(--nav-font);
    font-size: 0.95rem;
}

/* The account menu matches the admin panel's (Sneat) user menu: borderless, soft shadow, roomy grey rows. */
.header .account-menu {
    min-width: 14rem;
    margin-top: 0.5rem !important;
    padding: 0.3125rem 0;
    border: 0;
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 1rem rgba(161, 172, 184, 0.45);
}

.header .account-menu .dropdown-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    color: #a1acb8;
}

.header .account-menu .dropdown-item {
    padding: 0.532rem 1.25rem;
    color: #697a8d;
    display: flex;
    align-items: center;
}

.header .account-menu .dropdown-item i {
    font-size: 1.1rem;
    line-height: 1;
}

.header .account-menu .dropdown-item:hover,
.header .account-menu .dropdown-item:focus {
    background-color: rgba(67, 89, 113, 0.04);
    color: #697a8d;
}

.header .account-menu .dropdown-divider {
    margin: 0.3125rem 0;
    border-color: #d9dee3;
}

/* Theme choice (x-theme-choices) in the account menu and on the Profile page: three buttons side by side. */
.theme-choices {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem 1rem 0.5rem;
}

.theme-choice {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.25rem;
    border: 1px solid #d9dee3;
    border-radius: 0.375rem;
    background: none;
    color: #697a8d;
    font-size: 0.8125rem;
    line-height: 1.2;
}

.theme-choice i {
    font-size: 1.05rem;
}

.theme-choice:hover,
.theme-choice:focus-visible {
    background-color: rgba(67, 89, 113, 0.06);
}

.theme-choice.active {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

/* Guests' theme menu in the header: the chosen row is marked like the member theme buttons. */
.header .account-menu .dropdown-item.active,
.header .account-menu .dropdown-item.active:hover {
    background-color: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.theme-toggle {
    font-size: 1.1rem;
    line-height: 1;
}

.theme-choices-wide {
    max-width: 24rem;
    padding: 0;
    gap: 0.5rem;
}

.theme-choices-wide .theme-choice {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
}

/* Below 1200px ZenBlog orders the logo (1) and the menu toggle (3); keep the account area between them. */
@media (max-width: 1200px) {
    .header .header-account {
        order: 2;
        margin-right: 0.75rem;
    }
}

/* Buttons in the brand colour */
.btn-accent {
    --bs-btn-color: var(--contrast-color);
    --bs-btn-bg: var(--accent-color);
    --bs-btn-border-color: var(--accent-color);
    --bs-btn-hover-color: var(--contrast-color);
    --bs-btn-hover-bg: var(--accent-hover-color);
    --bs-btn-hover-border-color: var(--accent-active-color);
    --bs-btn-active-color: var(--contrast-color);
    --bs-btn-active-bg: var(--accent-active-color);
    --bs-btn-active-border-color: #0a53be;
    font-family: var(--nav-font);
}

.btn-outline-accent {
    --bs-btn-color: var(--accent-color);
    --bs-btn-border-color: var(--accent-color);
    --bs-btn-hover-color: var(--contrast-color);
    --bs-btn-hover-bg: var(--accent-color);
    --bs-btn-hover-border-color: var(--accent-color);
    --bs-btn-active-color: var(--contrast-color);
    --bs-btn-active-bg: var(--accent-color);
    --bs-btn-active-border-color: var(--accent-color);
    font-family: var(--nav-font);
}

/* Home */
.home-hero {
    padding: 24px 0;
}

.home-hero-title {
    font-size: 1.5rem;
}

@media (min-width: 992px) {
    .home-hero-actions {
        flex: 0 0 auto;
        width: 460px;
    }
}

.empty-state {
    border: 1px dashed #dee2e6;
    border-radius: 8px;
}

/* Footer */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Error pages */
.error-page {
    padding: 96px 0;
}

.error-page .error-code {
    font-family: var(--nav-font);
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

[x-cloak] {
    display: none !important;
}

/* Sign up / sign in */
.auth-section {
    padding: 56px 0 72px;
}

.auth-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

.field-error {
    color: var(--bs-form-invalid-color);
    font-size: 0.875rem;
    min-height: 1.25rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
    z-index: 5;
}

.password-strength .progress {
    height: 4px;
}

/* Keep Bootstrap's valid/invalid icon clear of the show-password button. */
.form-control.has-toggle {
    padding-right: 4.5rem;
}

.form-control.has-toggle.is-valid,
.form-control.has-toggle.is-invalid {
    background-position: right 2.75rem center;
}

/*
 * No glow around fields: Bootstrap's focus ring (box-shadow) is switched off for inputs, text areas and
 * selects in every state. The border colour still shows which field is active (blue), invalid (red) or valid (green).
 */
.form-control:focus,
.form-select:focus,
.form-control.is-valid:focus,
.form-control.is-invalid:focus,
.form-select.is-valid:focus,
.form-select.is-invalid:focus,
.was-validated .form-control:valid:focus,
.was-validated .form-control:invalid:focus,
.was-validated .form-select:valid:focus,
.was-validated .form-select:invalid:focus {
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
}

/*
 * Floating labels in the old site's style: the label starts inside the box and, once the field is focused
 * or filled, moves up onto the top border (smaller, blue while typing). Restyles Bootstrap's .form-floating,
 * so the markup stays standard.
 */
.form-floating > .form-control,
.form-floating > .form-select {
    height: 3.25rem;
    min-height: 3.25rem;
    padding: 0.75rem 1rem;
    line-height: 1.5;
}

.form-floating > textarea.form-control {
    height: auto;
    padding-top: 0.9rem;
}

/* Bootstrap pushes the text down to make room for a label inside the box; ours sits on the border instead. */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown),
.form-floating > .form-control:-webkit-autofill {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.form-floating > textarea.form-control:focus,
.form-floating > textarea.form-control:not(:placeholder-shown) {
    padding-top: 0.9rem;
}

.form-floating > label {
    top: 50%;
    left: 0.7rem;
    height: auto;
    max-width: calc(100% - 1.4rem);
    padding: 0 0.35rem;
    border: 0;
    line-height: 1.2;
    color: #777;
    /* Same colour as the card behind it, so the label hides the border line it sits on. */
    background-color: var(--bs-card-bg, var(--bs-body-bg));
    transform: translateY(-50%);
    transform-origin: left center;
    transition: top 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.form-floating > textarea ~ label {
    top: 1.5rem;
}

.form-floating > label::after {
    display: none;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control:-webkit-autofill ~ label,
.form-floating > .form-select ~ label {
    top: 0;
    color: #252525;
    transform: translateY(-50%) scale(0.85);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-select:focus ~ label {
    color: var(--accent-color);
}

.form-floating > .form-control.is-invalid ~ label,
.form-floating > .form-select.is-invalid ~ label {
    color: var(--bs-form-invalid-color);
}

.form-floating > .form-control:disabled ~ label,
.form-floating > .form-select:disabled ~ label {
    color: var(--bs-secondary-color);
}

/* Unverified email reminder under the header */
.verify-email-banner {
    background: #fff8e1;
    border-bottom: 1px solid #f3e2a9;
    color: #5c4a12;
    font-family: var(--nav-font);
    font-size: 0.9rem;
}

/* Every public and member page: full width with the same roomy side margins, so all pages line up with the header. */
.site-container {
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 992px) {
    .site-container {
        padding-left: 48px;
        padding-right: 48px;
    }

    /* Space between the main column and the category list (home and post pages). */
    .page-sidebar {
        padding-left: 2rem;
    }
}

@media (min-width: 1400px) {
    .site-container {
        padding-left: 80px;
        padding-right: 80px;
    }

    .page-sidebar {
        padding-left: 3rem;
    }
}

/* "More from <author>": numbered so the number of posts is clear. */
.more-from-list {
    padding-left: 1.5rem;
}

.more-from-list li {
    padding-left: 4px;
    margin-bottom: 6px;
}

.more-from-list li::marker {
    color: var(--bs-secondary-color);
    font-weight: 600;
}

/* Member area: the admin panel's (Sneat) look under the site header. Colours and sizes follow admin-theme/vendor/css/*-muallam.css. */
.member-body {
    --background-color: #f5f5f9;
    background-color: #f5f5f9;
}

/* The theme pads every <section>; the member menu should meet the header like the admin menu does. */
.member-area {
    padding: 0;
}

.member-layout {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - var(--member-header-height, 82px));
}

.member-sidebar {
    flex: 0 0 260px;
    width: 260px;
    background: #fff;
    box-shadow: 0 0.125rem 0.375rem 0 rgba(161, 172, 184, 0.12);
    padding: 1.25rem 0 1.5rem;
}

.member-sidebar-user {
    padding: 0 1.5rem 0.75rem;
    min-width: 0;
}

.member-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    position: sticky;
    top: calc(var(--member-header-height, 82px) + 0.5rem);
}

.member-menu-header {
    padding: 1rem 2rem 0.5rem;
    color: #a1acb8;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.member-menu-item {
    position: relative;
    margin-bottom: 2px;
}

.member-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 1rem;
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    color: #697a8d;
    font-size: 0.9375rem;
    transition: background-color 0.15s, color 0.15s;
}

.member-menu-link i {
    font-size: 1.15rem;
}

.member-menu-link:hover,
.member-menu-link:focus-visible {
    background-color: rgba(67, 89, 113, 0.06);
    color: #566a7f;
}

.member-menu-item.active > .member-menu-link {
    background-color: rgba(13, 110, 253, 0.16);
    color: #0d6efd;
    font-weight: 500;
}

/* The bar on the right edge of the active item, as in the admin menu. */
.member-menu-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0.25rem;
    border-radius: 0.375rem 0 0 0.375rem;
    background: #0d6efd;
}

.member-page {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.625rem 1.5rem 2.5rem;
}

@media (min-width: 1200px) {
    .member-page {
        padding: 1.625rem 2.5rem 3rem;
    }
}

.member-page-title {
    font-size: 1.375rem;
    font-weight: 700;
}

/* Cards, lists and tables inside the member area look like the admin panel's. */
.member-area .card,
.member-area .list-group,
.member-area .empty-state {
    border: 0;
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 2px 6px 0 rgba(67, 89, 113, 0.12);
}

.member-area .card-header {
    padding: 1.25rem 1.5rem;
    background-color: transparent;
    border-bottom: 1px solid #eceef1;
}

.member-area .card-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.member-area .list-group-item {
    border-color: #eceef1;
}

.member-area .list-group-flush > .list-group-item {
    border-left: 0;
    border-right: 0;
}

.member-area .table > thead th {
    color: #566a7f;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.member-area .form-control,
.member-area .form-select {
    border-color: #d9dee3;
    border-radius: 0.375rem;
}

.member-area .form-control:focus,
.member-area .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0.25rem 0.05rem rgba(13, 110, 253, 0.1);
}

/* The editor's writing area stays white on the grey member page. */
.member-area .post-editor .ql-container.ql-snow {
    background-color: #fff;
}

.member-area .btn-accent {
    box-shadow: 0 0.125rem 0.25rem 0 rgba(13, 110, 253, 0.4);
}

.member-footer {
    padding: 1rem 1.5rem;
    background: #f5f5f9;
    border-top: 1px solid #e4e6e8;
}

/* Centred under the page column (right of the menu), clear of the back-to-top button. */
@media (min-width: 992px) {
    .member-footer {
        padding-left: calc(260px + 1.5rem);
        padding-right: 4.5rem;
    }
}

/* Below lg the menu becomes a white strip of scrollable tabs above the page. */
@media (max-width: 991.98px) {
    .member-layout {
        flex-direction: column;
        min-height: 0;
    }

    .member-sidebar {
        flex-basis: auto;
        width: 100%;
        padding: 0.5rem 0;
    }

    .member-menu {
        position: static;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 0.75rem;
    }

    .member-menu-header {
        display: none;
    }

    .member-menu-link {
        margin: 0 0.125rem;
        white-space: nowrap;
    }

    .member-menu-item.active::before {
        display: none;
    }
}

/* Light "label" badges and icon backgrounds, as in the admin panel (bg-label-*). */
.bg-label-primary { background-color: #e7f1ff !important; color: #0d6efd !important; }
.bg-label-success { background-color: #e8fadf !important; color: #71dd37 !important; }
.bg-label-info { background-color: #d7f5fc !important; color: #03c3ec !important; }
.bg-label-warning { background-color: #fff2d6 !important; color: #ffab00 !important; }
.bg-label-danger { background-color: #ffe0db !important; color: #ff3e1d !important; }
.bg-label-secondary { background-color: #ebeef0 !important; color: #8592a3 !important; }

/* Admin-style stat tiles (member dashboard). */
.stat-tile .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-tile .stat-value {
    font-family: var(--nav-font);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--heading-color);
}

/* Every status badge is as wide as the longest label ("Restricted"), so they line up. */
.post-status-badge {
    display: inline-block;
    min-width: 6.25rem;
    text-align: center;
}

/* Profile page */
.profile-photo-preview {
    width: 96px;
    height: 96px;
}

.settings-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
}

.profile-link {
    font-size: 0.9rem;
    background: #f1f3f5;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Courses */
.course-cover-preview {
    display: block;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.course-search {
    flex: 1 1 240px;
    max-width: 420px;
}

.course-currency {
    flex: 0 0 96px;
    max-width: 96px;
}

.course-card .course-card-image {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.course-card .course-card-placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e7f1ff, #f5f5f9);
    color: var(--accent-color);
    font-size: 2.5rem;
    border-radius: 10px 10px 0 0;
}

.course-price {
    font-family: var(--nav-font);
    font-weight: 700;
    color: var(--heading-color);
}

.course-hero-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
}

.course-facts li + li {
    border-top: 1px solid #eceef1;
}

.course-syllabus .list-group-item {
    border-color: #eceef1;
}

/* Payment instructions in the enrol box (signed-in members only). */
.payment-instructions {
    background: #fff8e6;
    border: 1px solid #ffe2a8;
    border-radius: 8px;
    padding: 10px 12px;
}

/* Classroom */
.classroom-syllabus {
    position: sticky;
    top: calc(var(--member-header-height, 82px) + 1rem);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.classroom-section + .classroom-section {
    border-top: 1px solid #eceef1;
}

.classroom-section-title {
    padding: 0.85rem 1rem 0.35rem;
    font-family: var(--nav-font);
    font-weight: 600;
    font-size: 0.9rem;
}

.classroom-lecture-link {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.45rem 1rem 0.45rem 1.25rem;
    color: var(--default-color);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.classroom-lecture-link:hover {
    background: #f5f8ff;
}

.classroom-lecture-link.active {
    background: #e7f1ff;
    border-left-color: var(--accent-color);
    color: var(--accent-color);
    font-weight: 500;
}

.classroom-meeting {
    background: #f5f8ff;
    border-radius: 8px;
}

/* Profile links editor (Profile page). */
.social-link-row-icon {
    width: 42px;
    justify-content: center;
    color: #495057;
}

.social-link-platform {
    flex: 0 0 200px;
    max-width: 200px;
}

/* Profile links (x-social-links): round icon buttons under the bio. */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f3f5;
    color: #495057;
    transition: background-color 0.15s, color 0.15s;
}

.social-link-sm {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
}

.social-link-md {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
}

.social-link:hover,
.social-link:focus-visible {
    background: var(--accent-color);
    color: #fff;
}

.profile-bio {
    font-size: 1rem;
    line-height: 1.75;
}

/* Category and post cards */
.category-card,
.post-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    color: var(--default-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.category-card:hover,
.post-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Card halves: the top (image, title, summary) opens the post, the strip below the line opens the author. */
.post-card-main,
.post-card-author {
    color: inherit;
    text-decoration: none;
}

.post-card-title {
    color: var(--heading-color);
    transition: color 0.2s;
}

a.post-card-main:hover .post-card-title,
a.post-card-main:focus-visible .post-card-title {
    color: var(--accent-color);
}

.post-card-author {
    border-top: 1px solid #e9ecef;
    padding: 0.75rem var(--bs-card-spacer-x);
    border-radius: 0 0 10px 10px;
    transition: background-color 0.2s;
}

a.post-card-author:hover,
a.post-card-author:focus-visible {
    background-color: #f5f8ff;
}

a.post-card-author:hover .post-card-author-name,
a.post-card-author:focus-visible .post-card-author-name {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Post editor */
.post-editor {
    position: relative;
}

/* The toolbar stays visible below the sticky site header while a long post is scrolled. */
.post-editor .ql-toolbar.ql-snow {
    border-radius: 8px 8px 0 0;
    border-color: #dee2e6;
    background: #f8f9fa;
    position: sticky;
    top: var(--editor-sticky-top, 0px);
    z-index: 6;
}

/* Room on the left of each line for the "+" insert button. */
.post-editor .ql-editor {
    padding-left: 48px;
}

.post-editor .ql-editor.ql-blank::before {
    left: 48px;
}

/* Floating format bar shown above selected text. */
.editor-bubble {
    position: absolute;
    z-index: 7;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: #212529;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.editor-bubble button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #f8f9fa;
    font-size: 1.05rem;
    line-height: 1;
}

.editor-bubble button:hover,
.editor-bubble button:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

.editor-bubble button.active {
    color: #8ab4ff;
}

.editor-bubble-separator {
    align-self: stretch;
    width: 1px;
    margin: 4px 2px;
    background: rgba(255, 255, 255, 0.25);
}

/* "+" at the start of an empty line, opening image / heading / list / quote / code. */
.editor-plus {
    position: absolute;
    left: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-plus-toggle {
    width: 30px;
    height: 30px;
    border: 1px solid #adb5bd;
    border-radius: 50%;
    background: #fff;
    color: #6c757d;
    line-height: 1;
    transition: transform 0.15s, color 0.15s, border-color 0.15s;
}

.editor-plus-toggle:hover,
.editor-plus-toggle.open {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.editor-plus-toggle.open {
    transform: rotate(45deg);
}

.editor-plus-menu {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.editor-plus-menu button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--accent-color);
    font-size: 1.05rem;
}

.editor-plus-menu button:hover,
.editor-plus-menu button:focus-visible {
    background: #f1f3f5;
}

.post-editor .ql-container.ql-snow {
    border-radius: 0 0 8px 8px;
    border-color: #dee2e6;
    min-height: 480px;
    font-family: var(--default-font);
    font-size: 1rem;
}

.post-editor.is-invalid .ql-toolbar.ql-snow,
.post-editor.is-invalid .ql-container.ql-snow {
    border-color: var(--bs-form-invalid-border-color);
}

/* Editor steps: 1 Write, 2 Publishing options */
.editor-steps {
    align-items: center;
}

.editor-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: none;
    padding: 4px 0;
    color: var(--bs-secondary-color);
    font-family: var(--nav-font);
    font-weight: 600;
}

.editor-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    font-size: 0.85rem;
}

.editor-step.active {
    color: var(--heading-color);
}

.editor-step.active .editor-step-number {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--contrast-color);
}

.editor-step-divider {
    width: 40px;
    height: 2px;
    background: #dee2e6;
}

.editor-option + .editor-option {
    margin-top: 10px;
}

/* Always-visible explanation under an option: smaller and dimmer than the option itself. */
.option-help {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

/* "?" beside an option; its explanation shows as a tooltip. */
.help-tip {
    border: 0;
    background: none;
    padding: 0 2px;
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    line-height: 1;
    vertical-align: baseline;
}

.help-tip:hover,
.help-tip:focus-visible {
    color: var(--accent-color);
}

/* Floating image-upload progress in the post editor */
.upload-indicator {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 1080;
    width: min(320px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    font-family: var(--nav-font);
    font-size: 0.9rem;
}

.upload-indicator .spinner-border {
    color: var(--accent-color);
}

.upload-indicator .progress {
    height: 6px;
}

.upload-indicator .progress-bar {
    background-color: var(--accent-color);
    transition: width 0.2s;
}

/* Thin bar at the top of the page while a form is being sent (layouts/app). */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 2000;
    background: var(--accent-color);
    opacity: 0;
    pointer-events: none;
}

.page-loading.active {
    opacity: 1;
    width: 85%;
    transition: width 8s cubic-bezier(0.1, 0.7, 0.2, 1);
}

.editor-actions {
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
}

.featured-preview {
    max-height: 200px;
    width: 100%;
    object-fit: cover;
}

.post-filters .nav-link {
    font-family: var(--nav-font);
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
}

.post-filters .nav-link.active {
    background: var(--accent-color);
}

/* Post card image */
.post-card-image {
    height: 180px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

/* Preview */
.preview-banner {
    background: #e7f1ff;
    border-bottom: 1px solid #b6d4fe;
    color: #084298;
    font-family: var(--nav-font);
    font-size: 0.9rem;
}

/* Admin changes (word-by-word highlights for the author) */
.diff-added {
    background: #d1e7dd;
    color: #0a3622;
    text-decoration: none;
    border-radius: 3px;
    padding: 0 2px;
}

.diff-removed {
    background: #f8d7da;
    color: #58151c;
    text-decoration: line-through;
    border-radius: 3px;
    padding: 0 2px;
}

.post-diff .diff-block {
    margin-bottom: 0.9rem;
    line-height: 1.7;
}

.post-diff .diff-block-same {
    color: #6c757d;
}

.post-diff .diff-block-changed,
.post-diff .diff-block-added,
.post-diff .diff-block-removed {
    border-left: 3px solid var(--accent-color);
    padding-left: 0.75rem;
}

.post-diff .diff-heading {
    font-weight: 600;
    font-size: 1.15rem;
}

.post-diff .diff-list-item::before {
    content: "\2022  ";
}

.post-diff .diff-quote {
    font-style: italic;
}

/* Full post */
.post-article-title {
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    line-height: 1.2;
}

.post-article-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 10px;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    overflow-wrap: break-word;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content blockquote {
    border-left: 4px solid #dee2e6;
    padding-left: 1rem;
    color: var(--bs-secondary-color);
    font-style: italic;
}

.post-content pre {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-content .ql-align-center { text-align: center; }
.post-content .ql-align-right { text-align: right; }
.post-content .ql-align-justify { text-align: justify; }

.post-footer {
    border-top: 1px solid #e9ecef;
}

.author-box {
    background: #f8f9fa;
    border-radius: 10px;
}

/* Search */

.header-search .form-control {
    width: 180px;
    border-radius: 20px;
    font-family: var(--nav-font);
}

/* Home page: featured slider */
.featured-slider {
    border-radius: 12px;
    overflow: hidden;
}

.featured-slide {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 400px;
    color: #fff;
    text-decoration: none;
    background: #252525;
}

.featured-slide-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.featured-slide:hover .featured-slide-image {
    transform: scale(1.03);
}

/* Darkens the bottom of the picture so the white text stays readable on any photo. */
.featured-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0) 80%);
}

.featured-slide-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    padding: 2rem 2.5rem 2.75rem;
}

.featured-slide-category {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    font-family: var(--nav-font);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3em 0.75em;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.featured-slide-title {
    color: #fff;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.featured-slide-summary {
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0.75rem;
}

.featured-slide-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.featured-slider .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.6;
}

.featured-slider .swiper-pagination-bullet-active {
    background: var(--accent-color);
    opacity: 1;
}

.featured-slider .swiper-button-prev,
.featured-slider .swiper-button-next {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #252525;
    top: 45%;
}

.featured-slider .swiper-button-prev::after,
.featured-slider .swiper-button-next::after {
    font-size: 1rem;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .featured-slide {
        height: 300px;
    }

    .featured-slide-content {
        padding: 1.25rem 1.25rem 2.25rem;
    }

    .featured-slider .swiper-button-prev,
    .featured-slider .swiper-button-next {
        display: none;
    }
}

/* Home page: section headings and category blocks */
.home-section-heading {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.post-mini-list li + li {
    border-top: 1px solid #e9ecef;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}

.post-mini {
    color: var(--default-color);
    text-decoration: none;
}

.post-mini-image {
    flex: 0 0 auto;
    width: 84px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
}

.post-mini-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #adb5bd;
    font-size: 1.4rem;
}

.post-mini-title {
    font-family: var(--heading-font);
    font-weight: 600;
    line-height: 1.35;
    color: var(--heading-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.post-mini:hover .post-mini-title,
.post-mini:focus-visible .post-mini-title {
    color: var(--accent-color);
}

/* Visitors who asked their system for less motion get no scroll animations. */
@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .featured-slide-image {
        transition: none;
    }
}

/* Share buttons (post page): round brand-coloured icons */
.share-label {
    font-family: var(--nav-font);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--heading-color);
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 1.05rem;
    text-decoration: none;
    transition: transform 0.15s, filter 0.15s;
}

.share-button:hover,
.share-button:focus-visible {
    color: #fff;
    filter: brightness(0.9);
    transform: translateY(-2px);
}

.share-facebook { background: #1877f2; }
.share-whatsapp { background: #25d366; }
.share-linkedin { background: #0a66c2; }
.share-x { background: #000; }
.share-telegram { background: #229ed9; }
.share-email { background: #6c757d; }
.share-copy,
.share-native { background: #e9ecef; color: #252525; }

.share-copy:hover,
.share-copy:focus-visible,
.share-native:hover,
.share-native:focus-visible {
    color: #252525;
}

.share-copy.is-copied {
    background: #198754;
    color: #fff;
}

.share-copied {
    color: #198754;
}

@media (prefers-reduced-motion: reduce) {
    .share-button {
        transition: none;
    }

    .share-button:hover {
        transform: none;
    }
}

/* Online status: green dot on avatars, "Active now" on the bio page */
.user-avatar-presence {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.online-dot {
    position: absolute;
    right: 2%;
    bottom: 2%;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px #fff;
}

.presence-label {
    color: var(--bs-secondary-color);
}

.presence-label.is-online {
    color: #15803d;
    font-weight: 500;
}

.presence-label.is-online::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 0.4rem;
    border-radius: 50%;
    background: #22c55e;
    vertical-align: 0.05em;
}

/* Contact page */
.contact-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

/* Spam trap: kept off-screen rather than display:none, which some bots skip. */
.contact-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Privacy policy and terms */
.legal-page {
    line-height: 1.75;
}

.legal-page h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 90px;
}

.legal-toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.legal-toc ol {
    columns: 2;
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

@media (max-width: 575.98px) {
    .legal-toc ol {
        columns: 1;
    }
}

/* Right-hand sidebar (home and post pages): categories now, space for ads later */
.site-sidebar {
    position: sticky;
    top: 90px;
}

.sidebar-box {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.25rem;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--heading-color);
    margin-bottom: 0.75rem;
}

.sidebar-categories a {
    display: block;
    padding: 0.4rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: 6px;
    color: var(--default-color);
    font-family: var(--nav-font);
    font-size: 0.95rem;
}

.sidebar-categories a:hover {
    background: #f1f5ff;
    color: var(--accent-color);
}

.sidebar-categories a.active {
    background: var(--accent-color);
    color: var(--contrast-color);
    font-weight: 500;
}

/* Below the large breakpoint the sidebar drops under the content and should scroll normally. */
@media (max-width: 991.98px) {
    .site-sidebar {
        position: static;
    }
}

/* Breadcrumbs */
.site-breadcrumbs .breadcrumb {
    font-family: var(--nav-font);
}

.site-breadcrumbs .breadcrumb-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.site-breadcrumbs .breadcrumb-item a:hover {
    text-decoration: underline;
}

.site-breadcrumbs .breadcrumb-item.active {
    color: var(--bs-secondary-color);
}

/* Like button */
.like-button {
    border: 1px solid #dee2e6;
    border-radius: 20px;
    color: var(--default-color);
    font-family: var(--nav-font);
    padding: 0.2rem 0.75rem;
}

.like-button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.like-button.is-liked {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--contrast-color);
}

.like-button .like-count {
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Comments */
.comments {
    border-top: 1px solid #e9ecef;
    padding-top: 1.5rem;
}

.comment {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f1f3f5;
    scroll-margin-top: 90px;
}

.comment-replies {
    margin-left: 2.75rem;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
}

.comment-replies .comment:last-child {
    border-bottom: 0;
}

.comment-body {
    overflow-wrap: anywhere;
}

.comment-hidden > .d-flex {
    opacity: 0.6;
}

.comment-actions .btn-link {
    text-decoration: none;
    font-family: var(--nav-font);
}

/* Join codes are upper case; the placeholder keeps its normal case. */
.join-code-input {
    text-transform: uppercase;
}

.join-code-input::placeholder {
    text-transform: none;
}
