@font-face {
    font-family: 'written'; /* Give your font a descriptive name */
    src: url('/fonts/Stefscript-Regular.ttf') format('truetype');
    /*If you also have an OTF version:*/
    src: url('/fonts/Stefscript-Regular.otf') format('opentype');
    /*   It's good practice to include woff/woff2 for broader browser support,
       you can convert your ttf/otf to these formats online. 
 */ src: url('/fonts/Stefscript-Regular.woff2') format('woff2'), url('/fonts/Stefscript-Regular.woff') format('woff'), url('/fonts/Stefscript-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Improves performance by showing system font until custom font loads */
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img {
    /*    max-width: contain;*/
    max-width: 100%; /* Change `contain` to `100%` */
    height: auto; /* Add this to maintain aspect ratio */
}

.col {
    overflow-wrap: break-word;
    word-break: break-word;
}

.col img,
.col iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

#articleCarousel .carousel-item img {
    height: 70vh; /* half screen height */
    object-fit: contain;
    width: 100%;
}



.card {
    background-color: #eeeeee10;
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 2rem 2rem 12rem 12rem;
    padding: 0.2rem 0.2rem 1rem 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    max-width: contain;
    height: fit-content;
}

/*.card-title {
    word-wrap: break-word;*/ /* force wrapping long words */
    /*overflow-wrap: break-word;
    white-space: normal;*/ /* allow wrapping instead of one long line */
/*}*/

/* Input field background and text color */
input[type="text"]#userInput {
    background-color: #f3f3ff77;
    color: #333;
    border: 1px solid #aaa;
    padding: 8px;
    border-radius: 10px;
    transition: border 0.3s, box-shadow 0.3s;
}

/* Focus outline highlight color */
input[type="text"]#userInput:focus {
    outline: none;
    border-color: #a9a;
    box-shadow: 0 0 5px 2px rgba(170, 153, 170, 0.5);
}


/* Change input background and text color */
.form-control {
    background-color: #f3f3ff77;
    color: #333;  dark text 
    border: 1px solid #ccc;
    transition: box-shadow 0.3s, border 0.3s;
}

/* Change border and background on focus */
.form-control:focus {
    background-color: #f3f3ff77;
    outline: none;
    border-color: #a9a;
    box-shadow: 0 0 5px 2px rgba(170, 153, 170, 0.5);
}

.custom-select-bg {
    background-color: #f3f3ff77;
    color: #333;
}

.custom-select-bg:focus {
    background-color: #f3f3ff77;
    border-color: #ffda44;
    box-shadow: none;
}

/* Remove color when ON */
.form-check-input:checked {
    background-color: #f3f3ff77;
    border-color: #ced4da !important; /* neutral border */
}

/* Remove focus glow */
.form-check-input:focus {
    background-color: #f3f3ff77;
    box-shadow: none !important;
    outline: none !important;
}

/* Remove focus glow when checked */
.form-check-input:checked:focus {
    background-color: #f3f3ff77;
    box-shadow: none !important;
    outline: none !important;
}
/* Make the switch knob gray when focused */
.form-switch .form-check-input:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23d3d3d3'/%3e%3c/svg%3e");
}

/* Make the checkmark light gray when checked */
.form-check-input:checked[type=checkbox] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23d3d3d3' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

/* CSS Variables for consistent sizing and colors */
:root {
    /* Dark Mode Colors (Default) */
    --bg-primary: /*url("/img/paper-bg-dark.avif")*/ #202122;
    /* Main background */
    --bg-secondary: #2d3748;
    --sb-primary: #212123;
    /* Section backgrounds, card backgrounds */
    --text-primary: #ececf1;
    /* Primary light text */
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --sidebar-width-collapsed: 2rem;
    --sidebar-width-expanded: 8rem;
    --header-height: 2.3rem;
}


html {
    position: relative;
    min-height: 100%;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body.light-mode {
    /*    background: linear-gradient(194deg, rgba(235, 247, 244, 1) 4%, rgba(225, 234, 237, 1) 15%, rgba(230, 245, 245, 1) 100%);
*/ color: #333;
    /*    background: #e8e8e8;
*/ --bg-primary: #e8e8e8 /*url("/img/paper-bg.avif")*/ /*linear-gradient(194deg, rgba(235, 247, 244, 1) 4%, rgba(225, 234, 237, 1) 15%, rgba(230, 245, 245, 1) 100%)*/;
    --sb-primary: #e8e8e8;
    --bg-secondary: #f0f5f5;
    --text-primary: #212121;
    --text-secondary: #666;
    --accent-blue: #3b82f6;
    --accent-blue-dark: #2563eb;
    --border-color: #ccc;
    --header-bg: rgba(255, 255, 255, 0.9);
    --header-shadow: rgba(0, 0, 0, 0.1);
    --card-shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Figtree', 'Dosis', sans-serif;
    scroll-behavior: smooth;
        background-color: var(--bg-primary);
/* background-image: var(--bg-primary);
*/    background-size: cover; /* scale nicely */
    background-position: center;
    background-repeat: repeat;
    color: var(--text-primary);
    margin: 0;
    overflow-x: hidden;
}

/* --- Global Layout Wrapper --- */
#wrapper {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    padding: 0;
    margin: auto;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 200;
}

a:hover {
    color: #555;
}


button, .btn {
    background-color: #a9a;
    color: #eee;
    padding: 3px 10px;
    border: none;
    border-radius: 15px;
    margin: 1rem 0rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.4s ease;
}

button:hover, .btn:hover {
    background-color: #97c6c6;
}

.tags, .authors, .titles {
    font-family: Figtree, sans-serif;
    color: var(--text-primary);
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 100;
}

/* --- Sidebar Styles --- */
.sidebar {
    width: var(--sidebar-width-collapsed);
    min-width: var(--sidebar-width-collapsed);
    max-width: var(--sidebar-width-collapsed);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    padding: 1rem 0.5rem;
    overflow-x: hidden;
    transition: all 0.3s ease;
    /*    box-shadow: 2px 0 5px var(--header-shadow);*/
    box-shadow: 2px 0 5px rgba(250, 250, 250, 0.1);
    /*    background-color: var(--sb-primary);
*/ /*background: var(--bg-primary);*/
    background-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    font-family: 'written', 'Figtree', 'Global Sans Serif';
    font-size: 0.85rem;
    font-style: normal;
    text-transform: lowercase;
    font-weight: 100;
    letter-spacing: -0.05cap;
    line-height: 1.3rem;
}

body.light-mode .sidebar {
/*    background-color: var(--sb-primary);
*/    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Expanded state for sidebar */
.sidebar.expanded {
    width: var(--sidebar-width-expanded);
    min-width: var(--sidebar-width-expanded);
    max-width: var(--sidebar-width-expanded);
    padding-right: 1rem;
}

/* Hide text when collapsed */
.sidebar:not(.expanded) .sidebar-text,
.sidebar:not(.expanded) .logo-text {
    display: none;
}

/* Logo styling */
.sidebar .logo-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.5rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .logo {
    display: none;
    align-items: center;
    justify-content: center;
    width: 35px;
    min-width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.sidebar.expanded .logo {
    display: inline-flex;
    width: 40px;
    height: 40px;
}

/* Navigation list styling */
.sidebar .nav-pills {
    width: 100%;
    margin-top: 1rem;
    flex-grow: 1;
    list-style: none;
    padding: 0;
}

.nav-link {
    font-family: 'written', 'Figtree', 'Global Sans Serif';
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: var(--text-primary) !important;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    text-decoration: none;
/*    transition: background-color 0.3s ease, color 0.3s ease;*/
    color: #555;
    transition: color 0.7s ease;
    letter-spacing: 0.12rem;
    font-size: 1.2rem;
}

/*.sidebar .nav-link i {
    font-size: 1rem;
    width: 30px;
    text-align: center;
    margin-right: 0.5rem;
}*/

.sidebar:not(.expanded) .nav-link {
    display: none;
    justify-content: center;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.share-alike {
    width: 1.2em;
    filter: invert(0.23);
}

.nav-link:hover, .nav-link:focus, .loginbtn:hover, .loginbtn:focus {
    color: #eee;
    font-weight: 500;
}

.nav-link.active {
    color: #eee;
}

.loginbtn {
    color: #555;
    padding: 0;
    border: none;
    background-color: #00000000;
}

.loginbtn:hover, .loginbtn:focus {
    color: #eee;
    font-weight: 500;
    background-color: #00000000;
}


/***/

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
}

body.light-mode .nav-link:hover,
body.light-mode .nav-link.active {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000 !important;
}

 .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

body.light-mode .nav-link.active {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.nav-link {
    color: var(--text-primary);
}





.sidebar hr {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
    width: 100%;
}

body.light-mode .sidebar hr {
    border-top: 1px solid var(--border-color);
}

/* Sidebar Toggle Button (Desktop Only) */
.sidebar-toggle-btn {
    position: absolute;
    top: 50%;
    right: -0.2rem;
    transform: translateY(-50%);
    z-index: 1030;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    cursor: pointer;
    background-color: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
   }


.sidebar.expanded .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* --- Page Content Wrapper --- */
#page-content-wrapper {
    flex-grow: 1;
    margin-left: var(--sidebar-width-collapsed);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    padding-top: var(--header-height);
}

body.sidebar-expanded #page-content-wrapper {
    margin-left: var(--sidebar-width-expanded);
}


/* --- Header Styles (Main content area header) --- */

header.main-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
    max-width: 100%;
    z-index: 1030;
    padding: 1rem;
    display: flex;
    align-items: center;
    background-color: transparent;
    transition: left 0.3s ease, width 0.3s ease;
    height: var(--header-height);
    justify-content: flex-end;
}

body.light-mode header.main-header {
    background-color: transparent;
    /*background: var(--bg-primary);
    background-size: cover;
    background-color: var(--sb-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);*/
}

body.sidebar-expanded header.main-header {
    left: var(--sidebar-width-expanded);
    width: calc(100% - var(--sidebar-width-expanded));
}

header.main-header .right-aligned-elements {
    display: relative;
    margin-right: 3rem;
    gap: 1rem;
    align-items: center;
}

header.main-header .site-title {
    font-family: 'Figtree', 'Global Sans Serif';
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 100;
    letter-spacing: -0.024cap;
    line-height: 1.3rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 100;
    word-spacing: -0.07cap;
    text-align: end;
    margin-left: 2.3rem;
}

body.light-mode header.main-header .site-title {
/*    color: #a9a;
*/    color: var(--text-primary);
}

header.main-header .site-title:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.light-mode header.main-header .site-title:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
}

/* Mobile Hamburger Icon */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: color 0.3s ease, background-color 0.3s ease;
}

body.light-mode .mobile-menu-toggle {
    background-color: none;
}

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

body.light-mode .mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Dark/Light Mode Toggle Button in Header */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.light-mode .theme-toggle-btn {
    color: var(--text-primary);
}

body.light-mode .theme-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}


/* --- main Base Styles --- */
main {
    padding: 0rem 7rem;
    margin: auto;
    padding-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    position: relative;
    padding-bottom: 6rem;
    font-size: 1.4rem;
    letter-spacing: 0.03rem;
    font-weight: 100;
}


p {
 
    font-size: 1.25rem;
    font-family: 'Dosis', sans-serif;
    font-weight: 100;
}


h1 {
    color: #a9a;
    /*    font-family: 'Figtree', 'Global Sans Serif';
*/ font-family: lores-9-plus-narrow, sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 5rem;
    letter-spacing: 0.3cap;
    overflow-wrap: anywhere; /*  forces break anywhere */
    word-break: break-word; /* legacy support */
    max-width: 100%;
}

h2 {
    /*    color: #777;*/
    color: var(--text-primary);
    /*font-family: 'Figtree','Global Serif';
    font-weight: 200;*/
    font-family: "industry-inc-detail-fill", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.8rem;
    overflow-wrap: anywhere; /*  forces break anywhere */
    word-break: break-word; /* legacy support */
    max-width: 100%;
}

h3 {
    /*    color: #777;*/
    color: var(--text-primary);
    font-family: warbler-display, sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 2rem;
    overflow-wrap: anywhere; /*  forces break anywhere */
    word-break: break-word; /* legacy support */
    max-width: 100%;
    /*    font-family: 'Figtree','Global Serif';
    font-weight: 200;*/
}

blockquote {
    font-family: warbler-display, sans-serif;
    font-weight: 100;
    font-style: normal;
    font-size: 1.2rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    /* The core properties to make the GIF fill the text */
    /*background-image: url('/img/paper-bg.avif');
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;*/
    /* Make the text transparent so the background shows through */
    /*-webkit-text-fill-color: transparent;
    color: transparent;*/
}

.text-center, .card-title {
    min-width: 0; /* allows flex children to shrink */
}

.page-content{
    padding: 0rem 7rem;
    max-width: 100%;
}


/* Footer styles */
footer {
    position: static;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3rem;
    margin-bottom: 0.7rem;
    /*    margin-left: 0.5rem;*/
    padding: 0rem 2rem;
    white-space: nowrap;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    transition: padding-left 0.3s ease;
    display: flex;
    flex-flow: row-reverse;
    align-items: center;
    justify-content: space-between;
}

body.light-mode footer {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
}


footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff;
}

body.light-mode footer a:hover {
    color: var(--text-primary);
}

/* Placeholder image styles */
img[src*="placehold.co"] {
    border-radius: 0.5rem;
}


/*Custom scrollbar*/
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

body.light-mode ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

body.light-mode ::-webkit-scrollbar-thumb {
    background: #a0aec0;
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: #718096;
}


/* reading progress bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background-color: #a9a;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

.homepage {
    /*background-image: url('/img/birch-loop.gif');*/
    background-color: var(--bg-primary);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}



.quill-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050; /* Ensure it's above modals and other elements */
    background-color: white; /* Match your page background */
    padding: 20px;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
}

    .quill-fullscreen .ql-container {
        flex-grow: 1; /* Make the editor body fill the remaining height */
        height: auto !important;
        min-height: 100%;
    }
/* Ensure the parent card wrapper also goes fullscreen */
.quill-fullscreen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background-color: white;
    margin: 0 !important;
}

    .quill-fullscreen-wrapper .card-body {
        /* Take up all available space below the header */
        height: calc(100% - 60px);
    }






@media (max-width: 768px) {
    
    /* Sidebar behavior on mobile: Overlay */
    .sidebar {
        width: var(--sidebar-width-expanded);
        max-width: var(--sidebar-width-expanded);
        transform: translateX(-100%);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
        /*  Transparent + blur */
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .sidebar.expanded {
        transform: translateX(0);
    }

/*     Hide desktop toggle button on mobile */
        .sidebar-toggle-btn {
        display: none;
    }

/*     Show mobile hamburger button */
    .mobile-menu-toggle {
        display: block;   
    }

    /* --- New Wrapper for Header Content --- */
    .header-content-wrapper {
        width: 100%;
        display: flex;
        /* This pushes elements (title-area and controls) to the opposite ends */
        justify-content: space-between;
        align-items: center;
    }

    .header-controls {
        /* Ensures the hamburger button is aligned nicely */
        display: flex;
        align-items: center;
        /* Reset margin on button */
    }

    /* Specific styling adjustment for the button's margin */
    #mobileMenuToggle {
        margin-top: 0; /* Remove the large 'mt-5' top margin */
    }



    /* Main header on mobile: Now uses the new wrapper for space-between */
    header.main-header {
        left: 0;
        width: 100%;
        /* No longer need space-between here, the wrapper handles it */
        /* justify-content: space-between; */
        padding-left: 1rem;
        padding-right: 1rem;
    }



/*     Ensure site title is visible on mobile even when sidebar is expanded */
    body.sidebar-expanded header.main-header .site-title {
        display: block;
    }

/*     Page content wrapper on mobile: No margin-left, adjusts for header only */
    #page-content-wrapper {
        margin-left: 0;
        padding-top: var(--header-height);
    }

    main {
        padding: 0rem 1rem;
        max-width: 100%;
    }


    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.2rem;
      }

    h3 {
        font-size: 1.5rem;
     }

    blockquote {
        font-size: 1.2rem;
          }


}

@media (min-width: 980px) {
    main {
        padding: 0rem 5rem;
        max-width: 960px;
    }
}