/* 狭い画面とタッチ端末の横向き表示を組み替える。通常のPC表示は維持する。 */
.sr-mobile-label, .sr-menu-toggle, .sr-artist-toggle { display: none; }

@media (max-width: 807px), (pointer: coarse) and (max-width: 1023px) {
    html[data-sr-page] { -webkit-text-size-adjust: 100%; }
    html[data-sr-page] body {
        margin: 0; padding: 0; background: #080202; color: #fff;
        font-size: 16px; line-height: 1.65; overflow-wrap: anywhere;
    }
    html[data-sr-page] *, html[data-sr-page] *::before, html[data-sr-page] *::after { box-sizing: border-box; }
    #wrapper { width: 100%; max-width: 680px; margin: 0 auto; }
    #header {
        margin: 0; padding: 16px 20px; aspect-ratio: 704 / 225;
        display: flex; align-items: center; justify-content: center;
        background: url("../images/bg2.jpg") no-repeat center top / 210% auto;
    }
    #header img { width: 234px; max-width: 74vw; height: auto; }
    #navi { padding: 0; margin: 0 12px; border: 1px solid #773535; background: #080808; }
    #navi ul {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1px; width: auto; height: auto; padding: 8px; margin: 0;
    }
    #navi li, #navi li[class] { float: none; width: auto; margin: 0; min-width: 0; }
    #navi a {
        display: flex; align-items: center; justify-content: center;
        min-height: 48px; padding: 8px 10px; color: #fff; font-size: 15px;
        text-decoration: none; background: #191111;
    }
    a, button { -webkit-tap-highlight-color: rgba(255, 154, 154, .15); }
    #navi a:hover, #navi a:focus-visible { background: #4b1616; }
    #navi img { display: none; }
    #navi .sr-mobile-label { display: inline; }
    .sr-menu-toggle, .sr-artist-toggle {
        width: 100%; min-height: 48px; border: 0; padding: 12px 14px;
        color: #fff; background: #171010; font: inherit; text-align: left; cursor: pointer;
    }
    #navi.sr-collapsible > .sr-menu-toggle, .artist-page #main.sr-collapsible > .sr-artist-toggle {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
    }
    .sr-menu-toggle::after { content: "☰"; font-size: 24px; line-height: 1; flex: none; }
    .sr-artist-toggle::after { content: "+"; font-size: 22px; flex: none; }
    [aria-expanded="true"].sr-menu-toggle::after { content: "×"; }
    [aria-expanded="true"].sr-artist-toggle::after { content: "−"; }
    #navi.sr-collapsible:not(.sr-expanded) > ul,
    .artist-page #main.sr-collapsible:not(.sr-expanded) > table { display: none; }
    .sr-artist-toggle { border: 1px solid #773535; }
    .sr-artist-toggle strong { display: block; font-size: 13px; color: #e5bdbd; font-weight: normal; }
    #main, #artist, #artist2, .artist-page #main, .artist-page #artist2 {
        float: none; width: 100%; height: auto; min-height: 0; margin: 20px 0 0; padding: 0 12px;
    }
    #main table, #artist table, #artist-content table {
        width: 100%; max-width: 100%; height: auto; border-spacing: 0; table-layout: fixed;
    }
    #main > table > tbody > tr > td, #artist > table > tbody > tr > td,
    #artist-content > table > tbody > tr > td { padding: 14px; }
    #main td, #artist td, #artist-content td { min-width: 0; overflow-wrap: anywhere; }
    h1 { font-size: 16px; line-height: 1.4; margin: 0 0 18px; }
    p { padding: 0; }
    #main img, #artist img, #artist-content img, #banner img { max-width: 100%; height: auto; }
    a:link, a:visited { color: #ff9a9a; }
    a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
        outline: 3px solid #ffb0b0; outline-offset: 3px;
    }
    html[data-sr-page="home"] .sr-product-card, html[data-sr-page="catalog"] .sr-product-card {
        display: block; padding: 12px; border-bottom: 1px solid #552a2a; background-color: #100b0b;
    }
    html[data-sr-page="home"] .sr-product-card > tbody,
    html[data-sr-page="catalog"] .sr-product-card > tbody { display: block; }
    html[data-sr-page="home"] .sr-product-card > tbody > tr,
    html[data-sr-page="catalog"] .sr-product-card > tbody > tr {
        display: grid; grid-template-columns: clamp(76px, 28vw, 150px) minmax(0, 1fr); gap: 12px;
    }
    html[data-sr-page="home"] .sr-product-card td,
    html[data-sr-page="catalog"] .sr-product-card td { display: block; width: auto; padding: 0; }
    .sr-product-card p { margin: 0; padding: 0; font-size: 14px; line-height: 1.6; }
    .sr-product-card font[size="1"] { font-size: 13px; }
    .sr-product-card font[color] { color: #ff9a9a; }
    .sr-product-card img { display: block; width: 100%; max-width: 150px; aspect-ratio: 1; object-fit: contain; }
    html[data-sr-page="home"] .sr-product-card p a { display: inline-block; min-height: 44px; padding: 8px 0; }
    html[data-sr-page="home"] #main a[href="catalog.php"] { display: inline-block; min-height: 44px; padding: 8px 0; font-size: 14px; }
    #artist img, .artist-page #main img { display: block; width: 260px; max-width: 100%; height: auto; margin: 0 auto; }
    #artist a, .artist-page #main table a { display: block; }
    #artist a + br, .artist-page #main table a + br { display: none; }
    #artist a:not(:last-child), .artist-page #main table a:not(:last-child) { margin-bottom: 10px; }
    #artist-content > table > tbody > tr > td > img { display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto; }
    #artist-content .sr-product-card img { width: min(60vw, 220px); max-width: 100%; margin: 0 auto; }
    #artist-content .sr-product-card td { padding: 0; }
    #artist-content .sr-product-card { font-size: 14px; line-height: 1.6; }
    #artist-content a[target="_blank"]:not(:has(img)) { display: inline-block; min-height: 44px; padding: 8px 4px; }
    #artist-status { font-size: 14px; }
    #banner { clear: both; margin: 20px 12px 0; }
    #banner img[src$="spacer.png"] { display: none; }
    #wrapper [id^="footer"] {
        clear: both; width: 100%; height: auto; min-height: 0; margin-top: 28px;
        padding: 28px 12px; font-size: 13px; line-height: 1.7;
        background-size: 100% auto;
    }
    #wrapper [id^="footer"] a { display: inline-block; min-height: 44px; padding: 8px 5px; }
    #wrapper [id^="footer"] p { margin: 14px 0; }
    html[data-sr-page="contact"] input:not([type="submit"]):not([type="button"]),
    html[data-sr-page="contact"] textarea { display: block; width: 100%; max-width: 100%; padding: 12px; font: inherit; font-size: 16px; }
    html[data-sr-page="contact"] textarea { min-height: 220px; resize: vertical; }
    html[data-sr-page="contact"] input[type="submit"], html[data-sr-page="contact"] input[type="button"] {
        min-width: 100px; min-height: 48px; padding: 10px 18px; font: inherit; margin: 0 8px 8px 0;
    }
    html[data-sr-page="contact"] div.baloon { max-width: calc(100vw - 24px); }
    html[data-sr-page="contact"] div.baloon div { white-space: normal; }
    html[data-sr-page="link"] #main a { display: inline-block; min-height: 44px; padding: 7px 0; }
    html[data-sr-page="index"] #logo { padding: 44px 12px; }
    #logo a { display: inline-block; max-width: 100%; font-size: 20px; }
    #logo img { width: 100%; max-width: 520px; height: auto; }
    #logo a:last-child { min-width: 160px; min-height: 48px; padding: 8px 20px; border: 1px solid #944141; }
}


/* スマホの右側引き出しメニュー。元のPCナビゲーションには適用しない。 */
.sr-mobile-bar, .sr-drawer { display: none; }
@media (max-width: 807px), (pointer: coarse) and (max-width: 1023px) {
    html.sr-has-drawer body { padding-top: 52px; }
    html.sr-menu-open { overflow: hidden; }
    #navi.sr-drawer-ready { height: 0; padding: 0; margin: 0; border: 0; background: none; }
    #navi.sr-drawer-ready > ul { display: none; }
    #navi .sr-mobile-bar {
        position: fixed; inset: 0 0 auto; z-index: 100;
        display: flex; align-items: center; justify-content: space-between;
        height: 52px; padding: 0 8px 0 18px; background: #100909;
        border-bottom: 1px solid #693333;
    }
    #navi .sr-mobile-brand {
        display: flex; min-height: 44px; padding: 0; background: none;
        color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .08em;
    }
    #navi .sr-mobile-bar .sr-menu-toggle {
        display: flex; align-items: center; justify-content: center;
        flex: none; width: 48px; height: 48px; padding: 0; background: transparent; color: #fff;
    }
    #navi .sr-mobile-bar .sr-menu-toggle::after { content: none; }
    .sr-menu-icon, .sr-menu-icon::before, .sr-menu-icon::after {
        position: relative; display: block; width: 21px; height: 2px; background: currentColor;
    }
    .sr-menu-icon::before, .sr-menu-icon::after { content: ""; position: absolute; left: 0; }
    .sr-menu-icon::before { top: -6px; }
    .sr-menu-icon::after { top: 6px; }
    .sr-drawer[open] {
        display: block; position: fixed; inset: 0; width: 100%; max-width: none;
        height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0;
        border: 0; background: transparent; color: #fff; overflow: hidden;
    }
    .sr-drawer::backdrop { background: rgba(0, 0, 0, .65); }
    .sr-drawer-panel {
        width: min(340px, calc(100% - 56px)); height: 100%; margin-left: auto;
        padding: 0 22px max(24px, env(safe-area-inset-bottom));
        overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
        background: #130b0b; border-left: 1px solid #673232;
        box-shadow: -12px 0 36px #0005;
        transform: translateX(100%); transition: transform 240ms ease;
    }
    .sr-drawer-open .sr-drawer-panel { transform: translateX(0); }
    .sr-drawer-close {
        position: absolute; top: 0; right: min(340px, calc(100% - 56px));
        display: flex; align-items: center; justify-content: center;
        width: 56px; height: 56px; padding: 0; border: 0; border-radius: 0;
        background: #180b0bb3; color: #fff; font: 36px/1 sans-serif; cursor: pointer;
        opacity: 0; transition: opacity 180ms ease;
    }
    .sr-drawer-open .sr-drawer-close { opacity: 1; }
    .sr-drawer .sr-drawer-logo {
        display: flex; align-items: center; justify-content: center;
        min-height: 148px; padding: 28px 0; border-bottom: 1px solid #542a2a;
    }
    .sr-drawer-logo img { display: block; width: 180px; max-width: 100%; height: auto; }
    .sr-drawer ul { display: block; margin: 0; padding: 0; list-style: none; }
    .sr-drawer li, .sr-drawer li[class] { float: none; width: auto; margin: 0; }
    .sr-drawer li a {
        display: flex; align-items: center; min-height: 57px; padding: 16px 2px;
        border-bottom: 1px solid #422727; color: #fff;
        font-size: 14px; font-weight: 600; letter-spacing: .03em; text-decoration: none;
    }
    .sr-drawer li img { display: none; }
    .sr-drawer .sr-mobile-label { display: inline; }
    .sr-drawer li a:hover, .sr-drawer li a:focus-visible { background: #351616; }
    .sr-drawer a:focus-visible, .sr-drawer button:focus-visible, #navi .sr-mobile-bar :focus-visible {
        outline: 2px solid #ff9a9a; outline-offset: -3px;
    }
    .sr-drawer-close:focus:not(:focus-visible) { outline: none; }
    #artist2 { scroll-margin-top: 64px; }
    @media (prefers-reduced-motion: reduce) {
        .sr-drawer-panel, .sr-drawer-close { transition: none; }
    }
}
