/* ==========================================================================
   SolarSavingsHub.org - Global Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: hsl(142, 76%, 36%);       /* Emerald Green */
    --primary-light: hsl(142, 72%, 95%);
    --primary-dark: hsl(142, 76%, 24%);
    
    --accent: rgb(245, 158, 11);         /* Sun Amber Gold */
    --bg-base: rgb(248, 250, 252);       
    --bg-card: rgb(255, 255, 255);       
    
    --text-main: rgb(51, 65, 85);        
    --text-title: rgb(15, 23, 42);       
    --text-muted: rgb(100, 116, 139);    
    
    --border: rgb(226, 232, 240);        
    --ring: rgba(16, 185, 129, 0.2);
    
    /* Layout Tokens */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.05), 0 1px 2px -1px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(15,23,42,0.06), 0 4px 6px -4px rgba(15,23,42,0.06);
    --shadow-lg: 0 20px 25px -5px rgba(15,23,42,0.08), 0 8px 10px -6px rgba(15,23,42,0.08);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --max-width: 1200px;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-title);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* Header */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-title);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1010;
}

.logo span { color: var(--primary); }

.nav-container {
    display: block;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

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

/* Dropdown styling */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    list-style: none;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    text-align: left;
}

.dropdown-menu a:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.menu-toggle-checkbox, .menu-toggle-label {
    display: none;
}

@media (min-width: 769px) {
    .nav-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile responsive menu */
@media (max-width: 768px) {
    .menu-toggle-label {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        cursor: pointer;
        z-index: 1010;
    }
    
    .menu-toggle-label span {
        display: block;
        height: 2px;
        width: 100%;
        background-color: var(--text-title);
        border-radius: 2px;
        transition: var(--transition);
    }
    
    .menu-toggle-checkbox:checked ~ .menu-toggle-label span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle-checkbox:checked ~ .menu-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-checkbox:checked ~ .menu-toggle-label span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: white;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        padding: 5rem 2rem 2rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
    }
    
    .menu-toggle-checkbox:checked ~ .nav-container {
        right: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }
    
    .nav-link {
        font-size: 1.1rem;
        width: 100%;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border);
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--primary);
        background-color: var(--bg-base);
        margin-top: 0.5rem;
        margin-left: 1rem;
        padding: 0;
        opacity: 1;
        visibility: visible;
        display: none;
        min-width: 0;
    }
    
    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu,
    .nav-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
}

/* Main & Hero */
.main-content {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 4rem 1.5rem;
    background: radial-gradient(circle at top right, var(--primary-light), transparent 60%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-title), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
}

/* Calculator Grid */
.calc-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (max-width: 900px) {
    .calc-grid { grid-template-columns: 1fr; }
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
}

.calc-title-box {
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.input-value-display {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--accent);
}

/* Results Box */
.calc-results {
    background-color: var(--text-title);
    color: white;
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.result-main {
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1.5rem;
}

.result-main .val {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.result-main .lbl {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item .lbl { color: rgba(255,255,255,0.7); }
.result-item .val { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; }
.result-item.highlight .val { color: var(--primary); }

/* Silo Grid */
.section-header {
    margin-bottom: 2rem;
}

.section-header h2 { font-size: 2rem; }
.section-header p { color: var(--text-muted); }

.silo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.silo-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.silo-card:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.silo-icon {
    font-size: 1.5rem;
    background-color: var(--primary-light);
    color: var(--primary);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.silo-card h3 { font-size: 1.25rem; }
.silo-card p { color: var(--text-muted); font-size: 0.95rem; flex-grow: 1; }

/* Footer */
.site-footer {
    background-color: var(--text-title);
    color: rgba(255,255,255,0.7);
    padding: 4rem 1.5rem 1.5rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-column h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
}

.footer-column p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.6);
    max-width: 320px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    padding: 0;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    margin-top: 3rem;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.3rem;
        text-align: center;
    }
}

/* ==========================================================================
   Phase 2: SEO Components (Timeline & Accordion)
   ========================================================================== */

/* Vertical Application Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 9px;
    width: 3px;
    height: 100%;
    background-color: var(--primary-light);
    border-radius: 4px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2.5rem;
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--primary-light);
    z-index: 2;
}

.timeline-content {
    background: var(--bg-base);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(16, 185, 129, 0.3);
}

.timeline-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-title);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Native HTML5 FAQ Accordion */
.faq-section {
    max-width: 800px;
    margin: 3rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

details.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

details.faq-item[open] {
    box-shadow: var(--shadow-sm);
    border-color: rgba(16, 185, 129, 0.4);
}

summary.faq-question {
    padding: 1.25rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-title);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-base);
}

summary.faq-question::-webkit-details-marker {
    display: none;
}

summary.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary);
    transition: transform 0.3s ease;
}

details.faq-item[open] summary.faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 1.5rem;
    color: var(--text-main);
    line-height: 1.6;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
