body.np-body,
body.post-type-archive-nekrolog,
body.single-nekrolog,
body.page {
    background: var(--np-background-color, #f7f3ee);
}

.np-wrap {
    max-width: 980px;
    margin: 40px auto;
    padding: 0 16px;
    color: var(--np-text-color, #2d251d);
    font-family: var(--np-font-family, Georgia, serif);
}

.np-header {
    margin-bottom: 24px;
}

.np-header h1,
.np-card h1,
.np-card h2,
.np-card h3,
.np-single h1,
.np-comments h2 {
    color: var(--np-heading-color, #2d251d);
    font-family: var(--np-heading-font, Georgia, serif);
    margin-top: 0;
}

.np-header p,
.np-content,
.np-meta,
.np-card p,
.np-comment {
    color: var(--np-text-color, #2d251d);
}

.np-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.np-layout-grid .np-grid {
    grid-template-columns: repeat(var(--np-columns, 3), minmax(0, 1fr));
    align-items: stretch;
}

.np-layout-list .np-grid {
    display: block;
}

.np-layout-list .np-card {
    margin-bottom: 24px;
}

.np-card,
.np-single {
    background: var(--np-card-background-color, #ffffff);
    border: 1px solid var(--np-border-color, #eadfd3);
    border-radius: var(--np-card-radius, 12px);
    box-shadow: var(--np-card-shadow, 0 4px 18px rgba(0,0,0,0.05));
    overflow: hidden;
    box-sizing: border-box;
}

.np-card {
    padding: 20px;
}

.np-layout-grid .np-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: none;
}

.np-card__body,
.np-comment-body {
    width: 100%;
}

.np-card a {
    color: var(--np-text-color, #2d251d);
    text-decoration: none;
}

.np-card a:hover {
    text-decoration: underline;
}

.np-card__img-wrap,
.np-photo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    background: var(--np-card-background-color, #ffffff);
}

.np-card__img-wrap {
    min-height: 220px;
    margin-bottom: 16px;
}

.np-photo-wrap {
    min-height: 320px;
}

.np-card__img,
.np-photo,
.np-ornament-top img,
.np-ornament-bottom img,
.np-condolence-graphic img,
.np-comment-graphic img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.np-card__img {
    width: auto;
    max-height: 220px;
    border-radius: 10px;
}

.np-photo {
    width: auto;
    max-height: 420px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.np-ornament-top,
.np-ornament-bottom {
    text-align: center;
    margin: 6px 0 18px;
}

.np-ornament-top img,
.np-ornament-bottom img {
    width: auto;
    max-width: 100%;
    max-height: 180px;
    margin: 0 auto;
}

.np-single {
    padding: 24px;
}

.np-single-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 28px;
}

.np-person-name {
    font-size: var(--np-single-name-size, 2rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.np-person-name--archive {
    font-size: var(--np-archive-name-size, 1.4rem);
}

.np-person-name .np-sp,
.np-card h2 .np-sp,
.np-card h3 .np-sp {
    font-size: 0.55em;
    vertical-align: middle;
    letter-spacing: 0.04em;
    margin-right: 0.3em;
    display: inline-block;
}

.np-meta p {
    margin: 0 0 10px;
}

.np-card__body {
    text-align: center;
}

.np-content {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--np-border-color, #eadfd3);
}

.np-section,
.np-comments,
.np-card-condolences {
    margin-top: 20px;
}

.np-btn,
.np-card-link,
a.np-btn {
    display: inline-block;
    background: var(--np-button-bg, #000000);
    color: var(--np-button-text, #ffffff) !important;
    border: none;
    padding: var(--np-button-padding-y, 12px) var(--np-button-padding-x, 18px);
    border-radius: var(--np-button-radius, 8px);
    cursor: pointer;
    text-decoration: none !important;
    font-size: var(--np-button-font-size, 16px);
    font-weight: var(--np-button-font-weight, 600);
    line-height: 1.2;
}

.np-btn:hover,
.np-btn:focus,
.np-card-link:hover,
.np-card-link:focus,
a.np-btn:hover,
a.np-btn:focus {
    background: var(--np-button-hover-bg, #222222);
    color: var(--np-button-hover-text, #ffffff) !important;
    text-decoration: none !important;
}

.np-card-link {
    margin-top: 10px;
}

.np-condolence-form {
    display: none;
    margin-top: 16px;
}

.np-condolence-form input,
.np-condolence-form textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--np-border-color, #d8cabb);
    border-radius: 8px;
    box-sizing: border-box;
}

.np-form-message {
    display: none;
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
}

.np-form-message.success {
    background: #e7f4ea;
    color: #1d5a2d;
}

.np-form-message.error {
    background: #f9e5e5;
    color: #8a2020;
}

.np-comment {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--np-border-color, #eee);
}

.np-comment-graphic {
    flex: 0 0 56px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: 2px;
}

.np-comment-graphic img {
    max-width: 56px;
    max-height: 56px;
    width: auto;
    height: auto;
}

.np-comment-body strong {
    display: block;
    margin-bottom: 6px;
}

.np-condolence-graphic {
    text-align: center;
    margin: 0 0 16px;
}

.np-condolence-graphic img {
    width: auto;
    max-width: 100%;
    max-height: 140px;
    margin: 0 auto;
}

.np-comment--archive {
    margin-bottom: 12px;
}

.np-muted {
    color: var(--np-muted-color, #786a5b);
}

/* Kolor i zachowanie linku „Wróć do wszystkich nekrologów” */
body.single-nekrolog .np-backlink {
    color: #d4b28a;
    font-weight: 700;
}

body.single-nekrolog .np-backlink:hover {
    color: #ffffff;
    text-decoration: underline;
}

.np-pagination {
    margin-top: 24px;
}

.np-pagination .page-numbers {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 8px 12px;
    border: 1px solid var(--np-border-color, #eadfd3);
    border-radius: 6px;
    text-decoration: none;
    color: var(--np-text-color, #2d251d);
    background: var(--np-card-background-color, #ffffff);
}

.np-pagination .current {
    background: var(--np-button-bg, #000000);
    color: var(--np-button-text, #ffffff);
    border-color: var(--np-button-bg, #000000);
}

@media (max-width: 900px) {
    .np-layout-grid .np-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .np-single-grid {
        grid-template-columns: 1fr;
    }
}

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

    .np-person-name {
        font-size: calc(var(--np-single-name-size, 2rem) - 0.3rem);
    }
}

.np-share .np-share-btn {
    margin-right: 8px;
    margin-top: 8px;
}