/* =========================================================
   SadlerNet custom styling for Quark 2
   ========================================================= */


/* ---------------------------------------------------------
   1. Main page width
   --------------------------------------------------------- */

#body-wrapper > .container {
    width: calc(100% - 40px);
    max-width: 1500px;
    margin-inline: auto;
}

#body-wrapper > .container > .content-item {
    width: 100%;
    max-width: 1300px !important;
    margin-inline: auto;
}


/* ---------------------------------------------------------
   2. Main content card
   --------------------------------------------------------- */

.content-item {
    padding: 3rem 4rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
    line-height: 1.7;
}

:root[data-theme="dark"] .content-item {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}


/* ---------------------------------------------------------
   3. General typography and spacing
   --------------------------------------------------------- */

.content-item p {
    margin-top: 0;
    margin-bottom: 1.15rem;
}

.content-item ul,
.content-item ol {
    margin-top: 0.6rem;
    margin-bottom: 1.4rem;
    padding-left: 1.6rem;
}

.content-item li {
    margin-bottom: 0.4rem;
}

/* Keep ordinary text comfortable to read */

.content-item > p,
.content-item > blockquote {
    max-width: 950px;
}

/* Allow larger elements to use available width */

.content-item table,
.content-item figure,
.content-item pre,
.content-item .page-links {
    max-width: none;
}


/* ---------------------------------------------------------
   4. Headings
   --------------------------------------------------------- */

.content-item h1,
.content-item h2,
.content-item h3,
.content-item h4,
.content-item h5,
.content-item h6 {
    font-family: var(--pico-font-family-display);
    font-weight: 350;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

/* Main page title */

.content-item h1 {
    font-size: 2.75rem;
    margin-top: 0;
    margin-bottom: 0.65rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid color-mix(
        in srgb,
        var(--q2-accent, #8428df) 45%,
        transparent
    );
}

/* Section headings */

.content-item h2 {
    font-size: 2rem;
    margin-top: 2.2rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid color-mix(
        in srgb,
        currentColor 18%,
        transparent
    );
}

/* Sub-headings */

.content-item h3 {
    font-size: 1.5rem;
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
    font-weight: 320;
}

/* Minor headings */

.content-item h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 320;
}

.content-item h5 {
    font-size: 1.1rem;
    font-weight: 320;
}

.content-item h6 {
    font-size: 1rem;
    font-weight: 320;
}

/* Subtitle directly beneath page title */

.content-item h1 + h3 {
    margin-top: -0.2rem;
    margin-bottom: 1.8rem;
    padding: 0;
    border: 0;
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.75;
}


/* ---------------------------------------------------------
   5. Horizontal rules
   --------------------------------------------------------- */

.content-item hr {
    margin: 2.3rem 0;
    border: 0;
    border-top: 1px solid color-mix(
        in srgb,
        currentColor 22%,
        transparent
    );
}


/* ---------------------------------------------------------
   6. Blockquotes
   --------------------------------------------------------- */

.content-item blockquote {
    margin: 1.7rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--q2-accent, #8428df);
    border-radius: 0 5px 5px 0;
    background: color-mix(
        in srgb,
        var(--q2-accent, #8428df) 7%,
        transparent
    );
}

.content-item blockquote p:last-child {
    margin-bottom: 0;
}


/* ---------------------------------------------------------
   7. Links
   --------------------------------------------------------- */

.content-item a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.content-item a:hover {
    text-decoration-thickness: 2px;
}


/* ---------------------------------------------------------
   8. Application and navigation link boxes
   --------------------------------------------------------- */

.page-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
    margin: 1.5rem 0 2rem;
}

.page-links a {
    display: block;
    padding: 0.9rem 1rem;
    border: 1px solid color-mix(
        in srgb,
        currentColor 20%,
        transparent
    );
    border-left: 4px solid var(--q2-accent, #8428df);
    border-radius: 5px;
    background: color-mix(
        in srgb,
        currentColor 4%,
        transparent
    );
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    transition:
        background 0.15s ease,
        transform 0.15s ease,
        border-color 0.15s ease;
}

.page-links a:hover {
    background: color-mix(
        in srgb,
        var(--q2-accent, #8428df) 8%,
        transparent
    );
    border-color: color-mix(
        in srgb,
        var(--q2-accent, #8428df) 45%,
        transparent
    );
    transform: translateY(-1px);
}


/* ---------------------------------------------------------
   9. Tables
   --------------------------------------------------------- */

.content-item table {
    width: 100%;
    margin: 1.5rem 0 2rem;
    border-collapse: collapse;
    font-size: 0.96rem;
}

.content-item th,
.content-item td {
    padding: 0.7rem 0.85rem;
    border: 1px solid color-mix(
        in srgb,
        currentColor 20%,
        transparent
    );
    text-align: left;
    vertical-align: top;
}

.content-item th {
    background: color-mix(
        in srgb,
        currentColor 9%,
        transparent
    );
    font-weight: 700;
}

.content-item tbody tr:nth-child(even) {
    background: color-mix(
        in srgb,
        currentColor 3%,
        transparent
    );
}


/* ---------------------------------------------------------
   10. Images and figures
   --------------------------------------------------------- */

.content-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.content-item figure {
    margin: 1.8rem 0;
}

.content-item figcaption {
    margin-top: 0.5rem;
    opacity: 0.72;
    font-size: 0.9rem;
}


/* ---------------------------------------------------------
   11. Code and preformatted text
   --------------------------------------------------------- */

.content-item code {
    padding: 0.12rem 0.32rem;
    border-radius: 3px;
    font-size: 0.92em;
}

.content-item pre {
    overflow-x: auto;
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    border-radius: 5px;
}

.content-item pre code {
    padding: 0;
}


/* ---------------------------------------------------------
   12. Header
   --------------------------------------------------------- */

#header {
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

#header .container {
    width: calc(100% - 40px);
    max-width: 1500px;
    margin-inline: auto;
}

#header .navbar {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 3.8rem;
}

/* Logo stays on the left */

#header .navbar-section.logo {
    flex: 0 0 auto;
    margin-right: auto;
}

/* Menu sits beside the theme toggle */

#header .navbar-section.desktop-menu {
    flex: 0 0 auto;
    margin: 0;
    justify-content: flex-end;
}

/* Theme toggle stays at the far right */

#header .navbar-section.actions {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    margin-left: 0.75rem;
}

/* ---------------------------------------------------------
   13. Navigation
   --------------------------------------------------------- */

#header .dropmenu a {
    text-decoration: none;
}

#header .dropmenu a:hover {
    color: var(--q2-accent, #8428df);
}


/* ---------------------------------------------------------
   14. Footer
   --------------------------------------------------------- */

#footer {
    margin-top: 3rem;
    padding-top: 1.8rem;
    padding-bottom: 1.8rem;
    border-top: 1px solid color-mix(
        in srgb,
        currentColor 20%,
        transparent
    );
    font-size: 0.92rem;
}

#footer .container {
    width: calc(100% - 40px);
    max-width: 1500px;
}

#footer p {
    margin: 0.3rem 0;
}


/* ---------------------------------------------------------
   15. Mobile and tablet adjustments
   --------------------------------------------------------- */

@media (max-width: 900px) {

    #body-wrapper > .container,
    #header .container,
    #footer .container {
        width: calc(100% - 28px);
    }

    .content-item {
        padding: 2rem 2.2rem;
    }

    .content-item h1 {
        font-size: 2rem;
    }

    .content-item h2 {
        font-size: 1.55rem;
    }
}

@media (max-width: 600px) {

    #body-wrapper > .container,
    #header .container,
    #footer .container {
        width: calc(100% - 20px);
    }

    .content-item {
        padding: 1.5rem 1.25rem;
        border-radius: 5px;
    }

    .content-item h1 {
        font-size: 1.75rem;
    }

    .content-item h2 {
        margin-top: 2rem;
        font-size: 1.4rem;
    }

    .page-links {
        grid-template-columns: 1fr;
    }

    .content-item table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
