/*
 * Theme CSS for BCLI Theme
 *
 * This stylesheet defines the layout and appearance of the BCLI
 * questions and answers website.  The design draws inspiration
 * from the provided Adobe XD mock‑up by employing a clear
 * hierarchy, generous white space, a distinctive accent colour and
 * subtle typographic contrasts.  Colours are stored in CSS
 * custom properties to make future adjustments easy.  The layout
 * uses Flexbox and CSS Grid to create a responsive two‑column
 * design with a fixed sidebar for the table of contents on larger
 * screens and a collapsible drawer on smaller screens.
 */

:root {
    --colour-primary: #004c91; /* deep blue inspired by BCLI branding */
    --colour-secondary: #0070c0; /* lighter accent blue */
    --colour-background: #f7f9fc; /* very light grey for page background */
    --colour-surface: #ffffff; /* white panels */
    --colour-text: #1a1a1a; /* nearly black for high contrast */
    --colour-link: var(--colour-primary);
    --colour-link-hover: var(--colour-secondary);
    --font-body: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Segoe UI Semibold', Roboto, Helvetica, Arial, sans-serif;
    --sidebar-width: 280px;
    --max-content-width: 1200px;
    --transition-speed: 0.3s;
}

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--colour-background);
    color: var(--colour-text);
    line-height: 1.6;
}

a {
    color: var(--colour-link);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover, a:focus {
    color: var(--colour-link-hover);
    text-decoration: underline;
}

/* Header */
.site-header {
    background: var(--colour-primary);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
}

.site-header .site-title {
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
}

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

.site-header nav a {
    color: #fff;
    font-weight: 500;
}

.site-header nav a:hover, .site-header nav a:focus {
    color: var(--colour-secondary);
}

/* Layout grid */
.site-container {
    display: flex;
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 2rem;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding-right: 2rem;
    position: sticky;
    top: 6rem;
    height: calc(100vh - 6rem);
    overflow-y: auto;
    background: var(--colour-background);
    border-right: 1px solid #e0e6ed;
}

.sidebar h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-top: 0;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--colour-link);
}

.sidebar a:hover, .sidebar a:focus {
    background: var(--colour-primary);
    color: #fff;
}

/* Main content area */
.content-area {
    flex-grow: 1;
    background: var(--colour-surface);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content-area h1, .content-area h2, .content-area h3, .content-area h4, .content-area h5, .content-area h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--colour-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-area h1 {
    font-size: 2rem;
}

.content-area h2 {
    font-size: 1.75rem;
}

.content-area h3 {
    font-size: 1.5rem;
}

.content-area h4 {
    font-size: 1.25rem;
}

.content-area p {
    margin: 1rem 0;
}

/* Accordion for questions */
.accordion-item {
    border-bottom: 1px solid #e0e6ed;
}

.accordion-title {
    cursor: pointer;
    padding: 1rem;
    font-weight: 600;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--colour-background);
}

.accordion-title:hover, .accordion-title:focus {
    background: #eef4fa;
}

.accordion-title:after {
    content: '+';
    font-size: 1.25rem;
    color: var(--colour-primary);
    transition: transform var(--transition-speed);
}

.accordion-title.active:after {
    content: '-';
}

.accordion-content {
    display: none;
    padding: 1rem;
    background: var(--colour-surface);
}

.accordion-content p:last-child {
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    background: var(--colour-primary);
    color: #fff;
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.site-footer a {
    color: #fff;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .site-container {
        flex-direction: column;
        padding: 1rem;
    }
    .sidebar {
        width: 100%;
        position: relative;
        top: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e6ed;
        margin-bottom: 1rem;
    }
    .content-area {
        padding: 1rem;
    }
}