/*
 * F-004 sidebar.css — single + archive sidebar.
 *
 * Arkhe native sidebar-1 is rendered into .l-sidebar via parent
 * template-parts/sidebar.php. Our only deltas: widget container chrome,
 * a11y floor for interactive elements, and the F-005 placeholder styling
 * (data-feature="F-005") so the resolution-rate widget placeholder reads
 * as "プレースホルダー (F-005 で実装予定)" not as hidden text.
 */

.l-sidebar {
    padding: 16px 0;
    box-sizing: border-box;
}

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

/* Widget container (c-widget). Parent renders as <div class="c-widget">. */
.l-sidebar .c-widget {
    background: var(--tk-color-bg);
    border: 1px solid var(--tk-color-border);
    border-radius: var(--tk-radius-md);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--tk-shadow-xs);
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.l-sidebar .c-widget__title,
.l-sidebar .c-widget__title.-side {
    font-size: var(--tk-fs-lg);
    font-weight: var(--tk-fw-bold);
    color: var(--tk-color-ink);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tk-color-border);
    line-height: var(--tk-lh-snug);
}

.l-sidebar .c-widget a {
    color: var(--tk-color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 4px 0;
    display: inline-block;
    min-height: 36px;
    line-height: 1.6;
}

.l-sidebar .c-widget a:hover,
.l-sidebar .c-widget a:focus-visible {
    color: var(--tk-color-primary);
    text-decoration: underline;
}

.l-sidebar .c-widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--tk-fs-sm);
    line-height: var(--tk-lh-relaxed);
}

.l-sidebar .c-widget li {
    margin-bottom: 4px;
}

/* ----------------------------------------------------------------------
 * F-005 placeholder — the resolution-rate widget lands here later.
 * NOT a hidden element: visible text, explicit "準備中" label. NG-12 safe.
 * -------------------------------------------------------------------- */
.l-sidebar .c-placeholder,
[data-feature="F-005"].c-placeholder {
    background: var(--tk-color-bg-subtle);
    border: 1px dashed var(--tk-color-border);
    color: var(--tk-color-ink-muted);
    padding: 12px;
    border-radius: var(--tk-radius-md);
    font-size: var(--tk-fs-sm);
    font-style: italic;
    text-align: center;
    margin-bottom: 16px;
}

/* ----------------------------------------------------------------------
 * AI policy banner widget — distinct brand emphasis so users eyeball it.
 * -------------------------------------------------------------------- */
.l-sidebar .c-widget.c-widget--aiPolicy {
    background: var(--tk-color-bg-subtle);
    border-left: 4px solid var(--tk-color-primary);
}

.l-sidebar .c-widget.c-widget--aiPolicy a {
    font-weight: var(--tk-fw-bold);
    color: var(--tk-color-primary);
}

/* ----------------------------------------------------------------------
 * Desktop layout — Arkhe defaults to a right-rail sidebar at >= 1024px.
 * We only tune spacing; the grid stays Arkhe-native.
 * -------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .l-sidebar {
        width: 320px;
        max-width: 320px;
        padding: 24px 0 24px 24px;
    }
}
