/*
 * PawTunes documentation.
 * The page is a regular site page (template.blade.php + prahec.css), so colors, type and
 * form controls come from the site. This file only adds what long-form docs need on top.
 */

/** HERO **/

/*
 * The heading is one lockup: the logo with "Documentation" set into it like a product name.
 * The paw hangs lower than the lettering, which leaves room under "Tunes" inside the logo's own
 * box; the word starts there and runs out past the "s", so the two read as a single mark.
 * Every size is in em of the title, so one font-size scales the whole lockup.
 */
.doc-hero-title {
    position:    relative;
    display:     inline-block;
    font-size:   1.25rem;
    line-height: 1;
    margin:      0 0 .9em;
}

/* The lockup links back to the product page (the docs have no site header) */
.doc-hero-title a {
    display:         block;
    color:           inherit;
    text-decoration: none;
}

.doc-hero-logo {
    display: block;
    width:   20em;
    height:  auto;
}

.doc-hero-heading {
    position:       absolute;
    top:            71%;
    right:          -1.8em; /* hangs out past the "s", which leaves room for a larger word clear of the paw */
    font-size:      1.4em;
    font-weight:    400;
    line-height:    1;
    letter-spacing: .01em;
    color:          #484848; /* the logo's own grey */
    white-space:    nowrap;
}

@media (max-width: 575.98px) {

    /* Shifted left by half the word's overhang (1.8em of its 1.4em size), so the whole mark is
       centred and the word can not reach the edge of a narrow screen */
    .doc-hero-title {
        font-size: .9rem;
        transform: translateX(-1.26em);
    }

}

.doc-hero-updated {
    font-size: 1rem;
    color:     #8a90a2;
}

/** NAVIGATION COLUMN **/

/*
 * A flat list: every entry is always visible, so nothing opens, closes or moves while reading.
 * Chapters are small labels, their sections hang off a thin rail below them.
 */
.doc-nav {
    position: sticky;
    top:      1.5rem;
}

.doc-search {
    position:      relative;
    margin-bottom: 1.25rem;
}

/* Hint for the "/" shortcut; only shown where a keyboard is likely (see the lg block below) */
.doc-search kbd {
    display:          none;
    position:         absolute;
    top:              50%;
    right:            .75rem;
    transform:        translateY(-50%);
    padding:          .1rem .5rem;
    font-size:        .85rem;
    color:            #4b4e63;
    background-color: #f5faff;
    border:           1px solid #e3e6ef;
    border-radius:    .3rem;
    pointer-events:   none;
}

.navi ul {
    list-style-type: none;
    margin:          0;
    padding:         0;
}

.navi ul li a {
    display:         block;
    padding:         .35rem .85rem;
    font-size:       1.05rem;
    line-height:     1.4;
    color:           #4b4e63;
    text-decoration: none;
    border-left:     2px solid transparent;
}

/* Chapter labels */
.navi > ul > li > a {
    padding-top:    .5rem;
    padding-bottom: .5rem;
    font-size:      .9rem;
    font-weight:    600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color:          #1d1d33;
}

.navi > ul > li + li {
    margin-top: .75rem;
}

/* The rail; links are pulled 1px over it so the active marker replaces the rail instead of sitting next to it */
.navi > ul > li > ul {
    margin-left: .85rem;
    border-left: 1px solid #e3e6ef;
}

.navi ul ul li a {
    margin-left: -1px;
}

/* Third level shares the rail of the second and is only indented */
.navi ul ul ul li a {
    padding-left: 1.85rem;
}

.navi ul li a:hover {
    color: #233b52;
}

.navi ul ul li a:hover {
    border-left-color: #b9c0d4;
}

.navi ul li.active > a {
    color:             #233b52;
    font-weight:       600;
    border-left-color: #233b52;
}

.navi li.is-hidden {
    display: none;
}

.navi-empty {
    padding: .35rem .85rem;
    margin:  0;
}

@media screen and (min-width: 992px) {

    /* The column fills the screen height; the search stays put and the list scrolls under it */
    #docNavBody {
        max-height: calc(100vh - 3rem);
    }

    .navi {
        min-height:      0;
        overflow-y:      auto;
        scrollbar-width: thin;
        scrollbar-color: #d5d9e6 transparent;
    }

    .doc-search kbd {
        display: block;
    }

    /* The hint would sit under the caret or the native clear button */
    .doc-search input:focus + kbd,
    .doc-search input:not(:placeholder-shown) + kbd {
        display: none;
    }

}

@media screen and (max-width: 991.98px) {

    /*
     * Below lg the list collapses behind a button that stays at the top of the screen.
     * The column is the sticky element here: it is a child of the row, which is as tall as the content.
     */
    .doc-nav-col {
        position:       sticky;
        top:            0;
        z-index:        10;
        padding-top:    .75rem;
        padding-bottom: .75rem;
        margin-bottom:  1rem;
        background:     #fff;
    }

    .doc-nav {
        position: static;
    }

    .doc-nav .collapse.show,
    .doc-nav .collapsing {
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
        padding:    1.5rem 0 .5rem;
    }

}

/** CONTENT **/

/* The site's .blog-content text (1.1rem, weight 370) is tuned for short posts; reference docs get a larger, regular-weight face */
.doc.blog-content {
    font-size:   1.2rem;
    font-weight: 400;
    line-height: 1.75;
    color:       #272939;
}

.doc h2, .doc h3, .doc h4, .doc h5, .doc h6 {
    margin-top:    2.75rem;
    margin-bottom: 1rem;
    font-weight:   600;
    line-height:   1.3;
    color:         #1d1d33;
}

/* Chapters get a rule under the title so they are easy to spot while scrolling */
.doc h2 {
    font-size:      2.2rem;
    margin-top:     4.5rem;
    padding-bottom: .75rem;
    border-bottom:  1px solid #eeeff7;
}

.doc > h2:first-of-type {
    margin-top: 0;
}

.doc h3 {
    font-size: 1.7rem;
}

.doc h4 {
    font-size: 1.4rem;
}

.doc h5 {
    font-size: 1.2rem;
}

/* Navy links sit close to the text color, so they are underlined to stay recognisable */
.doc a:not(.text-heading) {
    color:                 #233b52;
    font-weight:           500;
    text-decoration:       underline;
    text-decoration-color: rgba(35, 59, 82, .35);
    text-underline-offset: .2em;
}

.doc a:not(.text-heading):hover {
    text-decoration-color: currentColor;
}

.doc strong {
    font-weight: 600;
    color:       #1d1d33;
}

.doc p, .doc li {
    overflow-wrap: break-word;
}

.doc p {
    margin-bottom: 1.25rem;
}

/* The README marks sections with <a name>, which CommonMark wraps in an empty paragraph */
.doc p:has(> a[name]:only-child) {
    margin: 0;
}

/* Jump targets keep a little air above them */
.doc a[name], .doc .text-heading {
    scroll-margin-top: 1.5rem;
}

/* Heading permalink (#): quiet until hovered */
.doc .text-heading {
    color:           #c3cbdd;
    text-decoration: none;
}

.doc .text-heading:hover {
    color: #233b52;
}

.doc ul, .doc ol {
    margin-bottom: 1.25rem;
    padding-left:  1.5rem;
}

.doc li {
    margin-bottom: .5rem;
}

.doc li::marker {
    color: #8090b5;
}

.doc li > ul, .doc li > ol {
    margin: .4rem 0 0;
}

.doc img {
    max-width:     100%;
    height:        auto;
    border-radius: .5rem;
}

/* Tables: tinted header row so columns are easy to tell apart from the first data row */
.doc table {
    font-size: 1.05rem;
}

.doc table thead th {
    background-color: #f5faff;
    color:            #1d1d33;
    white-space:      nowrap;
}

/* Notes written as blockquotes in the README; the site default (1.25rem) is meant for pull quotes */
.doc blockquote {
    font-size:        inherit;
    padding:          1rem 1.25rem;
    margin-bottom:    1.5rem;
    background-color: #f5faff;
    border-left:      .25rem solid #233b52;
    border-radius:    .3rem;
}

.doc :not(pre) > code {
    padding:          .15em .4em;
    font-size:        .9em;
    font-weight:      500;
    color:            #233b52;
    background-color: #f5faff;
    border:           1px solid #eeeff7;
    border-radius:    .25rem;
}

.doc pre {
    margin-bottom: 1.5rem;
    border-radius: .5rem;
}

.doc pre[class^="language-"] {
    tab-size:    4;
    padding:     1.25rem 1.5rem;
    line-height: 1.6;
}

.doc pre[class^="language-"] code {
    font-size: 1.05rem;
}

@media screen and (max-width: 991.98px) {

    /* Below lg jump targets land under the sticky navigation button */
    .doc a[name], .doc .text-heading {
        scroll-margin-top: 6rem;
    }

    /* Tables written as raw HTML in the README have no .table-responsive wrapper, so they scroll themselves */
    .doc > table {
        display:    block;
        overflow-x: auto;
    }

}

/** ADMONITIONS **/
.md-admonition {
    padding:       0.8em 0.8em 0.8em 1em;
    border-left:   0.25em solid;
    border-radius: 0.3rem;
}

.md-admonition .md-admonition-label {
    margin-bottom:         0.5em;
    font-weight:           500;
    padding-left:          1.5em;
    background-repeat:     no-repeat;
    background-position-y: 50%;
}

.md-admonition :last-child {
    margin-bottom: 0;
}

.md-admonition.md-admonition-note {
    border-color:     #3076dc;
    background-color: #e4ecf7;
}

.md-admonition.md-admonition-note .md-admonition-label {
    color:            #3076dc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' width='16' height='16' fill='%233076DC' aria-hidden='true'%3E%3Cpath d='M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'%3E%3C/path%3E%3C/svg%3E");
}

.md-admonition.md-admonition-tip {
    border-color:     #17bfbb;
    background-color: #e3f4f4;
}

.md-admonition.md-admonition-tip .md-admonition-label {
    color:            #17bfbb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2317BFBB' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z'%3E%3C/path%3E%3C/svg%3E");
}

.md-admonition.md-admonition-important {
    border-color:     #8250df;
    background-color: #ece6f8;
}

.md-admonition.md-admonition-important .md-admonition-label {
    color:            #8250df;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%238250df' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z'%3E%3C/path%3E%3C/svg%3E");
}

.md-admonition.md-admonition-warning {
    border-color: #ea7624;
    background:   #f9ede5;
}

.md-admonition.md-admonition-warning .md-admonition-label {
    color:            #ea7624;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23EA7624' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z'%3E%3C/path%3E%3C/svg%3E");
}

.md-admonition.md-admonition-caution {
    border-color:     #e7334d;
    background-color: #f9e6e9;
}

.md-admonition.md-admonition-caution .md-admonition-label {
    color:            #e7334d;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23E7334D' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'%3E%3C/path%3E%3C/svg%3E");
}
