* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f0f0;
    color: #333;
    line-height: 1.5;
}

header {
    background: #4a4a4a;
    color: #fff;
    padding: 1.5rem 1rem;
    text-align: center;
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.header-icon {
    height: 2.2rem;
    width: auto;
    opacity: 0.7;
}

.subtitle {
    font-size: 0.85rem;
    opacity: 0.75;
}

.last-updated {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    opacity: 0.55;
}

.search-form {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.search-form input[type="text"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 170px;
    color: #333;
}

.search-form button {
    padding: 0.4rem 0.7rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #444;
    font-size: 0.85rem;
    cursor: pointer;
}

.search-form button:hover {
    background: #eee;
}

.search-clear {
    color: #888;
    font-size: 0.8rem;
    text-decoration: none;
    margin-left: 0.2rem;
}

.search-clear:hover {
    color: #333;
}

.search-info {
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    background: #e8e8e8;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #444;
}

.page-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.page-nav__links {
    display: flex;
    gap: 1.5rem;
}

.page-nav a {
    color: #444;
    text-decoration: none;
}

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

.nav-current {
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #555;
    padding-bottom: 0.2rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.date-group {
    margin-bottom: 2rem;
}

.date-heading {
    font-size: 0.95rem;
    color: #666;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
    margin-bottom: 0.8rem;
}

/* Card grid layout */
.entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
}

.entry {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.entry:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.entry-photo {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #e0e0e0;
}

.entry-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-photo {
    width: 100%;
    height: 100%;
    background: #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
    font-weight: 300;
}

.entry-info {
    padding: 0.8rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.entry-name {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.entry-name a {
    color: #333;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.entry-name a:hover {
    text-decoration-thickness: 2px;
}

/* Photo is wrapped in the same link as the name when a rouwbrief exists.
   Make the anchor fill the photo area and give a subtle hover affordance. */
.entry-photo a {
    display: block;
    width: 100%;
    height: 100%;
}

.entry-photo a:hover img,
.entry-photo a:hover .no-photo {
    opacity: 0.92;
}

.entry-details {
    font-size: 0.82rem;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    margin-bottom: 0.3rem;
}

a.detail.place {
    color: #666;
    text-decoration: none;
}

a.detail.place::before {
    content: "\1F4CD ";
}

.detail.age {
    color: #999;
    font-style: italic;
}

.entry-source {
    font-size: 0.7rem;
    color: #bbb;
    margin-top: auto;
    padding-top: 0.3rem;
}

.entry-source a {
    color: #bbb;
    text-decoration: none;
}

/* Share buttons */
.share-row {
    position: relative;
    margin-top: 0.4rem;
    padding-top: 0.3rem;
}
.share-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    color: #999;
    cursor: pointer;
    transition: all 0.15s;
}
.share-toggle:hover {
    color: #666;
    border-color: #bbb;
}
.share-toggle svg {
    flex-shrink: 0;
}
.share-buttons {
    display: none;
    gap: 0.4rem;
    margin-top: 0.35rem;
}
.share-row.open .share-buttons {
    display: flex;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s;
}
.share-btn:hover {
    opacity: 0.8;
}
.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-messenger { background: #0084FF; }
.share-email { background: #888; }
.share-native { background: #555; }

/* Person detail page */
.person-banner {
    display: flex;
    gap: 1.5rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.person-photo {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    background: #e0e0e0;
}

.person-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.person-photo .no-photo {
    width: 100%;
    height: 100%;
    background: #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 4rem;
    font-weight: 300;
}

.person-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.person-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.person-name a {
    color: #333;
    text-decoration: none;
}

.person-name a:hover {
    text-decoration: underline;
}

.person-dates {
    font-size: 0.95rem;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    margin-bottom: 0.4rem;
}

.person-dates .age {
    color: #999;
    font-style: italic;
}

.person-place {
    margin-bottom: 0.3rem;
}

.person-place a {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
}

.person-place a::before {
    content: "\1F4CD ";
}

.person-place a:hover {
    text-decoration: underline;
}

.person-source {
    font-size: 0.8rem;
    color: #bbb;
    margin-bottom: 0.3rem;
}

.person-source a {
    color: #bbb;
    text-decoration: none;
}

.person-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.person-links a {
    color: #444;
    text-decoration: underline;
    font-size: 0.95rem;
}

.person-links a:hover {
    text-decoration: none;
}

.person-not-found {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.person-not-found a {
    color: #444;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .person-banner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }

    .person-photo {
        width: 150px;
        height: 150px;
    }

    .person-dates {
        justify-content: center;
    }

    .person-links {
        align-items: center;
    }
}

/* Archive navigation */
.archive-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.archive-year__title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.4rem;
}

.archive-months {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.archive-month {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #444;
    text-decoration: none;
    background: #e8e8e8;
}

.archive-month:hover {
    background: #ddd;
}

.archive-month--active {
    background: #4a4a4a;
    color: #fff;
    font-weight: 600;
}

.archive-selection {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.place-links {
    margin-top: 3.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

.place-links span {
    color: #ccc;
    margin: 0 0.15rem;
}

.place-links a {
    color: #666;
    text-decoration: underline;
}

.place-links a:hover {
    text-decoration: none;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
}

.sources {
    margin-top: 0.3rem;
}

.sources a {
    color: #666;
    text-decoration: underline;
}

.sources a:hover {
    text-decoration: none;
}

.footer-info {
    margin-bottom: 1rem;
    font-size: 0.82rem;
    color: #666;
    line-height: 1.6;
}

.footer-info p {
    margin: 0 0 0.2rem 0;
}

.footer-links {
    margin-top: 0;
}

.footer-links a {
    color: #666;
    text-decoration: underline;
}

.footer-links a:hover {
    text-decoration: none;
}

footer > p {
    margin-bottom: 0.3rem;
}

.telegram-link {
    margin-top: 1rem;
}

.telegram-link a {
    color: #0088cc;
    text-decoration: none;
    font-size: 0.85rem;
}

.telegram-link a:hover {
    text-decoration: underline;
}

.copyright {
    margin-top: 1.2rem;
    font-size: 0.75rem;
    color: #aaa;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.2rem;
    }

    .page-nav {
        flex-wrap: wrap;
    }

    .search-form {
        width: 100%;
    }

    .search-form input[type="text"] {
        flex: 1;
        width: auto;
    }

    .entries {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.6rem;
    }

    .entry-info {
        padding: 0.6rem 0.7rem;
    }

    .entry-name {
        font-size: 0.9rem;
    }

    .entry-details {
        font-size: 0.75rem;
    }
}
