/* 
 * Systems of Intelligence Website Styles
 * For systemsofintelligence.ai
 */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; 
}

body {
    background-color: #000000; /* reverted to black */
    color: #FFFFFF;
    /* Georgia for body copy – headings override below */
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.5; /* reduced from 1.7 for tighter paragraph spacing */
    padding: 0;
    margin: 0;
    font-size: 18px;
}

/* Layout */
header, footer {
    padding: 1.5rem 4%; /* move content closer to top-left */
    text-align: left; /* changed from center to left align */
}

main {
    /* Slightly narrower column for easier reading (similar to Activant layout) */
    max-width: 820px;
    margin: 0 auto;
    /* start content a bit higher on the page */
    padding: 10vh 5% 2rem;
}

/* Typography */
/* Headings use Monument Grotesque */
h1, h2, h3, h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #FFFFFF;
    line-height: 1.2;
    font-weight: 500;
    font-family: 'Grotesque Monument', Arial, sans-serif;
}

.site-name {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.03em;
    text-align: left; /* ensure left alignment */
}

.article-title {
    font-size: 2.2rem;
    line-height: 1.1;
}



.title-first {
    display: block;
    font-size: 3.55rem; /* larger first line */
        line-height: 0.95;
        margin-bottom: 0.5rem; /* slight extra space below first line */
}

h2 {
    font-size: 2.25rem; /* slightly larger */
    margin-top: 3rem;
}

h3 {
    font-size: 1.6rem; /* slightly larger */
}

h4 {
    font-size: 1.35rem; /* slightly larger */
}

p {
    margin-bottom: 1.5rem; /* keep paragraph spacing */
    font-family: Georgia, 'Times New Roman', serif; /* reinforce body font */
}

/* Intro paragraph + separator */
.intro-text {
    font-style: italic;
}

hr.separator {
    border: none;
    border-top: 1px solid rgba(179, 201, 255, 0.4);
    margin: 2.5rem 0 1rem; /* reduced bottom margin to bring metadata closer */
}

/* Header Styles */
header {
    border-bottom: none;
    margin-bottom: 0;
}

/* Author info with headshot */
.author-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 1.5rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    flex-basis: 100%;
    margin-left: 0;
}

.author-headshot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.author-headshot a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 0.25s ease;
}
.author-headshot a:hover {
    transform: translateY(-2px);
}
.author-headshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.author-name {
    opacity: 0.9;
    font-family: 'Grotesque Monument', Arial, sans-serif;
    font-size: 0.95rem;
    color: #FFFFFF;
    font-weight: 500;
    text-decoration: none;
}

.company-link {
    display: block;
    margin-left: 0;
}

.company-logo {
    height: 36px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.company-logo:hover {
    opacity: 1;
}

.logo-top {
    margin-top: 0.5rem; /* move logo slightly upward */
}

/* Fixed logo container */
.logo-container {
    position: fixed;
    top: 0.5rem;
    right: 4%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1002;
}

.site-link {
    font-family: 'Grotesque Monument', Arial, sans-serif;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: -0.25rem; /* pull text closer to logo */
}
.site-link:hover {
    text-decoration: none;
}

/* Metadata - Published date and reading time */
.metadata {
    display: flex;
    justify-content: space-between;
    font-family: 'Grotesque Monument', Arial, sans-serif;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #B3C9FF;
}

.metadata-label {
    display: block;
    margin-bottom: 0.25rem;
}

.metadata-value {
    color: #FFFFFF;
}

.metadata div:last-child .metadata-value {
    text-align: left;
    display: block;
}

/* Links */
a {
    color: #B3C9FF;
    text-decoration: underline;
    transition: color 0.3s ease;
}

a:hover {
    color: #FFFFFF;
    text-decoration: underline; /* keep underline */
}

/* Footnotes/Endnotes */
sup {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
}
sup a {
    text-decoration: none;
}

#endnotes {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(179, 201, 255, 0.2);
    font-family: 'Grotesque Monument', Arial, sans-serif; /* ensure Monument */
}

#endnotes h2 {
    margin-bottom: 1.5rem;
}

#endnotes ol {
    list-style: none;
    padding-left: 0;
}

#endnotes li {
    margin-bottom: 0.6rem; /* tighter spacing */
    font-size: 0.9rem;
    opacity: 0.9;
}

#endnotes a.footnote-number {
    margin-right: 0.5rem;
    opacity: 0.7;
    text-decoration: none;
}

#endnotes a.footnote-number:hover {
    color: #FFFFFF;
}

/* Aside Box */
.aside {
    border-left: 3px solid #B3C9FF; /* keep vertical line */
    padding: 1.5rem; /* maintain indent */
    margin: 2rem 0;
}

.aside h4 {
    margin-top: 0;
}

/* ─────────────────────────────────────────────
   Share Buttons
   ──────────────────────────────────────────── */

.share-section {
    margin: 1.5rem 0;
    font-family: 'Grotesque Monument', Arial, sans-serif;
    display: flex;
    align-items: center;
        column-gap: 1rem;
    row-gap: 0.3rem; /* slightly tighter spacing */ 
    flex-wrap: wrap;
    /* removed border-top since it's now below intro */
}

.share-section h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-right: 0; /* match author name spacing */
    color: #FFFFFF;
    letter-spacing: 0.02em;
        line-height: 46px;
}

.share-buttons {
    display: flex;
    gap: 1rem;
}

.share-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #FFFFFF; /* white buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;       /* dark icon/text */
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    text-decoration: none;
    font-size: 1.25rem;
}

.share-btn img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

#share-email img {
    width: 84%;
    height: 84%;
}

#share-linkedin img {
   width: 50%;
    height: 50%;
}

#share-x img {
    width: 84%;
    height: 84%;
}

.share-btn:hover {
    background: #B3C9FF; /* pale blue on hover */
    color: #000000;
    transform: translateY(-2px);
}

/* Inline article images */
.article-img {
    width: 100%;
    display: block;
    margin: 1.5rem 0;
}

.article-img.narrow {
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

/* Acknowledgements */
.acknowledgements {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(179, 201, 255, 0.2);
    font-style: italic;
    opacity: 0.9;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(179, 201, 255, 0.2);
    text-align: left; /* match header alignment */
}

.disclaimer {
    margin-top: 3rem; /* add separation from endnotes */
    font-family: 'Grotesque Monument', Arial, sans-serif;
    font-size: 0.9rem; /* match endnote size */
    color: #FFFFFF;
    opacity: 0.8;
}

.disclaimer p {
    font-family: inherit;
    font-size: inherit;
}

.copyright {
    margin-top: 0.5rem;
    font-family: 'Grotesque Monument', Arial, sans-serif;
    font-size: 0.8rem;
    color: #FFFFFF;
}

/* ─────────────────────────────────────────────
   Table of Contents Sidebar & Hamburger Toggle
   ──────────────────────────────────────────── */

#toc-toggle {
    position: fixed;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 1001;
    font-size: 3.2rem; /* slightly smaller arrow */
    color: #FFFFFF;    /* white color */
    font-family: 'Grotesque Monument', Arial, sans-serif;
    transition: transform 0.25s ease;
}

#toc-toggle:hover {
    transform: translateY(calc(-50% - 2px));
}

.toc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 320px; /* increased from 260px for wider TOC */
    background: #000000; /* match site background */
    color: #FFFFFF;
    padding: 3rem 1.25rem 1.5rem; /* extra top padding to avoid overlap */
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-family: 'Grotesque Monument', Arial, sans-serif; /* ensure Monument throughout */
}

.toc-sidebar.active {
    transform: translateX(0);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.toc-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-family: 'Grotesque Monument', Arial, sans-serif; /* Monument */
    color: #FFFFFF;
}

.toc-close {
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.toc-sidebar nav ul {
    list-style: none;
    padding-left: 0;
}

.toc-sidebar nav ul li {
    margin: 0.45rem 0; /* slightly looser spacing */
    line-height: 1.65;
}

.toc-sidebar nav ul li ul {
    margin-left: 1rem;
    margin-top: 0.1rem; /* tighter nesting */
    margin-bottom: 0.1rem;
}

.toc-sidebar a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    font-family: inherit; /* use Monument */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.toc-sidebar a:hover {
    color: #B3C9FF;
}

/* Smooth fade-in for TOC items */
.toc-sidebar nav {
    opacity: 0;
    transition: opacity 0.8s ease;
}
.toc-sidebar.active nav {
    opacity: 1;
}

/* Generic fade-in utility for body text (JS toggles .visible) */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px);
}
.fade-in-on-scroll.visible {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .site-name {
        font-size: 1.4rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 2rem; /* adjusted for larger desktop size */
    }
    
    h3 {
        font-size: 1.45rem;
    }
    
    h4 {
        font-size: 1.25rem;
    }
    
    .toc-sidebar {
        width: 280px; /* slightly narrower on mobile */
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    main {
        padding: 1.5rem 5%;
    }
    
    .site-name {
        font-size: 1.3rem;
    }
    
    .article-title {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.9rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    h4 {
        font-size: 1.15rem;
    }
    
    .metadata {
        flex-direction: column;
        gap: 0.5rem;
    }
}
