/* Sticky WordPress widget sidebar beside the long-form story reader. */
.dilfever-reading-shell {
    padding: 0 0 clamp(60px, 8vw, 100px);
    background: var(--df-cream);
}

.dilfever-reading-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--df-story-sidebar-width);
    gap: clamp(30px, 4vw, 52px);
    align-items: start;
}

.dilfever-reading-main {
    min-width: 0;
}

.dilfever-story-sidebar {
    width: 100%;
    min-width: 0;
    align-self: stretch;
    padding-top: 48px;
}

/* The inner wrapper is sticky rather than the grid item itself. This keeps
   sticky positioning reliable while the story column continues growing. */
.dilfever-story-sidebar__sticky {
    position: sticky;
    top: 28px;
    width: 100%;
    max-height: calc(100vh - 56px);
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 5px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--df-border) transparent;
}

.admin-bar .dilfever-story-sidebar__sticky {
    top: 60px;
    max-height: calc(100vh - 88px);
}

.dilfever-story-widget {
    margin: 0 0 20px;
    padding: 22px;
    color: var(--df-ink);
    background: var(--df-paper);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-md);
    box-shadow: var(--df-shadow-sm);
}

.dilfever-story-widget:last-child {
    margin-bottom: 0;
}

.dilfever-story-widget__heading {
    margin-bottom: 16px;
}

.dilfever-story-widget__title,
.dilfever-story-widget .widget-title,
.dilfever-story-widget .wp-block-heading {
    margin: 4px 0 14px;
    color: var(--df-deep);
    font-size: 1.35rem;
    line-height: 1.3;
}

.dilfever-story-widget a {
    color: var(--df-deep);
}

.dilfever-story-widget p,
.dilfever-story-widget li {
    color: var(--df-muted);
}

.dilfever-story-widget ul {
    margin: 0;
    padding-left: 20px;
}

.dilfever-sidebar-posts {
    display: grid;
    gap: 14px;
}

.dilfever-sidebar-post {
    display: grid;
    grid-template-columns: 92px minmax(0,1fr);
    gap: 12px;
    align-items: start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--df-border);
}

.dilfever-sidebar-post:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.dilfever-sidebar-post__thumb {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0,0,0,.08);
}

.dilfever-sidebar-post__thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.dilfever-sidebar-post h3 {
    margin: 0;
    font-size: .98rem;
    line-height: 1.4;
}

.dilfever-sidebar-post h3 a {
    color: var(--df-deep);
    text-decoration: none;
}

.dilfever-sidebar-post h3 a:hover,
.dilfever-sidebar-post h3 a:focus-visible {
    color: var(--df-accent);
}

.dilfever-sidebar-post span {
    display: block;
    margin-top: 5px;
    color: var(--df-muted);
    font-size: .75rem;
}

.dilfever-sidebar-all {
    display: inline-flex;
    margin-top: 18px;
    color: var(--df-accent) !important;
    font-weight: 800;
    text-decoration: none;
}


.dilfever-reading-shell .dilfever-chapter-nav {
    padding-bottom: 0;
}
