/* --- Global Styles --- */
html {
    font-size: 20px; /* Default browser value is 16px */
}
body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
}

.home::after {
    content: "";
    position: fixed;              /* stays at bottom even when scrolling */
    left: 0;
    bottom: 0;
    width: 100%;
    height: 120px;                /* height of your pattern strip */
    background-image: url("pattern.png");
    background-repeat: repeat-x;  /* repeat horizontally only */
    background-position: bottom;
    background-size: auto 100%;   /* scales height if needed */
    z-index: -1;                  /* keeps it behind content */
    pointer-events: none;         /* so it doesn’t block clicks */
}

h1, h2, h3 {
    margin: 0.5em 0;
}

/* --- Index Page --- */
header {
    text-align: center;
    padding: 5rem 1rem 1rem;
}

header {
    display: flex;
    align-items: center;   /* vertically center image + text */
    justify-content: center; /* center them horizontally on the page */
    gap: 1rem;             /* spacing between logo and text */
}

/* Make sure logo fits nicely next to text */
header img {
    height: 100px;          /* adjust as needed */
    width: auto;           /* keeps aspect ratio */
    display: block;
}

/* Optional: Adjust heading style */
header h1 {
    font-size: 2rem;
    margin: 0;
}

.index-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
}

.sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
}

.section-card {
    background: #2b2b2b;
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    color: #f0f0f0;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.section-card:hover {
    background: #383838;
    transform: translateY(-4px);
}

/* --- Top menu --- */
.top-menu {
    background-image: url('pattern.png');
    background-repeat: repeat-x;
    background-position: top left;
    background-size: auto;

    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
}

.top-menu nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-menu nav a {
    background: #222;
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.3rem 0.6rem 0.6rem 0.6rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.top-menu nav a:hover {
    background: #222;
    color: #fff;
}

/* --- Layout with sidebar --- */
.layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 240px;
    background: #222;
    padding: 1rem;
    border-right: 1px solid #333;
    flex-shrink: 0;
}

.sidebar h3 {
    margin-bottom: 1rem;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 0.5rem 0;
}

.sidebar a {
    display: block;
    color: #ccc;
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.sidebar a:hover {
    color: #fff;
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
}

/* --- Responsive adjustments --- */
@media (max-width: 800px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .content {
        padding: 1.25rem;
    }

    .section-card {
        font-size: 1.1rem;
    }
}

@media (max-width: 500px) {
    .section-card {
        padding: 1.75rem 1rem;
        font-size: 1rem;
    }

    header h1 {
        font-size: 1.6rem;
    }
}

.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;     /* removes inline gaps */
    margin: 0 auto;     /* centers image */
}

/* Fancy Search Bar */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto 1rem;
}

.search-container input {
    width: 100%;
    padding: 0.8rem 2.8rem 0.8rem 1rem;
    font-size: 1rem;
    color: #f0f0f0;
    background: #2b2b2b;
    border: 2px solid #333;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
}

.search-container input::placeholder {
    color: #888;
}

.search-container input:focus {
    border-color: #00b4d8;
    box-shadow: 0 0 10px #00b4d8;
}

.search-icon {
    position: absolute;
    right: -3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #aaa;
    pointer-events: none;
}

/* Responsive Cyrillic Letter Grid */
.letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.6rem;
    max-width: 800px;
    margin: 1.5rem auto;
    text-align: center;
}

.letter {
    background: #2b2b2b;
    color: #f0f0f0;
    font-size: 1.5rem;
    text-decoration: none;
    padding: 1rem;
    border-radius: 8px;
    display: block;
    transition: background 0.2s, transform 0.2s;
}

.letter:hover {
    background: #383838;
    transform: scale(1.1);
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .search-container {
        max-width: 90%;
    }

    .letter {
        font-size: 1.2rem;
        padding: 0.8rem;
    }
}