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

body {
    font-family: 'Inter', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: #2c3e50;
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.site-title {
    font-size: 2.4rem;
    font-weight: 400;
    letter-spacing: -0.5px;
}

.main {
    flex: 1;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.tags-container {
    padding: 12px;
    background-color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid #f0f0f0;
    position: relative;
    min-height: 50px;
}

.tag {
    display: inline-block;
    background-color: #f1f8ff;
    color: #0366d6;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tag:hover {
    background-color: #e1ecff;
    transform: translateY(-1px);
}

.tag-more {
    cursor: pointer;
    background-color: #e9ecef;
    color: #495057;
}

.tag-more:hover {
    background-color: #dee2e6;
}

.gallery-item.expanded .tags-container {
    flex-wrap: wrap;
}

.loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c3e50;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header {
        padding: 20px;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .main {
        padding: 20px;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .img-container {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .img-container {
        height: 160px;
    }
}
