.blog-shell {
    width: calc(100% - 2rem);
    max-width: 1600px;
    margin: 0 auto;
}

.blog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.blog-post {
    padding: 1.4rem 0 1.6rem;
    border-bottom: 1px solid #d6dde3;
}

.blog-post:first-of-type {
    padding-top: 0.4rem;
}

.blog-post:last-child {
    border-bottom: 0;
}

.blog-post h2 {
    margin: 0 0 0.35rem;
}

.blog-post-meta,
.blog-comment-meta {
    color: #5d6670;
    font-size: 0.88rem;
}

.blog-post-body {
    margin-top: 1rem;
    line-height: 1.65;
}

.blog-post-body p {
    margin: 0 0 0.9rem;
}

.blog-comments {
    margin-top: 1.3rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e6ea;
}

.blog-comments h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.blog-comment {
    margin: 0.7rem 0 0;
    padding: 0.75rem 0.85rem;
    background: #f7f8f9;
    border: 1px solid #d8dde2;
    border-radius: 3px;
}

.blog-comment.is-hidden {
    opacity: 0.68;
    border-style: dashed;
}

.blog-comment-children {
    margin-left: 1.5rem;
}

.blog-comment-body {
    margin: 0.45rem 0 0.55rem;
    white-space: pre-wrap;
}

.blog-comment-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
}

.blog-button,
.blog-link-button {
    display: inline-block;
    border: 1px solid #2e6f9e;
    background: #377cac;
    color: #fff;
    padding: 0.38rem 0.65rem;
    border-radius: 3px;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.blog-link-button.is-secondary,
.blog-button.is-secondary {
    background: #fff;
    color: #2d668f;
}

.blog-post-form,
.blog-comment-form {
    margin-top: 0.9rem;
}

.blog-post-form input,
.blog-post-form textarea,
.blog-comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    margin: 0.25rem 0 0.65rem;
    padding: 0.55rem;
    font: inherit;
}

.blog-post-form textarea {
    min-height: 12rem;
}

.blog-comment-form textarea {
    min-height: 6rem;
}

.blog-role {
    font-weight: 600;
}

.blog-empty {
    color: #5d6670;
    font-style: italic;
}

.blog-pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 0;
}

@media (max-width: 700px) {
    .blog-shell {
        width: min(100% - 1rem, 980px);
    }

    .blog-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .blog-comment-children {
        margin-left: 0.7rem;
    }
}

/* Reader comment parity with chapter commenting */
.blog-comment.is-deleted .blog-comment-body { color: #5d6670; }
.blog-comment-actions .comment-vote-button { min-width: 3.25rem; }


/* Keep authentication and terms gating at the comment point, not above the post. */
.blog-comment-auth {
    margin-top: .75rem;
}

.blog-comment-auth > [data-blog-auth-mount]:not(:empty) {
    margin-top: .65rem;
}

.blog-comment-terms {
    margin-top: .75rem;
}

/* Blog side widgets. Keep the content centered while rails sit near page edges. */
.blog-search-widget,
.blog-calendar {
    position: sticky;
    top: 1rem;
    width: 17rem;
    box-sizing: border-box;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(47, 95, 143, 0.24);
    border-radius: 0.65rem;
    background: #f7fbff;
    box-shadow: 0 0.45rem 1.4rem rgba(0, 0, 0, 0.08);
    text-align: left;
}

.blog-widget-eyebrow {
    margin: 0 0 0.15rem;
    color: #5d6770;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.blog-widget-heading h2 {
    margin: 0;
    color: #2f5f8f;
    font-size: 1.2rem;
}

.blog-search-form {
    margin-top: 0.65rem;
    padding: 0.6rem;
    border: 1px solid rgba(47, 95, 143, 0.18);
    border-radius: 0.45rem;
    background: #fff;
}

.blog-search-form label {
    display: block;
    margin-bottom: 0.35rem;
    color: #5d6770;
    font-size: 0.68rem;
    font-weight: 700;
}

.blog-search-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
}

.blog-search-controls input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0.46rem 0.5rem;
    border: 1px solid rgba(47, 95, 143, 0.35);
    border-radius: 0.3rem;
    font: inherit;
    font-size: 0.78rem;
}

.blog-search-controls button {
    border: 1px solid #2f5f8f;
    border-radius: 0.3rem;
    background: #2f5f8f;
    color: #fff;
    padding: 0.42rem 0.55rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
}

.blog-search-controls button:hover,
.blog-search-controls button:focus-visible {
    background: #244f79;
}

.blog-search-clear {
    display: inline-block;
    margin-top: 0.45rem;
    color: #2f5f8f;
    font-size: 0.7rem;
    font-weight: 700;
}

.blog-recent-tags {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(47, 95, 143, 0.14);
}

.blog-recent-tags h3 {
    margin: 0 0 0.45rem;
    color: #2f5f8f;
    font-size: 0.82rem;
}

.blog-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.blog-tag-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid rgba(47, 95, 143, 0.22);
    border-radius: 999px;
    background: #fff;
    color: #2f5f8f;
    text-decoration: none;
    font-size: 0.68rem;
}

.blog-tag-list span {
    color: #68727b;
}

.blog-widget-source {
    margin: 0.55rem 0 0;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(47, 95, 143, 0.14);
    color: #68727b;
    font-size: 0.7rem;
    line-height: 1.35;
}

/* Blog calendar / archive navigation. Match the established Aurora widget language. */
.blog-layout {
    display: grid;
    grid-template-columns: 17rem minmax(0, 44rem) 17rem;
    gap: 2rem;
    align-items: start;
    justify-content: space-between;
}

.blog-search-widget {
    grid-column: 1;
}

.blog-content {
    grid-column: 2;
    min-width: 0;
}

.blog-calendar {
    grid-column: 3;
}


.blog-mini-calendar {
    margin-top: 0.65rem;
    padding: 0.45rem;
    border: 1px solid rgba(47, 95, 143, 0.18);
    border-radius: 0.45rem;
    background: #fff;
}

.blog-calendar-header {
    display: grid;
    grid-template-columns: 1.8rem 1fr 1.8rem;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.blog-calendar-header strong {
    text-align: center;
    color: #2f5f8f;
    font-size: 0.8rem;
}

.blog-calendar-nav {
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.3rem;
    background: transparent;
    color: #2f5f8f;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
}

.blog-calendar-nav:hover,
.blog-calendar-nav:focus-visible {
    border-color: rgba(47, 95, 143, 0.25);
    background: #eef5fb;
    outline: none;
}

.blog-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.18rem;
}

.blog-calendar-weekdays {
    margin-bottom: 0.2rem;
}

.blog-calendar-weekdays span {
    text-align: center;
    color: #68727b;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
}

.blog-calendar-day,
.blog-calendar-empty {
    position: relative;
    min-width: 0;
    aspect-ratio: 1;
}

.blog-calendar-day {
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.32rem;
    background: transparent;
    color: #26313a;
    font-size: 0.68rem;
}

.blog-calendar-day > a {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border-radius: inherit;
}

.blog-calendar-day.is-today {
    border-color: #2f5f8f;
    font-weight: 800;
}

.blog-calendar-day.has-posts {
    background: #2f5f8f;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.blog-calendar-day.has-posts:hover,
.blog-calendar-day.has-posts:focus-within {
    background: #244f79;
}

.blog-calendar-day.has-posts > a:focus-visible {
    outline: 2px solid #2f5f8f;
    outline-offset: 2px;
}

.blog-calendar-day.is-selected {
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px #2f5f8f;
}

.blog-calendar-dot {
    position: absolute;
    bottom: 0.15rem;
    width: 0.22rem;
    height: 0.22rem;
    border-radius: 50%;
    background: #fff;
}

.blog-calendar-tooltip {
    position: absolute;
    right: calc(100% + 0.45rem);
    top: 0;
    z-index: 5000;
    width: 15rem;
    max-height: 18rem;
    padding: 0.55rem;
    overflow-y: auto;
    border: 1px solid rgba(47, 95, 143, 0.28);
    border-radius: 0.45rem;
    background: #fff;
    box-shadow: 0 0.45rem 1.25rem rgba(0, 0, 0, 0.18);
    color: #202830;
    text-align: left;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.3;
}

.blog-calendar-day.has-posts:hover .blog-calendar-tooltip,
.blog-calendar-day.has-posts:focus-within .blog-calendar-tooltip {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.blog-calendar-tooltip > strong {
    display: block;
    margin-bottom: 0.3rem;
    color: #2f5f8f;
    font-size: 0.72rem;
}

.blog-calendar-tip-post + .blog-calendar-tip-post {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(47, 95, 143, 0.15);
}

.blog-calendar-tip-post span,
.blog-calendar-tip-post small {
    display: block;
}

.blog-calendar-tip-post span {
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25;
}

.blog-calendar-tip-post small,
.blog-calendar-tooltip > small {
    margin-top: 0.18rem;
    color: #59636d;
    font-size: 0.64rem;
    line-height: 1.3;
}

.blog-calendar-clear {
    display: block;
    margin-top: 0.55rem;
    color: #2f5f8f;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.blog-calendar-source {
    margin: 0.55rem 0 0;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(47, 95, 143, 0.14);
    color: #68727b;
    font-size: 0.7rem;
    line-height: 1.35;
}

.blog-date-filter {
    margin: 0.65rem 0 1rem;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid #377cac;
    background: #f2f6f9;
}

@media (max-width: 950px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-search-widget,
    .blog-content,
    .blog-calendar {
        grid-column: 1;
    }

    .blog-search-widget,
    .blog-calendar {
        position: static;
        width: min(100%, 24rem);
        margin: 0 auto 1rem;
    }

    .blog-search-widget {
        order: -2;
    }

    .blog-calendar {
        order: -1;
    }

    .blog-calendar-tooltip {
        right: auto;
        left: 50%;
        top: calc(100% + 0.35rem);
        transform: translateX(-50%);
        width: min(15rem, 80vw);
    }
}


/* Blog administration */
.blog-admin-section {
    padding-top: 1.5rem;
}

.blog-admin-container {
    width: min(100% - 2rem, 1180px);
    margin: 0 auto;
}

.blog-admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-admin-header h1,
.blog-admin-header p {
    margin-top: 0;
}

.blog-admin-header-actions,
.blog-admin-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.blog-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.blog-admin-card,
.blog-admin-login-card,
.blog-admin-panel {
    border: 1px solid rgba(47, 95, 143, 0.24);
    border-radius: 0.65rem;
    background: #f7fbff;
    box-shadow: 0 0.45rem 1.4rem rgba(0, 0, 0, 0.06);
}

.blog-admin-card {
    display: block;
    padding: 1.15rem 1.25rem;
    color: inherit;
    text-decoration: none;
}

.blog-admin-card h2 {
    margin: 0 0 0.45rem;
    color: #2f5f8f;
    font-size: 1.2rem;
}

.blog-admin-card p {
    margin: 0 0 0.8rem;
    line-height: 1.5;
}

.blog-admin-card span {
    color: #2f5f8f;
    font-weight: 700;
}

.blog-admin-login-card,
.blog-admin-panel {
    padding: 1rem 1.15rem;
}

.blog-admin-login-card h1,
.blog-admin-panel h2 {
    margin-top: 0;
    color: #2f5f8f;
}

.blog-admin-panel-heading,
.blog-admin-comment-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-admin-post-form label {
    display: block;
    margin: 0 0 0.85rem;
    font-weight: 700;
}

.blog-admin-post-form input,
.blog-admin-post-form textarea,
.blog-admin-post-form select {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.3rem;
    padding: 0.55rem;
    font: inherit;
}

.blog-admin-post-form textarea {
    min-height: 18rem;
    resize: vertical;
}

.blog-admin-post-list {
    display: grid;
    gap: 0.85rem;
}

.blog-admin-post-item {
    padding: 0.9rem 1rem;
    border: 1px solid #d8dde2;
    border-radius: 0.4rem;
    background: #fff;
}

.blog-admin-post-item h3 {
    margin: 0 0 0.3rem;
}

.blog-admin-excerpt {
    margin: 0.55rem 0 0.75rem;
    line-height: 1.5;
}

.blog-admin-comment-location {
    margin: 0.35rem 0 0.55rem;
}

.blog-button.is-danger {
    border-color: #9b2f2f;
    background: #fff;
    color: #9b2f2f;
}

@media (max-width: 760px) {
    .blog-admin-header {
        flex-direction: column;
    }

    .blog-admin-grid {
        grid-template-columns: 1fr;
    }
}
