html {
    scroll-padding-top: 80px;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
}

body {
    line-height: 2rem;
}

header {
    height: 80px;
    width: 100%;
    position: sticky;
    top: 0;
    background-color: var(--color-neutral-white);
    z-index: 100;
}

header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    height: 80px;
}

header img {
    height: 50px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

@media (max-width: 768px) {
    header {
        height: 60px;
    }

    header h1 {
        height: 60px;
    }

    header img {
        height: 40px;
    }
}

/* ハンバーガーメニューによるナビゲーション */
.nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    z-index: 90;
    display: flex;
    justify-content: flex-end;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.nav.is-open {
    opacity: 1;
    visibility: visible;
}


.nav ul {
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
    height: 100%;
    background-color: var(--color-neutral-white);
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: left;
    padding-top: calc(80px + 2rem);
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 3rem;
    transition: transform 0.5s ease;
}

@media (max-width: 768px) {
    .nav ul {
        width: 100%;
        white-space: nowrap;
    }
}

/**/

main {
    padding: 0 1.5rem;
    margin: 0 auto;
    max-width: 77.375rem;
    min-height: calc(100svh - 145px - 5rem);
}

@media (max-width: 768px) {
    main {
        min-height: calc(100svh - 135px - 5rem);
    }
}

footer {
    color: var(--color-neutral-white);
    margin-top: 5rem;
    padding: 3rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-direction: column;
    background-color: var(--color-neutral-solid-gray-900);
}

.footer-logo a {
    height: 3rem;
    display: inline-flex;
}

.footer-logo img {
    min-width: 15rem;
    max-height: 3rem;
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(213deg) brightness(104%) contrast(102%);
}

.footer-sns {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.footer-sns a {
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.footer-sns i {
    color: var(--color-neutral-white);
    font-size: 25px;
}

.footer-sns li:first-child {
    padding-right: 5px;
}

.footer-sns img {
    height: 45px;
    width: 45px;
}

@media (max-width: 768px) {
    .footer-logo img {
        width: 80%;
        margin: 0 auto;
    }
}

.footer-sns a:focus-visible i {
    color: var(--color-neutral-white);
}

/* ----- ルビフルボタン【始】 ----- */
.rubyful-rt {
    font-size: 0.5em;
    text-align: center;
    margin: 0.2em 0.1rem;
    padding: 0.1rem;
    color: var(--color-primitive-red-900);
    background-color: var(--color-neutral-white);
}

rt.rubyfuljs-insert {
    font-size: 50%;
    padding-bottom: 0.5em;
}

@media (max-width: 768px) {
    .rubyful-rt {
        font-size: 0.5em;
        margin: 0;
    }
}

.ruby-toggle-wrap {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font: 13px/1 "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
    z-index: 99999;
}

.ruby-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 35px;
}

.ruby-toggle-title {
    font-weight: 600;
    font-size: 14px;
    color: #222;
}

.ruby-toggle-sub {
    font-size: 12px;
    color: #555;
}

.ruby-switch {
    width: 56px;
    height: 32px;
    border-radius: 16px;
    padding: 4px;
    box-sizing: border-box;
    background: #e6e6e6;
    position: relative;
    cursor: pointer;
    transition: background 180ms, box-shadow 120ms;
    display: inline-block;
    outline: none;
}

.ruby-switch .knob {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: left 220ms cubic-bezier(.2, .9, .2, 1), box-shadow 120ms;
}

.ruby-switch.on {
    background: #000;
    box-shadow: 0 6px 18px rgba(11, 118, 239, 0.18);
}

.ruby-switch.on .knob {
    left: calc(100% - 28px);
}

.ruby-switch:focus {
    outline: calc(4 / 16 * 1rem) solid var(--color-neutral-black);
    outline-offset: calc(2 / 16 * 1rem);
    box-shadow: 0 0 0 calc(2 / 16 * 1rem) var(--color-primitive-yellow-300);
}

.ruby-hidden .rubyful-rt,
.rubyful-rt.hidden {
    display: none !important;
}

.rubyful-toggle {
    display: none !important;
}

@media (max-width:420px) {
    .ruby-toggle-wrap {
        right: 12px;
        bottom: 12px;
        padding: 6px 10px;
    }

    .ruby-switch {
        width: 48px;
        height: 28px;
    }

    .ruby-switch .knob {
        width: 20px;
        height: 20px;
        left: 4px;
    }

    .ruby-switch.on .knob {
        left: calc(100% - 24px);
    }
}

@media (prefers-color-scheme: dark) {
    .ruby-switch {
        background: var(--color-neutral-solid-gray-600);
    }

    .ruby-toggle-title,
    .ruby-toggle-sub {
        color: #000;
    }
}

/* ----- ルビフルボタン【終】 ----- */

/* ダークモード */
@media (prefers-color-scheme: dark) {
    header {
        background-color: var(--color-neutral-black);
    }

    header img {
        filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(213deg) brightness(104%) contrast(102%);
    }

    body {
        background-color: var(--color-neutral-black);
        color: var(--color-neutral-white);
    }

    * {
        color: var(--color-neutral-white);
    }

    .ruby-contents,
    .ruby-contents * {
        color: var(--color-neutral-white);
    }

    .rubyful-rt {
        color: var(--color-primitive-yellow-300);
        background-color: var(--color-neutral-black);
    }

    :focus-visible .ruby-contents,
    :focus-visible .ruby-contents *:not(.rubyful-rt) {
        color: var(--color-neutral-black);
    }

    :focus-visible i {
        color: var(--color-neutral-black);
    }

    :focus-visible svg {
        fill: var(--color-neutral-black);
    }

    .dads-form-control-label__requirement ruby {
        color: var(--color-semantic-error-1);
    }

    .nav {
        background-color: rgba(255, 255, 255, 0.5);
    }

    .nav ul {
        background-color: var(--color-neutral-black);
    }
}
