:root {
    --hdFont: -apple-system, BlinkMacSystemFont, 'Mona Sans', "Segoe UI", Helvetica, Arial, sans-serif;
    --txtFont: Georgia, "Palatino Linotype", Times, serif;
    --baseFontSize: 18px;
    --bgColor: #f8f8f4;
    --mainColor: rgb(34, 34, 34);
    --subtleColor: #a7a7a7;
    --subtleBgColor: #c3c3c3c2;
    --hrColor: #c3c3c3c2;
    --highlightColor: hsl(31, 97%, 57%);
    --blueColor: #0000b7;
    --happyBackground: rgb(230, 255, 225);
}

html,
body {
    box-sizing: border-box;
    font-family: var(--txtFont);
    font-size: var(--baseFontSize);
    font-weight: 300;
    line-height: 1.75;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

a,
a:visited {
    color: var(--mainColor);
}

p {
    margin: 0 0 1.35em;
    padding: 0;
}

strong,
b {
    font-weight: bold;
}

.nowrapme {
    white-space: nowrap;
}

body {
    line-height: var(--baseLineHeight);
}

h1,
h2,
h3,
h4 {
    text-align: left;
    font-family: var(--hdFont);
    font-weight: 500;
    margin: 1em 0;
    padding: 0;
    line-height: 1.15;
}

li {
    margin-bottom: 0.2em;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button,
.button {
    font-family: var(--hdFont);
}

code {
    font-size: 0.9rem;
    background-color: var(--subtleBgColor);
    padding: 0.1rem 0.25rem;
    border-radius: 0.25rem;
}

details {
    border: 1px solid #ccc;
    border-radius: 0.5em;
    padding: 0.5em 1em;
    margin-bottom: 1em;
    background: #f9f9f9;
    transition: all 0.3s ease;

    summary {
        font-weight: bold;
        cursor: pointer;
        list-style: none;
        display: flex;
        align-items: center;
        gap: 0.5em;
    }

    summary::marker {
        display: none;
    }

    summary::before {
        content: "▶";
        transition: transform 0.2s ease;
    }

    &[open] summary::before {
        transform: rotate(90deg);
    }

    &[open] {
        background: #eef;
    }

    &>*:not(summary) {
        margin-top: 0.5em;
    }

    &>*:last-child {
        margin-bottom: 0;
    }
}

blockquote {
    font-style: italic;
}

hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--hrColor);


    &.invisible {
        border: none;
        background-color: transparent;
    }
}

/* ======================= */

body {
    max-width: 46em;
    margin: 0 auto;
    padding: 0 1rem 1rem;
    line-height: var(--baseLineHeight);
    background-color: var(--bgColor);
    color: var(--mainColor);
}

h1 {
    /* margin-top: 1.5rem; */
    margin-top: 0;
    margin-bottom: 2rem;
    font-size: 2.3rem;
    letter-spacing: -0.05rem;
}

h2 {
    text-align: left;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

h3 {
    margin-top: 2em;
}

header {
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}

nav {
    font-family: var(--hdFont);
    font-size: 0.9rem;
    color: var(--subtleColor);
    display: flex;
    justify-content: flex-start;
    max-width: 100%;
    /* gap: 1rem; */
    flex-wrap: wrap;

    a {
        color: var(--subtleColor);
        text-decoration: none;
        margin: 0.25rem 1rem 0.25rem 0;

        &:visited {
            color: var(--subtleColor);
        }

        &:hover {
            color: var(--mainColor);
        }

        &::last-child {
            margin-right: 0;
        }
    }

    .logo {
        width: 250px;
        height: auto;
        display: block;
        max-width: 100%;
        margin-left: -1rem;
        margin-right: 2rem;
    }
}

img,
image {
    max-width: 100%;
    height: auto;
    display: block;
    /* aby nezůstal inline-gap */

    &.vtextu {
        width: 100%;
        max-width: 650px;
        margin: 2rem auto;
    }
}

.highlight {
    font-weight: bold;
    font-style: italic;
}

.controlled-wrap {
    display: inline-block;
    white-space: normal;
}

.headspace {
    margin-top: 3.5rem;
}

.nobr {
    white-space: nowrap;
}

.smaller {
    font-size: 0.9rem;
}

.article-date {
    font-size: 0.9rem;
    color: var(--subtleColor);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.updated {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--subtleColor);
    margin: 0 auto 1rem;
}

.note {
    font-style: italic;
    margin-left: 1.5rem;
    color: var(--subtleColor);

    a {
        color: var(--subtleColor);
        text-decoration: underline;
    }
}

.buttonlike {
    display: block;
    margin: 1rem auto;
    width: fit-content;
    font-family: var(--hdFont);
    background-color: var(--highlightColor);
    color: white;
    border: 1px solid color-mix(in srgb, var(--highlightColor) 80%, black 20%);
    border-left: 1px solid color-mix(in srgb, var(--highlightColor) 80%, white 20%);
    border-top: 1px solid color-mix(in srgb, var(--highlightColor) 80%, white 20%);
    padding: 0.5rem 1rem 0.6rem;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0.5rem;
    text-decoration: none;
    /* box-shadow: 0.1rem 0.1rem 0.25rem rgba(0, 0, 0, 0.2); */
    box-shadow:
        0.1rem 0.1rem 0.25rem rgba(0, 0, 0, 0.2),
        inset -0.2rem -0.2rem 0.25rem color-mix(in srgb, var(--highlightColor) 95%, black 5%),
        inset 0.2rem 0.2rem 0.25rem color-mix(in srgb, var(--highlightColor) 85%, white 15%);

    &:hover {
        background-color: color-mix(in srgb, var(--highlightColor) 90%, white 10%);
    }
}

.cta {
    text-align: center;

    button span {
        font-weight: normal;
    }

    p {
        margin-bottom: 0.75rem;
    }
}

dialog {
    padding: 0 0.5rem;
    border: 0;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.95);

    &::backdrop {
        background-color: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(5px);
    }

    form {
        text-align: left;
    }

    button.close {
        background-color: transparent;
        font-size: 0.8rem;
        border: none;
        color: var(--subtleColor);
        margin: 0;
        padding: 0;
    }

    .inner {
        padding: 1rem 1rem 0 1rem;

        h3 {
            margin-top: 0;
            margin-bottom: 0.5rem;
        }
    }
}

#openm {
    text-decoration: none;
    background-color: hsl(39, 100%, 80%);
    padding: 0.1rem 0.5rem 0.2rem;
    border: 1px solid var(--highlightColor);
}

dt h3 {
    margin-bottom: 0.5rem;
}

dd {
    margin: 0;
    text-align: center;
}

/* button#link-talk {
    font: inherit;
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
} */

nav.footer-nav {
    text-align: center;
    margin-top: 3rem;
    color: gray;
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-family: var(--hdFont);
    font-weight: 600;

    & a {
        color: gray;
        text-decoration: none;
    }
}

.legal,
.legal a {
    color: var(--subtleColor);
    font-size: 0.7rem;
}

footer {
    text-align: center;
    padding: 1rem 0 0;
    padding-top: 3rem;

    p:last-child {
        margin-bottom: 0;
    }
}

.intro {
    font-size: 1.25rem;
    font-style: italic;
    margin-bottom: 2rem;
    color: var(--mainColor);
    line-height: 1.6;
}

.gridlist {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));

    .item {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }

    .item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .item .caption {
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translate(-50%, 0);
        /* width: 100%; */
        /* background: rgba(0, 0, 0, 0.5); */
        color: white;
        font-family: var(--hdFont);
        font-weight: 500;
        font-size: 1.2rem;
        text-shadow: 0 0 5px rgba(0, 0, 0, 0.8),
            0 0 3px rgba(0, 0, 0, 0.9);
        white-space: nowrap;
        /* padding: 0.25rem 0.5rem; */
        /* box-sizing: border-box; */
        /* text-align: center; */
    }
}