/* ACGEOS Site Styles - Earthy, Research-Grade Aesthetic */

/* Self-hosted Noto Sans — latin-ext + latin, normal 400/500/700/800 + italic 400 */
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/noto-sans/noto-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/noto-sans/noto-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Noto Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/noto-sans/noto-sans-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Noto Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/noto-sans/noto-sans-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/noto-sans/noto-sans-devanagari.woff2') format('woff2');
    unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0,
                   U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}
@font-face {
    font-family: 'Noto Sans Arabic';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/noto-sans/noto-sans-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
                   U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41,
                   U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
    /* Base color scheme */
    --bg-primary: #F5F1E8;
    --text-primary: #2B2B2B;
    --text-secondary: #4A4A4A;
    --accent: #8B6F47;
    --link: #5C7A4D;
    --code-bg: #E8E3D6;
    --border: #D4C9B8;
    
    /* Typography */
    --font-family: 'Noto Sans Arabic', 'Noto Sans', sans-serif;
    --font-size-base: 18px;
    --line-height-base: 1.7;
    
    /* Spacing */
    --spacing-unit: 1.5rem;
    --max-width: 800px;
}

/* Vision mode color overrides */
body.deuteranopia {
    --accent: #4A7BA7;
    --link: #6B8E9F;
}

body.protanopia {
    --accent: #5A8DB5;
    --link: #4A7BA7;
}

body.tritanopia {
    --accent: #8B6F47;
    --link: #B85A5A;
}

body.high-contrast {
    --bg-primary: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #000000;
    --accent: #000000;
    --link: #0000EE;
    --code-bg: #F0F0F0;
    --border: #000000;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Navigation */
.main-nav {
    background-color: var(--bg-primary);
    border-bottom: 2px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-decoration: none;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.control-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background-color: var(--code-bg);
    border-color: var(--accent);
}

/* Main content */
.content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
}

article {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Typography */
h1 {
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

h2 {
    font-weight: 700;
    font-size: 1.8rem;
    line-height: 1.3;
    color: var(--text-secondary);
    margin-top: calc(var(--spacing-unit) * 2);
    margin-bottom: var(--spacing-unit);
}

h3 {
    font-weight: 500;
    font-size: 1.3rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-top: calc(var(--spacing-unit) * 1.5);
    margin-bottom: calc(var(--spacing-unit) * 0.75);
}

p {
    margin-bottom: var(--spacing-unit);
}

.lead {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

strong {
    font-weight: 700;
}

em {
    font-style: italic;
}

/* Links */
a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

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

/* TBF Dots */
.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
    vertical-align: middle;
    cursor: pointer;
    transition: transform 0.2s;
}

.dot:hover {
    transform: scale(1.2);
}

.dot-white {
    background: #FFFFFF;
    border: 2px solid var(--text-primary);
}

.dot-yellow {
    background: #F4C430;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.dot-orange {
    background: #FF8C42;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.dot-red {
    background: #D32F2F;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.dot-green {
    background: #5C7A4D;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Code blocks */
code {
    font-family: 'Courier New', monospace;
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: var(--spacing-unit);
}

pre code {
    background: none;
    padding: 0;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--accent);
    padding-left: var(--spacing-unit);
    margin: var(--spacing-unit) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Page navigation */
.page-nav {
    margin-top: calc(var(--spacing-unit) * 2);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.next-link,
.prev-link {
    font-weight: 500;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--accent);
    transition: all 0.2s;
}

.next-link:hover,
.prev-link:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
}

/* Email CTAs */
.email-cta {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin: calc(var(--spacing-unit) * 2) 0 var(--spacing-unit) 0;
}

button.email-btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 1rem 2rem;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.4;
}

button.email-btn:hover {
    background: var(--text-primary);
    transform: translateY(-2px);
}

/* Lists */
ul, ol {
    margin-left: 2rem;
    margin-bottom: var(--spacing-unit);
}

li {
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-unit);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 700;
    background-color: var(--code-bg);
}

/* Footer */
.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    border-top: 2px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Section index list (core-issues, infrastructure) */
.section-list {
    list-style: none;
    margin-left: 0;
}

.section-list li {
    margin-bottom: 1.5rem;
}

/* Hover-reveal link (power quality hidden page) */
.hover-reveal {
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s;
}

.hover-reveal:hover,
p:hover .hover-reveal {
    opacity: 1;
}

/* Placeholder content indicator */
.content-placeholder {
    background: var(--code-bg);
    border-left: 4px solid var(--accent);
    padding: var(--spacing-unit);
    margin: calc(var(--spacing-unit) * 2) 0;
    font-style: italic;
}

/* Vision mode toggle dropdown */
#vision-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 200;
}

#vision-dropdown.active {
    display: block;
}

#vision-dropdown button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

#vision-dropdown button:hover {
    background: var(--code-bg);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --font-size-base: 16px;
    }
    
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        flex-wrap: wrap;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* ACGEOS Vertical Spacing Scale — em-based, scales with font size */
.space-xs { display: block; margin-top: 1em; }
.space-s  { display: block; margin-top: 2em; }
.space-m  { display: block; margin-top: 3em; }
.space-l  { display: block; margin-top: 4em; }
.space-xl { display: block; margin-top: 6em; }
