/*
 * COS226 FAQ Page Styles
 * Modern Bootstrap 5 based styling
 */

/* ============================================
   CSS Variables for Course Branding
   ============================================ */
:root {
    --cos226-primary: #E77500;      /* Princeton orange */
    --cos226-secondary: #000000;     /* Black */
    --cos226-light: #FBE8E5;         /* Light pink/salmon */
    --cos226-code-color: #c7254e;    /* Code text color */
    --cos226-code-bg: #f9f2f4;       /* Code background */
}

/* ============================================
   Body & Typography
   ============================================ */
body {
    padding-top: 80px;  /* Space for fixed navbar */
    line-height: 1.6;
}

/* Main content container */
.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cos226-secondary);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--cos226-primary);
}

/* First h1 shouldn't have as much top margin */
.main-content > h1:first-of-type {
    margin-top: 1.5rem;
}

/* Section summaries (TL;DR) */
.section-summary {
    background-color: #f8f9fa;
    border-left: 3px solid var(--cos226-primary);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    color: #555;
}

/* ============================================
   Navigation Bar
   ============================================ */
.navbar {
    background-color: var(--cos226-light) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-variant: small-caps;
    font-size: 1.3rem;
    color: #222 !important;
}

.navbar-brand i {
    color: var(--cos226-primary);
}

.navbar-nav .nav-link {
    font-weight: 600;
    color: #666 !important;
    margin-left: 0.5rem;
}

.navbar-nav .nav-link:hover {
    color: #000 !important;
}

/* ============================================
   Code Styling
   ============================================ */

/* Inline code */
code {
    color: var(--cos226-code-color);
    background-color: var(--cos226-code-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

/* ============================================
   Collapsible Sections (Details/Summary)
   ============================================ */
details {
    margin: 1rem 0;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

details summary {
    padding: 0.875rem 1.25rem;
    background-color: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
}

details summary:hover {
    background-color: #e9ecef;
}

details summary::before {
    content: '\25B6';  /* Right-pointing triangle */
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    color: var(--cos226-primary);
}

details[open] summary::before {
    transform: rotate(90deg);
}

details[open] summary {
    border-bottom: 1px solid #dee2e6;
}

details > div {
    padding: 1rem 1.25rem;
}

/* ============================================
   Lists
   ============================================ */
ul, ol {
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ============================================
   Links
   ============================================ */
a {
    color: var(--cos226-primary);
    text-decoration: none;
}

a:hover {
    color: #c66000;
    text-decoration: underline;
}

/* ============================================
   Footer
   ============================================ */
footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid #dee2e6;
    color: #666;
    font-size: 0.9rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    details summary {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    details > div {
        padding: 0.875rem 1rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar {
        position: relative;
    }

    body {
        padding-top: 0;
    }

    details {
        display: block;
        border: none;
    }

    details summary {
        background: none;
        font-weight: bold;
    }

    details summary::before {
        display: none;
    }

    details > div {
        display: block !important;
        padding-left: 0;
    }
}
