/* 1. Базовые сбросы */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    background-image:
            radial-gradient(#cbd5e1 1px, transparent 1px),
            radial-gradient(#cbd5e1 1px, #f8fafc 1px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    color: #1e293b;
    line-height: 1.5;
    padding-left: 240px;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* 2. Вертикальное навигационное меню СЛЕВА */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 30px 15px;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

nav ul li a {
    display: block;
    padding: 10px 14px;
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

nav ul li a:hover {
    color: #2563eb;
    background-color: #eff6ff;
    border-left-color: #2563eb;
}

/* 3. Шапка сайта */
header {
    padding: 40px 20px 25px;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

header::after {
    content: "Veebiarenduse portfoolio ja praktilised ülesanded";
    display: block;
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 6px;
    font-weight: 500;
}

/* 4. Гибкая сетка main (работает универсально для всех страниц) */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 5. Общие стили карточек и секций */
section {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

section:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.1);
}

section h2, section h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 14px;
}

/* Картинки внутри блоков */
section img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 10px 0;
}

/* 6. Галерея картинок */
section#pildigalerii, .galerii-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

section#pildigalerii img, .galerii-grid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    margin: 5px;
}

/* 7. Интерактивные фреймы и видео */
section iframe,
section video {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    border: none;
    display: block;
}

section#video iframe {
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Сетки для двух колонок (карта + музыка и т.д.) */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Ссылки-кнопки */
section a {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    margin: 4px 0;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

section a::before {
    content: "🔗";
    margin-right: 10px;
    font-size: 0.85rem;
}

section a:hover {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* 8. Подвал */
footer {
    position: fixed;
    bottom: 0;
    left: 220px;
    width: calc(100% - 220px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e2e8f0;
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    color: #64748b;
    z-index: 100;
}

/* 9. Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding-left: 0;
    }

    nav {
        position: relative;
        width: 100%;
        height: auto;
    }

    footer {
        left: 0;
        width: 100%;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}