*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    font-family: sans-serif;
    font-size: 1.2rem;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    --color-header: oklch(0.18 0.01 270);
    --color-cards: oklch(0.23 0.01 270);
    --black: oklch(0.18 0.01 270);
    --white: oklch(0.96 0.005 270);
}

main {
    flex-grow: 1;
}

.container {
    max-width: 90rem;
    width: 95%;
    margin-inline: auto;
    padding-inline: 1rem;
}

main section {
    border-bottom: 2px solid var(--black);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

main section:last-child {
    border-bottom: none;
}


a:visited {
    color: inherit;
}

header {
    background-color: var(--color-header);
    color: white;
    padding: 1rem;
}

header nav ul li a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: white;
}

header nav ul li a:hover {
    background-color: white;
    color: black;
}

.intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding-inline: 2rem;
}


.intro-text {
    max-width: 40rem;
    flex: 1 1 300px;
}


.intro > img {
    width: 100%;
    max-width: 18rem;
    height: auto;
    flex: 0 1 150px;
    margin-right: 0;
}


.intro > a {
    order: 1;
}

.intro h2 {
    display: flex;
}

.latest-exercises h2 {
    margin-top: 2rem;
    font-size: 1.5rem;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;  /* center all rows */
    gap: 1rem;
    margin: 0 auto;           /* center container itself */
    padding: 0;               /* remove extra padding */
    list-style: none;
    width: fit-content;       /* shrink container to content width */
}




.cards li {
    flex: 0 1 20rem;
    max-width: 25rem;
}



.cards li .content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 0.75rem var(--black);
    overflow: hidden;
    padding-bottom: 1rem;

    > a {
        color: var(--black);
    }
}

.cards li img {
    order: -1;
    width: 100%;
    height: 12rem;
    object-fit: cover;
    display: block;
}

.cards li h3,
.cards li p,
.cards li a:not(.overlay-link) {
    padding-inline: 1rem;
}

.cards li h3 {
    margin-block-start: 1rem;
}

.cards li p {
    flex-grow: 1;
}

.overlay-link {
    position: absolute;
    inset: 0;

    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden;
}

.cards li a:not(.overlay-link) {
    position: relative;
    z-index: 1;
}

.socials {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.socials .overlay-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.socials > ul {
    display: flex;
    gap: 5rem;
    list-style: none;
}

.socials > ul li {
    position: relative;
}

.socials > ul li a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: black;
}



main.container {
    padding-block: 3rem;
    max-width: 40rem;
}

form h1 {
    color: var(--black);
    border-bottom: 2px solid var(--black);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.message {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: block;
}

.message.error {
    color: #d32f2f;
    font-weight: bold;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

form div {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--black);
}

input.input-text,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--black);
    border-radius: 0.25rem;
    background-color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input.input-text:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-header);
    box-shadow: 0 0 0 3px rgba(46, 46, 46, 0.1);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

input[type="submit"] {
    background-color: var(--color-header);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    width: fit-content;
}

input[type="submit"]:hover {
    filter: brightness(1.2);
}

input[type="submit"]:active {
    transform: scale(0.98);
}

.socials > ul li img {
    width: 5rem;
}

footer {
    background-color: var(--color-header);
    color: white;
    padding: 1rem;
}

@media (max-width: 600px) {
    input[type="submit"] {
        width: 100%;
    }
}