/* ========================================
   RESET I PODSTAWY
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* zapobiega skalowaniu czcionek na mobile */
}

body {
    font-family: 'Noto Sans', 'Noto Sans SC', 'Noto Sans Arabic', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #4a3c31;
    background: #f5ece4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* zapobiega przewijaniu poziomemu */
	
/* === NOWE TŁO – dopasowane do wysokości, zachowuje proporcje === */
    background-color: #f5ece4;                    /* kolor widoczny po bokach, jeśli obrazek jest węższy */
    background-image: url('images/obrazek.jpg');
    background-repeat: no-repeat;
    background-position: center top;              /* wyśrodkowany poziomo, przyklejony do góry */
    background-attachment: fixed;                 /* nieruchome przy scrollowaniu */

    /* KLUCZOWA LINIA – dopasowuje do wysokości, zachowuje proporcje */
    background-size: auto 100vh;
}

/* ========================================
   MIĘDZYNARODOWOŚĆ – RTL I BIDI
   ======================================== */
[lang="ar"],
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    unicode-bidi: isolate;
}

[lang="zh"] {
    unicode-bidi: isolate;
}

/* ========================================
   SEKCJIA HERO
   ======================================== */
.hero {
    background-image: url('images/baner2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 60vh;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid #8b5a2b;
    position: relative;
    isolation: isolate; /* zapobiega przenikaniu cieni */
}

/* Tło z gradientem dla lepszej czytelności (opcjonalnie) */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(109, 76, 65, 0.2), rgba(139, 90, 43, 0.1));
    z-index: 1;
}

/* ========================================
   SIATKA FLAG
   ======================================== */
.flags-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    width: 100%;
    padding: 1.5rem;
    background-color: transparent;
    position: relative;
    z-index: 2;
}

/* Linki w siatce – zawsze LTR (nawet w RTL) */
.flags-grid a {
    direction: ltr !important;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

/* Flagi */
.flag {
    width: 100%;
    max-width: 120px;
    height: 75px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #8b5a2b;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(109, 76, 65, 0.3);
    will-change: transform; /* optymalizacja animacji */
}

.flag:hover,
.flag:focus {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 16px 32px rgba(139, 90, 43, 0.5);
    border-color: #a1887f;
    outline: none;
}

/* ========================================
   BLOK SEO – DODANY (widoczny, subtelny)
   ======================================== */
.seo-text {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    z-index: 2;
    position: relative;
}

.seo-text p {
    margin: 0.8rem 0;
}

.seo-text strong {
    color: #5d4037;
    font-weight: 600;
}

.seo-text a {
    color: #6d4c41;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.seo-text a:hover,
.seo-text a:focus {
    color: #8b5a2b;
    outline: none;
}

/* ========================================
   MENU GÓRNE (opcjonalne – zostawione, ale ukryte jeśli nie używane)
   ======================================== */
.top-menu {
    background-color: #6d4c41;
    padding: 1rem 0;
    text-align: center;
    flex-shrink: 0;
}

.top-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.top-menu a {
    color: #fff8f0;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    transition: background 0.3s ease, color 0.3s ease;
    border-radius: 5px;
}

.top-menu a:hover,
.top-menu a:focus {
    background-color: #8b5a2b;
    color: #fff;
    outline: none;
}

/* ========================================
   KOLUMNY TREŚCI (opcjonalne – dla podstron)
   ======================================== */
.columns-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 2rem;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

.column {
    flex: 1;
    min-width: 280px;
    background-color: #fff8f0;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(109, 76, 65, 0.15);
    border: 1px solid #d7ccc8;
}

.column h2 {
    margin-bottom: 1rem;
    color: #5d4037;
    border-bottom: 2px solid #a1887f;
    padding-bottom: 0.5rem;
    font-size: 1.3rem;
}

/* ========================================
   STOPKA
   ======================================== */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #4e342e;
    color: #ddd;
    font-size: 0.9rem;
    margin-top: auto;
    border-top: 3px solid #8d6e63;
}

/* ========================================
   UKRYWANIE DLA SEO / DOSTĘPNOŚCI
   ======================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   RESPONSZYWNOŚĆ
   ======================================== */
@media (max-width: 992px) {
    .flags-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
        padding: 1.2rem;
    }
    .flag {
        height: 65px;
    }
    .seo-text {
        font-size: 0.93rem;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 50vh;
        padding: 1.5rem 1rem;
    }
    .flags-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    .flag {
        height: 70px;
        max-width: 110px;
    }
    .seo-text {
        margin: 1.5rem auto;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 45vh;
        padding: 1rem;
    }
    .flags-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    .flag {
        height: 60px;
        max-width: 100px;
        margin: 0 auto;
    }
    .top-menu ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    .columns-container {
        padding: 1rem;
    }
    .seo-text {
        font-size: 0.9rem;
        padding: 0 0.8rem;
    }
    .seo-text p.small {
        font-size: 0.85rem;
    }
}

/* ========================================
   DARK MODE (opcjonalnie – dla przyszłości)
   ======================================== */
@media (prefers-color-scheme: dark) {
    body {
        background: #2b1e18;
        color: #e0d6cd;
    }
    .column {
        background-color: #3a2a22;
        border-color: #5d4037;
    }
    .seo-text {
        color: #d7ccc8;
    }
}

/* ========================================
   OPTYMALIZACJE WYDAJNOŚCI
   ======================================== */
img {
    loading: lazy; /* już w HTML, ale na wszelki wypadek */
}

a {
    -webkit-tap-highlight-color: transparent; /* usuwa podświetlenie na mobile */
}