/* Reading experience shared by the PyGREET manuals: calmer chrome, clearer hierarchy and
   softer surfaces. Brand colours stay in extra.css; this file only shapes layout and type. */

:root {
    --guide-radius: 10px;
    --guide-border: var(--md-default-fg-color--lightest);
    --guide-link: #2E8B2A;
}

[data-md-color-scheme="slate"] {
    --guide-link: #7FD077;
}

/* ---------------------------------------------------------------- page frame */

.md-grid {
    max-width: 78rem;
}

/* A flat header with a hairline reads lighter than a shadowed bar. */
.md-header,
.md-header--shadow {
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.md-tabs {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.md-header__title {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* The current section is marked by weight and an underline, not a boxed button. */
.md-tabs__link {
    opacity: 1;
    font-size: 0.74rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.62);
    margin-top: 0.7rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid transparent;
    transition: color 120ms ease, border-color 120ms ease;
}

.md-tabs__link--active,
.md-tabs__item .md-tabs__link--active {
    color: rgba(0, 0, 0, 0.92) !important;
    font-weight: 600 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.8) !important;
    border-radius: 0 !important;
    padding: 0 0 0.55rem 0 !important;
    display: inline-block !important;
}

.md-tabs__link:hover {
    color: rgba(0, 0, 0, 0.92) !important;
    background: transparent !important;
    background-color: transparent !important;
    border-bottom-color: rgba(0, 0, 0, 0.3);
}

/* ---------------------------------------------------------------- sidebars */

.md-nav {
    font-size: 0.72rem;
    line-height: 1.45;
}

/* Group names label the lists under them; they are not destinations. */
.md-nav__item--section > .md-nav__link,
.md-nav__item--section > label.md-nav__link {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--md-default-fg-color--light);
    margin-top: 1.1em;
}

.md-nav__link {
    border-radius: 6px;
    padding: 0.28em 0.5em;
    margin-top: 0.1em;
}

.md-nav__item .md-nav__link--active {
    color: var(--md-default-fg-color);
    font-weight: 600;
    background: var(--md-accent-fg-color--transparent);
}

.md-nav__link:hover {
    color: var(--md-default-fg-color);
}

.md-nav--secondary .md-nav__title {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--md-default-fg-color--light);
}

.md-path {
    font-size: 0.66rem;
    color: var(--md-default-fg-color--light);
}

/* ---------------------------------------------------------------- type */

.md-typeset {
    font-size: 0.8rem;
    line-height: 1.7;
}

.md-typeset a {
    color: var(--guide-link);
    text-decoration: none;
}

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

.md-typeset h1 {
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--md-default-fg-color);
    margin-bottom: 0.9em;
}

.md-typeset h2 {
    font-weight: 650;
    font-size: 1.35rem;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin-top: 2.4em;
    padding-top: 1.2em;
    border-top: 1px solid var(--guide-border);
}

/* The first section follows the title directly, so it needs no divider. */
.md-typeset h1 + h2,
.md-typeset h1 + p + h2,
.md-typeset h1 + figure + h2 {
    border-top: 0;
    padding-top: 0;
    margin-top: 1.4em;
}

.md-typeset h3 {
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    margin-top: 1.9em;
}

.md-typeset h4 {
    font-weight: 600;
    font-size: 0.86rem;
    text-transform: none;
    margin-top: 1.6em;
}

.md-typeset .headerlink {
    opacity: 0;
    transition: opacity 120ms ease;
}

.md-typeset :is(h1, h2, h3, h4):hover .headerlink {
    opacity: 0.5;
}

.md-typeset strong {
    font-weight: 600;
}

.md-typeset hr {
    border-bottom: 1px solid var(--guide-border);
    margin: 2.2em 0;
}

/* Numbered steps: the number is the anchor the eye returns to. */
.md-typeset ol > li::marker {
    font-weight: 600;
    color: var(--md-default-fg-color--light);
}

.md-typeset ol > li,
.md-typeset ul > li {
    margin-bottom: 0.45em;
}

.md-typeset code {
    border-radius: 5px;
    padding: 0.1em 0.38em;
    font-size: 0.86em;
}

.md-typeset pre > code {
    border-radius: var(--guide-radius);
}

.md-typeset kbd {
    border-radius: 5px;
    box-shadow: 0 0 0 1px var(--guide-border), 0 1.5px 0 0 var(--guide-border);
    font-size: 0.8em;
}

/* ---------------------------------------------------------------- figures */

figure {
    margin: 2.2em auto;
}

figure img,
.md-typeset p > img {
    border: 1px solid var(--guide-border);
    border-radius: var(--guide-radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

[data-md-color-scheme="slate"] figure img,
[data-md-color-scheme="slate"] .md-typeset p > img {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Small inline icons (glossary, library legend) are symbols, not screenshots. */
.md-typeset td img,
.md-typeset li > img,
.md-typeset img[width="24"],
.md-typeset img[width="32"],
.md-typeset img[width="48"] {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

figcaption {
    margin-top: 0.9em;
    font-style: normal;
    font-size: 0.72rem;
    color: var(--md-default-fg-color--light);
}

/* ---------------------------------------------------------------- tables */

.md-typeset table:not([class]) {
    border: 1px solid var(--guide-border);
    border-radius: var(--guide-radius);
    box-shadow: none;
    font-size: 0.74rem;
    overflow: hidden;
}

.md-typeset table:not([class]) th {
    background: var(--md-default-fg-color--lightest);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    padding: 0.7em 1em;
}

.md-typeset table:not([class]) td {
    padding: 0.7em 1em;
    border-top: 1px solid var(--guide-border);
    vertical-align: top;
}

.md-typeset table:not([class]) tbody tr:hover {
    background: transparent;
    box-shadow: none;
}

/* ---------------------------------------------------------------- callouts */

.md-typeset .admonition,
.md-typeset details {
    border-width: 1px;
    border-radius: var(--guide-radius);
    box-shadow: none;
    font-size: 0.76rem;
}

.md-typeset .admonition-title,
.md-typeset summary {
    font-weight: 600;
    border-radius: calc(var(--guide-radius) - 1px) calc(var(--guide-radius) - 1px) 0 0;
}

/* ---------------------------------------------------------------- tabs in content */

.md-typeset .tabbed-labels > label {
    font-size: 0.74rem;
    font-weight: 500;
}

.md-typeset .tabbed-set {
    border: 1px solid var(--guide-border);
    border-radius: var(--guide-radius);
    padding: 0 1em 0.4em;
}

/* ---------------------------------------------------------------- landing page */

.md-typeset .grid {
    grid-gap: 0.9rem;
}

.md-typeset .grid.cards > ul > li {
    border: 1px solid var(--guide-border);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.md-typeset .grid.cards > ul > li:hover {
    border-color: var(--md-default-fg-color--lighter);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.md-typeset .grid.cards > ul > li > hr {
    margin: 0.8em 0;
}

.md-typeset .grid.cards .twemoji {
    color: var(--guide-link);
}

/* Landing page: release, publisher and build date, shown under the logo. */
.guide-credits {
    text-align: right;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--md-default-fg-color--light);
    margin: 0 0 2.4rem;
}

.guide-credits strong {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--md-default-fg-color);
    margin-bottom: 0.3rem;
}

/* ---------------------------------------------------------------- footer and search */

.md-footer__link {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
}

.md-search__form {
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .md-typeset .grid.cards > ul > li,
    .md-tabs__link,
    .md-typeset .headerlink {
        transition: none;
    }

    .md-typeset .grid.cards > ul > li:hover {
        transform: none;
    }
}
