@charset "UTF-8";

/* 
Theme Name: Hobby Graphics
Description: グラフィックデザインなどの個人的な趣味や嗜好を語るブログサイトです
Version: 1.0
Author: Naoto Iwahashi
Author URI: https://hobbygraphics.jp
*/

/* ------------------------------
general settings
------------------------------ */
:root {
    scroll-behavior: smooth;
    /* --fz: clamp(0.9375rem, 0.852rem + 0.36vw, 1.125rem); */
    --fz: clamp(0.75rem, 0.205rem + 2.73vw, 0.938rem);
    @media (min-width: 768px) {
        --fz: clamp(0.875rem, 0.688rem + 0.39vw, 1rem);
    }
    @media (min-width: 1280px) {
        --fz: 16px;
    }
    --gradient: conic-gradient(from 0deg, #ffff00, #00f000, #00e6e6, #0000ff, #f000f0, #ff0000, #ffff00);
    --text-color: #222;
    --text-sub-color: #aaaaaa;
    --background-color: #f7f7f7;
    --background-sub-color: #ededed;
    --sans-serif: YakuHanJP, "Roboto", "游ゴシック", "Yu Gothic", YuGothic, "メイリオ", Meiryo, "メイリオ", Meiryo,
        "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", sans-serif;
    --header-height: 16em;
    --header-border-width: 1em;
    --footer-height: var(--header-height);
    --footer-border-width: var(--header-border-width);
}
.body {
    font-size: var(--fz);
    padding: 1em 0 2em;
    min-height: 100vh;
    margin: 0;
    background-color: var(--background-color);
    display: grid;
    /* grid-template-columns: minmax(5vw, 1fr) minmax(33vw, 1280px) minmax(5vw, 1fr); */
    /* grid-template-columns: minmax(5vw, 1fr) max(640px) minmax(5vw, 1fr); */
    grid-template-columns: minmax(5vw, 1fr) minmax(33vw, 640px) minmax(5vw, 1fr);

    grid-template-rows: auto 1fr auto;
    a {
        color: var(--text-color);
        text-decoration: none;
    }
    & > * {
        font-family: var(--sans-serif);
        line-height: 1.75;
        text-align: justify;
    }
}
.text-link a {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

/* ------------------------------
header settings
------------------------------ */
.header {
    container-type: inline-size;

    width: clamp(256px, 100%, 100%);
    height: var(--header-height);
    overflow: hidden;
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    align-items: center;
    position: relative;
}
.header-background {
    width: 142cqw;
    height: 142cqw;
    border-radius: 100%;
    background-image: var(--gradient);
    transform-origin: center calc(var(--header-height) / 2);
    transform: translateY(calc(-50% + (var(--header-height) / 2)));
    display: grid;
    position: absolute;
    top: 0;
    left: -21cqw;
}
.header-container {
    width: 100cqw;
    height: calc(var(--header-height) - (var(--header-border-width) * 2));
    background-color: rgba(255, 255, 255, 0.9);
    grid-column: 2;
    align-self: center;
}
.header-contents {
    height: calc((var(--header-height) / 1) - (var(--header-border-width) * 2));
    display: grid;
    grid-template-columns: minmax(5vw, 1fr) minmax(33vw, 1280px) minmax(5vw, 1fr);
    grid-template-rows: 1.75em 1fr 1.75em;
    align-items: center;
    position: relative;
}
.site-title {
    font-size: 1em;
    height: 2em;
    width: 14em;
    grid-column: 2;
    grid-row: 2;
    a {
        font-size: 2em;
        display: block;
        transition-duration: 0.75s;
        &:hover {
            filter: blur(6px);
            opacity: 0.75;
        }
        img {
            height: 1em;
            object-fit: contain;
            object-position: 0 0;
        }
    }
}
.nav {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    align-self: start;
    justify-self: end;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    position: relative;
    @media screen and (width >= 768px) {
        grid-column: 2;
        grid-row: 3;
        align-self: start;
        justify-self: end;
        position: static;
        background-color: rgba(255, 255, 255, 0);
    }
    #nav-btn {
        width: 32px;
        height: 32px;
        background: url(images/btn-img_toOpen.svg) no-repeat center center / cover;
        position: absolute;
        top: 5vw;
        right: 5vw;
        z-index: 10;
        overflow: hidden;
        transition-duration: 0.5s;
        span {
            position: absolute;
            top: -200%;
            left: -200%;
        }
        @media (min-width: 768px) {
            display: none;
        }
        &.is-open-btn {
            background: url(images/btn-img_toClose.svg) no-repeat center center / cover;
        }
    }

    #nav-menu {
        font-size: 1.25em;
        text-align: center;
        width: 100vw;
        display: flex;
        flex-direction: column;
        opacity: 0;
        margin-right: -100vw;
        background-color: rgba(255, 255, 255, 0.9);
        transition-duration: 0.5s;
        @media screen and (width >= 768px) {
            font-size: 1em;
            width: auto;
            flex-direction: row;
            opacity: 1;
            margin-right: 0;
            background-color: rgba(255, 255, 255, 0);
        }
        &.is-open-menu {
            opacity: 1;
            margin-right: 0;
        }
    }
    .nav-list {
        font-size: inherit;
    }
    .nav-item {
        line-height: 1;
        padding: 0.6125em 0;
        display: block;
        transition-duration: 0.5s;
        @media screen and (width >= 768px) {
            padding: 0.25em 1.5em;
        }
        &:hover {
            filter: blur(2px);
        }
    }
    .nav-list:first-child {
        padding-top: 3em;
        @media screen and (width >= 768px) {
            padding-top: 0;
        }
    }
    .nav-item:last-child {
        padding-right: 0;
    }
}
/* ------------------------------
main settings
------------------------------ */
.main {
    margin-block: 6em;
    grid-column: 2 / -2;
    grid-row: 2;
}
.to-site-top,
.pagination {
    width: fit-content;
    margin: 4em auto 0;
    display: flex;
    column-gap: 4em;
    a {
        font-size: 0.875em;
        line-height: 1;
        padding: 0.5em 1em;
        border: 1px solid var(--text-color);
        display: block;
        transition: 0.5s;
        &:hover {
            color: var(--background-color);
            background-color: var(--text-color);
        }
    }
}

/* ------------------------------
footer settings
------------------------------ */
.footer {
    font-size: 0.9375em;
    line-height: 1;
    text-align: center;
    grid-column: 1 / -1;
    grid-row: 3;
    p {
        margin-top: 1em;
    }
}
.footer-border-top {
    width: 100%;
    margin-bottom: 0.75em;
    height: calc(var(--footer-border-width) * 0.125);
    overflow: hidden;
    position: relative;
}
.footer-border-top-background {
    width: 142cqw;
    height: 142cqw;
    border-radius: 100%;
    background-image: var(--gradient);
    position: absolute;
    top: calc(-71cqw - calc(var(--footer-height) / 2));
    left: -21cqw;
    transform-origin: center center;
}
.footer-text {
    width: fit-content;
    margin: 0 auto;
    a {
        display: block;
    }
}
.to-top {
    width: 3em;
    height: auto;
    grid-column: 2;
    justify-self: end;
    position: sticky;
    bottom: 2em;
    opacity: 0.666667;
    z-index: 10;
}

/* --------------------------------------------------
large width body common settings settings
-------------------------------------------------- */
.home,
.archive {
    grid-template-columns: minmax(5vw, 1fr) minmax(33vw, 1280px) minmax(5vw, 1fr);
}

/* --------------------------------------------------
.archive .home .page .single common settings settings
-------------------------------------------------- */
article.post {
    display: grid;
    grid-column: auto;
    grid-auto-flow: row;
}
.article-container {
    padding-bottom: 4em;
    margin-top: 4em;
    display: grid;
    grid-template-columns: repeat(auto-fit, clamp(240px, 17.75em, 430px));
    gap: 5em 3em;
    justify-content: center;
}
.block-width-67 {
    width: 100%;
    margin-inline: auto;
    @media (min-width: 768px) {
        width: 66.666667%;
    }
}
.box-has-border {
    padding: 2em;
    border: 1px solid var(--text-sub-color);
}
.caption {
    font-size: 0.875em;
    line-height: 1.375;
    text-indent: -1em;
    margin-top: -0.1875em;
    margin-left: 1em;
    margin-bottom: calc((1em * 1.066667) - 0.1875em);
}
.front-article-heading,
.works-heading {
    margin-top: 0.75em;
    font-size: 1.25em;
    font-weight: normal;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}
.front-article-image,
.works-image {
    width: 100%;
    margin-top: 1.5em;
    aspect-ratio: 10 / 7;
    overflow: hidden;
    img {
        max-width: 100%;
        aspect-ratio: 10 / 7;
        object-fit: cover;
        object-position: center center;
        width: 100%;
        height: auto;
    }
}

.page {
    p {
        margin-top: 1em;
        letter-spacing: -0.015em;
    }
    p:nth-child(2) {
        margin-top: 2em;
    }
}
.front-title,
.page-title {
    font-size: 1.25em;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}
.post-heading {
    font-size: 1.5em;
    font-weight: bold;
    line-height: 1.25;
    text-align: left;
    margin-block: -0.125em;
}
.single {
    .summary {
        padding: 2em;
        margin-top: 2em;
        background-color: var(--background-sub-color);
        em {
            color: var(--background-sub-color);
            font-weight: bold;
            font-style: normal;
            line-height: 1;
            padding: 0.25em 0.75em 0.3em;
            margin-right: 0.5em;
            background-color: var(--text-color);
            display: inline-block;
        }
    }
    .works-image {
        /* margin-bottom: 1.5em; */
        aspect-ratio: 10 / 7;
        img {
            max-height: 100%;
        }
    }
    time {
        font-size: 0.9375em;
        line-height: 1;
        margin-top: 0.75em;
        display: block;
    }
    .wp-block-group.images,
    .wp-block-image.images {
        margin-top: 4.5em;
        margin-bottom: 1.5em;
        display: flex;
        flex-wrap: nowrap;
        column-gap: 2em;
        .wp-element-caption {
            line-height: 1;
            margin-top: 0.5em;
            margin-bottom: 0;
        }
    }
    .wp-block-image.images {
        flex-direction: column;
    }
    .wp-block-heading {
        font-size: 1.25em;
        font-weight: bold;
        line-height: 1.25;
        /* margin-block: -0.125em; */
        & + p {
            margin-top: 0.75em;
        }
    }
}
.post-categories {
    margin-top: 1em;
    display: flex;
    column-gap: 0.5em;
    li {
        width: fit-content;
        a {
            line-height: 1;
            padding: 0.25em 0.5em;
            border: 1px solid var(--text-color);
            display: block;
            transition: 0.5s;
            &:hover {
                color: var(--background-color);
                background-color: var(--text-color);
            }
        }
    }
}
.post-heading {
    font-size: 1.5em;
    font-weight: bold;
    line-height: 1.25;
    text-align: left;
    margin-block: -0.125em;
}
.tag-item {
    width: fit-content;
    a {
        line-height: 1;
        padding: 0.25em 0.5em;
        border: 1px solid var(--text-color);
        display: block;
        transition: 0.5s;
        &:hover {
            color: var(--background-color);
            background-color: var(--text-color);
        }
    }
}
.tag-items-wrapper {
    display: flex;
    column-gap: 0.5em;
    margin-top: 1em;
}
.to-works {
    width: fit-content;
    margin: 4em auto 0;
    display: block;
    a {
        font-size: 0.875em;
        line-height: 1;
        padding: 0.5em 1em;
        border: 1px solid var(--text-color);
        display: block;
        transition: 0.5s;
        &:hover {
            color: var(--background-color);
            background-color: var(--text-color);
        }
    }
}

/* ---------- margin-block settings ---------- */
p {
    margin-block: 1em;
}
p + p {
    margin-top: 0;
}
.works-image {
    margin-top: 2em;
}
.wp-block-heading {
    /* margin-top: calc(1em - 0.125em); */
    margin-top: calc(2.5em - 0.125em);
    margin-bottom: -0.25em;
}
.wp-block-image,
.wp-block-group {
    /* margin-top: 2em; */
    margin-block: 1em;
}
.wp-block-group {
    .wp-block-image {
        margin-top: 0;
    }
}
.wp-block-image figcaption.wp-element-caption {
    line-height: 1.25;
    margin-top: 0.5em;
}
.cp_embed_wrapper {
    margin-block: 1em;
}

/*  ----------------------------------------
about page style
 ---------------------------------------- */
p.about-note {
    font-size: 0.8725em;
    line-height: 1.25;
    text-indent: -1.25em;
    width: 27em;
    padding-left: 1.25em;
    @media screen and (min-width: 768px) {
        text-align: right;
        width: auto;
    }
}

/*  ----------------------------------------
.category-works page style
 ---------------------------------------- */
article.category-works {
    display: grid;
    grid-template-columns: auto;
    grid-auto-flow: row;
    .post-heading {
        font-weight: normal;
        grid-row: 2;
    }
    .post-heading {
        margin-top: 0.75em;
    }
    .works-image {
        width: 75%;
        margin-top: 0;
        margin-inline: auto;
        aspect-ratio: 7 /10;
        grid-row: 1;
        img {
            height: 100%;
        }
    }
    p {
        margin-top: 0.25em;
        &:nth-child(4) {
            margin-top: 0.75em;
        }
    }
    &:has(.wp-block-group) {
        .post-heading {
            grid-row: 3;
        }
        .wp-block-group {
            grid-row: 2;
            .wp-block-group__inner-container {
                margin-bottom: 3em;
                display: flex;
                flex-wrap: wrap;
                justify-content: center;
                gap: 0.5em;
            }
        }
        .double-columns {
            .wp-block-image {
                width: calc((100% - 0.5em) / 2);
            }
        }
        .triple-columns {
            .wp-block-image {
                width: calc((100% - 0.5em) / 2);
                @media screen and (min-width: 768px) {
                    width: calc((100% - 1em) / 3);
                }
            }
        }
    }
}

/*  ----------------------------------------
contact page style
 ---------------------------------------- */
input,
textarea {
    color: var(--text-color);
    padding: 0.25em 0.5em;
    margin-top: 0.5em;
    width: 100%;
    border: 1px solid var(--text-color);
    /* border-radius: 0.125em; */
}
input.wpcf7-submit {
    margin: 0;
    border-radius: 9999px;
    transition-duration: 0.3s;
    &:hover {
        color: var(--background-color);
        background-color: var(--text-color);
    }
}
label {
    margin-top: 2em;
    display: block;
}
p:has(.wpcf7-submit) {
    width: 6em;
    text-align: center;
    margin: 2em auto;
    span {
        display: none;
    }
}
.contact-note {
    font-size: 0.9375em;
    line-height: 1.25;
    text-align: center;
    margin-block: 0 6em;
    a {
        text-decoration: underline;
        text-underline-offset: 15%;
    }
}
.grecaptcha-badge {
    visibility: hidden;
}

/*  ----------------------------------------
pre, code style
 ---------------------------------------- */
.wp-block-group:has(.wp-block-code) {
    /* margin-top: calc(1.14285714em * 2); */
    margin-block: calc(1.14285714em * 1);
}
.wp-block-group__inner-container:has(.wp-block-code) {
    position: relative;
}
.wp-block-code {
    max-width: 90vw;
    max-height: 300px;
    padding: 1.14285714em;
    padding-top: 2.25em;
    overflow: scroll;
    counter-reset: linenumber;
    border: none;
    font-size: 0.933333em;
    background: var(--background-sub-color);
    position: relative;
    code {
        color: black;
        background: none;
        text-align: left;
        white-space: pre;
        word-spacing: normal;
        word-break: normal;
        word-wrap: normal;
        line-height: 1.333333;
    }
}
@media (min-width: 768px) {
    .wp-block-code {
        font-size: 0.875em;
        max-width: max(640px, 33vw);
    }
}
.code-title {
    color: var(--background-color);
    font-size: 0.875em;
    line-height: 1;
    width: fit-content;
    padding: 0.25em 0.75em 0.3em;
    margin: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    background-color: var(--text-color);
}
