@charset "UTF-8";

:root {
    --page-bar-height: 64px;
    --main-background-color: #9e3e3e;
    --header-logo-size: 36px;
    --title-icon-size: 28px;
    --menu-button-size: 48px;
    --thumbnail-width: 320px;
    --thumbnail-height: 400px;
    --z-index-fixed-contents: 1000;
}

body {
    margin: 0;
    padding: 0;
}

img {
    pointer-events: none;
    -webkit-touch-callout: none;
}

.hidden,
.making-hide {
    display: none !important;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--page-bar-height);
    background-color: var(--main-background-color);
    border-bottom: 3px ridge lightgray;
    display: flex;
    justify-content: space-between;
    z-index: var(--z-index-fixed-contents);

    .title-bar {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;

        >div {
            white-space: nowrap;
        }

        img {
            margin-right: 4px;
            height: var(--header-logo-size);
            width: auto;
            border-radius: 4px;
            vertical-align: text-bottom;
            background-color: bisque;
        }

        h1 {
            all: initial;
            font-size: 32px;
            font-weight: bold;
            text-shadow: 1px 1px 2px white;
            white-space: nowrap;
            font-family: "Zen Maru Gothic", sans-serif;

            .h1-sub {
                margin-left: 4px;
                font-size: 24px;
            }
        }
    }

    .status-bar {
        margin: 0px 4px;

        #calendar-summary {

            .calendar-summary-header {
                color: white;
                font-size: 14px;
            }

            .calendar-summary-contents {
                display: flex;
                gap: 2px;

                >div {
                    display: flex;
                    align-items: center;
                    padding: 0px 8px;
                    font-size: 14px;
                    font-weight: bold;
                    border-radius: 4px;
                    line-height: 1rem;
                    height: 40px;
                    width: 100%;
                    min-width: calc(16px * 8);

                    @media screen and (max-width:768px) {
                        min-width: calc(16px * 4.5);
                    }

                    @media screen and (max-width:360px) {
                        min-width: calc(16px * 4);
                    }
                }

                .holiday {
                    background-color: yellow;
                    color: red;
                }

                .visit {
                    background-color: lime;
                    color: green;
                }
            }
        }
    }
}

main {
    margin: calc(var(--page-bar-height) + 4px) 0px;

    .content {
        margin: 16px 16px 48px;
        border-top: 1px groove lightgray;

        .content-header {
            min-height: var(--page-bar-height);
            display: flex;
            align-items: center;
            flex-wrap: wrap;

            img {
                margin: 4px;
                height: var(--title-icon-size);
                width: auto;
                vertical-align: text-bottom;
            }

            h2 {
                all: initial;
                font-size: 24px;
                font-weight: bold;
                text-shadow: 1px 1px 2px lightgray;
                white-space: nowrap;
                font-family: "Zen Maru Gothic", sans-serif;
            }

            .description {
                margin: 0px 8px;

                p {
                    all: initial;
                    display: block !important;
                    font-size: 16px;
                }
            }
        }

        .content-body {

            h3 {
                all: initial;
                display: block;
                font-size: 20px;
                font-weight: bold;
                padding: 4px 8px 16px;
                background-color: sandybrown;
                border-radius: 6px;
            }

            p {
                all: initial;
                display: block !important;
                font-size: 20px;
            }

            .carousel {
                width: 100%;
                box-sizing: border-box;
                display: flex;
                overflow: auto;
                scroll-snap-type: x mandatory;
                scroll-behavior: smooth;

                &.sns-link {
                    column-gap: 12px;
                }

                .carousel-content {
                    position: relative;
                    flex-shrink: 0;
                    scroll-snap-align: center;

                    &.flex-rows {
                        display: flex;
                        flex-direction: column;

                        iframe {
                            height: 100%;
                        }
                    }

                    .scroll-y {
                        height: 700px;
                        overflow-y: auto;
                    }

                    table {
                        width: var(--thumbnail-width);
                        max-height: var(--thumbnail-height);
                        border-spacing: 0px;

                        thead {
                            td {
                                position: sticky;
                                top: 0;
                                background-color: sandybrown;
                            }

                            tr {
                                td:first-child {
                                    border-radius: 6px 0px 0px 6px;
                                }

                                td:last-child {
                                    border-radius: 0px 6px 6px 0px;
                                }
                            }

                        }

                        tr:nth-child(even) td {
                            background: cornsilk;
                        }

                        .datetime {
                            vertical-align: top;
                            white-space: nowrap;
                            font-size: 14px;
                        }

                        .text {
                            padding-left: 8px;
                            word-break: break-all;
                        }

                        .sns-link {
                            vertical-align: baseline;
                        }

                        .permalink {
                            display: inline-block;
                            width: 36px;
                            height: 36px;

                            img {
                                height: 36px;
                                width: auto;
                            }
                        }
                    }

                    .instagram-media-thumbnail {
                        width: var(--thumbnail-width);

                        .carousel {
                            column-gap: normal;
                        }

                        img,
                        video {
                            width: var(--thumbnail-width);
                            height: var(--thumbnail-height);
                        }

                        img {
                            object-fit: contain;
                        }

                        .caption {
                            padding: 4px;
                            height: 240px;
                            overflow-y: auto;
                            background-color: cornsilk;

                            .permalink {
                                display: block;
                                float: right;
                                margin: 4px;
                                width: 36px;
                                height: 36px;

                                img {
                                    height: 36px;
                                    width: auto;
                                }
                            }
                        }
                    }

                    .youtube-media-thumbnail {
                        height: 400px;
                        display: flex;
                        align-items: center;
                    }
                }
            }

            .carousel.navigate {
                scroll-marker-group: after;

                &.instagram {
                    anchor-name: --carousel-instagram;
                }
            }

            .carousel.navigate {
                &::scroll-button(*) {
                    border: 1px solid black;
                    border-radius: 8px;
                    font-size: 12px;
                    width: 16px;
                    height: 16px;
                    background-color: white;
                    color: black;
                    cursor: pointer;
                    position: absolute;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                }

                &.instagram::scroll-button(*) {
                    position-anchor: --carousel-instagram;
                }
            }

            .carousel.navigate::scroll-button(*):disabled {
                opacity: 0;
                cursor: unset;
            }

            .carousel.navigate {
                &::scroll-button(left) {
                    content: "◀";
                    padding: 0px 2px 2px 0px;
                }

                &::scroll-button(right) {
                    content: "▶";
                    padding: 0px 0px 2px 2px;
                }

                &.bottom-view::scroll-button(*) {
                    transform: translate(0px, 648px);
                }

                &.instagram::scroll-button(left) {
                    right: calc(anchor(left) - 18px);
                    top: calc(anchor(bottom) - 224px);
                }

                &.instagram::scroll-button(right) {
                    left: calc(anchor(right) - 18px);
                    top: calc(anchor(bottom) - 224px);
                }
            }

            .carousel.navigate {
                &::scroll-marker-group {
                    position: absolute;
                    justify-self: anchor-center;
                    display: flex;
                    justify-content: center;
                    gap: 4px;
                    padding: 2px 6px;
                    background-color: white;
                    border-radius: 6px;
                }

                &.bottom-view::scroll-marker-group {
                    transform: translate(0px, 648px);
                }

                &.instagram::scroll-marker-group {
                    position-anchor: --carousel-instagram;
                    top: calc(anchor(bottom) - 28px);
                }
            }

            .navigate>.carousel-content::scroll-marker {
                content: "";
                width: 8px;
                height: 8px;
                border-radius: 50%;
                background-color: lightgray;
            }

            .navigate>.carousel-content::scroll-marker:target-current {
                background-color: black;
            }

            .navigate>.carousel-content:only-child::scroll-marker {
                display: none;
            }
        }
    }
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: var(--page-bar-height);
    background-color: var(--main-background-color);
    border-top: 4px ridge lightgray;
    z-index: var(--z-index-fixed-contents);

    .menu-bar {
        width: 100%;
        box-sizing: border-box;
        display: flex;
        overflow: auto;

        .menu-button {
            position: relative;
            flex-shrink: 0;
            width: var(--menu-button-size);
            height: var(--menu-button-size);
            margin: 8px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;

            p {
                position: absolute;
                line-height: 18px;
                font-size: 14px;
                hyphens: auto;
                color: white;
                text-shadow: 1px 1px 1px lightgray;
            }

            a {
                text-decoration: none;
            }
        }
    }
}