/* =========================================================
   CONTENT IN CONTEXT
   Main Stylesheet
========================================================= */


/* =========================================================
   OPENDYSLEXIC FONTS
========================================================= */

@font-face {
    font-family: "OpenDyslexic";
    src: url("fonts/OpenDyslexic-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "OpenDyslexic";
    src: url("fonts/OpenDyslexic-Italic.otf") format("opentype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "OpenDyslexic";
    src: url("fonts/OpenDyslexic-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "OpenDyslexic";
    src: url("fonts/OpenDyslexic-BoldItalic.otf") format("opentype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}


/* =========================================================
   GENERAL / RESET
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    background: #ffffff;
    color: #111111;

    font-family: Arial, Helvetica, sans-serif;

    overflow-x: hidden;
}

img {
    max-width: 100%;
}

button {
    font: inherit;
}


/* =========================================================
   OPENDYSLEXIC MODE
========================================================= */

body.dyslexic-font {
    font-family: "OpenDyslexic", Arial, sans-serif;
}

body.dyslexic-font .site-title,
body.dyslexic-font .side-menu a,
body.dyslexic-font .font-toggle,
body.dyslexic-font .post-title,
body.dyslexic-font .post-date,
body.dyslexic-font .carousel-button,
body.dyslexic-font .site-footer,
body.dyslexic-font .no-posts,
body.dyslexic-font .library,
body.dyslexic-font .library-year,
body.dyslexic-font .library-month,
body.dyslexic-font .library-post,
body.dyslexic-font .article-title,
body.dyslexic-font .article-date,
body.dyslexic-font .article-content,
body.dyslexic-font .article-content h1,
body.dyslexic-font .article-content h2,
body.dyslexic-font .article-content h3,
body.dyslexic-font .article-content h4,
body.dyslexic-font .article-content h5,
body.dyslexic-font .article-content h6,
body.dyslexic-font .back-link {
    font-family: "OpenDyslexic", Arial, sans-serif;
}

body.dyslexic-font .article-content code,
body.dyslexic-font .article-content pre,
body.dyslexic-font .article-content pre code {
    font-family: "Courier New", Courier, monospace;
}


/* =========================================================
   HAMBURGER BUTTON
========================================================= */

.menu-button {
    position: fixed;

    top: 14px;
    right: 14px;

    width: 32px;
    height: 28px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    margin: 0;
    padding: 0;

    border: 0;
    background: transparent;

    cursor: pointer;

    z-index: 1000;

    opacity: 1;
    visibility: visible;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.menu-button span {
    display: block;

    width: 100%;
    height: 3px;

    background: #111111;

    border-radius: 3px;
}

body.menu-open .menu-button {
    opacity: 0;
    visibility: hidden;

    pointer-events: none;
}


/* =========================================================
   MENU OVERLAY
========================================================= */

.menu-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.15);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    z-index: 900;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   SIDE MENU
========================================================= */

.side-menu {
    position: fixed;

    top: 0;
    right: 0;

    width: 240px;
    height: 100vh;

    padding: 80px 35px;

    background: #ffffff;

    transform: translateX(100%);

    transition: transform 0.3s ease;

    box-shadow:
        -5px 0 20px
        rgba(0, 0, 0, 0.08);

    z-index: 950;
}

.side-menu.active {
    transform: translateX(0);
}


/* =========================================================
   SIDE MENU LINKS
========================================================= */

.side-menu a {
    display: block;
    width: fit-content;

    margin: 0 0 20px;

    padding: 0 8px 0 0;

    color: #111111;

    font-family: "Caveat", cursive;

    font-size: 30px;
    font-weight: 400;

    line-height: 1.3;

    text-align: left;
    text-decoration: none;

    cursor: pointer;

    transition: opacity 0.2s ease;
}

.side-menu a:hover {
    opacity: 0.6;
}


/* =========================================================
   OPENDYSLEXIC MENU OPTION
========================================================= */

.font-toggle {
    display: block;
    width: fit-content;

    margin: 0 0 20px;

    padding: 0 8px 0 0;

    border: 0;

    background: none;

    color: #111111;

    font-family: "Caveat", cursive;

    font-size: 30px;
    font-weight: 400;

    line-height: 1.3;

    text-align: left;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition: opacity 0.2s ease;
}

.font-toggle:hover {
    opacity: 0.6;
}

.font-toggle:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 4px;
}


/* =========================================================
   MENU CLOSE BUTTON
========================================================= */

.menu-close {
    position: absolute;

    top: 12px;
    right: 18px;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    color: #111111;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 35px;

    line-height: 1;

    cursor: pointer;
}

body.dyslexic-font .menu-close {
    font-family: Arial, Helvetica, sans-serif;
}

body.menu-open {
    overflow: hidden;
}


/* =========================================================
   SHARED SITE TITLE
========================================================= */

.site-title {
    margin: 0;

    color: #111111;

    font-family: "Caveat", cursive;

    font-weight: 500;

    text-align: center;
}


/* =========================================================
   SHARED LINES
========================================================= */

.header-line,
.footer-line {
    border: 0;
    border-top: 1px solid #999999;
}


/* =========================================================
   HOME PAGE
========================================================= */

.home-page {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   HOME HEADER
========================================================= */

.home-header {
    padding-top: 76px;

    text-align: center;
}

.home-header .site-title {
    font-size: clamp(48px, 6vw, 72px);
    line-height: 1;
}

.home-header .header-line {
    width: min(610px, 61vw);

    margin: 40px auto 36px;
}


/* =========================================================
   CAROUSEL SECTION
========================================================= */

.carousel-section {
    position: relative;

    width: 100%;

    overflow: hidden;
}


/* =========================================================
   CAROUSEL
========================================================= */

.carousel {
    display: flex;

    gap: 19px;

    overflow-x: auto;

    padding:
        0
        max(
            20px,
            calc((100vw - 806px) / 2)
        );

    scroll-behavior: smooth;

    scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
    display: none;
}


/* =========================================================
   POST CARD
========================================================= */

.post-card {
    position: relative;

    flex: 0 0 146px;

    height: 222px;

    overflow: hidden;

    background: #d5d5d5;

    color: #ffffff;

    text-decoration: none;

    cursor: pointer;
}


/* =========================================================
   POST IMAGE
========================================================= */

.post-image {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.3s ease,
        filter 0.3s ease;
}


/* =========================================================
   POST PLACEHOLDER
========================================================= */

.post-placeholder {
    position: absolute;

    inset: 0;

    background: #d5d5d5;
}


/* =========================================================
   POST OVERLAY
========================================================= */

.post-overlay {
    position: absolute;

    inset: 0;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    padding: 15px;

    background: rgba(0, 0, 0, 0);

    opacity: 0;

    text-align: center;

    transition:
        opacity 0.25s ease,
        background 0.25s ease;
}

.post-title {
    margin: 0;

    font-family: "Caveat", cursive;

    font-size: 25px;
    font-weight: 500;

    line-height: 1.05;
}

.post-date {
    margin-top: 7px;

    font-family: "Caveat", cursive;

    font-size: 16px;
}


/* =========================================================
   POST CARD HOVER
========================================================= */

.post-card:hover .post-image {
    transform: scale(1.04);
}

.post-card:hover .post-overlay {
    opacity: 1;

    background: rgba(0, 0, 0, 0.48);
}


/* =========================================================
   CAROUSEL BUTTONS
========================================================= */

.carousel-button {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    width: 50px;
    height: 70px;

    padding: 0;

    border: 0;

    background: rgba(255, 255, 255, 0.75);

    color: #111111;

    font-family: "Caveat", cursive;

    font-size: 45px;

    cursor: pointer;

    opacity: 0;

    transition:
        opacity 0.2s ease,
        background 0.2s ease;

    z-index: 10;
}

.carousel-section:hover .carousel-button {
    opacity: 1;
}

.carousel-button:hover {
    background: #ffffff;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}


/* =========================================================
   HOME FOOTER
========================================================= */

.home-page .footer-line {
    width: min(610px, 61vw);

    margin: 39px auto 26px;
}


/* =========================================================
   SHARED FOOTER
========================================================= */

.site-footer {
    padding-bottom: 35px;

    text-align: center;

    font-family: "Caveat", cursive;

    font-size: 18px;
}


/* =========================================================
   NO POSTS
========================================================= */

.no-posts {
    width: 100%;

    padding: 70px 20px;

    text-align: center;

    font-family: "Caveat", cursive;

    font-size: 28px;
}


/* =========================================================
   LIBRARY PAGE
========================================================= */

.library-wrapper {
    width: min(610px, calc(100% - 40px));

    margin: 0 auto;

    padding: 8px 0 70px;
}


/* =========================================================
   LIBRARY HEADER
========================================================= */

.library-header .site-title {
    margin: 0 0 9px;

    font-size: 23px;

    line-height: 1.2;
}

.library-header .header-line {
    width: 100%;

    margin: 0 0 25px;
}


/* =========================================================
   LIBRARY TREE
========================================================= */

.library {
    width: 180px;

    margin: 0 auto;

    font-family: "Caveat", cursive;
}


/* =========================================================
   LIBRARY YEAR
========================================================= */

.library-year {
    margin: 20px 0 8px;

    font-size: 25px;

    font-weight: 500;
}


/* =========================================================
   LIBRARY MONTH
========================================================= */

.library-month {
    margin: 5px 0;

    font-size: 22px;
}


/* =========================================================
   LIBRARY POSTS
========================================================= */

.library-posts {
    margin: 4px 0 7px;
}

.library-post {
    display: block;

    margin: 3px 0;

    color: #111111;

    text-decoration: none;

    font-size: 22px;
}

.library-post:hover {
    text-decoration: underline;
}


/* =========================================================
   ARTICLE / POST PAGE
========================================================= */

.article-wrapper {
    width: min(760px, calc(100% - 40px));

    margin-left: auto;
    margin-right: auto;

    padding-top: 100px;
    padding-bottom: 60px;
}


/* =========================================================
   ARTICLE HEADER
========================================================= */

.article-header {
    text-align: center;
}

.article-title {
    margin: 20px 0 10px;

    font-family: "Caveat", cursive;

    font-weight: 500;

    font-size: clamp(48px, 7vw, 74px);

    line-height: 1;
}

.article-date {
    margin-bottom: 28px;

    color: #555555;

    font-family: "Caveat", cursive;

    font-size: 20px;
}

.article-header .header-line {
    width: 75%;

    margin: 0 auto 38px;
}


/* =========================================================
   HERO IMAGE
========================================================= */

.hero-image {
    display: block;

    width: 100%;
    max-height: 480px;

    margin-bottom: 42px;

    object-fit: cover;
}


/* =========================================================
   ARTICLE CONTENT
========================================================= */

.article-content {
    color: #111111;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 19px;

    line-height: 1.75;
}

.article-content p {
    margin: 0 0 1.5em;
}


/* =========================================================
   ARTICLE HEADINGS
========================================================= */

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.6em;

    font-family: "Caveat", cursive;

    font-weight: 500;

    line-height: 1.1;
}

.article-content h1 {
    font-size: 44px;
}

.article-content h2 {
    font-size: 38px;
}

.article-content h3 {
    font-size: 32px;
}

.article-content h4 {
    font-size: 28px;
}

.article-content h5 {
    font-size: 24px;
}

.article-content h6 {
    font-size: 21px;
}


/* =========================================================
   ARTICLE LINKS
========================================================= */

.article-content a {
    color: #111111;

    text-decoration-thickness: 1px;

    text-underline-offset: 3px;
}

.article-content a:hover {
    opacity: 0.65;
}


/* =========================================================
   ARTICLE IMAGES
========================================================= */

.article-content img {
    display: block;

    width: 100%;
    height: auto;

    margin: 35px auto;
}


/* =========================================================
   ARTICLE LISTS
========================================================= */

.article-content ul,
.article-content ol {
    margin: 1em 0 1.7em 1.5em;
}

.article-content li {
    margin-bottom: 0.5em;
}


/* =========================================================
   ARTICLE BLOCKQUOTES
========================================================= */

.article-content blockquote {
    margin: 35px 0;

    padding: 8px 0 8px 25px;

    border-left: 2px solid #999999;

    color: #444444;

    font-style: italic;
}


/* =========================================================
   INLINE CODE
========================================================= */

.article-content code {
    padding: 2px 5px;

    background: #eeeeee;

    border-radius: 3px;

    font-family:
        "Courier New",
        Courier,
        monospace;

    font-size: 0.9em;
}


/* =========================================================
   CODE BLOCKS
========================================================= */

.article-content pre {
    overflow-x: auto;

    margin: 30px 0;

    padding: 18px;

    background: #eeeeee;

    line-height: 1.5;
}

.article-content pre code {
    padding: 0;

    background: transparent;
}


/* =========================================================
   ARTICLE HORIZONTAL RULE
========================================================= */

.article-content hr {
    width: 50%;

    margin: 45px auto;

    border: 0;

    border-top: 1px solid #999999;
}


/* =========================================================
   ARTICLE FOOTER
========================================================= */

.article-wrapper > .footer-line {
    width: 75%;

    margin: 50px auto 25px;
}


/* =========================================================
   BACK / HOME LINK
========================================================= */

.back-link {
    position: absolute;

    top: 18px;
    left: 20px;

    margin: 0;

    padding: 4px 8px;

    color: #111111;
    background: #ffffff;

    text-decoration: none;

    font-family: "Caveat", cursive;

    font-size: 23px;

    line-height: 1.3;

    z-index: 1100;
}

.back-link:hover {
    text-decoration: underline;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 700px) {

    /* HOME */

    .home-header {
        padding-top: 85px;
    }

    .home-header .header-line,
    .home-page .footer-line {
        width: 72%;
    }

    .carousel {
        gap: 15px;

        padding-left: 20px;
        padding-right: 20px;
    }

    .post-card {
        flex-basis: 145px;
    }

    .carousel-button {
        display: none;
    }


    /* ARTICLE */

    .article-wrapper {
        width: calc(100% - 34px);

        margin-left: auto;
        margin-right: auto;

        padding-top: 105px;
        padding-bottom: 50px;
    }

    .back-link {
        top: 16px;
        left: 12px;
    }

    .article-title {
        font-size: clamp(44px, 14vw, 60px);
    }

    .article-content {
        font-size: 18px;

        line-height: 1.7;
    }

    .hero-image {
        max-height: 350px;
    }

    .article-header .header-line,
    .article-wrapper > .footer-line {
        width: 85%;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    /* MENU */

    .side-menu {
        width: min(260px, 85vw);

        padding: 75px 30px;
    }

    .side-menu a,
    .font-toggle {
        font-size: 28px;
    }


    /* LIBRARY */

    .library-wrapper {
        width: calc(100% - 35px);
    }

    .library {
        width: 170px;
    }

}


/* =========================================================
   TOUCH DEVICES
========================================================= */

@media (hover: none) {

    .post-overlay {
        justify-content: flex-end;

        opacity: 1;

        background:
            linear-gradient(
                transparent,
                rgba(0, 0, 0, 0.65)
            );
    }

    .post-title {
        font-size: 21px;
    }

    .post-date {
        font-size: 14px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .side-menu,
    .menu-overlay,
    .menu-button,
    .post-image,
    .post-overlay,
    .carousel {
        transition: none;

        scroll-behavior: auto;
    }

}

/* =========================================================
   CONTACT PAGE
========================================================= */

.contact-wrapper {
    width: min(
        610px,
        calc(100% - 40px)
    );

    margin: 0 auto;

    padding:
        75px
        0
        60px;
}


/* =========================================================
   CONTACT HEADER
========================================================= */

.contact-header {
    text-align: center;
}

.contact-header .site-title {
    font-size: clamp(
        48px,
        6vw,
        72px
    );

    line-height: 1;
}

.contact-header .header-line {
    width: 75%;

    margin:
        35px
        auto
        45px;
}


/* =========================================================
   CONTACT CONTENT
========================================================= */

.contact-content {
    max-width: 480px;

    margin: 0 auto;

    text-align: center;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 19px;

    line-height: 1.75;
}

.contact-content p {
    margin:
        0
        0
        20px;
}


/* =========================================================
   EMAIL
========================================================= */

.contact-email {
    display: inline-block;

    margin:
        5px
        0
        35px;

    color: #111111;

    font-family: "Caveat", cursive;

    font-size: 30px;

    text-decoration: underline;

    text-underline-offset: 4px;
}

.contact-email:hover {
    opacity: 0.6;
}


/* =========================================================
   SOCIAL / EXTERNAL LINKS
========================================================= */

.contact-links {
    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap: 10px 25px;
}

.contact-links a {
    color: #111111;

    font-family: "Caveat", cursive;

    font-size: 24px;

    text-decoration: none;
}

.contact-links a:hover {
    text-decoration: underline;
}


/* =========================================================
   CONTACT FOOTER
========================================================= */

.contact-wrapper > .footer-line {
    width: 75%;

    margin:
        50px
        auto
        25px;
}


/* =========================================================
   OPENDYSLEXIC CONTACT MODE
========================================================= */

body.dyslexic-font .contact-content,
body.dyslexic-font .contact-email,
body.dyslexic-font .contact-links a {
    font-family: "OpenDyslexic", Arial, sans-serif;
}


/* =========================================================
   CONTACT MOBILE
========================================================= */

@media (max-width: 700px) {

    .contact-wrapper {
        width: calc(100% - 34px);

        padding-top: 85px;
    }

    .contact-header .header-line,
    .contact-wrapper > .footer-line {
        width: 85%;
    }

    .contact-content {
        font-size: 18px;
    }

    .contact-email {
        font-size: 25px;

        overflow-wrap: anywhere;
    }

}