/**
 * Shared stylesheet for the content / policy pages: return, shipping, and any future legal page,
 * plus the left navigation that the FAQ page also uses.
 *
 * One file for the whole cluster so the pages stay visually identical. It owns:
 *   - the page shell (.ryuk-legal-wrap / head / body / main)
 *   - the left nav (.ryuk-legal-nav*), whose current-page state reuses the FAQ multi-tab look
 *     (solid near-black fill) so the tabs and the side menu read as one system
 *   - the prose elements that sit inside accordion-inner (.ryuk-legal-p / note / steps)
 *   - the copy-to-clipboard template (.ryuk-copy*)
 *
 * Accordion mechanics come from accordion.css (.accordion--faq). Colours are the Toolkit tokens
 * from global.css (--tk-color-*), which resolve to the brand palette.
 */

.ryuk-legal {
    font-size: 16px;
    line-height: 1.9; /* Japanese body copy needs more leading than the 1.65 used for Latin text */
    color: var(--tk-color-text, #414141);
    background: var(--tk-color-bg, #ffffff);
}

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

/* ---- Page shell (single-column legal pages) ---- */
.ryuk-legal-wrap {
    max-width: 1120px;
    margin: 0 auto;
    /* Generous top/bottom padding centres the content vertically and keeps the rhythm even. */
    padding: 64px 32px 96px;
}

.ryuk-legal-head {
    margin: 0 0 40px;
}

.ryuk-legal-eyebrow {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--tk-color-accent, #d4aa73);
}

.ryuk-legal-title {
    font-weight: 700;
    font-size: 30px;
    line-height: 1.5;
    color: var(--tk-color-primary, #000000);
    margin: 12px 0 0;
}

.ryuk-legal-lede {
    font-size: 16px;
    line-height: 1.9;
    color: var(--tk-color-text-muted, #575757);
    margin: 12px 0 0;
    max-width: 640px;
}

.ryuk-legal-body {
    display: grid;
    grid-template-columns: 248px 1fr;
    gap: 44px;
    align-items: start;
}

.ryuk-legal-main {
    min-width: 0;
}

/* ---- Left navigation (shared with the FAQ) ---- */
.ryuk-legal-nav {
    position: sticky;
    top: 24px;
}

.ryuk-legal-nav-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--tk-color-primary, #000000);
    margin: 0 0 14px;
}

.ryuk-legal-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ryuk-legal-nav-link {
    display: block;
    padding: 12px 16px;
    background: var(--tk-color-bg, #ffffff);
    border: 1px solid var(--tk-color-border, #eaeaec);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--tk-color-text-muted, #575757);
    text-decoration: none;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

/* Hover mirrors the current-page fill: solid near-black with white text. The two states share the
   same look so the whole maillage reads as one control; .is-current keeps default cursor to signal
   it is not clickable. The second selector is required on the legal pages: there the nav sits inside
   .ryuk-legal, where `.ryuk-legal a:hover` (0,2,1) sets the gold text colour and would beat a plain
   `.ryuk-legal-nav-link:hover` (0,2,0) — turning the hover gold-on-black. `.ryuk-legal .ryuk-legal-
   nav-link:hover` (0,3,0) wins. On the FAQ the nav is not inside .ryuk-legal, so the first selector
   (with nothing competing) carries it. */
.ryuk-legal-nav-link:hover,
.ryuk-legal .ryuk-legal-nav-link:hover {
    background: var(--tk-color-primary, #1a1a1a);
    border-color: var(--tk-color-primary, #1a1a1a);
    color: var(--tk-color-bg, #ffffff);
}

/* Current page: solid fill, matching the FAQ tab's aria-selected state. */
.ryuk-legal-nav-link.is-current {
    background: var(--tk-color-primary, #1a1a1a);
    border-color: var(--tk-color-primary, #1a1a1a);
    color: var(--tk-color-bg, #ffffff);
    cursor: default;
}

.ryuk-legal-nav-link:focus-visible {
    outline: 2px solid var(--tk-color-accent, #d4aa73);
    outline-offset: 2px;
}

/* ---- Accordion breathing room (legal pages) ----
   The shared accordion is tuned for product specs; policy prose needs a touch more air. The extra
   space MUST come from the first/last child margins, not from padding on .accordion-inner: the
   collapse is a grid-template-rows 0fr track with overflow:hidden on the inner, and padding is not
   clipped by that (it would leave every closed panel ~28px tall showing a sliver of content),
   whereas child margins collapse away to zero. Scoped to .ryuk-legal-main so product accordions are
   untouched. */
.ryuk-legal-main .accordion--faq .accordion-inner > *:first-child {
    margin-top: 18px;
}

.ryuk-legal-main .accordion--faq .accordion-inner > *:last-child {
    margin-bottom: 22px;
}

/* ---- Prose (inside accordion-inner) ---- */
.ryuk-legal-p {
    margin: 0 0 16px;
}

.ryuk-legal-p:last-child {
    margin-bottom: 0;
}

.ryuk-legal-p b {
    color: var(--tk-color-primary, #1a1a1a);
}

.ryuk-legal a {
    color: var(--tk-color-primary, #1a1a1a);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.ryuk-legal a:hover {
    color: var(--tk-color-accent, #d4aa73);
}

/* Nav links must not pick up the content underline. Scoped under .ryuk-legal to reach (0,2,0),
   which beats the (0,1,1) of `.ryuk-legal a`. */
.ryuk-legal .ryuk-legal-nav-link,
.ryuk-legal .ryuk-legal-nav-link:hover {
    text-decoration: none;
}

/* Callout */
.ryuk-legal-note {
    background: var(--tk-color-bg-light, #fafafa);
    border-left: 3px solid var(--tk-color-accent, #d4aa73);
    border-radius: 4px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.85;
    color: var(--tk-color-text-muted, #575757);
    margin: 20px 0 0;
}

/* Numbered steps */
.ryuk-legal-steps {
    counter-reset: ryuk-legal-step;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ryuk-legal-step {
    counter-increment: ryuk-legal-step;
    position: relative;
    padding: 0 0 0 44px;
    margin: 0 0 20px;
}

.ryuk-legal-step:last-child {
    margin-bottom: 0;
}

.ryuk-legal-step::before {
    content: counter(ryuk-legal-step);
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--tk-color-primary, #1a1a1a);
    color: var(--tk-color-bg, #ffffff);
    font-size: 13px;
    font-weight: 600;
    line-height: 28px;
    text-align: center;
}

/* ---- Copy-to-clipboard template ---- */
.ryuk-copy {
    border: 1px solid var(--tk-color-border, #eaeaec);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 22px;
}

.ryuk-copy-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--tk-color-bg-light, #fafafa);
    border-bottom: 1px solid var(--tk-color-border, #eaeaec);
    padding: 12px 16px;
}

.ryuk-copy-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--tk-color-primary, #1a1a1a);
}

.ryuk-copy-btn {
    flex: none;
    min-height: 38px;
    padding: 0 18px;
    background: var(--tk-color-primary, #1a1a1a);
    color: var(--tk-color-bg, #ffffff);
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.ryuk-copy-btn:hover {
    background: var(--tk-color-accent, #d4aa73);
}

.ryuk-copy-btn:focus-visible {
    outline: 2px solid var(--tk-color-accent, #d4aa73);
    outline-offset: 2px;
}

/* Confirmation is a state on the button, not a toast: it appears where the user is already looking. */
.ryuk-copy-btn.is-copied {
    background: #4a7c59;
    color: #ffffff;
}

.ryuk-copy-body {
    padding: 18px 16px;
    font-size: 15px;
    line-height: 2;
    color: var(--tk-color-text, #414141);
}

.ryuk-copy-line {
    display: block;
}

.ryuk-copy-line:empty {
    min-height: 1em;
}

.ryuk-copy-dots {
    color: #9a9a9a;
    user-select: none;
}

/* ---- Prose document (privacy, 特商法 / terms) ----
   Single-column legal pages with no side nav: a narrow reading column centred in the wrap. */
.ryuk-legal-doc {
    max-width: 820px;
    margin: 0 auto;
}

.ryuk-legal-section + .ryuk-legal-section {
    margin-top: 40px;
}

.ryuk-legal-h2 {
    font-weight: 700;
    font-size: 20px;
    line-height: 1.5;
    color: var(--tk-color-primary, #1a1a1a);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tk-color-border, #eaeaec);
}

/* Definition table for the 特商法 disclosure (label | value rows) */
.ryuk-legal-dl {
    margin: 0;
    border: 1px solid var(--tk-color-border, #eaeaec);
    border-radius: 10px;
    overflow: hidden;
}

.ryuk-legal-dl-row {
    display: grid;
    grid-template-columns: 210px 1fr;
}

.ryuk-legal-dl-row + .ryuk-legal-dl-row {
    border-top: 1px solid var(--tk-color-border, #eaeaec);
}

.ryuk-legal-dt {
    background: var(--tk-color-bg-light, #fafafa);
    /* 10px vertical (was 14px): tighter rows read as a scannable spec sheet rather than a stack of
       paragraphs — the disclosure values are short, so the extra height was dead space. */
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.65;
    color: var(--tk-color-primary, #1a1a1a);
    border-right: 1px solid var(--tk-color-border, #eaeaec);
}

.ryuk-legal-dd {
    padding: 10px 16px;
    font-size: 15px;
    line-height: 1.75;
    margin: 0;
}

@media (max-width: 600px) {
    .ryuk-legal-dl-row {
        grid-template-columns: 1fr;
    }
    .ryuk-legal-dt {
        border-right: none;
        border-bottom: 1px solid var(--tk-color-border, #eaeaec);
    }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    /* minmax(0,1fr), not 1fr: a bare 1fr track floors at its content's min-content, so the nav
       strip (nowrap pills) would push it past the viewport. minmax(0,…) lets the track shrink. */
    .ryuk-legal-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
    /* Nav moves above the content and becomes a horizontal strip that scrolls if it overflows. */
    .ryuk-legal-nav {
        position: static;
    }
    .ryuk-legal-nav-title {
        margin-bottom: 10px;
    }
    .ryuk-legal-nav-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .ryuk-legal-nav-link {
        white-space: nowrap;
        flex: none;
    }
}

@media (max-width: 782px) {
    .ryuk-legal-wrap {
        padding: 52px 24px 72px;
    }
    .ryuk-legal-title {
        font-size: 26px;
    }
}

@media (max-width: 600px) {
    .ryuk-legal-wrap {
        padding: 40px 18px 56px;
    }
    .ryuk-legal-title {
        font-size: 22px;
    }
    .ryuk-legal-head {
        margin-bottom: 32px;
    }
    .ryuk-copy-btn {
        width: 100%;
    }
    .ryuk-copy-body {
        font-size: 14px;
    }
}
