/* JuggleBoard Help: Material for MkDocs dressed to match juggleboard.com
   (website/web/styles.css). Colours, header, type, notes and footer. */

/* Colours ----------------------------------------------------------------- */
:root,
[data-md-color-scheme="default"] {
    --jb-green: #4CAF50;
    --jb-dark-green: #2E7D32;
    --jb-light-green: #E8F5E9;
    --jb-heading: #2E7D32;
    --jb-ink: #2E2E2E;
    --jb-charcoal: #2E2E2E;

    --md-primary-fg-color: #2E7D32;
    --md-primary-fg-color--light: #4CAF50;
    --md-primary-fg-color--dark: #1B5E20;
    --md-accent-fg-color: #1B5E20;
    --md-accent-fg-color--transparent: rgba(46, 125, 50, 0.1);
    --md-typeset-a-color: #2E7D32;
}

[data-md-color-scheme="slate"] {
    --md-hue: 130;
    --jb-heading: #9BD99F;
    --jb-ink: #E3EEE4;
    --jb-light-green: rgba(124, 198, 129, 0.12);

    --md-primary-fg-color: #7CC681;
    --md-primary-fg-color--light: #9BD99F;
    --md-primary-fg-color--dark: #5BAF61;
    --md-accent-fg-color: #9BD99F;
    --md-accent-fg-color--transparent: rgba(124, 198, 129, 0.12);
    --md-typeset-a-color: #8FD394;
}

/* Header: white like the website's, logo and green name ------------------- */
.md-header {
    --md-primary-fg-color: #FFFFFF;
    --md-primary-bg-color: #2E2E2E;
    --md-primary-bg-color--light: rgba(46, 46, 46, 0.6);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

[data-md-color-scheme="slate"] .md-header {
    --md-primary-fg-color: var(--md-default-bg-color);
    --md-primary-bg-color: var(--md-default-fg-color);
    --md-primary-bg-color--light: var(--md-default-fg-color--light);
    box-shadow: 0 1px 0 var(--md-default-fg-color--lightest);
}

.md-header__button.md-logo img {
    height: 1.9rem;
}

.md-header__title {
    font-weight: 700;
    color: var(--jb-heading);
}

@media screen and (min-width: 60em) {
    .md-header .md-search__form {
        background-color: rgba(46, 125, 50, 0.08);
        border-radius: 0.5rem;
    }

    .md-header .md-search__form:hover {
        background-color: rgba(46, 125, 50, 0.14);
    }

    [data-md-color-scheme="slate"] .md-header .md-search__form {
        background-color: var(--md-default-fg-color--lightest);
    }
}

/* Links back to the website */
.jb-header-links {
    display: none;
    align-items: center;
    gap: 1.4rem;
    margin: 0 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.jb-header-links a {
    color: var(--md-primary-bg-color);
}

.jb-header-links a:hover {
    color: var(--jb-heading);
}

.jb-header-links .jb-header-cta {
    background: var(--jb-dark-green);
    color: #FFFFFF;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.jb-header-links .jb-header-cta:hover {
    background: #1B5E20;
    color: #FFFFFF;
}

@media screen and (min-width: 76.25em) {
    .jb-header-links {
        display: flex;
    }
}

/* Phone menu title bar: white too */
.md-nav--primary .md-nav__title[for="__drawer"] {
    background-color: var(--md-default-bg-color);
    color: var(--jb-heading);
    font-weight: 700;
}

/* Type: the website's bold headings --------------------------------------- */
.md-typeset h1 {
    font-weight: 700;
    color: var(--jb-heading);
    letter-spacing: -0.015em;
    margin-bottom: 1em;
}

.md-typeset h2 {
    font-weight: 700;
    color: var(--jb-heading);
    letter-spacing: -0.01em;
}

.md-typeset h3 {
    font-weight: 600;
    color: var(--jb-ink);
}

.md-typeset a {
    text-underline-offset: 0.15em;
}

.md-typeset a:hover {
    text-decoration: underline;
}

/* Notes: green, not Material's blue --------------------------------------- */
.md-typeset .admonition.info,
.md-typeset .admonition.note,
.md-typeset details.info,
.md-typeset details.note {
    border-color: var(--md-primary-fg-color);
}

.md-typeset .info > .admonition-title,
.md-typeset .info > summary,
.md-typeset .note > .admonition-title,
.md-typeset .note > summary {
    background-color: var(--md-accent-fg-color--transparent);
}

.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before,
.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before {
    background-color: var(--md-primary-fg-color);
}

.md-typeset .admonition,
.md-typeset details {
    border-radius: 0.6rem;
}

/* Tables */
.md-typeset table:not([class]) {
    border-radius: 0.6rem;
}

.md-typeset table:not([class]) th {
    background-color: var(--jb-light-green);
}

/* App screenshots (taken automatically; see app/tool/screenshots.sh) */
.md-typeset img.screenshot {
    border-radius: 12px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Footer: the website's (overrides/main.html) ------------------------------ */
.jb-footer {
    background: #2E2E2E;
    color: #FFFFFF;
    padding: 2rem 0;
    font-size: 0.8rem;
}

.jb-footer .container {
    max-width: 61rem;
    margin: 0 auto;
    padding: 0 1.2rem;
}

.jb-footer .footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1.6rem;
    margin-bottom: 1.6rem;
}

.jb-footer .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.jb-footer .brand-text {
    font-size: 1.05rem;
    font-weight: 700;
}

.jb-footer p,
.jb-footer a {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.jb-footer a:hover {
    color: #FFFFFF;
}

.jb-footer h2 {
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--jb-green);
    display: inline-block;
}

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

.jb-footer li {
    margin-bottom: 0.4rem;
}

.jb-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.8rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
}

@media screen and (max-width: 44.9375em) {
    .jb-footer .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .jb-footer .footer-brand {
        align-items: center;
    }
}

/* Phones and tablets: menu button, then the logo and name, like the
   website's header. */
@media screen and (max-width: 76.2344em) {
    .md-header__button[for="__drawer"] {
        order: -1;
    }

    .md-header__button.md-logo {
        display: inline-block;
        margin-left: 0;
        margin-right: 0;
    }

    [dir="ltr"] .md-header__title {
        margin-left: 0.3rem;
    }
}

/* Small phones: tighter, so "JuggleBoard Help" fits beside the logo */
@media screen and (max-width: 30em) {
    .md-header__button {
        margin: 0.2rem 0;
    }

    .md-header__button.md-logo {
        padding: 0.4rem 0.2rem;
    }

    [dir="ltr"] .md-header__title {
        margin-left: 0.1rem;
        margin-right: 0.1rem;
        font-size: 0.85rem;
    }
}

/* "JuggleBoard website" section of the menu: phones and tablets only, as
   desktop has the same links in the header (mkdocs.yml nav). */
@media screen and (min-width: 76.25em) {
    .md-nav--primary > .md-nav__list > .md-nav__item:last-child:has(a[href^="https://juggleboard.com/"]) {
        display: none;
    }
}
