
:root {
    --background: #f8f6f2;
    --surface: #ffffff;
    --primary: #425a46;
    --primary-dark: #344738;
    --text: #343a32;
    --muted: #7d857b;
    --border: #e5e7e0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Georgia, serif;
    background: var(--background);
    color: var(--text);
}

a {
    color: var(--primary);
}

.site-header {
    background: #e7e8df;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1100px;
    margin: auto;
    padding: 22px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: var(--text);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.site-nav a {
    text-decoration: none;
}

.site-nav a:hover {
    text-decoration: underline;
}

.site-nav form {
    margin: 0;
}

.logout-button {
    background: transparent;
    color: var(--primary);
    border: 0;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.page-container {
    width: min(760px, 100%);
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

.card {
    background: var(--surface);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px #00000008;
}

.date {
    color: var(--muted);
    font-size: 14px;
}

.post-content {
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dfe5d9;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.site-footer {
    text-align: center;
    padding: 25px;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-logo {
        font-size: 21px;
    }

    .site-nav {
        gap: 15px;
    }

    .page-container {
        margin-top: 25px;
    }

    .card {
        padding: 20px;
    }
}

/* Comments */

.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.comment:last-of-type {
    border-bottom: none;
}

.comment .author-row {
    margin-bottom: 8px;
}

.comment p {
    overflow-wrap: anywhere;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

.comment-actions form {
    margin: 0;
}

.comment-actions button {
    background: none;
    border: none;
    padding: 0;
    color: #9b3939;
    cursor: pointer;
    font: inherit;
}

/* Forms */

input,
textarea {
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

textarea {
    width: 100%;
    resize: vertical;
}

.comment-form {
    margin-top: 20px;
}

.primary-button {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    margin-top: 12px;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.errorlist {
    color: #9b3939;
}


/* Profile page */

.profile-header {
    text-align: center;
    margin-bottom: 35px;
}

.profile-avatar,
.profile-avatar-placeholder {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.profile-avatar {
    display: block;
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dfe5d9;
    color: var(--primary);
    font-size: 45px;
}

.profile-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

.profile-form input,
.profile-form textarea {
    display: block;
    width: 100%;
    margin-bottom: 18px;
}

/* Login page */

.login-card {
    max-width: 440px;
    margin: 60px auto;
}

.form-error {
    color: #9b3939;
}


/* Post photo galleries */

.post-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 25px;
}

.post-photo {
    margin: 0;
}

.post-photo img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.post-photo figcaption {
    padding: 8px 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.post-photo:only-child {
    grid-column: 1 / -1;
}

.post-photo:only-child img {
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

@media (max-width: 600px) {
    .post-gallery {
        grid-template-columns: 1fr;
    }

    .post-photo img {
        height: auto;
        max-height: 450px;
        object-fit: contain;
    }
}


/* Family directory */

.family-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.member-card {
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 3px 15px #00000008;
    transition: transform 0.2s ease;
}

.member-card:hover {
    transform: translateY(-3px);
}

.member-card h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.member-card p {
    color: var(--muted);
    line-height: 1.5;
}

.member-card span {
    color: var(--primary);
    font-size: 14px;
}

.member-avatar,
.member-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.member-avatar {
    display: block;
    object-fit: cover;
}

.member-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dfe5d9;
    color: var(--primary);
    font-size: 36px;
}

.member-profile-card {
    text-align: center;
    margin-top: 25px;
}

.member-bio {
    max-width: 450px;
    margin: 25px auto;
    line-height: 1.8;
}

@media (max-width: 600px) {
    .family-grid {
        grid-template-columns: 1fr;
    }
}

/* Album gallery */

.album-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.album-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 3px 15px #00000008;
}

.album-card img,
.album-placeholder {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.album-placeholder {
    background: #dfe5d9;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--muted);
}

.album-info {
    padding: 20px;
}

.album-info h2 {
    margin: 0 0 10px;
}

.album-info p {
    line-height: 1.5;
    color: var(--muted);
}

.album-info span {
    font-size: 13px;
    color: var(--primary);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.album-photo {
    margin: 0;
}

.album-photo img {
    display: block;
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
}

.album-photo figcaption {
    padding: 8px 0;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 600px) {
    .album-grid,
    .photo-grid {
        grid-template-columns: 1fr;
    }

    .album-photo img {
        height: auto;
    }
}
