/* 全体的なスタイル */

html {
    font-size: 100%;
}

/* 7.css側でフォントサイズが固定されているため全体を拡大%表示 */
body {
    font-family: 'Meiryo UI', 'メイリオ', sans-serif;

    zoom: 1.25;
    margin: 0;
    padding: 0;
    color: #222;
    background: var(--w7-surface);
    font: var(--w7-font);
}

/* レイアウト */

article {
    margin-bottom: 2rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 40rem;
}

aside {
    max-width: 25em;
}

.wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
    margin-top: 2rem;
}

/* Utility classes for cleaned templates */
.px-1-5 {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.hr-center {
    margin: 1em auto;
    width: 80%;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.center-small {
    margin-left: auto;
    margin-right: auto;
    width: 12rem !important;
}

.p-1 {
    padding: 1em;
}

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

.emoji-sm {
    width: 6rem;
    height: 6rem;
    margin: 1rem;
}

.fs-2 {
    font-size: 2em;
}

.favicon-inline {
    height: 1em;
    transform: translateY(12%);
}

.footer-box {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
    max-width: 250px;
}

.link-black {
    color: #000;
}

/* Previous / Next links under posts */
.next-prev-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1.5rem;
}

.next-prev-block a {
    display: block;
}

.next-window,
.prev-window {
    width: 100%;
}

.toc-dialog-h2 {
    margin: 0.5em 0em 0.5em;
}

.dialog-contents {
    margin: 0 1em;
}

/* ヘッダーとフッター */

/* ヘッダーの固定とアニメーション https://qiita.com/00000000/items/bef3e96ad1b19cc46d0a */
header {
    height: 2rem;
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 99;
    transition: transform 0.2s 0.2s;
}

header.hidden {
    transform: translateY(-2rem);
}

footer {
    text-align: center;
}

footer p {
    margin: 0;
    padding-top: 1em;
    padding-bottom: 0.5em;
    text-align: center;
    max-width: 100%;
}

.footer-block {
    margin: 0;
    background-color: #d8d8d8;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1em;
    padding-top: 1em;
}


/* タイポグラフィ */

h1 {
    font-size: 2.5em;
    margin: 2rem 0 1rem;
}

h2 {
    font-size: 2em;
    margin-top: 2em;
}

h3 {
    font-size: 1.6em;
}

h4 {
    font-size: 1.5em;
}

h3,
h4 {
    /* Swap the margin for a top-padding so linking to this section
     results in a better scroll position */
    padding-top: 20px;
    margin-top: 0;
    display: block;
    flex: 0 0 200px;
}

p {
    max-width: 50em;
    line-height: 1.6;
    margin-top: 1.2em;
    margin-bottom: 1.2em;
}

blockquote {
    margin: 0;
    padding: 0.1em;
    padding-left: 1em;
    padding-right: 1em;
    background: #dfdfdf;
}

hr {
    margin: 0;
    border: 1px solid #ccc;
    max-width: 400px;
    box-shadow: 0 1px #fff;
}

.title-bar-link {
    color: #000;
    text-decoration: underline;
}

p.about-name {
    line-height: 0;
    padding: 0;
    margin: 0;
    margin-top: 0.6em;
    font-size: 1.5em;
    text-align: center;
}

p.about-copyright {
    line-height: 0;
    padding: 0;
    padding-right: 2em;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    text-align: right;
}

p.taglist {
    padding: 0 2rem;
}

ul.taglist {
    margin: auto;
}

article ul {
    list-style-type: "- ";
    padding-left: 1em;
}

.notice-message {
    margin: 0.5em;
    margin-bottom: 1em;
}

/* コンポーネント */

[role="dialog"] {
    width: 450px;
}

[role="tooltip"]:not([id]) {
    margin: 2em 0;
}

table {
    table-layout: fixed;
    max-width: 100%;
    margin: auto;
    margin-top: 1em;
}

/* 画像関連 */
.imgwindow {
    display: inline-block;
    padding: 0;
    padding-bottom: -1px;
}

.articleimg {
    max-width: 100%;
    max-height: 20em;
}

.img-container {
    margin-top: 2em;
    margin-bottom: 2em;
    text-align: center;
    max-width: 100%;
}

/* 表: table スタイルは上で統合済み */

table td {
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
}

time {
    display: flex;
    justify-content: flex-end;
}


.post-list {
    max-width: 95%;
    margin-bottom: 1rem;
}

.post-list td,
.post-list th {
    padding-top: 0.3em;
    padding-bottom: 0.3em;
}

.post-list th:nth-child(2),
.post-list td:nth-child(2) {
    width: 5.5em;
}

.post-list td:nth-child(3) {
    max-width: 8em;
}


.post-list td.tags-cell .tags-closed {
    display: block;
    max-width: 8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-list td:nth-child(4) {
    width: 9em;
    text-align: right;
}

.post-list th:nth-child(3),
.post-list th:nth-child(4) {
    text-align: center;
}

.post-list a {
    color: #000;
}

.post-list a:hover {
    text-decoration: underline;
}


.post-list td.tags-cell {
    overflow: visible;
}


.tags-cell {
    position: relative;
}

.tags-balloon {
    overflow-wrap: anywhere;
    word-break: normal;
    line-break: strict;
    white-space: normal;

    height: 7em;
    z-index: 1;
    position: absolute;
    width: 200px;
    bottom: -9em;
    right: 5em;
    visibility: hidden;
}

.tags-cell:hover .tags-balloon {
    visibility: visible;
}


.tabs {
    margin: auto;
    max-width: 97%;
}


/* サイドバー関連 */

.sidebar-window {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

aside .tree-view {
    width: 100%;
    overflow-y: scroll;
}

aside table {
    width: 100%;
    box-sizing: border-box;
}

.sidebar-title {
    color: #000;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /*幅の文字数を超えたら...にする*/
}

.sidebar-category {
    color: #000;
}

.sidebar-link {
    line-height: 1.8em;
    padding: 0;
    margin: 0;
    margin-right: 0.2em;
    text-align: right;
}

/* 特定のID */

#sidebar #recent-article-window th:nth-child(2),
#sidebar #recent-article-window td:nth-child(2),
#sidebar #category-window th:nth-child(2),
#sidebar #category-window td:nth-child(2) {
    width: 5.5em;
}

#tag-window ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    justify-content: space-between;
    padding: 0;
    margin: 0;
}

#tag-window li {
    flex: 1 0 50%;
    padding: 0.2em;
}

#tag-window li button {
    width: 100%
}

.searchbox,
#search-query {
    width: 100%;
    box-sizing: border-box;
}


/* plugins */
.eleventy-plugin-youtube-embed,
.eleventy-plugin-embed-twitter {
    margin: auto;
    max-width: 80%;
}

/* メディアクエリ */
.taglist-mobile,
.categories-list-mobile,
.post-list-mobile,
.notice-mobile {
    display: none;
}

@media (max-width:1214px) {
    .notice-mobile {
        display: block;
    }
}

@media (max-width: 600px) {
    .wrapper {
        flex-direction: column;
        align-items: center;
    }


    .eleventy-plugin-youtube-embed,
    .eleventy-plugin-embed-twitter {
        margin: auto;
        max-width: 100%;
    }

    .eleventy-plugin-embed-twitter {
        margin: auto;
        max-width: 100%;

    }

    .twitter-tweet-rendered iframe {
        max-width: 100%;
    }

    .footer-block {
        flex-direction: column;
        align-items: center;
        gap: 0.5em;
    }

    h1 {
        font-size: 2em;

    }

    h2 {
        font-size: 1.7em;
    }

    h3 {
        font-size: 1.5em;
    }

    h4 {
        font-size: 1em;
    }

    .next-prev-block {
        flex-direction: column;
    }

    .post-list,
    .tabs,
    .taglist {
        display: none;
    }

    .taglist-mobile ul {
        padding: 2rem;
    }

    .taglist-mobile li {
        margin: 0.8em;
    }

    .taglist-mobile,
    .categories-list-mobile,
    .post-list-mobile {
        display: block;
    }

    .categories-list-mobile details {
        margin-top: 1.5em;
        margin-bottom: 1.5em;
    }


    time {
        flex-direction: column;
    }


    .post-list-mobile {
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }

    a.post-list-mobile-block {

        color: #000;

        width: 100%;
        display: flex;
        flex-direction: column;
        border-radius: 3px;
        border: 1px solid #80afdd;
        background-image: linear-gradient(0deg, #d1e5ff, #eff8ff);
        padding-top: 0.1rem;
        padding-bottom: 0.3rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;

        min-height: 4.7em;

        margin-top: 0.4em;
    }

    a.post-list-mobile-block:hover {
        background-image: linear-gradient(0deg, #c1dbfc, #dcebfc);
    }

    .post-list-mobile-title {
        line-height: 1.6;
        padding-top: 0;
        margin-top: auto;
        margin-bottom: auto;
    }

    .post-list-mobile-description {
        line-height: 1.6;
        margin-top: auto;
        margin-bottom: auto;
        color: #726c6c;
    }

}

@media (max-width: 480px) {
    #index-window {
        display: none;
    }

    hr,
    p {
        width: 100%;
    }

    h3,
    h4 {
        flex: 0;
    }

    pre {
        overflow-x: scroll;
    }

    [role="dialog"] {
        width: 90%;
    }
}
