:root { --sidebar-rail: 36px; --sidebar-width: min(360px, calc(100vw - 12px)); }
body.has-right-sidebar { padding-right: var(--sidebar-rail); }
.right-sidebar { display: none; position: fixed; top: var(--header-height, 84px); bottom: 0; right: 0; z-index: 30; width: var(--sidebar-rail); background: #fff; border-left: 1px solid #e5e5e5; transition: width .2s ease; }
.right-sidebar.is-ready { display: flex; }
.right-sidebar.is-open { width: var(--sidebar-width); box-shadow: -8px 0 28px rgba(0,0,0,.08); }
.sidebar-handle { position: relative; order: 2; display: block; flex: 0 0 var(--sidebar-rail); width: var(--sidebar-rail); min-width: 0; height: 100%; padding: 0; border: 0; background: #fff; cursor: pointer; overflow: hidden; }
/* Hide the old image strip even if an earlier PHP view is still cached. */
.sidebar-handle .sidebar-peek, .sidebar-handle img { display: none !important; }
.sidebar-handle-icon { position: absolute; bottom: 18px; left: 50%; display: grid; place-items: center; width: 28px; height: 36px; transform: translateX(-50%); border-radius: 2px; color: #171717; background: rgba(255,255,255,.93); font-size: 17px; }
.sidebar-handle:focus-visible { outline-offset: -4px; }
.sidebar-panel { order: 1; flex: 1 1 auto; min-width: 0; padding: 14px 12px max(24px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.sidebar-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.sidebar-panel-heading h2 { margin: 0; font-size: 13px; line-height: 1.4; font-weight: 400; letter-spacing: .04em; }
.sidebar-close { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 0; background: transparent; color: #171717; cursor: pointer; font-size: 26px; }
.sidebar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; margin: 0; padding: 0; list-style: none; }
.sidebar-link { display: block; min-width: 0; }
.sidebar-thumbnail { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #f6f5f3; }
.sidebar-thumbnail img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; object-fit: cover; }
.sidebar-caption { display: block; margin-top: 8px; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.sidebar-link:hover .sidebar-caption { text-decoration: underline; text-underline-offset: 3px; }
.sidebar-image-fallback { padding: 10px 5px; color: #666; font-size: 10px; text-align: center; overflow-wrap: anywhere; }
.sidebar-nojs { margin: 20px var(--page-padding); padding: 16px; border: 1px solid #e5e5e5; font-size: 13px; }
.sidebar-nojs summary { cursor: pointer; }
.sidebar-nojs a { display: inline-block; min-height: 44px; padding: 12px 0; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .right-sidebar { transition: none; } }


/* STEP62: three fixed thumbnail columns, without a blank handle column when open. */
:root { --sidebar-rail: 32px; --sidebar-width: 304px; }
.right-sidebar.is-open { max-width: calc(100vw - 24px); }
.sidebar-panel { flex: 1 1 100%; padding: 10px 12px max(54px, env(safe-area-inset-bottom)); }
.right-sidebar.is-open .sidebar-handle {
    position: absolute; right: 0; bottom: 8px; width: 44px; height: 44px;
}
.sidebar-instagram { position: absolute; top: 12px; left: 50%; width: 22px; height: 22px; transform: translateX(-50%); color: #171717; }
.right-sidebar.is-open .sidebar-instagram { display: none; }
.sidebar-handle-icon { width: 20px; height: 20px; bottom: 12px; color: #777; font-size: 0; background: transparent; }
.sidebar-handle-icon::before { content: ''; width: 6px; height: 6px; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.right-sidebar.is-open .sidebar-handle-icon::before { transform: rotate(225deg); }
.sidebar-close { font-size: 20px; font-weight: 300; color: #777; }
.sidebar-panel-heading { margin-bottom: 8px; }
.sidebar-caption { margin-top: 5px; }
.sidebar-external-mark { display: inline-block; width: 9px; height: 9px; margin-left: 3px; color: #777; }
@media (max-width: 600px) {
    :root { --sidebar-width: 256px; }
}
