:root {
    --th01-color-canvas: #ffffff;
    --th01-color-surface: #f6f7f9;
    --th01-color-surface-strong: #eef1f5;
    --th01-color-text: #1f2328;
    --th01-color-muted: #667085;
    --th01-color-link: #0b57d0;
    --th01-color-link-hover: #083b8c;
    --th01-color-border: #d0d5dd;
    --th01-color-focus: #f59e0b;
    --th01-color-button-text: #ffffff;
    --th01-content-width: 760px;
    --th01-wide-width: 1180px;
    --th01-sidebar-width: 320px;
    --th01-radius: 8px;
    --th01-shadow: 0 8px 28px rgba(16, 24, 40, 0.08);
    --th01-space-1: 0.5rem;
    --th01-space-2: 0.75rem;
    --th01-space-3: 1rem;
    --th01-space-4: 1.5rem;
    --th01-space-5: 2rem;
    --th01-space-6: 3rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--th01-color-canvas);
    color: var(--th01-color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
    vertical-align: middle;
}

iframe {
    border: 0;
}

a {
    color: var(--th01-color-link);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

a:hover,
a:focus-visible {
    color: var(--th01-color-link-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.wp-element-button,
.wp-block-button__link {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: var(--th01-radius);
    background: var(--th01-color-link);
    color: var(--th01-color-button-text);
    cursor: pointer;
    padding: 0.65rem 1rem;
    text-decoration: none;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.wp-element-button:hover,
.wp-block-button__link:hover {
    background: var(--th01-color-link-hover);
    color: var(--th01-color-button-text);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--th01-color-border);
    border-radius: var(--th01-radius);
    background: var(--th01-color-canvas);
    color: var(--th01-color-text);
    padding: 0.65rem 0.75rem;
}

textarea {
    min-height: 9rem;
    resize: vertical;
}

:focus-visible {
    outline: 3px solid var(--th01-color-focus);
    outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--th01-color-text);
    font-weight: 700;
    line-height: 1.3;
    margin: 2em 0 0.75em;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.55rem, 3vw, 2.1rem);
}

h3 {
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

p,
ul,
ol,
blockquote,
pre,
table,
figure {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

blockquote {
    border-inline-start: 4px solid var(--th01-color-link);
    margin-inline: 0;
    padding: 0.5rem 0 0.5rem 1.25rem;
}

pre,
code,
kbd,
samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
    overflow: auto;
    background: var(--th01-color-surface);
    border: 1px solid var(--th01-color-border);
    border-radius: var(--th01-radius);
    padding: 1rem;
}

code {
    background: var(--th01-color-surface);
    border-radius: 4px;
    padding: 0.12em 0.3em;
}

hr {
    border: 0;
    border-top: 1px solid var(--th01-color-border);
    margin: var(--th01-space-5) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid var(--th01-color-border);
    padding: 0.75rem;
    text-align: start;
    vertical-align: top;
}

th {
    background: var(--th01-color-surface);
}

.site-container {
    width: min(calc(100% - 2rem), var(--th01-wide-width));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--th01-color-border);
    background: var(--th01-color-canvas);
    transition: box-shadow 160ms ease;
}

body.admin-bar .site-header {
    top: 32px;
}

.site-header.is-scrolled {
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
}

.site-header__inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--th01-space-4);
    padding-block: var(--th01-space-3);
    transition: min-height 160ms ease, padding 160ms ease;
}

.site-header.is-scrolled .site-header__inner {
    min-height: 58px;
    padding-block: var(--th01-space-2);
}

.site-branding {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--th01-space-3);
}

.custom-logo {
    display: block;
    max-height: 52px;
    width: auto;
}

.site-title,
.site-description {
    margin: 0;
}

.site-title {
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.2;
}

.site-title a {
    color: var(--th01-color-text);
    text-decoration: none;
}

.site-description {
    overflow: hidden;
    max-height: 2em;
    color: var(--th01-color-muted);
    font-size: 0.875rem;
    opacity: 1;
    transition: max-height 160ms ease, margin 160ms ease, opacity 120ms ease;
}

.site-header.is-scrolled .site-description {
    max-height: 0;
    margin: 0;
    opacity: 0;
}

.main-navigation ul,
.footer-navigation ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation a,
.footer-navigation a {
    display: block;
    color: var(--th01-color-text);
    padding: 0.55rem 0;
    text-decoration: none;
}

.main-navigation a:hover,
.main-navigation a:focus-visible,
.footer-navigation a:hover,
.footer-navigation a:focus-visible,
.current-menu-item > a,
.current-menu-ancestor > a {
    color: var(--th01-color-link);
}

.menu-toggle {
    display: none;
    min-height: 42px;
    background: var(--th01-color-surface);
    border-color: var(--th01-color-border);
    color: var(--th01-color-text);
}

.menu-toggle:hover {
    background: var(--th01-color-surface-strong);
    color: var(--th01-color-text);
}

.breadcrumb-area {
    color: var(--th01-color-muted);
    font-size: 0.9rem;
    padding-top: var(--th01-space-3);
}

.site-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--th01-space-5);
    padding-block: var(--th01-space-5) var(--th01-space-6);
}

.has-sidebar .site-content {
    grid-template-columns: minmax(0, 1fr) minmax(260px, var(--th01-sidebar-width));
}

.site-main {
    min-width: 0;
}

.page-header {
    margin-bottom: var(--th01-space-4);
}

.page-title,
.entry-title {
    overflow-wrap: anywhere;
    margin-top: 0;
}

.archive-description {
    color: var(--th01-color-muted);
}

.entry {
    min-width: 0;
    margin-bottom: var(--th01-space-5);
}

.entry-card,
.widget,
.comments-area {
    border: 1px solid var(--th01-color-border);
    border-radius: var(--th01-radius);
    background: var(--th01-color-canvas);
    padding: clamp(1rem, 2.5vw, 1.5rem);
}

.entry-card {
    box-shadow: var(--th01-shadow);
}

.entry-card .entry-title {
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    margin-bottom: 0.5rem;
}

.entry-title a {
    color: var(--th01-color-text);
    text-decoration: none;
}

.entry-title a:hover,
.entry-title a:focus-visible {
    color: var(--th01-color-link);
}

.entry-meta,
.entry-footer,
.comment-metadata {
    color: var(--th01-color-muted);
    font-size: 0.9rem;
}

.entry-meta a,
.entry-footer a,
.comment-metadata a {
    color: inherit;
}

.post-thumbnail {
    display: block;
    margin-bottom: var(--th01-space-4);
}

.post-thumbnail img {
    width: 100%;
    border-radius: var(--th01-radius);
}

.entry-content > :first-child,
.entry-summary > :first-child {
    margin-top: 0;
}

.entry-content > :last-child,
.entry-summary > :last-child {
    margin-bottom: 0;
}

.entry-content .alignwide {
    width: min(var(--th01-wide-width), calc(100vw - 2rem));
    max-width: none;
    margin-inline: 50%;
    transform: translateX(-50%);
}

.no-sidebar .entry-content .alignfull {
    width: 100vw;
    max-width: none;
    margin-inline: 50%;
    transform: translateX(-50%);
}

.cat-links,
.tags-links {
    display: block;
}

.post-navigation,
.posts-navigation,
.pagination,
.comments-pagination {
    margin: var(--th01-space-5) 0;
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--th01-space-3);
}

.post-navigation a {
    display: block;
    border: 1px solid var(--th01-color-border);
    border-radius: var(--th01-radius);
    padding: 1rem;
    text-decoration: none;
}

.nav-next {
    text-align: end;
}

.nav-subtitle {
    display: block;
    color: var(--th01-color-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.nav-title {
    display: block;
    color: var(--th01-color-text);
    font-weight: 700;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-numbers {
    display: inline-flex;
    min-width: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--th01-color-border);
    border-radius: var(--th01-radius);
    padding: 0.35rem 0.7rem;
    text-decoration: none;
}

.page-numbers.current {
    background: var(--th01-color-link);
    border-color: var(--th01-color-link);
    color: var(--th01-color-button-text);
}

.widget-area {
    min-width: 0;
}

.widget {
    margin-bottom: var(--th01-space-4);
    box-shadow: none;
}

.widget-title {
    font-size: 1.15rem;
    margin-top: 0;
}

.widget ul {
    padding-inline-start: 1.2rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form label {
    flex: 1 1 auto;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    padding-inline-start: 1.5rem;
}

.comment-body {
    border-bottom: 1px solid var(--th01-color-border);
    padding-block: 1rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.comment-author .avatar {
    border-radius: 50%;
}

.site-footer {
    border-top: 1px solid var(--th01-color-border);
    background: var(--th01-color-surface);
    color: var(--th01-color-muted);
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--th01-space-4);
    padding-block: var(--th01-space-5);
}

.footer-widget-area {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: var(--th01-space-3);
}

.footer-widgets .widget {
    height: 100%;
    margin: 0;
}

.footer-widgets .wp-block-calendar table,
.footer-widgets .calendar_wrap table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: center;
}

.footer-widgets .wp-block-calendar caption,
.footer-widgets .calendar_wrap caption {
    margin-bottom: var(--th01-space-2);
    color: var(--th01-color-text);
    font-weight: 700;
}

.footer-widgets .wp-block-calendar th,
.footer-widgets .wp-block-calendar td,
.footer-widgets .calendar_wrap th,
.footer-widgets .calendar_wrap td {
    border: 1px solid var(--th01-color-border);
    padding: 0.35rem 0.15rem;
}

.footer-widgets .wp-block-calendar th,
.footer-widgets .calendar_wrap th {
    color: var(--th01-color-text);
    font-size: 0.8rem;
}

.footer-widgets .wp-block-calendar #today,
.footer-widgets .calendar_wrap #today {
    background: var(--th01-color-surface-strong);
    font-weight: 700;
}

.footer-widgets .wp-calendar-nav,
.footer-widgets .wp-block-calendar__navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--th01-space-2);
    margin-top: var(--th01-space-2);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--th01-space-3);
    padding-block: var(--th01-space-4);
}

.site-info {
    margin: 0;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
}

.screen-reader-text:focus,
.skip-link:focus {
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100000;
    background: var(--th01-color-canvas);
    color: var(--th01-color-text);
    border: 2px solid var(--th01-color-focus);
    border-radius: var(--th01-radius);
    padding: 0.75rem 1rem;
}

@media (max-width: 1200px) {
    .footer-widgets {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .footer-widgets--hide-after-three .footer-widget-area:nth-child(n + 4) {
        display: none;
    }
}

@media (max-width: 900px) {
    .has-sidebar .site-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-widgets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .site-header__inner {
        min-height: 64px;
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
    }

    .main-navigation {
        display: none;
        flex-basis: 100%;
    }

    .main-navigation.is-open {
        display: block;
    }

    .main-navigation ul {
        display: block;
        border-top: 1px solid var(--th01-color-border);
        padding-top: 0.5rem;
    }

    .main-navigation a {
        padding: 0.75rem 0;
    }

    .post-navigation .nav-links {
        grid-template-columns: 1fr;
    }

    .nav-next {
        text-align: start;
    }

    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-form {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .footer-widgets {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        scroll-behavior: auto;
        transition-duration: 0.01ms;
    }
}

@media print {
    .site-header,
    .site-footer,
    .widget-area,
    .post-navigation,
    .comments-area,
    .breadcrumb-area {
        display: none;
    }

    .site-content,
    .has-sidebar .site-content {
        display: block;
        width: 100%;
        padding: 0;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }
}
