/* CSS Variables */
/* CSS Variables */
:root {
    color-scheme: light;
    --button-text: #f8e0bb;
    --button-hover-text: #36312a;
    --text-secondary: #625b52;
    --border-color: #8b8173;
    --link-color-rgb: 54, 49, 42;
    --info-bg: #e7f3ff;
    --info-text: #163d5c;
    --info-border: #7da4c4;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #6b9975;
    --warning-bg: #fff3cd;
    --warning-text: #654c03;
    --warning-border: #a08025;
    --danger-bg: #f8d7da;
    --danger-text: #9b1c2a;
    --danger-border: #bb6770;
    --danger-action: #b42335;
    --danger-action-hover: #931c2b;
    --success-action: #20743a;
    --success-action-hover: #17572b;
    --info-action: #075bb5;
    --info-action-hover: #06488f;
    --action-text: #fff;
    --accent-color: var(--link-color);
    --accent-hover: var(--link-hover);
    --hover-color: var(--form-bg);
    --card-background: var(--card-bg);
    --input-background: var(--container-bg);

    --title-logo-img: url("images/logos/logo-regular.71a13102702d.svg");
    --simple-logo-img: url("images/logos/logo-simple.1bbe868b9e90.svg");
    --friend-request-btn: url("images/icons/olive-branch-frnd-rqst-btn-icon-inverted.d02088195609.svg");
    --unfriend-icon: url("images/icons/unfriend-icon-black.675eeecafeb5.svg");
    --direct-message-btn: url("images/icons/quill-msg-btn-icon-inverted.8eb2b251c34b.svg");
    --like-greyed-out: url("images/icons/heart-grey.6383d824cc9e.svg");
    --liked-icon: url("images/icons/heart-black.030928f74112.svg");
    --comment-icon: url("images/icons/comment-white.f986deca77e4.svg");
    --blog-icon: url("images/icons/blog-icon-black.3a9099acadf5.svg");
    --stories-icon: url("images/icons/stories-icon-black.8934d1182a66.svg");
    --conversations-icon: url("images/icons/Conversations-black.d0859c3fff5c.svg");
    --notifications-icon: url("images/icons/bell-icon-black.fb4245f58f89.svg");
    --settings-icon: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDMTMuMSAyIDE0IDIuOSAxNCA0VjVDMTUuNiA1LjIgMTcuMSA1LjcgMTguNCA2LjZMMTkuMyA1LjdDMjAuMSA0LjkgMjEuMyA0LjkgMjIuMSA1LjdDMjIuOSA2LjUgMjIuOSA3LjcgMjIuMSA4LjVMMjEuMiA5LjRDMjIuMSAxMC43IDIyLjYgMTIuMiAyMi44IDEzLjhIMjMuOEMyNC45IDEzLjggMjUuOCAxNC43IDI1LjggMTUuOEMyNS44IDE2LjkgMjQuOSAxNy44IDIzLjggMTcuOEgyMi44QzIyLjYgMTkuNCAyMi4xIDIwLjkgMjEuMiAyMi4yTDIyLjEgMjMuMUMyMi45IDIzLjkgMjIuOSAyNS4xIDIyLjEgMjUuOUMyMS4zIDI2LjcgMjAuMSAyNi43IDE5LjMgMjUuOUwxOC40IDI1QzE3LjEgMjUuOSAxNS42IDI2LjQgMTQgMjYuNlYyN0MxNCAyOC4xIDEzLjEgMjkgMTIgMjlDMTAuOSAyOSAxMCAyOC4xIDEwIDI3VjI2LjZDOC40IDI2LjQgNi45IDI1LjkgNS42IDI1TDQuNyAyNS45QzMuOSAyNi43IDIuNyAyNi43IDEuOSAyNS45QzEuMSAyNS4xIDEuMSAyMy45IDEuOSAyMy4xTDIuOCAyMi4yQzEuOSAyMC45IDEuNCAzOS40IDEuMiAxNy44SDAuMkMtMC45IDE3LjggLTEuOCAxNi45IC0xLjggMTUuOEMtMS44IDE0LjcgLTAuOSAxMy44IDAuMiAxMy44SDEuMkMxLjQgMTIuMiAxLjkgMTAuNyAyLjggOS40TDEuOSA4LjVDMS4xIDcuNyAxLjEgNi41IDEuOSA1LjdDMi43IDQuOSAzLjkgNC45IDQuNyA1LjdMNS42IDYuNkM2LjkgNS43IDguNCA1LjIgMTAgNVY0QzEwIDIuOSAxMC45IDIgMTIgMlpNMTIgMTVDMTMuNjYgMTUgMTUgMTMuNjYgMTUgMTJDMTUgMTAuMzQgMTMuNjYgOSAxMiA5QzEwLjM0IDkgOSAxMC4zNCA5IDEyQzkgMTMuNjYgMTAuMzQgMTUgMTIgMTVaIiBmaWxsPSIjMzYzMTJhIi8+Cjwvc3ZnPgo=");
    --background: #f2f2f2;
    --bg-theme-image: url("images/white-paper-2026-09.acea42268899.jpg");
    --header-bg: #f8e0bb;
    --header-color: #36312a;
    --title-txt-color: #000;
    --container-bg: #fff;
    --text-color: #222;
    --form-bg: #f8f4ee;
    --button-bg: #36312a;
    --button-hover: #f8e0bb;
    --link-color: #36312a;
    --link-hover: #514431;
    --error-bg: #ffe5e5;
    --error-color: #b20000;
    --card-bg: #fffbe6;
    --card-title: #36312a;
    --shadow: 0 4px 24px rgba(54, 45, 32, 0.08);
    --link-text-shadow: 2px 2px 4px rgba(54, 45, 32, 0.08);
    --border-radius: 12px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --button-text: #36312a;
    --button-hover-text: #f8e0bb;
    --text-secondary: #c5bdb2;
    --border-color: #968978;
    --link-color-rgb: 248, 224, 187;
    --info-bg: #203b50;
    --info-text: #d2eaff;
    --info-border: #6e9ab9;
    --success-bg: #233e2c;
    --success-text: #bce9c7;
    --success-border: #6a9f78;
    --warning-bg: #493c1c;
    --warning-text: #ffe3a0;
    --warning-border: #b79a52;
    --danger-bg: #49272d;
    --danger-text: #ffb9c1;
    --danger-border: #b77b83;

    --title-logo-img: url("images/logos/logo-inverted.dc5f8050ce88.svg");
    --simple-logo-img: url("images/logos/logo-inverted-simple.3b0d295838a8.svg");
    --friend-request-btn: url("images/icons/olive-branch-frnd-rqst-btn-icon.32f2d3f512f1.svg");
    --unfriend-icon: url("images/icons/unfriend-icon-white.7b3b4bf95388.svg");
    --direct-message-btn: url("images/icons/quill-msg-btn-icon.af435ac7a360.svg");
    --like-greyed-out: url("images/icons/heart-grey.6383d824cc9e.svg");
    --liked-icon: url("images/icons/heart-white.b6f69cb70887.svg");
    --comment-icon: url("images/icons/comment-no-outline.56086757388f.svg");
    --blog-icon: url("images/icons/blog-icon-white.ac16c7a0d6fb.svg");
    --stories-icon: url("images/icons/stories-icon-white.30319085c818.svg");
    --conversations-icon: url("images/icons/Conversations-white.030bb1585222.svg");
    --notifications-icon: url("images/icons/bell-icon-white.3384e8a99571.svg");
    --settings-icon: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDMTMuMSAyIDE0IDIuOSAxNCA0VjVDMTUuNiA1LjIgMTcuMSA1LjcgMTguNCA2LjZMMTkuMyA1LjdDMjAuMSA0LjkgMjEuMyA0LjkgMjIuMSA1LjdDMjIuOSA2LjUgMjIuOSA3LjcgMjIuMSA4LjVMMjEuMiA5LjRDMjIuMSAxMC43IDIyLjYgMTIuMiAyMi44IDEzLjhIMjMuOEMyNC45IDEzLjggMjUuOCAxNC43IDI1LjggMTUuOEMyNS44IDE2LjkgMjQuOSAxNy44IDIzLjggMTcuOEgyMi44QzIyLjYgMTkuNCAyMi4xIDIwLjkgMjEuMiAyMi4yTDIyLjEgMjMuMUMyMi45IDIzLjkgMjIuOSAyNS4xIDIyLjEgMjUuOUMyMS4zIDI2LjcgMjAuMSAyNi43IDE5LjMgMjUuOUwxOC40IDI1QzE3LjEgMjUuOSAxNS42IDI2LjQgMTQgMjYuNlYyN0MxNCAyOC4xIDEzLjEgMjkgMTIgMjlDMTAuOSAyOSAxMCAyOC4xIDEwIDI3VjI2LjZDOC40IDI2LjQgNi45IDI1LjkgNS42IDI1TDQuNyAyNS45QzMuOSAyNi43IDIuNyAyNi43IDEuOSAyNS45QzEuMSAyNS4xIDEuMSAyMy45IDEuOSAyMy4xTDIuOCAyMi4yQzEuOSAyMC45IDEuNCAzOS40IDEuMiAxNy44SDAuMkMtMC45IDE3LjggLTEuOCAxNi45IC0xLjggMTUuOEMtMS44IDE0LjcgLTAuOSAxMy44IDAuMiAxMy44SDEuMkMxLjQgMTIuMiAxLjkgMTAuNyAyLjggOS40TDEuOSA4LjVDMS4xIDcuNyAxLjEgNi41IDEuOSA1LjdDMi43IDQuOSAzLjkgNC45IDQuNyA1LjdMNS42IDYuNkM2LjkgNS43IDguNCA1LjIgMTAgNVY0QzEwIDIuOSAxMC45IDIgMTIgMlpNMTIgMTVDMTMuNjYgMTUgMTUgMTMuNjYgMTUgMTJDMTUgMTAuMzQgMTMuNjYgOSAxMiA5QzEwLjM0IDkgOSAxMC4zNCA5IDEyQzkgMTMuNjYgMTAuMzQgMTUgMTIgMTVaIiBmaWxsPSIjZjhlMGJiIi8+Cjwvc3ZnPgo=");
    --background: #222;
    --bg-theme-image: url("images/black-paper-2026-09.7703cff51246.png");
    --header-bg: #36312a;
    --header-color: #f8e0bb;
    --title-txt-color: #fff;
    --container-bg: #2d2d2d;
    --text-color: #f2f2f2;
    --form-bg: #36312a;
    --button-bg: #f8e0bb;
    --button-hover: #4e4231;
    --link-color: #f8e0bb;
    --link-hover: #ffe7c5;
    --error-bg: #4e4231;
    --error-color: #f8e0bb;
    --card-bg: #36312a;
    --card-title: #f8e0bb;
    --shadow: 0 4px 24px rgba(236, 203, 155, 0.08);
    --link-text-shadow: 2px 2px 4px  rgba(236, 203, 155, 0.08);
    --border-radius: 12px;
}


/* Import fonts must come before other rules (except @charset) */
@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Define the custom font */
@font-face {
    font-family: 'Brother Signature';
    src: url("brother-signature-font/BrotherSignature-7BWnK.f6efbc31131d.otf") format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* HTML Elements */
a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.2s;
}
a:hover {
    color: var(--card-title);
    text-shadow: var(--link-text-shadow)
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background-image: var(--bg-theme-image);
    background-color: var(--background);
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    max-width: 100vw;
    /* Base font size increase for better mobile readability */
    font-size: 16px;
    line-height: 1.5;
}    

header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100vw;
    display: grid;
    place-items: center;
    background-color: var(--header-bg);
}

header.site-header {
    color: var(--title-txt-color);
    box-shadow: var(--shadow);
    padding: 0;
    margin-bottom: 0;
    width: 100vw;
}

hr {
    border: none;
    border-top: 1.5px solid var(--border-color);
    margin: 24px 0;
}   

html {
    width: 100vw;
    overflow-x: hidden;
}

li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
}    

li:last-child {
    border-bottom: none;
}    

main {
    max-width: 900px;
    margin: 48px auto 0px auto;
    padding: 0 16px 48px 16px;
    display: grid;
    place-items: center;
}    

svg {
    display: block;
    margin-bottom: 10px;
}    

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}    

.auth-link {
    color: var(--title-txt-color);
    text-decoration: none;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    transition: background 0.2s, color 0.2s;
    font-size: 1.1rem;
    justify-content: space-between;
    display: inline-block;
}    

.auth-link:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}    

.notification-link {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

.notification-bell {
    font-size: 1.1rem;
}

.notification-badge {
    background: var(--danger-action);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -2px;
    right: -2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Navigation Icon Styles */
.nav-icon-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    transition: 0.2s;
}
.nav-icon-link:hover .nav-icon {
    scale: 1.1;
}

.blog-icon {
    background-image: var(--blog-icon);
}

.chapter-box-card {
    background-color: var(--form-bg);
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--button-bg);
    margin-bottom: 24px;
}

.conversations-icon {
    background-image: var(--conversations-icon);
}

.notifications-icon {
    background-image: var(--notifications-icon);
}

.settings-icon {
    background-image: var(--settings-icon);
}

/* Desktop: Hide text, show only icons */
@media (min-width: 769px) {
    .nav-icon-link .nav-text {
        display: none;
    }
    
    .nav-icon-link:hover .nav-text {
        display: inline;
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--container-bg);
        color: var(--text-color);
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 0.85rem;
        white-space: nowrap;
        box-shadow: var(--shadow);
        border: 1px solid var(--form-bg);
        z-index: 1000;
    }
}

/* Mobile: Show both icon and text */
@media (max-width: 768px) {
    .nav-icon-link {
        justify-content: flex-start;
    }
    
    .nav-icon-link .nav-text {
        display: inline;
    }
}

/* Profile Link Styles */
.profile-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.nav-profile-picture {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.profile-username {
    white-space: nowrap;
}

/* Profile Page Icon Button Styles */
.profile-icon-btn {
    display: flex !important;
    align-items: center;
    padding: 0px;
    transition: all 0.2s ease;
    background: none;
    border:none;
}

.profile-action-icon {
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.profile-icon-btn .dm-icon {
    background-image: var(--direct-message-btn);
}

.profile-icon-btn .unfriend-icon {
    background-image: var(--friend-request-btn);
}
.profile-icon-btn:hover .unfriend-icon {
    background-image: var(--unfriend-icon);
}


.profile-icon-btn .friend-request-icon {
    background-image: var(--friend-request-btn);
    transition: background-image 0.3s ease;
}


/* Desktop: Hide text, show only icons with tooltips */
@media (min-width: 769px) {
    .profile-icon-btn .profile-action-text {
        display: none;
    }
    
    /* Specific styling for unfriend text outside button */
    form .profile-action-text {
        display: none;
    }
    
    .profile-icon-btn:hover {
        position: relative;
    }
    
    .profile-icon-btn:hover .profile-action-text {
        display: inline;
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--container-bg);
        color: var(--text-color);
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 0.85rem;
        white-space: nowrap;
        box-shadow: var(--shadow);
        border: 1px solid var(--form-bg);
        z-index: 1000;
    }
    
    /* Show unfriend text on button hover */
    form:hover .profile-action-text {
        display: inline;
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--container-bg);
        color: var(--text-color);
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 0.85rem;
        white-space: nowrap;
        box-shadow: var(--shadow);
        border: 1px solid var(--form-bg);
        z-index: 1000;
    }
}

/* Mobile: Show both icon and text */
@media (max-width: 768px) {
    .profile-icon-btn {
        justify-content: center;
    }
    
    .profile-icon-btn .profile-action-text {
        display: inline;
    }
    
    /* Show unfriend text on mobile */
    form .profile-action-text {
        display: inline;
    }
    
    .profile-action-icon {
        width: 18px;
        height: 18px;
    }
}

/* Inline form styling for unfriend button */
.inline-form {
    display: inline-block;
    position: relative;
}

/* Navbar Icon Styles */
.auth-link.icon-only {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-link.icon-only::before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.auth-link.icon-only .auth-text {
    display: none;
}

.auth-link.blog-icon::before {
    background-image: var(--blog-icon);
}

.auth-link.conversations-icon::before {
    background-image: var(--conversations-icon);
}

.auth-link.notifications-icon::before {
    background-image: var(--notifications-icon);
}

/* Tooltip styles for icon-only mode */
.auth-link.icon-only {
    overflow: visible;
}

.auth-link.icon-only::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--container-bg);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: var(--shadow);
    border: 1px solid var(--form-bg);
    z-index: 1000;
}

.auth-link.icon-only:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mobile/collapsed navbar - show icons with text */
@media (max-width: 768px) {
    .auth-link.icon-only {
        width: auto;
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 14px;
    }
    
    .auth-link.icon-only .auth-text {
        display: inline;
    }
    
    .auth-link.icon-only::after {
        display: none;
    }
}

.blog-post-card {
    border: solid 1px var(--button-bg);
    padding: 10px;
    background-color: var(--container-bg);
    border-radius: 5px;
    box-shadow: var(--shadow);
    margin: 15px;
}    

.bp-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    vertical-align: middle;
}

.bp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.card-body {
    padding: 16px 16px;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}    

.card-title {
    color: var(--card-title);
    font-size: 2.2rem;
    margin-bottom: 16px;
    font-weight: 700;
    line-height: 1.3;
}    

.chapter-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-window {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 10px;
}    

.container {
    background-color: var(--container-bg);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    padding: 32px 28px;
    margin: 32px;
    width: 90%;
    max-width: 1500px;
}    

/* Custom form styles */
.custom-blog-form {
    background-color: var(--form-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 20px 0px;
}    

.custom-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--link-color);
    border-radius: var(--border-radius);
    background-color: var(--container-bg);
    color: var(--text-color);
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}    

.custom-textarea:focus {
    border-color: var(--header-bg);
    outline: none;
    box-shadow: 0 0 5px rgba(236, 203, 155, 0.5);
}    

.custom-submit-btn {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}    

.custom-submit-btn:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}    

/* Like button styles with heart icons */
.like-button {
    background: none !important;
    border: none !important;
    padding: 8px 12px !important;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.like-button:hover {
    background: var(--form-bg) !important;
    border-radius: 4px;
}

.like-button::before {
    content: "";
    width: 16px;
    height: 16px;
    background-image: var(--like-greyed-out);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
}

.like-button.liked::before {
    background-image: var(--liked-icon);
}

.like-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.list-group-flush {
    justify-content: space-around;
    display: flex;
    width: 100%;
}

/* Comment button styles with comment icon */
.comment-button {
    background: none !important;
    border: none !important;
    padding: 8px 12px !important;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    margin-left: 15px;
}

.comment-button:hover {
    background: var(--form-bg) !important;
    border-radius: 4px;
}

.comment-button::before {
    content: "";
    width: 16px;
    height: 16px;
    background-image: var(--comment-icon);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.post-interactions {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

/* Three-dot menu for post actions */
.post-actions {
    position: relative;
    display: inline-block;
}

.post-menu-button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    font-size: 1.2rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.post-menu-button:hover {
    background-color: var(--form-bg);
}

.post-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--container-bg);
    border: 1px solid var(--button-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1000;
    min-width: 120px;
    margin-top: 4px;
}

.post-menu-dropdown.show {
    display: block;
}

.post-menu-item {
    display: block;
    max-width: 100%;
    padding: 10px 15px;
    background: none;
    border: none;
    border-radius: 8px 8px 0px 0px;
    text-align: left;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.post-menu-item:hover {
    background-color: var(--form-bg);
}

.post-menu-item.delete {
    border-radius: 0px 0px 8px 8px;
    color: var(--danger-text);
}

.post-menu-item.delete:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Comments section */
.comments-section {
    margin-top: 15px;
    border-top: 1px solid var(--form-bg);
    padding-top: 15px;
}

.comments-toggle {
    background: none;
    border: none;
    color: var(--link-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    margin-bottom: 10px;
    text-decoration: underline;
}

.comments-toggle:hover {
    color: var(--link-hover);
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.comment-item {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px;
    background-color: var(--form-bg);
    border-radius: 8px;
}

.comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--link-color);
}

.comment-author a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.comment-author a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.comment-text {
    font-size: 0.9rem;
    margin: 2px 0;
    line-height: 1.3;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.7;
}

.comment-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.comment-like {
    font-size: 0.8rem !important;
    padding: 4px 8px !important;
    margin: 0 !important;
}

.comment-like::before {
    width: 12px;
    height: 12px;
}

.like-display {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

.comment-form {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.comment-input {
    flex: 1;
    border: 1px solid var(--button-bg);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: var(--container-bg);
    color: var(--text-color);
    resize: vertical;
    min-height: 36px;
}

.comment-input:focus {
    outline: none;
    border-color: var(--link-color);
}

.comment-submit {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.comment-submit:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}

/* File input wrapper for custom upload button */
.file-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.file-input-wrapper label {
    cursor: pointer;
}

#file-selected-name {
    font-size: 0.9rem;
    font-style: italic;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--button-text);
}
#file-selected-name:hover {
    color: var(--header-color);
}

.d-flex {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.dm-icon {
    width: 30px;
    height: 30px;
    background-image: var(--direct-message-btn);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: auto;
    border: none;
    border-radius: 50%;
    transition: transform 0.1s ease;
    transform: rotate(-70deg) scale(1);
    will-change: transform;
}    
.profile-icon-btn:hover .dm-icon {
    transform: rotate(-50deg) scale(1.1);
}    

.error-messages {
    background: var(--error-bg);
    color: var(--error-color);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 18px;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(178, 0, 0, 0.08);
}    

.form-control {
    padding: 6px;
    border-radius: var(--border-radius);
    box-shadow: inset var(--shadow);
    border: 1px solid #8885;
}
.form-control.me-2 {
    display: flex;
    flex-grow: 1;
}

.form-group {
    margin-bottom: 18px;
}    

.form-group input, .form-group textarea, .message-form input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--container-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border 0.2s;
}    

.form-group input:focus, .form-group textarea:focus {
    border: 1.5px solid var(--header-bg);
    outline: none;
}    

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-color);
    font-weight: 500;
}    

.friend-request-icon {
    width: 30px;
    height: 30px;
    background-image: var(--friend-request-btn);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: auto;
    border: none;
    border-radius: 50%;
    transition: transform 0.1s ease;
    transform: rotate(0deg) scale(1);
    will-change: transform;
}    
.profile-icon-btn:hover .friend-request-icon {
    transform: rotate(-10deg) scale(1.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
    height: fit-content;
}

.header-contents-left {
    display: flex;
    align-items: center;
}

.header-contents-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-button {
    width: 100%;
    padding: 12px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(54, 45, 32, 0.08);
}

.login-button:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}

.login-form {
    background-color: var(--form-bg);
    padding: 28px 22px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.login-form button {
    width: 100%;
    padding: 12px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(54, 45, 32, 0.08);
}

.login-form button:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 22px;
    color: var(--card-title);
    font-size: 1.5rem;
    font-weight: 600;
}

.main-splash-logo {
    width: 200px;
    height: 200px;
    padding: 0px 165px 0px 0px;
    background-image: var(--title-logo-img);
    background-size: contain;
    background-repeat: no-repeat;
    /* background-attachment: fixed; */
    /* background-position: left; */
    margin: auto;
}

.mb-3 {
    margin-bottom: 18px;
}

.message {
    margin: 5px 0;
    border-radius: 5px;
    padding: 10px;
    width: fit-content;
    max-width: 80%;
    min-width: 40px;
}

.message-container-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}
.message-container-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

.message-form {
    display: flex;
    margin-top: 10px;
}

.message-form input {
    flex: 1;
    margin-right: 6px;
}

.profile-card {
    background: var(--container-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 40px auto;
    width: 90%;
    padding: 32px 28px;
    text-align: center;
    place-items: center;
}

.profile-header {
    display: grid;
    grid-template-columns: 33% 67%; /* corrected property name (was grid-column-template) */
    align-items: center;            /* vertical centering of children */
}

.profile-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-stats {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.friend-count {
    font-weight: 500;
    white-space: nowrap;
}

.settings-container { 
    background-color: var(--container-bg);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.settings-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background-color: var(--button-bg);
    color: var(--button-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 1;
}

.settings-link:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
    transform: translateY(-1px);
}

.settings-link i {
    font-size: 0.9em;
}

.profile-bio {
    position: relative;
    margin-top: 12px;
    padding: 12px;
    background: var(--form-bg);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--link-color);
}

.profile-bio p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.4;
    font-style: italic;
}

.no-bio-text {
    opacity: 0.7;
    cursor: pointer;
}

.banner-content {
    width: 90%;
    max-width: 15   00px;
}

.bio-edit-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 16px;
    opacity: 1;
    transition: opacity 0.2s ease;
    border-radius: 4px;
}

.bio-edit-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.profile-bio-edit {
    margin-top: 12px;
    padding: 12px;
    background: var(--form-bg);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--link-color);
}

.inline-bio-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--button-bg);
    border-radius: var(--border-radius);
    background: var(--container-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
}

.inline-bio-form textarea:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 2px rgba(var(--link-color-rgb), 0.2);
}

.bio-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.bio-save-btn, .bio-cancel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bio-save-btn {
    background: var(--button-bg);
    color: var(--button-text);
}

.bio-save-btn:hover {
    background: var(--button-hover);
    color: var(--button-hover-text);
}

.bio-cancel-btn {
    background: var(--form-bg);
    color: var(--text-color);
    border: 1px solid var(--button-bg);
}

.bio-cancel-btn:hover {
    background: var(--button-bg);
    color: var(--button-text);
}

/* Declined request info */
.declined-request-info {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 15px;
}

.declined-request-info p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
}

.declined-request-info small {
    opacity: 0.8;
}

/* Friend actions styling */
.friend-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 16px;
    margin: auto;
}

.friend-action-btn {
    color: var(--link-color);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: background 0.2s ease;
}

.friend-action-btn:hover {
    background: var(--form-bg);
}

/* Old unfriend button styles - now using profile-icon-btn instead */
/* 
.unfriend-btn {
    background: var(--danger-action);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.unfriend-btn:hover {
    background: var(--danger-action-hover);
}
*/

@media (max-width: 768px) {
    .friend-actions {
        gap: 8px;
    }
    
    .friend-action-btn {
        text-align: center;
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

/* Profile page user list */
.profile-user-list-heading {
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

.profile-user-list {
    border: 1px solid #8888;
    border-radius: var(--border-radius);
    padding: 4px 0;
    background: var(--container-bg);
}

.profile-user-list-item {
    margin: 0 12px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}
.profile-user-list-item:last-child {
    border-bottom: none;
}

.profile-user-link {
    flex: 1;
    text-align: left;
    font-weight: 500;
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.2s;
}
.profile-user-link:hover {
    color: var(--link-hover);
}

.profile-dm-link.dm-icon { /* refine dm icon spacing within list */
    margin-left: auto;
}

/* Friend request banner standard styling */
.friend-request-banner {
    background: var(--header-bg);
    color: var(--header-color);
    padding: 10px 14px;
    border-radius: var(--border-radius);
    margin: 16px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.friend-request-banner form { display: inline; }

.friend-request-form {
    margin: 16px 0;
}

.profile-picture.profile-page-picture {
    height: 60px;
    width: 60px;
    border-radius: 50px;
    margin-right: 42px;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.recent-posts {
    margin-top: 20px;
    border-radius: var(--border-radius);
}

.register-button {
    width: 100%;
    padding: 12px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(54, 45, 32, 0.08);
}

.register-button:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}

.register-form {
    background-color: var(--form-bg);
    padding: 28px 22px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.register-form button {
    width: 100%;
    padding: 12px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(54, 45, 32, 0.08);
}

.register-form button:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}

.register-form h2 {
    text-align: center;
    align-items: center;
    margin-bottom: 22px;
    color: var(--card-title);
    font-size: 1.5rem;
    font-weight: 600;
}

.received {
    background-color: var(--button-bg);
    color: var(--button-text);
    text-align: left;
}

.sent {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
    text-align: right;
}


.site-badge {
    font-family: "Lexend Deca", sans-serif;
    margin: 30px;
    padding: 18px 18px 50px 18px;
    border-radius: 2px 2px 50% 50%;
    background-color: var(--header-bg);
    align-content: center;
    justify-content: center;
    text-align: center;
    border: solid 1px var(--button-bg);

}

.site-title {
    margin: 0 8px;
    font-family: 'Brother Signature', cursive, sans-serif;
    font-size: 2.3rem;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--title-txt-color);
    transition: color 0.2s;
    text-decoration: underline;
}

.theme-toggle-btn, #themeToggleBtn {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: solid 1px var(--button-bg);
    padding: 8px 18px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 5px 10px 8px rgba(54, 45, 32, 0.08);
}

.theme-toggle-btn:hover, #themeToggleBtn:hover {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}

.title-logo {
    width: 60px;
    height: 60px;
    background-image: var(--title-logo-img);
    background-size: contain;
    background-repeat: no-repeat;
    margin: auto;
}

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    width: 48px;
    height: 48px;
    justify-content: space-around;
    position: relative;
    z-index: 1001;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-btn span {
    display: block;
    height: 4px;
    width: 28px;
    background-color: var(--title-txt-color);
    transition: all 0.3s ease;
    transform-origin: center;
    border-radius: 2px;
}

.mobile-menu-btn-open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn-open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn-open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Chat Header Styles */
.chat-header {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--form-bg);
    box-shadow: var(--shadow);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-profile-picture-container {
    position: relative;
    flex-shrink: 0;
}

.chat-profile-picture {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--form-bg);
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    transition: background-color 0.3s ease;
}

.status-indicator.viewing-chat {
    background-color: var(--success-action); /* Green - currently viewing chat */
}

.status-indicator.online {
    background-color: #ffc107; /* Yellow - online but not viewing chat */
}

.status-indicator.offline {
    background-color: #6c757d; /* Grey - offline */
}

.chat-user-details h2 {
    margin: 0 0 4px 0;
    font-size: 1.3rem;
    color: var(--text-color);
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0;
}

/* Mobile responsiveness for chat header */
@media (max-width: 768px) {
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-profile-picture {
        width: 40px;
        height: 40px;
    }
    
    .status-indicator {
        width: 12px;
        height: 12px;
    }
    
    .chat-user-details h2 {
        font-size: 1.1rem;
    }
}

.profile-picture-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.profile-picture.clickable {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-picture.clickable::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    pointer-events: none;
}

.profile-picture.clickable::after {
    content: "Change Picture";
    color: transparent;
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
    transition: color 0.3s ease;
    pointer-events: none;
    z-index: 2;
    position: relative;
}

.profile-picture-upload:hover .profile-picture.clickable::before {
    background-color: rgba(136, 136, 136, 0.7); /* #8888 overlay that dims the background image */
}

.profile-picture-upload:hover .profile-picture.clickable::after {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stories-icon {
    width: 24px;
    height: 24px;
    background-image: var(--stories-icon);
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    vertical-align: middle;
}

/* Stories Section Styles */
.stories-navbar {
    display: flex;
    justify-content: space-around;
    background-color: var(--card-bg);
    border-bottom: 2px solid var(--header-bg);
    padding: 12px 0;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}


.story-nav-link {
    color: var(--link-color) !important;
    text-decoration: none;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.story-nav-link:hover {
    background-color: var(--header-bg);
    color: var(--text-color) !important;
    transform: translateY(-1px);
}

.story-nav-icon {
    font-size: 1.1rem;
    filter: brightness(0.8);
}

.story-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-text {
    color: var(--text-color);
    font-size: 0.9rem;
    margin: 0;
}

.navbar-text .story-nav-link {
    display: inline;
    padding: 4px 8px;
    margin: 0;
}

/* Mobile styles for stories navbar */
@media (max-width: 900px), 
       screen and (max-device-width: 900px),
       (pointer: coarse),
       (hover: none) {
    .stories-navbar {
        padding: 8px 0;
        margin-bottom: 16px;
    }
    
    .stories-navbar .navbar-nav {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .nav-left {
        flex-direction: column !important;
        margin-bottom: 12px;
    }
    
    .story-nav-link {
        padding: 12px 16px;
        margin: 2px 0;
        text-align: center;
        justify-content: center;
    }
    
    .nav-right {
        text-align: center;
    }
    
    .story-container {
        padding: 0 16px;
    }
}

/* Dark theme adjustments for stories */
[data-theme="dark"] .stories-navbar {
    border-bottom-color: var(--button-bg);
}

/* Library functionality styles */
.library-actions {
    margin-bottom: 1rem;
}

.library-actions .btn {
    margin-right: 0.5rem;
}

.library-actions .btn i {
    margin-right: 0.25rem;
}

/* Story cards in library */
.story-content {
    line-height: 1.6;
    font-size: 1rem;
}

/* Library empty state */
.library-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.library-empty i {
    color: var(--text-color);
    opacity: 0.5;
    margin-bottom: 1rem;
}
/* Shared sizing prevents padded cards and form controls exceeding the viewport. */
*, *::before, *::after { box-sizing: border-box; }
html, body, header, header.site-header { width: 100%; }
html { overflow-x: visible; }
body { overflow-wrap: anywhere; }
main { width: 100%; min-width: 0; }
main > *, .d-flex > *, .header-content > * { min-width: 0; }
img { max-width: 100%; height: auto; }
input, textarea, select { max-width: 100%; font: inherit; }
textarea { resize: vertical; }
.form-control { width: 100%; background: var(--container-bg); color: var(--text-color); }
input[type="checkbox"], input[type="radio"] { width: auto; }
.flex-column { flex-direction: column; align-items: stretch; }
.container { margin: 24px auto; }
.story-container { width: 100%; margin: 0; padding: 0; box-shadow: none; }
.site-header .header-content { width: 100%; min-height: 72px; }
.title-logo { flex-shrink: 0; }
.main-splash-logo { width: 200px; max-width: 100%; padding: 0; background-position: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 1px solid var(--link-color); border-radius: 8px; text-decoration: none; font: inherit; gap: 6px; }
.btn:not(.btn-primary) { color: var(--link-color); background: var(--container-bg); }
.btn-primary { background: var(--button-bg); color: var(--button-text); }
button, a, input, textarea, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--link-color); outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 2000; padding: 12px; background: var(--container-bg); color: var(--text-color); }
.skip-link:focus { top: 12px; }
.chapter-content { font-family: Georgia, serif; font-size: 1.125rem; line-height: 1.8; max-width: 65ch; margin: auto; }
.chapter-content p { margin: 0 0 1.25em; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-link { display: inline-flex; min-height: 44px; align-items: center; padding: 8px; }
.message-form input { min-width: 0; }

@media (min-width: 901px) {
    .site-title { font-size: 1.8rem; }
    .nav-menu { visibility: visible; }
}

@media (max-width: 900px) {
    body { font-size: 1.125rem; line-height: 1.65; }
    main { margin-top: 20px; padding: 0 12px 32px; }
    .site-header .header-content { padding: 0 12px; gap: 8px; }
    .site-title { font-family: Georgia, serif; font-size: clamp(1.125rem, 4.8vw, 1.5rem); line-height: 1.25; letter-spacing: 0; margin: 0 4px; text-decoration: none; }
    .title-logo { width: 44px; height: 52px; }
    .mobile-menu-btn { display: flex; flex-shrink: 0; align-items: center; }
    .nav-menu {
        position: absolute; top: 100%; right: 12px;
        width: min(340px, calc(100vw - 24px));
        max-height: calc(100vh - var(--site-header-height, 72px) - 12px);
        max-height: calc(100dvh - var(--site-header-height, 72px) - 12px);
        overflow-y: auto; overscroll-behavior: contain;
        display: none; flex-direction: column; align-items: stretch; gap: 4px;
        padding: 12px 12px max(12px, env(safe-area-inset-bottom));
        background: var(--header-bg); border-radius: 0 0 16px 16px;
        box-shadow: 0 12px 24px #0003; z-index: 1000;
    }
    .nav-menu-open { display: flex; }
    .nav-menu .auth-link { width: 100%; min-height: 48px; padding: 12px; text-align: left; font-size: 1.0625rem; }
    .nav-menu .nav-icon-link, .nav-menu .profile-link { justify-content: flex-start; gap: 12px; }
    .nav-menu .nav-icon-link .nav-text, .nav-menu .nav-icon-link:hover .nav-text {
        display: inline; position: static; transform: none; padding: 0; border: 0;
        background: transparent; color: inherit; box-shadow: none; font-size: inherit;
    }
    .nav-menu .profile-username { white-space: normal; }
    .nav-menu .theme-toggle-btn { margin: 4px 0 0; min-height: 48px; width: 100%; }
    .notification-badge { top: 12px; right: 12px; }
    .container, .profile-card { width: 100%; margin: 0 auto 20px; padding: 20px; }
    .story-container { padding: 0; margin: 0; }
    .stories-navbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px 0 12px; }
    .story-nav-link { padding: 8px 4px; margin: 0; min-height: 44px; text-align: center; justify-content: center; }
    .story-nav-icon { font-size: 1rem; }
    .card-body { padding: 12px 0; font-size: 1.125rem; line-height: 1.65; }
    .card-title { font-size: 1.5rem; margin: 0 0 12px; }
    .chapter-box-card { padding: 16px; }
    .site-badge { margin: 0 0 24px; padding: 20px; max-width: 100%; border-radius: 12px; }
    .site-badge h1 { font-size: 1.75rem; line-height: 1.25; }
    .main-splash-logo { width: 120px; height: 120px; }
    .blog-post-card { margin: 16px 0; padding: 16px; }
    .custom-blog-form { padding: 12px; }
    .custom-textarea { min-height: 120px; }
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; padding: 12px; }
    button, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
    input[type="checkbox"], input[type="radio"] { min-height: 0; }
    .form-group label { font-size: 1rem; margin-bottom: 6px; }
    .login-form, .register-form, .settings-container { width: 100%; max-width: 480px; padding: 20px; }
    .d-flex { flex-wrap: wrap; }
    form.d-flex .form-control { flex: 1 1 160px; min-width: 0; }
    .chapter-navigation .header-content, main form .header-content { flex-wrap: wrap; gap: 12px; padding: 0; }
    .chapter-navigation .header-content > * { flex: 1 1 180px; }
    .chapter-navigation .btn { width: 100%; }
    .message-form { gap: 8px; }
    .message-form input { margin: 0; }
    .message-form button { padding: 10px 14px; }
    .chat-header { padding: 12px; }
    .chat-window { max-height: 50dvh; }
    li { font-size: inherit; }
    .story-content, .blog-post-content { font-size: 1.125rem; line-height: 1.7; }
    .recent-posts h2 { font-size: 1.25rem; line-height: 1.4; }
    .help-text, small { font-size: .9375rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Keep the close glyph centered instead of rotating spaced flex items. */
.mobile-menu-btn span { position: absolute; left: 10px; top: 22px; height: 3px; }
.mobile-menu-btn span:nth-child(1) { transform: translateY(-8px); }
.mobile-menu-btn span:nth-child(3) { transform: translateY(8px); }
.mobile-menu-btn-open span:nth-child(1) { transform: rotate(45deg); }
.mobile-menu-btn-open span:nth-child(3) { transform: rotate(-45deg); }

/* Rotate only the Stories glyph; leave its link and other icons in place. */
@media (hover: hover) {
    .nav-icon-link:hover .stories-icon { transform: rotate(-10deg); }
}

@media (max-width: 900px) {
    .comment-form { flex-wrap: wrap; gap: 12px; }
    .comment-form > .mb-3 { flex: 1 1 100%; margin-bottom: 0; }
    .comment-form > button { flex-shrink: 0; }
    .comment-form-container h6, .card-header h5 { font-size: 1rem; }
}

/* Shared foreground/background pairs apply to forms and feedback on every page. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), textarea, select {
    background-color: var(--container-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}
input::placeholder, textarea::placeholder { color: var(--text-secondary); opacity: 1; }
input, select, textarea { accent-color: var(--link-color); }
:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 3px;
}
.text-muted, .help-text { color: var(--text-secondary); }
.bg-light { background: var(--form-bg); }
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid; border-radius: 6px; }
.alert-info { color: var(--info-text); background: var(--info-bg); border-color: var(--info-border); }
.alert-success { color: var(--success-text); background: var(--success-bg); border-color: var(--success-border); }
.alert-warning { color: var(--warning-text); background: var(--warning-bg); border-color: var(--warning-border); }
.alert-error, .alert-danger { color: var(--danger-text); background: var(--danger-bg); border-color: var(--danger-border); }
.alert a { color: inherit; }
.text-danger { color: var(--danger-text); }
.text-success { color: var(--success-text); }
.bg-danger { background: var(--danger-action); color: var(--action-text); }
.btn.btn-danger { background: var(--danger-action); color: var(--action-text); }
.btn.btn-danger:hover { background: var(--danger-action-hover); }
.btn.btn-success { background: var(--success-action); color: var(--action-text); }
.btn.btn-success:hover { background: var(--success-action-hover); }
.btn-primary:hover { background: var(--button-hover); color: var(--button-hover-text); }
