/* Reading typography — Open Sans, sizes/line-height aligned with CPS276 course book site */
body.trades-reading {
    --bs-body-font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bs-body-font-size: 1.1rem;
    --bs-body-line-height: 1.8;
    --bs-body-color: #333;
    --bs-heading-color: #212529;
    font-family: var(--bs-body-font-family);
    font-size: var(--bs-body-font-size);
    line-height: var(--bs-body-line-height);
    color: var(--bs-body-color);
}

body.trades-reading .trades-content p,
body.trades-reading .topic-slide p {
    margin: 1rem 0;
    font-size: 1.1rem;
    line-height: 1.8;
}

body.trades-reading .trades-content h2,
body.trades-reading .topic-slide__title,
body.trades-reading .topic-slide h2.topic-slide__title {
    font-size: clamp(1.85rem, 4.5vw, 2.5rem);
    font-weight: 300;
    line-height: 1.2;
    margin-top: 0.35rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    color: var(--bs-heading-color);
}

body.trades-reading .topic-slide .topic-slide__title,
body.trades-reading .topic-slide h2.topic-slide__title {
    margin-top: 0;
}

body.trades-reading .topic-slide__lead {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    color: #333;
}

body.trades-reading .trades-content h3 {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.25;
    margin-top: 1.25rem;
    margin-bottom: 0.65rem;
}

body.trades-reading .trades-content h4 {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

body.trades-reading .trades-content ul,
body.trades-reading .trades-content ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

body.trades-reading .trades-content ul li,
body.trades-reading .trades-content ol li,
body.trades-reading .topic-slide__list li {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.35rem;
    color: #333;
}

body.trades-reading .trades-content code {
    color: #004cdb;
    font-size: 1.05rem;
    line-height: 1.8;
}

body.trades-reading .shortcut-keys-table,
body.trades-reading .shortcut-keys-table td,
body.trades-reading .shortcut-keys-table th {
    font-size: 1.1rem;
}

body.trades-reading .shortcut-keys-table kbd {
    font-size: 1rem;
}

body.trades-reading .login-header h2 {
    font-family: var(--bs-body-font-family);
    font-size: 1.85rem;
    font-weight: 400;
    line-height: 1.25;
}

body.trades-reading .login-header .text-muted {
    font-size: 1.05rem;
}

.login-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    background-color: #fff;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #212529;
}

.login-header img {
    width: 80px;
    margin-bottom: 1rem;
}

.login-container .form-label {
    color: #495057;
    font-size: 0.875rem;
}

body.trades-reading .login-container .form-label {
    font-size: 1rem;
}

.login-container .form-control {
    border-radius: 0.375rem;
    border-color: #dee2e6;
}

.login-container .form-control:focus {
    border-color: #adb5bd;
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.15);
}

.btn-login {
    background-color: #2c3e50;
    border-color: #2c3e50;
    color: white;
    border-radius: 0.375rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    font-weight: 500;
}

.btn-login:hover {
    background-color: #34495e;
    border-color: #34495e;
    color: white;
}

.btn-login:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.35);
}

/* Logged-in course layout */
.trades-layout {
    min-height: 0;
}

.trades-hamburger {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1040;
}

.trades-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    min-height: 100vh;
}

.trades-sidebar-header {
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 0.5rem;
}

.trades-sidebar-header h3 {
    color: #fff;
    font-weight: 600;
}

.trades-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.trades-subject-accordion {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.trades-nav-subject {
    margin-bottom: 0.25rem;
}

.trades-nav-subject-toggle {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0.25rem;
}

.trades-nav-subject-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.trades-nav-topics {
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.trades-nav-topics li a {
    display: block;
    padding: 0.35rem 0.75rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 0.25rem;
}

.trades-nav-topics li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.trades-nav-topics li.active > a,
.trades-nav-topics li.active a {
    color: #fff;
    background: rgba(52, 152, 219, 0.45);
}

.trades-sidebar-footer {
    padding: 0 1rem;
}

.trades-main {
    background: #f8f9fa;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
}

.trades-content {
    max-width: none;
    width: 100%;
    margin: 0;
    background: transparent;
    padding: 1.25rem 1.25rem 2.5rem;
    border-radius: 0;
    box-shadow: none;
}

@media (min-width: 992px) {
    .trades-content {
        padding: 1.5rem 2rem 3rem;
    }
}

.trades-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .trades-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1035;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    }

    .trades-sidebar.open {
        transform: translateX(0);
    }

    .trades-main {
        width: 100%;
    }
}

@media (min-width: 992px) {
    .trades-hamburger {
        display: none !important;
    }

    .trades-sidebar-backdrop {
        display: none !important;
    }
}

/* Topic content: gray-striped reference tables */
.shortcut-keys-table {
    --bs-table-striped-bg: #e2e6ea;
    --bs-table-bg: #f8f9fa;
    --bs-table-border-color: #ced4da;
    border-color: var(--bs-table-border-color);
}

.shortcut-keys-table thead th {
    background-color: #dee2e6 !important;
    color: #212529;
    border-color: #ced4da;
    font-weight: 600;
}

.shortcut-keys-table td,
.shortcut-keys-table th {
    border-color: #ced4da;
    vertical-align: middle;
}

.shortcut-keys-table kbd {
    background: #e9ecef;
    color: #212529;
    border: 1px solid #ced4da;
    border-radius: 0.2rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.9em;
}

/* Start menu page: image floated, text wraps (full-width flow, no columns) */
.topic-start-menu-float {
    width: 100%;
    max-width: none;
}

.topic-start-menu-float::after {
    content: "";
    display: table;
    clear: both;
}

.topic-start-menu-figure {
    float: right;
    width: min(46%, 480px);
    max-width: 100%;
    margin: 0 0 1rem 1.5rem;
}

.topic-start-menu-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.35rem;
}

@media (max-width: 767.98px) {
    .topic-start-menu-figure {
        float: none;
        width: 100%;
        max-width: 28rem;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.25rem;
    }
}

/* Slide-style topic pages: text left, image right (same canvas as other topics) */
.topic-inline-icon {
    vertical-align: text-bottom;
    display: inline-block;
    margin: 0 0.1rem;
}

.topic-slide {
    background: transparent;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.topic-slide__text {
    border-left: none;
    padding-left: 0;
    padding-top: 0;
}

.topic-slide__list {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.topic-slide__list li:last-child {
    margin-bottom: 0;
}

.topic-slide__figure {
    text-align: center;
}

.topic-slide__img.img-fluid {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: min(92vh, 1200px);
    margin-left: auto;
    margin-right: auto;
    display: block;
    border: 0;
    border-radius: 0.35rem;
    box-shadow: none;
}

.topic-slide__caption {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
}

/* -------------------------------------------------------------------------
   Project asset download cards (projectAssets.html for Excel, Word,
   PowerPoint). Loaded via php/partials/head.php → css/main.css.
   Wrap content: <div class="trades-project-assets">…</div> (Excel green).
   For Word/PowerPoint add: trades-project-assets--office (blue accent).
   ------------------------------------------------------------------------- */

.trades-project-assets {
    --tpa-accent: #217346;
    --tpa-accent-strong: #185c37;
    --tpa-thumb-1: #e8f5e9;
    --tpa-thumb-2: #c8e6c9;
    --tpa-file-color: #1b5e20;
}

.trades-project-assets--office {
    --tpa-accent: #2563eb;
    --tpa-accent-strong: #1d4ed8;
    --tpa-thumb-1: #e8eef7;
    --tpa-thumb-2: #dce6f5;
    --tpa-file-color: #475569;
}

.trades-project-assets .asset-dl-wrap {
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
    margin: 1.25rem 0 2rem;
}

.trades-project-assets .asset-dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
}

.trades-project-assets .asset-dl-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #c5cbd3;
    border-radius: 12px;
    overflow: hidden;
    background: #fafbfc;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.trades-project-assets .asset-dl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    border-color: var(--tpa-accent);
}

.trades-project-assets .asset-dl-card:focus {
    outline: 2px solid var(--tpa-accent);
    outline-offset: 2px;
}

.trades-project-assets .asset-dl-thumb {
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, var(--tpa-thumb-1) 0%, var(--tpa-thumb-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.trades-project-assets .asset-dl-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.trades-project-assets .asset-dl-thumb--file {
    flex-direction: column;
    gap: 0.35rem;
    color: var(--tpa-file-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.trades-project-assets .asset-dl-thumb--file > span:first-child {
    font-size: 2.25rem;
    line-height: 1;
}

.trades-project-assets .asset-dl-body {
    padding: 1rem 1.1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.trades-project-assets .asset-dl-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    word-break: break-word;
}

.trades-project-assets .asset-dl-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.trades-project-assets .asset-dl-cta {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    align-self: flex-start;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: var(--tpa-accent);
    color: #fff !important;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    pointer-events: none;
}

.trades-project-assets .asset-dl-card:hover .asset-dl-cta {
    background: var(--tpa-accent-strong);
}

.trades-project-assets .asset-dl-cta svg {
    flex-shrink: 0;
    opacity: 0.95;
}

.trades-project-assets .asset-dl-hint {
    font-size: 0.9rem;
    color: #64748b;
    max-width: 42rem;
}
