/* ==========================================================================
   Home page (resources/views/app/website/index.php and home/*.php)
   Guest: code of the day, articles, forum, quiz of the week, challenges, examples, sign-up.
   Client: path to continue, then what's left to do.
   Linked by Modules\Website\Controllers\IndexController via $additional_css_files_links.
   Colours come from Bootstrap variables, so they follow the theme.
   ========================================================================== */

/* Hero ------------------------------------------------------------------- */

.hm-hero {
    padding: 4.5rem 0 5rem;
}

.hm-hero > .container {
    position: relative;
    z-index: 1;
}

.hm-hero-title {
    font-size: clamp(2.1rem, 4.6vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -.02em;
    text-wrap: balance;
    margin-bottom: 1rem;
}

.hm-hero-lead {
    max-width: 34rem;
    font-size: 1.125rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1.75rem;
}

.hm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

/* Code of the day -------------------------------------------------------- */

.hm-console {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg, .5rem);
    background: var(--bs-body-bg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.hm-console-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}

.hm-console-day {
    font-family: var(--bs-font-monospace);
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bs-primary);
}

.hm-console-title {
    margin: 0;
    font-size: 1rem;
}

.hm-console-code {
    display: block;
    width: 100%;
    min-height: 9rem;
    padding: 1rem;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: transparent;
    color: var(--bs-body-color);
    font-family: var(--bs-font-monospace);
    font-size: .9375rem;
    line-height: 1.6;
    tab-size: 4;
    white-space: pre;
    overflow-x: auto;
    resize: none;
}

.hm-console-code:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.hm-console-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
}

.hm-console-status {
    font-size: .875rem;
    color: var(--bs-secondary-color);
}

.hm-console-out {
    min-height: 6.5rem;
    max-height: 16rem;
    margin: 0 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius, .375rem);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    font-family: var(--bs-font-monospace);
    font-size: .9375rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow: auto;
}

.hm-console-out.is-idle {
    color: var(--bs-secondary-color);
}

.hm-console-out.is-error {
    border-color: var(--bs-danger);
    color: var(--bs-danger-text-emphasis, var(--bs-danger));
}

.hm-console-hint {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .25rem 1rem;
    margin: 0;
    padding: .75rem 1rem 1rem;
    font-size: .875rem;
    color: var(--bs-secondary-color);
}

.hm-console-hint a {
    white-space: nowrap;
}

/* Section heads ---------------------------------------------------------- */

.hm-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem 2rem;
    margin-bottom: 2rem;
}

.hm-head h2 {
    margin-bottom: .5rem;
}

.hm-intro {
    max-width: 44rem;
    margin: 0;
    color: var(--bs-secondary-color);
}

.hm-more {
    white-space: nowrap;
}

.hm-empty {
    color: var(--bs-secondary-color);
}

/* Cards: quizzes, challenges, examples, paths ---------------------------- */

.hm-card .card-body {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.hm-card-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}

.hm-card-title a {
    color: inherit;
    text-decoration: none;
}

.hm-card:hover .hm-card-title a,
.hm-card-title a:focus-visible {
    color: var(--bs-primary);
}

.hm-card-text {
    margin: 0;
    color: var(--bs-secondary-color);
}

.hm-card-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .8125rem;
    color: var(--bs-secondary-color);
}

.hm-card-lock {
    color: var(--bs-warning-text-emphasis, var(--bs-warning));
}

.hm-card-status {
    margin: 0;
    font-size: .8125rem;
    font-weight: 600;
}

.hm-card-status--warning {
    color: var(--bs-warning-text-emphasis, var(--bs-warning));
}

.hm-card-status--info {
    color: var(--bs-info-text-emphasis, var(--bs-info));
}

.hm-card-action {
    margin-top: auto;
    padding-top: .4rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--bs-primary);
}

.hm-card--featured .card-body {
    padding: 1.75rem;
}

.hm-card--featured .hm-card-title {
    font-size: 1.5rem;
}

.hm-card--featured .hm-card-text {
    max-width: 48rem;
}

/* Forum threads ---------------------------------------------------------- */

.hm-threads {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--bs-border-color);
}

.hm-thread {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.hm-thread-main {
    min-width: 0;
}

.hm-thread-title {
    margin: 0 0 .2rem;
    font-size: 1.05rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.hm-thread-title a {
    text-decoration: none;
}

.hm-thread-title a:hover {
    text-decoration: underline;
}

.hm-thread-meta {
    margin: 0;
    font-size: .8125rem;
    color: var(--bs-secondary-color);
}

.hm-thread-category {
    color: var(--bs-body-color);
}

.hm-thread-count {
    flex: 0 0 auto;
    font-size: .875rem;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Client: the path to continue ------------------------------------------- */

.hm-hero--client .hm-hero-title {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.hm-path {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.5rem 2.5rem;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg, .5rem);
    background: var(--bs-body-bg);
}

.hm-path-label {
    margin: 0 0 .35rem;
    font-family: var(--bs-font-monospace);
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.hm-path-name {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.hm-path-name a {
    color: inherit;
    text-decoration: none;
}

.hm-path-name a:hover {
    color: var(--bs-primary);
}

.hm-path-numbers {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
    font-size: .875rem;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
}

.hm-path-bar {
    display: block;
    width: 100%;
    height: .5rem;
    border: 0;
    border-radius: 1rem;
    background: var(--bs-tertiary-bg);
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
}

.hm-path-bar::-webkit-progress-bar {
    background: var(--bs-tertiary-bg);
}

.hm-path-bar::-webkit-progress-value {
    background: var(--bs-success);
}

.hm-path-bar::-moz-progress-bar {
    background: var(--bs-success);
}

.hm-path-item {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Sign-up ---------------------------------------------------------------- */

.hm-cta > .container {
    position: relative;
    z-index: 1;
}

.hm-cta-title {
    font-size: clamp(1.7rem, 3.6vw, 2.4rem);
    text-wrap: balance;
    margin-bottom: 1rem;
}

.hm-cta-text {
    font-size: 1.0625rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1.75rem;
}

/* Small screens ---------------------------------------------------------- */

@media (max-width: 991.98px) {
    .hm-hero {
        padding: 3rem 0 3.5rem;
    }
}

@media (max-width: 767.98px) {
    .hm-path {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-console-code,
    .hm-console-out {
        font-size: .875rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hm-card-title a,
    .hm-path-name a {
        transition: color .15s ease;
    }
}
