/* --- Globalne --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding-top: 70px;
    line-height: 1.6;
    color: #2c3e50;
}

header {
    text-align: center;      /* Wyśrodkowanie całej zawartości nagłówka */
    padding: 50px 20px 30px; /* Odstępy od góry i pod nagłówkiem */
    background-color: #f8f9fa; 
    border-bottom: 2px solid #3498db;
}

header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #2c3e50;
}

header p {
    font-size: 18px;
    color: #555;
    margin: 0;              /* usuń wszelkie marginesy, które przesuwają tekst */
    text-align: center;     /* dodatkowo wyśrodkuj */
}

/* --- Obrazy --- */
img {
    max-width: 100%;
    height: auto;
}

/* --- Pasek nawigacji --- */
.navbar {
    background-color: #2c3e50;
    padding: 10px 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.navbar li {
    margin: 0 20px;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.3s;
}

.navbar a:hover {
    color: #3498db;
}

/* --- Kontener strony --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
}

/* --- Cards członków rodziny --- */
.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.card {
    background: white;
    border-radius: 6px;
    padding: 15px;
    width: 280px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    word-break: normal;
    line-height: 1.4;
}

.card h3 {
    margin: 0 0 5px;
}

.card p {
    margin: 10px 0 0;
    font-size: 14px;
    text-align: center;
}

.card a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.card a:hover {
    text-decoration: underline;
}

/* --- Infobox Wikipedii --- */
.osoba-box {

    float: right;

    width: 160px;

    margin: 0 0 15px 15px;

}


.osoba-box h3 {
    background-color: #eaecf0;
    margin: 0;
    padding: 6px;
    text-align: center;
    font-size: 15px;
}

.osoba-box img {
    width: 140px;
    height: auto;
    display: block;
    margin: 5px auto;
}

.dane-osoby {
    width: 100%;
    border-collapse: collapse;
}

.dane-osoby th {
    text-align: left;
    background-color: #eaecf0;
    width: 100px;
    padding: 4px;
    border-top: 1px solid #fff;
}

.dane-osoby td {
    padding: 4px;
    border-top: 1px solid #fff;
    vertical-align: top;
}

/* --- Tekst obok infoboxu --- */
.container p {
    text-align: justify;
    line-height: 1.6;
}

/* --- Stopka --- */
footer {
    margin-top: 60px;
    padding: 20px;
    width: 100%;          /* pełna szerokość */
    display: flex;         /* używamy flexboxa */
    justify-content: center; /* wyśrodkowanie w poziomie */
    align-items: center;    /* wyśrodkowanie w pionie (jeśli potrzebne) */
    color: #2c3e50;
    box-sizing: border-box; /* żeby padding się nie „wychodził” */
}



/* --- Reset float po container --- */
.container::after {
    content: "";
    display: block;
    clear: both;
}

/* --- Linki w biografiach --- */
.wiki-link {
    color: #3498db;
    text-decoration: none;
}

.wiki-link:hover {
    text-decoration: underline;
}

/* --- Galeria zdjęć --- */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-item {
    width: calc(33.33% - 10px);
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.caption {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
}

/* --- Responsywność --- */
@media (max-width: 768px) {
    .gallery-item {
        width: calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: 100%;
    }

    main.container p {
        text-align: left;           /* usuwa gigantyczne spacje */
        word-break: break-word;      /* łamanie długich słów */
        line-height: 1.6;
    }

    .osoba-box {
        float: 100%;
        width: 100%;
        margin: 0 auto 5px;
        display: block;
    }

    .osoba-box img {
        float: none;
        width: 100%;
        margin: 300 10px;
        display: block;
    }

    .card {
        width: 90%;                   /* karty dopasowują się do telefonu */
    }
}

/* --- Paragrafy ogólnie --- */
p {
    margin: 0 0 1em;
    line-height: 1.6;
    text-align: justify;
}

/* ===== ARCHIWUM ===== */

.search-box {
    text-align: center;
    margin: 30px 0;
}

.search-box input {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.archive-section {
    margin-top: 40px;
}

.archive-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.archive-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    width: 280px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.archive-card img {
    width: 100%;
    border-radius: 5px;
    margin-bottom: 10px;
}

.archive-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.archive-buttons a {
    flex: 1;
    text-align: center;
    background: #2c3e50;
    color: white;
    padding: 8px;
    border-radius: 5px;
    text-decoration: none;
}

.archive-buttons a:hover {
    background: #3498db;
}

/* TELEFON */

@media (max-width: 600px) {

    .archive-card {
        width: 100%;
    }

}

/* ===== LINK DO ARCHIWUM ===== */

.archive-link-section {
    margin-top: 50px;
    text-align: center;
}

.archive-home-card {
    background: white;
    max-width: 500px;
    margin: 20px auto;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.archive-home-card a {
    display: inline-block;
    margin-top: 15px;
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
}

.archive-home-card a:hover {
    background: #3498db;
}



