/* Copyright 2026 MOTOKI. GPL-2.0-or-later. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; }
:where(h1,h2,h3,h4,h5,h6,p,li,dd,td,th,.wp-block-site-title) { overflow-wrap: anywhere; }
:where(a,button,input,select,textarea):focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
:where(.wp-block-post-content,.wp-block-comment-content) a { text-decoration: underline; text-underline-offset: .2em; }
:where(.wp-block-navigation a) { min-height: 44px; display: inline-flex; align-items: center; }
:where(.wp-block-navigation__responsive-container-close,.wp-block-navigation__responsive-container-open) { min-width: 44px; min-height: 44px; justify-content: center; align-items: center; }
:where(input,select,textarea,button) { font: inherit; max-width: 100%; }
:where(input:not([type=checkbox]):not([type=radio]),select,button) { min-height: 44px; }
img { max-width: 100%; height: auto; }
pre { overflow-x: auto; }
:where(.wp-block-table) { overflow-x: auto; }
:where(.siteframe-base-header) { padding: 2rem clamp(1.25rem, 4vw, 3rem); border-bottom: 1px solid var(--wp--preset--color--surface); }
:where(.siteframe-base-footer) { padding: 3rem clamp(1.25rem, 4vw, 3rem); border-top: 1px solid var(--wp--preset--color--surface); }
:where(.siteframe-base-main) { padding-block: clamp(2.5rem,6vw,5rem); min-height: 50vh; }
:where(.wp-block-column) { min-width: 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Keep long, legacy and nested content usable without prescribing child designs. */
:where(.wp-block-post-content, .wp-block-comment-content) { display: flow-root; }
:where(video, iframe, embed, object, .wp-caption) { max-width: 100%; }
:where(.wp-block-post-content table, .wp-block-comment-content table) { border-collapse: collapse; width: 100%; }
:where(.wp-block-post-content th, .wp-block-post-content td, .wp-block-comment-content th, .wp-block-comment-content td) { border: 1px solid currentColor; padding: .5em; text-align: start; }
:where(blockquote) { border-inline-start: .2rem solid currentColor; margin-inline: 0; padding-inline-start: 1.25rem; }
:where(.wp-block-comment-template ol) { padding-inline-start: clamp(.75rem, 3vw, 2rem); }
:where(.wp-block-comment-template > li) { margin-block: 2rem; }
:where(.wp-block-post-template > li) { margin-block-end: 3rem; }
:where(.wp-block-post-terms) { overflow-wrap: anywhere; }

/* Core content blocks inherit theme presets and user-selected block styles. */
:where(.wp-block-code, .wp-block-preformatted) { padding: 1.25rem; border-radius: var(--wp--custom--siteframe--radius--small, 8px); background: var(--wp--preset--color--surface); font-size: .875rem; }
:where(.wp-block-quote) { padding: 1rem 1.5rem; }
:where(.wp-block-pullquote) { padding: 2rem 1.5rem; }
:where(.wp-block-pullquote blockquote) { border: 0; padding: 0; }
:where(.wp-block-pullquote p) { font-size: var(--wp--preset--font-size--large); line-height: 1.6; }
:where(.wp-block-details) { padding: 1.25rem 1.5rem; border-radius: var(--wp--custom--siteframe--radius--small, 8px); background: var(--wp--preset--color--surface); }
:where(.wp-block-details summary) { cursor: pointer; font-weight: 700; }
:where(.wp-block-details[open] summary) { margin-block-end: 1rem; }
:where(.wp-block-image figcaption, .wp-block-video figcaption, .wp-block-audio figcaption, .wp-block-table figcaption) { font-size: var(--wp--preset--font-size--small); line-height: 1.6; text-align: center; }
:where(.wp-block-calendar table) { table-layout: fixed; }
:where(.wp-block-calendar th, .wp-block-calendar td) { padding: .5rem .25rem; }
:where(.wp-block-post-comments-form textarea, .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox])) { width: 100%; padding: .75rem; border: 1px solid currentColor; border-radius: 4px; background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); }
:where(.wp-block-post-comments-form label) { display: block; margin-block-end: .5rem; }
:where(.wp-block-post-comments-form .comment-form-cookies-consent label) { display: inline; }
:where(.wp-block-accordion-heading__toggle, .wp-block-tab-list button) { color: inherit; font: inherit; }

/* Consistent control shape; functional outlines and explicit block styles remain available. */
:where(.wp-block-search__input,.wp-block-post-comments-form textarea,.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox])) { border-radius: var(--wp--custom--siteframe--radius--control,12px); }
:where(.wp-block-accordion-item,.wp-block-details,.wp-block-code,.wp-block-preformatted) { border-radius: var(--wp--custom--siteframe--radius--card,16px); }
:where(.wp-block-accordion-item) { padding: 16px 24px; background: var(--wp--preset--color--surface); }
:where(.wp-block-accordion-heading__toggle,.wp-block-tab-list button) { border-radius: var(--wp--custom--siteframe--radius--small,8px); }

/* New core controls follow the same surface-based interaction language. */
.wp-block-accordion .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-title { text-decoration: none; }
.wp-block-accordion .wp-block-accordion-heading__toggle:is(:hover,:focus-visible) { background: var(--wp--custom--siteframe--surface--hover,var(--wp--preset--color--surface)); }
.wp-block-tab-list button[role="tab"] { padding: 10px 18px; border-radius: var(--wp--custom--siteframe--radius--button,999px); transition: background-color var(--wp--custom--siteframe--motion--duration,220ms),color var(--wp--custom--siteframe--motion--duration,220ms); }
.wp-block-tab-list button[role="tab"][aria-selected="true"] { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.wp-block-tab-list button[role="tab"][aria-selected="true"]::before { border: 0; }
.wp-block-tab-list button[role="tab"][aria-selected="false"]:is(:hover,:focus-visible) { background: var(--wp--preset--color--surface); }
@media (prefers-reduced-motion: reduce) { .wp-block-tab-list button[role="tab"] { transition: none; } }

/* Core password form: support both direct and block-wrapped submit controls. */
.post-password-form { max-width: 100%; }
.post-password-form > p:empty { display: none; }
.post-password-form p:has(> label) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.post-password-form label { display: flex; flex: 1 1 16rem; flex-direction: column; gap: 8px; min-width: 0; }
.post-password-form input[type="password"] {
    box-sizing: border-box; width: 100%; min-width: 0; min-height: 52px;
    padding: 12px 16px; border: 0; line-height: 1.5;
    border-radius: var(--wp--custom--siteframe--radius--control, 12px);
    background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast);
}
.post-password-form p > .wp-block-button { display: inline-flex; flex: 0 0 auto; width: auto; margin: 0; }
.post-password-form input[type="submit"] {
    box-sizing: border-box; width: auto; min-height: 52px; margin: 0;
    padding: 12px 32px; border: 0;
    border-radius: var(--wp--custom--siteframe--radius--button, 999px);
    background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base);
    font-weight: 700; line-height: 1.5; text-align: center; cursor: pointer;
    transition: background-color var(--wp--custom--siteframe--motion--duration, 220ms), color var(--wp--custom--siteframe--motion--duration, 220ms), box-shadow var(--wp--custom--siteframe--motion--duration, 220ms);
}
.post-password-form input[type="submit"]:is(:hover,:focus-visible) {
    background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast);
    box-shadow: var(--wp--custom--siteframe--shadow--soft);
}
@media (max-width: 600px) {
    .post-password-form label { flex-basis: 100%; }
    .post-password-form p > .wp-block-button, .post-password-form input[type="submit"] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .post-password-form input[type="submit"] { transition: none; } }
