/* ==========================================================
   TypingTutor.Online
   Responsive Site Shell v5.5
   File: css/layout.css
========================================================== */

#app {
    width: 100%;
    min-height: 100vh;

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
}

/* Shared width for header, tutor and footer */
.site-shell,
#courseModePanel,
.feature-placeholder {
    box-sizing: border-box;
    width: min(1480px, calc(100% - 34px));
    margin-inline: auto;
}

/* Header */
#header {
    position: relative;
    z-index: 100;

    width: 100%;

    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: grid;
    grid-template-columns:
        minmax(235px, 300px)
        minmax(0, 1fr)
        auto;

    gap: clamp(12px, 2vw, 28px);
    align-items: center;

    min-height: 72px;
    padding-block: 8px;
}

.logo,
#modeSwitcher,
.header-tools {
    min-width: 0;
}

.header-tools {
    justify-self: end;
}

/* Main */
#mainContent {
    width: 100%;
    min-width: 0;
    padding: 10px 0 28px;
}

/* Footer */
#footer {
    width: 100%;

    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    min-height: 58px;
    padding-block: 10px;
}

/* Laptop */
@media (max-width: 1180px) {

    .header-inner {
        grid-template-columns:
            minmax(190px, 225px)
            minmax(0, 1fr)
            auto;

        gap: 10px;
    }

}

/* Tablet / narrow laptop */
@media (max-width: 900px) {

    .site-shell,
    #courseModePanel,
    .feature-placeholder {
        width: min(100% - 22px, 1480px);
    }

    .header-inner {
        grid-template-columns:
            minmax(0, 1fr)
            auto;

        gap: 8px 12px;
        min-height: 0;
        padding-block: 8px;
    }

    #modeSwitcher {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .header-tools {
        grid-column: 2;
        grid-row: 1;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

}

/* Mobile */
@media (max-width: 560px) {

    .site-shell,
    #courseModePanel,
    .feature-placeholder {
        width: min(100% - 14px, 1480px);
    }

    #mainContent {
        padding-top: 7px;
        padding-bottom: 18px;
    }

    .footer-inner {
        min-height: 0;
        padding-block: 14px;
    }

}
