/************ RESET *************/

/* Box sizing rules */
*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

:root {
    --header-height: 60px;

    /* Nordic color palette */
    --color-bg:          #f8f8f7;
    --color-bg-sub:      #f0f0ef;
    --color-bg-aside:    #ededec;
    --color-text:        #1a1a19;
    --color-text-muted:  #7a7a78;
    --color-text-light:  #9a9a98;
    --color-border:      #e4e4e2;
    --color-border-sub:  #d0d0ce;
    --color-accent:      #3d6343;
    --color-accent-bg:   #dde8de;
    --color-accent-text: #2d5233;
    --color-accent-dark: #1a1a19;
}

/* Prevent font size inflation */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, calc(0.75rem + 1vw), 1.25rem);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
}


a {
    text-decoration-skip-ink: auto;
    transition: all 0.7s;
}

a:hover {
    transform: scale(1.02);
}

/*************Effect******************/

/* page Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    70% {
        opacity: 0.8;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.fadeIn {
    animation: fadeIn 1.5s ease-in-out 0.2s forwards;
    opacity: 0;
}

.slideIn {
    animation: slideIn 0.5s forwards;
    opacity: 0;
}

.slideOut {
    animation: slideOut 0.5s forwards;
    opacity: 1;
}

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.mouse-focus {
    outline: 2px solid blue;
}

.keyboard-focus {
    outline: 2px solid orange;
    outline-offset: 2px;
}

.skip-link {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link:focus {
    background-color: #f8fafc;
    clip: auto !important;
    clip-path: none;
    color: #5898ff;
    display: block;
    font-weight: bold;
    height: auto;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    width: auto;
    z-index: 100000;
    position: relative;
}


/************ BASE *************/

.body__wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.content__wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--header-height);
    overflow: auto;
    position: relative;
}

header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    border-bottom: 0.5px solid var(--color-border);
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
}

aside {
    width: 100%;
    height: 260px;
    padding: 0;
    background-color: var(--color-bg-sub);
    position: relative;
    overflow: hidden;
}

    nav:not([class]) {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: .5rem;
}

main {
    width: 100%;
    max-width: 600px;
    height: auto;
    padding-right: 0;
    position: relative;
}

@media screen and (min-width: 1024px) {
    .content__wrap {
        flex: 1;
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        height: calc(100vh - 200px);
        padding-top: var(--header-height);
        overflow: hidden;
        position: relative;
    }

    aside {
        flex: 1;
        width: 100%;
        height: calc(100vh - var(--header-height));
        padding: 0;
        background-color: transparent;
        background-image: none;
        position: relative;
        overflow: visible;
    }

nav:not([class]) {
        position: fixed;
        bottom: 10%;
        left: 2rem;
        width: calc(100% - 600px - 4rem);
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 2rem;
    }

    main {
        width: 100%;
        max-width: 600px;
        height: 100%;
        padding-right: 1rem;
        z-index: 10;
    }
}

footer {
    background-color: var(--color-bg-aside);
    border-top: 0.5px solid var(--color-border);
    text-align: center;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 .5rem;
}

@media screen and (min-width: 1024px) {
    .container {
        width: 100%;
        margin: 0 auto;
        padding: 0 2rem;
    }
}

a.blue:link {
    color: #5898ff;
}

.align-right {
    text-align: right;
    width: 100%;
}


/************ HEADER *************/
.header__wrap {
    display: flex;
    justify-content: space-between;
}

.header__logo {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    flex: 1;
    overflow: hidden;
}

.custom-logo-link {
    float: none;
    display: flex;
    align-items: center;
    padding: 5px 0 0 0;
    margin-right: .25rem;
}

.custom-logo-link img {
    width: 60px;
    height: auto;
    object-fit: contain;
}

.header__logo__link {
    flex: 1;
    padding: .5rem 0;
    display: flex;
    align-items: center;
    gap: .25rem;
    text-decoration: none;
}

.header__logo__link img {
    width: 60px;
    height: auto;
    object-fit: contain;
}

.header__logo__title {
    font-size: clamp(1.25rem, 0.85rem + 0.88vw, 1.75rem);
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header__nav {
    display: flex;
    gap: 1rem;
}

.header__link {
    display: none;
}

a.header__link__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    color: var(--color-bg);
    font-size: 1rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

a.header__link__button:hover {
    background: #2d5233;
    color: var(--color-bg);
    transform: scale(1);
}

.header__menu__close {
    color: var(--color-text);
    font-size: 1.25rem;
}

.header__menu__button {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: .75rem 0;
    width: 44px;
    flex-shrink: 0;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    background: transparent;
}

.header__menu__button:hover {
    opacity: 0.6;
}

.header__menu__button .bar {
    width: 100%;
    height: 1.5px;
    background-color: var(--color-text);
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.header__menu__button.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.header__menu__button.active .bar:nth-child(2) {
    opacity: 0;
}

.header__menu__button.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(10px, -10px);
}

#header-menu-modal {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 90%;
    overflow-y: auto;
    background-color: var(--color-bg);
    border-bottom: 0.5px solid var(--color-border);
    justify-content: center;
    z-index: 90;
    animation: slideIn 0.5s forwards;
    padding: 2rem;
}

#header-menu-modal[aria-hidden="true"] {
    display: none;
}

#header-menu-modal[aria-hidden="false"] {
    display: block;
}

.modal-content {
    padding: 1rem;
    border: 0.5px solid var(--color-border);
    border-radius: .5rem;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

ul.header__menu__list {
    display: flex;
    flex-direction: column;
    list-style: none;
}

ul.header__menu__list li ul {
    list-style: none;
    padding-left: 1rem;
}

ul.header__menu__list li {
    width: 100%;
    border-bottom: 0.5px solid var(--color-border);
}

ul.header__menu__list li ul li {
    width: 100%;
    border-bottom: 0.5px solid var(--color-border-sub);
}


ul.header__menu__list li ul li:last-child {
    border-bottom: none;
}

ul.header__menu__list li a {
    display: flex;
    padding: 1rem;
    color: var(--color-text);
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
}

ul.header__menu__list li a:hover {
    background-color: var(--color-accent-bg);
    color: var(--color-accent-text);
}

img.open, img.close {
    -webkit-filter: invert(1);
    filter: invert(1);
}

@media screen and (min-width: 1024px) {
    .header__link {
        display: flex;
        width: 200px;
        background-color: var(--color-accent-dark);
    }

    dialog.header__menu {
        width: 500px;
    }
}


/************** ASIDE ****************/
.aside__wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.aside__title {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    align-items: center;
}

aside h1 {
    width: 100%;
    color: var(--color-text);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 400;
    text-align: center;
    text-shadow: none;
    line-height: 1.2;
}

aside h1::after {
    content: "";
    display: block;
    width: 32px;
    height: 1.5px;
    background: var(--color-accent);
    margin: 10px auto 0;
    border-radius: 1px;
}

aside p {
    display: none;
}

.text-cyan {
    color: var(--color-accent);
}

.aside__title__image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.aside__title__image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media screen and (min-width: 1024px) {
    .aside__wrap {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: calc(100% - 600px);
        height: calc(100vh - var(--header-height));
        padding: 0 1rem;
        justify-content: center;
        align-items: flex-start;
        z-index: auto;
        background-color: var(--color-bg-aside);
        border-right: 0.5px solid var(--color-border);
    }

    .aside__title {
        gap: 2rem;
        padding: 0 .5rem;
        align-items: flex-start;
    }

    aside h1 {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: clamp(3rem, 3.6rem + 2vw, 5rem);
        font-weight: 400;
        text-align: left;
        text-shadow: none;
        color: var(--color-text);
        line-height: 1.15;
    }

    aside h1::after {
        margin: 10px 0 0;
        background: var(--color-accent);
    }

    aside p {
        display: block;
        width: 100%;
        color: var(--color-text-muted);
        font-size: 1rem;
        text-align: left;
    }
}


/************** MAIN *****************/
.main__wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    background-color: var(--color-bg);
}

.odd {
    background-color: var(--color-bg-sub);
}

section {
    width: 100%;
    position: relative;
    padding: 2rem 0 4rem 0;
    margin-bottom: 2rem;
}

main h2 {
    color: var(--color-text);
    text-align: center;
    margin: 2rem 0;
    position: relative;
    font-size: 1.125rem;
    font-weight: 500;
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    letter-spacing: .05em;
}

main h2 a {
    color: var(--color-text);
    text-decoration: none;
    display: inline-block;
    font-size: 1.125rem;
}

main h2::before {
    content: " ";
    display: inline-block;
    width: 15%;
    height: 0.5px;
    border: none;
    background: var(--color-border-sub);
}

main h2::after {
    content: " ";
    display: inline-block;
    width: 15%;
    height: 0.5px;
    border: none;
    background: var(--color-border-sub);
}

/* Top Banner */
.top__banner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.top__banner img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.top__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    line-height: 1.8;
}

.top__content ul {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download__button {
    button {
        max-width: 320px;
        background: linear-gradient(90deg, #4a90e2, #007aff);
        color: #ffffff;
        border: none;
        padding: 1rem 2rem;
        font-size: 1rem;
        border-radius: 0.5rem;
        cursor: pointer;
        transition: background 0.3s ease;
    }

    button:hover {
        background: linear-gradient(90deg, #007aff, #4a90e2);
    }
}

/************** FOOTER ***************/
.footer__wrap {
    display: flex;
    flex-direction: column;
}

@media screen and (min-width: 1024px) {
    .footer__wrap {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

ul.footer__link {
    display: flex;
    padding-top: .5rem;
}

ul.footer__link li {
    list-style: none;
    display: flex;
}

ul.footer__link li a {
    display: flex;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: .5rem;
}

@media screen and (min-width: 1024px) {
    ul.footer__link {
        padding-top: 0;
    }

    ul.footer__link li a {
        display: flex;
        color: #94a3b8;
        text-decoration: none;
        padding: .5rem 1rem;
    }

}

ul.footer__link li a:hover {
    color: var(--color-text);
    background-color: var(--color-accent-bg);
    transform: scale(1);
}

.footer__copyright {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-text-muted);
    text-decoration: none;
    padding-bottom: 1rem;
}

@media screen and (min-width: 1024px) {
    .footer__copyright {
        display: flex;
        flex-direction: row;
        align-items: center;
        color: var(--color-text-muted);
        text-decoration: none;
        gap: 1rem;
        padding: 1rem 0;
    }

}

/************ COMPONENTS *************/
.content-area {
    padding: 1rem;
    line-height: 1.75;
    letter-spacing: .03em;
}


.content-area ul {
    list-style-position: inside;
}

/************ Adjustment *************/
article>footer {
    background: transparent;
}

.error-404 {
    width: 100%;
    height: calc(50vh);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.error_red {
    color: #ff0000;
    font-size: 2rem;
    font-weight: 700;
    display: inline-block;
}

.sidebar-top {
    border-bottom: 1px solid #D7D7D7;
    padding: .5rem 0;
    width: 100%;
    height: .5rem;
    margin-bottom: 1rem;
}

/************ ADMIN BAR *************/
/* デスクトップ: アドミンバー 32px */
.admin-bar header {
    top: 32px;
}

.admin-bar .content__wrap {
    padding-top: calc(var(--header-height) + 32px);
}

.admin-bar #header-menu-modal {
    top: calc(80px + 32px);
}

@media screen and (min-width: 1024px) {
    .admin-bar .aside__wrap {
        top: calc(var(--header-height) + 32px);
        height: calc(100vh - var(--header-height) - 32px);
    }
}

/* モバイル: アドミンバー 46px (782px以下) */
@media screen and (max-width: 782px) {
    .admin-bar header {
        top: 46px;
    }

    .admin-bar .content__wrap {
        padding-top: calc(var(--header-height) + 46px);
    }

    .admin-bar #header-menu-modal {
        top: calc(80px + 46px);
    }
}