/* Lightning Protection & Earthing Design Guide - Main Stylesheet */
/* Strict adherence to design specifications */

/* ==================== CSS RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== COLOR SCHEME ==================== */
:root {
    /* Primary Colors */
    --primary-blue: #0D6EFD;
    --secondary-green: #198754;
    
    /* Background Colors */
    --bg-white: #FFFFFF;
    --bg-light-gray: #F8F9FA;
    
    /* Text Colors */
    --text-dark-gray: #212529;
    --text-gray: #6C757D;
    
    /* Border Colors */
    --border-gray: #DEE2E6;
    
    /* Layout Dimensions - STRICTLY ENFORCED */
    --sidebar-width: 250px;
    --content-max-width: 1000px;
    --menu-item-height: 80px; /* 5rem - STRICTLY ENFORCED */
    --hero-height: 340px;
    --card-height: 130px; /* STRICTLY ENFORCED */
}

/* ==================== TYPOGRAPHY ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark-gray);
    background-color: var(--bg-white);
}

h1 {
    font-size: 2.5rem; /* 40px */
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem; /* 32px */
    font-weight: 700;
    color: var(--primary-blue);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    color: var(--primary-blue);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    color: var(--primary-blue);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==================== LAYOUT - TWO COLUMN ==================== */
.container {
    display: flex;
    min-height: 100vh;
}

/* ==================== LEFT SIDEBAR - FIXED ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width); /* STRICTLY 250px */
    height: 100vh;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-gray);
    overflow-y: auto;
    z-index: 1000;
}

/* Logo Area */
.logo-area {
    background-color: var(--bg-light-gray);
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-gray);
}

.logo-area img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 0.75rem auto;
}

.logo-area a {
    display: block;
    color: var(--primary-blue);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Navigation Menu */
.nav-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-menu li {
    /* STRICTLY ENFORCED: Each menu item MUST be exactly 80px (5rem) in height */
    height: var(--menu-item-height); /* 80px - NO DEVIATION ALLOWED */
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-gray);
    position: relative;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0.75rem 1rem;
    color: var(--text-dark-gray);
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-menu li a:hover {
    background-color: var(--bg-light-gray);
    text-decoration: none;
    cursor: pointer;
}

/* Active State Indicator */
.nav-menu li.active {
    background-color: var(--bg-light-gray);
}

.nav-menu li.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-blue);
}

/* File Icon */
.nav-menu li a::before {
    content: '📄';
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* ==================== RIGHT CONTENT AREA ==================== */
.main-content {
    margin-left: var(--sidebar-width); /* 250px */
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background-color: var(--bg-white);
}

.content-wrapper {
    max-width: var(--content-max-width); /* 1000px - STRICTLY ENFORCED */
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* ==================== HERO SECTION (Homepage Only) ==================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #5DADE2 100%);
    border-radius: 1rem; /* 16px - STRICTLY ENFORCED rounded corners */
    padding: 3.75rem 3rem; /* 60px top/bottom, 50px left/right */
    margin-bottom: 2rem;
    color: white;
    max-width: var(--content-max-width); /* 1000px */
    height: var(--hero-height); /* 340px */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-section .version-tag {
    font-size: 0.875rem; /* 14px */
    color: white;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero-section h1 {
    font-size: 2.5rem; /* 40px */
    font-weight: 700;
    color: white; /* STRICTLY ENFORCED: White text on blue background */
    margin-bottom: 1rem;
}

.hero-section .subtitle {
    font-size: 1rem; /* 16px */
    color: white;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

.btn-primary {
    background-color: white;
    color: var(--primary-blue);
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    border: 2px solid white;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* ==================== CHAPTER NAVIGATION CARDS ==================== */
.chapter-grid-wrapper {
    background-color: var(--bg-light-gray); /* STRICTLY ENFORCED: Uniform light gray background */
    padding: 2.5rem;
    border-radius: 0.5rem;
    max-width: var(--content-max-width); /* 1000px - STRICTLY ENFORCED */
    margin: 2rem auto;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* STRICTLY ENFORCED: 20px gap between rows and columns */
}

.chapter-card {
    background-color: white;
    border: 2px dashed var(--secondary-green); /* STRICTLY ENFORCED: Green dashed border */
    border-radius: 0.5rem;
    padding: 15px;
    height: var(--card-height); /* 130px - STRICTLY ENFORCED */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.chapter-card:hover {
    background-color: var(--bg-light-gray);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.chapter-card-icon {
    font-size: 2.5rem; /* 40px */
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.chapter-card-title {
    font-size: 1rem; /* 16px */
    font-weight: 700;
    color: var(--text-dark-gray);
    line-height: 1.3;
}

.chapter-card-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--secondary-green);
    color: white;
    font-size: 0.75rem; /* 12px */
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* ==================== CONTENT SECTIONS ==================== */
.content-section {
    margin-bottom: 3rem;
}

.content-section img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-gray);
}

.image-caption {
    text-align: center;
    font-size: 0.875rem; /* 14px */
    color: var(--text-gray);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ==================== TABLES ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: white;
    border: 1px solid var(--border-gray);
}

thead {
    background-color: var(--bg-light-gray);
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-dark-gray);
    border-bottom: 1px solid var(--border-gray);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-gray);
}

tbody tr:hover {
    background-color: var(--bg-light-gray);
}

/* ==================== LISTS ==================== */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .chapter-grid {
        grid-template-columns: 1fr;
    }
}
