/* ============================================================================
   Grade 9 Mathematics Curriculum Website - Main Stylesheet
   2023 Ontario De-streamed Curriculum (MTH1W)
   ============================================================================ */

/* ============================================================================
   CSS RESET AND BASE STYLES
   ============================================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: #333333;
    background-color: #F8F9FA;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    color: #2C3E50;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    color: #2C3E50;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #16A085;
}

h3 {
    font-size: 1.5rem;
    color: #16A085;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    color: #333333;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

strong {
    font-weight: bold;
    color: #2C3E50;
}

/* ============================================================================
   LAYOUT STRUCTURE
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================================================
   HEADER AND NAVIGATION
   ============================================================================ */

header {
    background-color: #2C3E50;
    color: #FFFFFF;
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-title {
    margin: 0;
    font-size: 2rem;
    color: #FFFFFF;
}

.site-subtitle {
    font-size: 1rem;
    color: #16A085;
    font-weight: normal;
    margin: 0;
}

.course-period {
    font-size: 0.9rem;
    color: #FFFFFF;
    opacity: 0.9;
    font-style: italic;
}

/* Navigation Menu */
nav {
    background-color: #16A085;
    margin-top: 1rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #FFFFFF;
    text-decoration: none;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a:focus {
    background-color: #138F73;
}

.nav-menu a.active {
    background-color: #2C3E50;
}

/* Dropdown Menu for Weekly Lessons */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.75rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #16A085;
    min-width: 250px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    list-style: none;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #138F73;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background-color: #FFFFFF;
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb-list li::after {
    content: '›';
    margin-left: 0.5rem;
    color: #16A085;
}

.breadcrumb-list li:last-child::after {
    content: '';
}

.breadcrumb-list a {
    color: #16A085;
    text-decoration: none;
}

.breadcrumb-list a:hover {
    text-decoration: underline;
}

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */

main {
    background-color: #FFFFFF;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 60vh;
}

/* ============================================================================
   CONTENT SECTIONS
   ============================================================================ */

section {
    margin-bottom: 2.5rem;
}

section:last-child {
    margin-bottom: 0;
}

.section-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333333;
    margin-bottom: 2rem;
}

/* ============================================================================
   LISTS
   ============================================================================ */

ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.8;
}

ul li, ol li {
    margin-bottom: 0.5rem;
}

ul ul, ol ol, ul ol, ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ============================================================================
   CARDS AND CONTENT BOXES
   ============================================================================ */

.card {
    background-color: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #F8F9FA;
    padding: 1rem 1.5rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #16A085;
}

.card-header h3 {
    margin: 0;
    color: #2C3E50;
}

.info-box {
    background-color: #E8F5F3;
    border-left: 4px solid #16A085;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.warning-box {
    background-color: #FFF3E0;
    border-left: 4px solid #E74C3C;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

/* ============================================================================
   BADGES AND LABELS
   ============================================================================ */

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    border-radius: 4px;
    color: #FFFFFF;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge-number {
    background-color: #3498DB;
}

.badge-algebra {
    background-color: #9B59B6;
}

.badge-data {
    background-color: #E67E22;
}

.badge-geometry {
    background-color: #27AE60;
}

.badge-financial {
    background-color: #16A085;
}

.badge-sel {
    background-color: #E74C3C;
}

.badge-thinking {
    background-color: #34495E;
}

/* ============================================================================
   LESSON HEADER
   ============================================================================ */

.lesson-header {
    background: linear-gradient(135deg, #2C3E50 0%, #16A085 100%);
    color: #FFFFFF;
    padding: 2rem;
    margin: -2rem -2rem 2rem -2rem;
    border-radius: 8px 8px 0 0;
}

.lesson-week {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.lesson-title {
    font-size: 2.5rem;
    color: #FFFFFF;
    margin: 0.5rem 0;
}

.lesson-dates {
    font-size: 1rem;
    opacity: 0.9;
    font-style: italic;
}

/* ============================================================================
   LESSON NAVIGATION
   ============================================================================ */

.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background-color: #F8F9FA;
    border-radius: 8px;
}

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

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: #16A085;
    color: #FFFFFF;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #138F73;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: #2C3E50;
    color: #FFFFFF;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #1A252F;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    background-color: transparent;
    color: #16A085;
    border: 2px solid #16A085;
}

.btn-outline:hover,
.btn-outline:focus {
    background-color: #16A085;
    color: #FFFFFF;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================================================
   TABLES
   ============================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background-color: #FFFFFF;
}

thead {
    background-color: #2C3E50;
    color: #FFFFFF;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #DEE2E6;
}

tbody tr:nth-child(even) {
    background-color: #F8F9FA;
}

tbody tr:hover {
    background-color: #E8F5F3;
}

/* ============================================================================
   WEEKLY OVERVIEW GRID
   ============================================================================ */

.weekly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.week-card {
    background-color: #FFFFFF;
    border: 2px solid #DEE2E6;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333333;
    display: block;
}

.week-card:hover {
    border-color: #16A085;
    box-shadow: 0 4px 12px rgba(22, 160, 133, 0.2);
    transform: translateY(-4px);
}

.week-number {
    font-size: 0.9rem;
    color: #16A085;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.week-topic {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 0.5rem;
}

.week-dates {
    font-size: 0.85rem;
    color: #666666;
    margin-bottom: 0.75rem;
}

.week-strand {
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    background-color: #E8F5F3;
    color: #16A085;
    border-radius: 4px;
    font-weight: 600;
}

/* ============================================================================
   LESSON STRUCTURE SECTIONS
   ============================================================================ */

.lesson-part {
    background-color: #F8F9FA;
    border-left: 5px solid #16A085;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.lesson-part h3 {
    color: #2C3E50;
    margin-top: 0;
}

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

.lesson-timing {
    font-size: 0.9rem;
    color: #16A085;
    font-weight: 600;
    background-color: #FFFFFF;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.lesson-purpose {
    font-style: italic;
    color: #666666;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #FFFFFF;
    border-radius: 4px;
}

/* ============================================================================
   CALL TO ACTION SECTION
   ============================================================================ */

.cta-section {
    background: linear-gradient(135deg, #2C3E50 0%, #16A085 100%);
    color: #FFFFFF;
    padding: 3rem 2rem;
    margin: 3rem -2rem -2rem -2rem;
    border-radius: 0 0 8px 8px;
    text-align: center;
}

.cta-section h2 {
    color: #FFFFFF;
    border-bottom: none;
    margin-top: 0;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.cta-buttons .btn {
    background-color: #FFFFFF;
    color: #2C3E50;
}

.cta-buttons .btn:hover {
    background-color: #F8F9FA;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    background-color: #2C3E50;
    color: #FFFFFF;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer-content {
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

.footer-copyright {
    font-weight: 600;
}

.footer-source {
    font-style: italic;
    opacity: 0.9;
}

.footer-updated {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet (768px to 1199px) */
@media (max-width: 1199px) {
    .container {
        padding: 0 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .lesson-title {
        font-size: 2rem;
    }
    
    .weekly-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Mobile and Small Tablet (below 768px) */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    main {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .lesson-header {
        padding: 1.5rem;
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    }
    
    .lesson-title {
        font-size: 1.75rem;
    }
    
    .lesson-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .lesson-nav-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .weekly-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-section {
        padding: 2rem 1rem;
        margin: 2rem -1.5rem -1.5rem -1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    header,
    nav,
    footer,
    .breadcrumb,
    .lesson-nav,
    .cta-section,
    .btn {
        display: none !important;
    }
    
    main {
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    h1 {
        font-size: 24pt;
        page-break-after: avoid;
    }
    
    h2 {
        font-size: 18pt;
        page-break-after: avoid;
        border-bottom: 2pt solid black;
    }
    
    h3 {
        font-size: 14pt;
        page-break-after: avoid;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .lesson-part {
        page-break-inside: avoid;
        border-left: 3pt solid black;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }
    
    .lesson-header {
        background: white !important;
        color: black !important;
        border: 2pt solid black;
        padding: 1rem;
        margin: 0 0 1rem 0;
    }
    
    .badge {
        border: 1pt solid black;
        color: black !important;
        background: white !important;
    }
}

/* ============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================ */

/* Focus indicators */
a:focus,
button:focus,
.btn:focus {
    outline: 3px solid #16A085;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #16A085;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
