:root {
    --brand-color: #013d5a;
    --brand-color-alt: #c8d9e6;
    --text-color-brand: #013d5a;
    --text-color-white: #ffffff;
    --text-color-black: #1e1e1e;
    --text-color-brand-alt: #9dafbf;
}

.sr-only:not(:focus):not(:active) {
    width: 1px;
    height: 1px;
    overflow: hidden;
    position: absolute;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

html {
    line-height: 1.4;
    font-family: system-ui, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    margin-inline: auto;
}

h2 {
    text-transform: uppercase;
    font-weight: 400;
    color: var(--text-color-brand);
}

h3 {
    font-weight: 450;
    color: var(--text-color-brand);
}

button,
input[type="submit"] {
    cursor: pointer;
    padding: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 400ms ease;
    color: var(--text-color-white);
    background: var(--brand-color);
    border: 0.0625rem solid var(--brand-color);
}

button:is(:hover, :focus),
input[type="submit"]:is(:hover, :focus) {
    outline: none;
    background: transparent;
    color: var(--brand-color);
}

header {
    top: 0;
    width: 100%;
    z-index: 1000;
    position: sticky;
    background: white;
    border-bottom: 0.0625rem solid var(--brand-color-alt);
}

main {
    width: 75%;
    padding-inline-end: 4rem;

    @media only screen and (max-width: 820px) {
        width: 100%;
        padding-inline-end: 0;
    }
}

main.home {
    margin-block-end: 10rem;

    @media only screen and (max-width: 820px) {
        margin-block-end: 2rem;
    }

    article {
        margin-block-end: 3rem;
        border-bottom: 0.0625rem solid var(--brand-color-alt);
    }

    img {
        max-width: 100%;
        object-fit: cover;
    }

    p {
        display: -webkit-box;
        -webkit-line-clamp: 5;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    a {
        position: relative;
        font-size: 0.875rem;
        text-decoration: none;
        display: inline-block;
        padding-inline: 0.5rem;
        padding-block: 0.25rem;
        margin-block: 1rem 2rem;
        color: var(--brand-color);
        text-transform: uppercase;
        transition: all 400ms ease;

        &:is(:hover, :focus) {
            outline: none;
            color: var(--text-color-white);

            &::before {
                bottom: 0;
                height: 100%;
            }
        }

        &::before {
            content: "";
            background-color: var(--brand-color);
            position: absolute;
            left: 0;
            bottom: 0px;
            width: 100%;
            height: 2px;
            z-index: -1;
            transition: all 0.3s ease-in-out;
        }
    }

    .load-more {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

aside {
    top: 3rem;
    width: 25%;
    height: 100%;
    display: flex;
    position: sticky;
    align-items: center;
    flex-direction: column;
    padding-block: 2rem 8rem;

    @media only screen and (max-width: 820px) {
        width: 100%;
        max-width: 100%;
        padding-inline: 0;
        position: relative;
    }
}

aside section {
    width: 100%;
    display: flex;
    align-items: center;
    margin-block-end: 3rem;
    flex-direction: column;
}

aside section ul {
    margin: 0;
    padding: 0;
    width: 100%;
    list-style-type: none;
}

aside section h2 {
    font-size: 3rem;
    margin-block: 1rem;
    text-align: center;
    font-optical-sizing: auto;
    text-transform: capitalize;
    font-family: "Corinthia", cursive;
}

.nav-container {
    display: flex;
    max-width: 1200px;
    align-items: center;
    margin-inline: auto;
    padding-inline: 2rem;
    padding-block: 0.5rem;
}

.nav-links {
    flex: 1;
}

.nav-links ul {
    gap: 5%;
    margin: 0;
    padding: 0;
    display: flex;
    list-style-type: none;
    justify-content: center;
    text-transform: uppercase;
}

.nav-links a {
    position: relative;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--text-color-brand);
    transition: all 0.2s ease-in-out;
}

.nav-links a::before {
    left: 0;
    content: "";
    width: 100%;
    opacity: 0.6;
    display: block;
    bottom: -0.25rem;
    height: 0.125rem;
    position: absolute;
    transform: scaleX(0);
    background-color: #000;
    transition: transform 0.3s ease;
}

.nav-links a:is(:hover, :focus)::before {
    transform: scaleX(1);
}

.nav-links a:is(:hover, :focus) {
    outline: none;
    opacity: 0.6;
}

.social-links ul {
    margin: 0;
    padding: 0;
    gap: 0.75rem;
    display: flex;
    list-style-type: none;
    justify-content: center;
}

.social-links a {
    text-decoration: none;
    color: var(--text-color-brand);
}

.social-links a:is(:hover, :focus) {
    outline: none;
    opacity: 0.6;
}

.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;

    img {
        height: 250px;
    }
}

.main-container {
    display: flex;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 2rem;

    @media only screen and (max-width: 820px) {
        flex-direction: column;
    }
}

.author-container {
    img {
        aspect-ratio: 1;
        max-width: 250px;
        object-fit: cover;
        border-radius: 250px;
        width: 100%;
    }

    p {
        text-align: center;
        margin-block: 0 2rem;
    }
}

.form-container {
    padding-block: 0 1rem;
    border: 0.0625rem solid var(--brand-color-alt);

    form {
        gap: 1rem;
        width: 86%;
        display: flex;
        flex-direction: column;
    }

    input[type="text"],
    input[type="email"] {
        font-size: 1rem;
        border-radius: 0;
        padding: 0.75rem;
        transition: all 400ms ease;
        border: 0.0625rem solid var(--brand-color-alt);
    }

    input[type="text"]:is(:hover, :focus),
    input[type="email"]:is(:hover, :focus) {
        outline: none;
        border-color: var(--brand-color);
    }

    input::placeholder {
        font-style: italic;
        opacity: 0.7;
        color: var(--brand-color);
    }
}

.categories-container {
    ul {
        gap: 0.75rem;
        display: flex;
        flex-direction: column;
    }

    li {
        cursor: pointer;
        transition: all 400ms ease;
        background: var(--brand-color-alt);
        border: 0.0625rem solid var(--brand-color-alt);
    }

    li:is(:hover, :focus-within) {
        background: transparent;
        border-color: var(--brand-color);
    }

    a {
        width: 100%;
        font-size: 1rem;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        padding-block: 0.75rem;
        text-transform: uppercase;
        color: var(--brand-color);
    }

    a:is(:focus) {
        outline: none;
    }
}

.next-read-container {
    a {
        text-decoration: none;
        color: var(--brand-color);
    }

    a:is(:focus) {
        outline: none;
    }

    li {
        cursor: pointer;
        padding-block: 0.75rem;
        transition: all 500ms ease;
        box-shadow: 0 0.0625rem 0 0 var(--brand-color-alt);
    }

    li:is(:hover, :focus-within) {
        box-shadow: 0 0.0625rem 0 0 var(--brand-color);
    }
}

footer {
    background: var(--brand-color-alt);
}

.footer-container {
    display: flex;
    max-width: 1200px;
    align-items: center;
    margin-inline: auto;
    padding-inline: 2rem;
    padding-block: 1.5rem;
    justify-content: space-between;

    span {
        color: var(--text-color-brand);
    }

    a {
        position: relative;
        text-decoration: none;
        color: var(--text-color-brand);
    }

    a::before {
        content: "";
        position: absolute;
        display: block;
        width: 100%;
        height: 0.125rem;
        bottom: 0;
        left: 0;
        background-color: #000;
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    a:is(:hover)::before {
        transform: scaleX(1);
    }
}

dialog[modal] {
    position: fixed;
    width: 100%;
    height: 100%;
    inset: 0;
    margin: 0;
    padding: 0;
    background: rgba(51, 51, 51, 0.521);
    backdrop-filter: blur(2px);

    outline: none;
    border: none;

    overflow: hidden !important;

    & [modal-content] {
        position: absolute;
        width: 100%;
        inset: 0;
        margin: auto;
        overflow-x: hidden !important;
    }

    opacity: 0;

    transition: display 0.5s, opacity 0.5s;
    transition-behavior: allow-discrete;

    &[open] {
        opacity: 1;
        display: flex;
        flex-direction: column;

        @starting-style {
            opacity: 0;
        }
    }
}
